Skip to main content
POST
/
api
/
v1
/
invitations
Create Invitation
curl --request POST \
  --url https://api.example.com/api/v1/invitations \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "[email protected]",
  "role_id": "<string>",
  "groups": [
    "<string>"
  ],
  "account_id": "<string>"
}
'
{
  "id": "<string>",
  "account_id": "<string>",
  "account_code": "<string>",
  "email": "<string>",
  "invited_by": "<string>",
  "expires_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "status": "pending",
  "token": "<string>",
  "accepted_at": "2023-11-07T05:31:56Z",
  "email_sent": false,
  "email_sent_at": "2023-11-07T05:31:56Z"
}

Headers

authorization
string | null

Body

application/json

Request schema for creating an invitation.

email
string<email>
required

Email address of the user to invite

role_id
string | null

Optional role ID to assign to the user

groups
string[] | null

Optional list of group IDs to add the user to

account_id
string | null

Optional account ID (Superadmin only)

Response

Successful Response

Response schema for invitation details.

id
string
required

Invitation ID

account_id
string
required

Account ID (UUID)

account_code
string
required

Human-readable account code in XX#### format (e.g., AB1234)

email
string
required

Email address of the invited user

invited_by
string
required

User ID of the inviter

expires_at
string<date-time>
required

Expiration timestamp

created_at
string<date-time>
required

Creation timestamp

status
enum<string>
required

Current invitation status

Available options:
pending,
accepted,
expired,
cancelled
token
string
required

Invitation token for constructing acceptance URL

accepted_at
string<date-time> | null

Acceptance timestamp (if accepted)

email_sent
boolean
default:false

Whether the invitation email has been sent

email_sent_at
string<date-time> | null

Timestamp when the email was sent