Skip to content

Invite a user to an organization

POST
/organizations/{org_id}/invitations
curl --request POST \
--url https://api.perstat.io/organizations/example/invitations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "email": "example", "role": "example" }'

Creates a pending invitation for the given email and role, enforcing role assignment rules and the plan’s seat limit (402 when members plus open invitations exceed it). An invitation email is sent when possible; if delivery is unavailable or fails, the response contains the invite token so the link can be shared manually. Returns 409 if the user is already a member or an invitation already exists. Invitations are accepted through the web application, not through this API.

org_id
required
string
Media typeapplication/json
object
email
required
string
role
required
string
Examplegenerated
{
"email": "example",
"role": "example"
}
Media typeapplication/json
object
invitation
required
object
email
required
string
expires_at_unix
required
integer format: int64
id
required

Public-ID der Einladung (inv_…).

string
role
required
string
invite_token

Dev-Modus (kein SMTP): das einmalige Einladungs-Token, damit das Frontend den Einladungs-Link selbst anzeigen kann. Mit Mailer wäre dies null und der Link würde per E-Mail zugestellt.

string | null
Examplegenerated
{
"invitation": {
"email": "example",
"expires_at_unix": 1,
"id": "example",
"role": "example"
},
"invite_token": "example"
}

Already a member or invite exists