Skip to content

Create invitation

POST
/api/v1/organizations/{orgId}/invitations
curl --request POST \
--url http://localhost:3000/api/v1/organizations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/invitations \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "email": "newuser@example.com", "roleId": "550e8400-e29b-41d4-a716-446655440000", "expiresInDays": 7, "department": "Engineering", "personalMessage": "Welcome to the team! Looking forward to working with you." }'

Sends an invitation email to a user to join the organization.

orgId
required
string format: uuid

Organization UUID

Media type application/json
object
email
required

Email address to send the invitation to

string format: email
Example
newuser@example.com
roleId
required

Role ID to assign to the user when they accept the invitation

string format: uuid
Example
550e8400-e29b-41d4-a716-446655440000
expiresInDays

Number of days until the invitation expires

number
default: 7 >= 1 <= 30
Example
7
department

Department to assign to the user when they accept the invitation

string
<= 200 characters
Example
Engineering
personalMessage

Personal message to include in the invitation email

string
<= 1000 characters
Example
Welcome to the team! Looking forward to working with you.

Invitation created and email sent successfully

Media type application/json
object
id
required

Unique invitation identifier

string format: uuid
email
required

Email address the invitation was sent to

string format: email
roleId
required

Role ID that will be assigned when the invitation is accepted

string format: uuid
organizationId
required

Organization ID the user will be added to

string format: uuid
organizationName
required

Name of the organization

string
invitedById

User ID who sent the invitation (null if inviter was deleted)

string format: uuid
invitedByEmail

Email of the user who sent the invitation (null if inviter was deleted)

string format: email
expiresAt
required

When the invitation expires

string format: date-time
acceptedAt

When the invitation was accepted (null if pending)

string format: date-time
createdAt
required

When the invitation was created

string format: date-time
isPending
required

Whether the invitation is pending (not accepted)

boolean
isExpired
required

Whether the invitation has expired

boolean
Example
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "newuser@example.com",
"roleId": "550e8400-e29b-41d4-a716-446655440001",
"organizationId": "550e8400-e29b-41d4-a716-446655440002",
"organizationName": "Acme Corporation",
"invitedById": "550e8400-e29b-41d4-a716-446655440003",
"invitedByEmail": "admin@acme.com",
"expiresAt": "2024-06-27T10:30:00Z",
"acceptedAt": "2024-06-21T14:45:00Z",
"createdAt": "2024-06-20T10:30:00Z",
"isPending": true,
"isExpired": false
}

Invalid input data

Unauthorized

Forbidden - Insufficient permissions

User already in organization or invitation pending