Create an invitation
POST
/tenants/{id}/invitations
const url = 'https://localhost:3000/api/v1/tenants/example/invitations';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"expires_in":168,"role":"member"}'};
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://localhost:3000/api/v1/tenants/example/invitations \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "expires_in": 168, "role": "member" }'Creates a new invitation link. Requires admin or owner role.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Tenant ID (UUID)
Request Body
Section titled “Request Body”Invitation details
Media typeapplication/json
object
expires_in
Hours, default 168 (7 days)
integer
Example
168role
required
string
Example
memberResponses
Section titled “Responses”Invitation created
Media typeapplication/json
object
created_at
required
string format: date-time
created_by
required
string format: uuid
expires_at
required
string format: date-time
id
required
string format: uuid
role
required
string
tenant_id
required
string format: uuid
token
string
token_preview
string
used_at
string format: date-time
used_by
string format: uuid
Example
{ "created_at": "2024-01-15T10:30:00Z", "created_by": "550e8400-e29b-41d4-a716-446655440000", "expires_at": "2024-01-22T10:30:00Z", "id": "550e8400-e29b-41d4-a716-446655440000", "role": "member", "tenant_id": "550e8400-e29b-41d4-a716-446655440000", "token": "abc123...", "token_preview": "abc123...", "used_at": "2024-01-16T10:30:00Z", "used_by": "550e8400-e29b-41d4-a716-446655440000"}Invalid request
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Unauthorized
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Insufficient permissions
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Tenant not found
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Internal error
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}