# Create organization invitation **POST /api/organization-invitations** 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. ## Servers - Logto endpoint address.: https://[tenant_id].logto.app (Logto endpoint address.) ## Authentication methods - O auth2 ## Parameters ## Body parameters Content-type: application/json The organization invitation to create. - **inviterId** (string | null) The ID of the user who is inviting the user to join the organization. - **invitee** (string(email)) The email address of the user to invite to join the organization. - **organizationId** (string) The ID of the organization to invite the user to join. - **expiresAt** (number) The epoch time in milliseconds when the invitation expires. - **organizationRoleIds** (array[string]) The IDs of the organization roles to assign to the user when they accept the invitation. - **messagePayload** (object | boolean(false)) The message payload for the "OrganizationInvitation" template to use when sending the invitation via email. If it is `false`, the invitation will not be sent via email. ## Responses ### 201: The organization invitation was created successfully. #### Body Parameters: application/json (object) - **tenantId** (string) - **id** (string) - **inviterId** (string | null) - **invitee** (string) - **acceptedUserId** (string | null) - **organizationId** (string) - **status** (string) - **createdAt** (number) - **updatedAt** (number) - **expiresAt** (number) - **organizationRoles** (array[object]) ### 400: The organization invitation could not be created. This can happen if the input is invalid or if the expiration date is in the past. ### 401: Unauthorized ### 403: Forbidden ### 422: Unprocessable Content ### 501: No email connector is configured for the tenant. [Powered by Bump.sh](https://bump.sh)