Create organization invitation
Create an organization invitation and optionally send it via email. The tenant should have an email connector configured if you want to send the invitation via email at this point.
Body
Required
The organization invitation to create.
-
The ID of the user who is inviting the user to join the organization.
Maximum length is
21
. -
The email address of the user to invite to join the organization.
-
The ID of the organization to invite the user to join.
Minimum length is
1
, maximum length is21
. -
The epoch time in milliseconds when the invitation expires.
-
The IDs of the organization roles to assign to the user when they accept the invitation.
POST
/api/organization-invitations
curl \
--request POST 'https://[tenant_id].logto.app/api/organization-invitations' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"inviterId":"string","invitee":"hello@example.com","organizationId":"string","expiresAt":42.0,"organizationRoleIds":["string"],"messagePayload":{"code":"string","link":"string","locale":"string"}}'
Request examples
{
"inviterId": "string",
"invitee": "hello@example.com",
"organizationId": "string",
"expiresAt": 42.0,
"organizationRoleIds": [
"string"
],
"messagePayload": {
"code": "string",
"link": "string",
"locale": "string"
}
}
Response examples (201)
{
"tenantId": "string",
"id": "string",
"inviterId": "string",
"invitee": "string",
"acceptedUserId": "string",
"organizationId": "string",
"status": "Pending",
"createdAt": 42.0,
"updatedAt": 42.0,
"expiresAt": 42.0,
"organizationRoles": [
{
"id": "string",
"name": "string"
}
]
}