Make a single-use invite link with a role (REQ-081). The URL appears one time.
POST
/admin/invites
const url = 'https://example.com/api/v1/admin/invites';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"role":"admin"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/admin/invites \ --header 'Content-Type: application/json' \ --data '{ "role": "admin" }'Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
role
required
string
Responses
Section titled “ Responses ”The invite and its link.
Media typeapplication/json
object
url
required
string
invite
required
object
id
required
string format: uuid
role
required
string
expires_at
required
string format: date-time
created_by
required
string
created_at
required
string format: date-time
used_by
string
adopt
The frontmatter keys the main doc does not name, and the values a review used for them (REQ-135). Absent when the doc names both.
object
type
string
size
string
status
required
string
Example
{ "invite": { "role": "admin", "status": "pending" }}default
Section titled “default”An error.
Media typeapplication/problem+json
RFC 9457 problem details with a stable code.
object
type
required
string
title
required
string
status
required
integer
detail
string
instance
string
code
required
A stable machine-readable error code.
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": "example"}