Create invitation
const url = 'http://localhost:3000/api/v1/organizations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/invitations';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"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."}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Organization UUID
Header Parameters
Section titled “Header Parameters”UUID of the organization (tenant) the request acts in. It selects the tenant and grants nothing: the server checks membership or an open tenant switch. Not needed for global operations. A malformed value returns 400. API keys are fixed to their own organization; another organization returns 403. The x-organization-source header grants nothing.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Email address to send the invitation to
Example
newuser@example.comRole ID to assign to the user when they accept the invitation
Example
550e8400-e29b-41d4-a716-446655440000Number of days until the invitation expires
Example
7Department to assign to the user when they accept the invitation
Example
EngineeringPersonal message to include in the invitation email
Example
Welcome to the team! Looking forward to working with you.Responses
Section titled “Responses”Invitation created and email sent successfully
object
Unique invitation identifier
Email address the invitation was sent to
Role ID that will be assigned when the invitation is accepted
Organization ID the user will be added to
Name of the organization
User ID who sent the invitation (null if inviter was deleted)
Email of the user who sent the invitation (null if inviter was deleted)
When the invitation expires
When the invitation was accepted (null if pending)
When the invitation was created
Whether the invitation is pending (not accepted)
Whether the invitation has expired
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