---
title: "Create organization invitation"
method: POST
path: "/api/organization-invitations"
tags: ["Organization invitations"]
---

# 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.

## Request body

- object
  - `inviterId` string, nullable — The ID of the user who is inviting the user to join the organization.
  - `invitee` string, email, required — The email address of the user to invite to join the organization.
  - `organizationId` string, required — The ID of the organization to invite the user to join.
  - `expiresAt` number, required — The epoch time in milliseconds when the invitation expires.
  - `organizationRoleIds` string[] — The IDs of the organization roles to assign to the user when they accept the invitation.
  - `messagePayload` union, required — 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.
    - object
      - `code` string
      - `link` string
      - `locale` string
      - `uiLocales` string
    - boolean

## Response `201`

The organization invitation was created successfully.

- object
  - `tenantId` string, required
  - `id` string, required
  - `inviterId` string, nullable, required
  - `invitee` string, required
  - `acceptedUserId` string, nullable, required
  - `organizationId` string, required
  - `status` 'Pending' | 'Accepted' | 'Expired' | 'Revoked', required
  - `createdAt` number, required
  - `updatedAt` number, required
  - `expiresAt` number, required
  - `organizationRoles` object[], required
    - `id` string, required
    - `name` string, required

## Other responses

- `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
- `429` — Too Many Requests
- `501` — No email connector is configured for the tenant.

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/revisions/a163dc77d842/schema)
