---
title: "Create an invitation"
method: POST
path: "/v1/organizations/{organizationId}/invitations"
tags: ["User management"]
---

# Create an invitation

`POST /v1/organizations/{organizationId}/invitations`

## Request

- Base URL: `https://api.clickhouse.cloud`
- URL: `https://api.clickhouse.cloud/v1/organizations/{organizationId}/invitations`
- Auth: HTTP basic

Creates organization invitation.

## Path parameters

- `organizationId` string, uuid, required

## Request body

- InvitationPostRequest
  - `email` string, email, required: Email of the invited user. Only a user with this email can join using the invitation. The email is stored in a lowercase form.
  - `role` 'admin' | 'developer': DEPRECATED. Use `assignedRoleIds` instead. Role to assign to the invited user in the organization.
  - `assignedRoleIds` string[]: List of role IDs to assign to the invited user when they accept the invitation

## Response `200`

Successful response

- object
  - `status` number: HTTP status code.
  - `requestId` string, uuid: Unique id assigned to every request. UUIDv4
  - `result` Invitation
    - `role` 'admin' | 'developer': DEPRECATED. Use `assignedRoles` instead. Role of the invited user in the organization. For organizations that have migrated to custom roles, this field is frozen at the pre-migration value and does not reflect the role assignment that will be applied.
    - `id` string, uuid: Unique invitation ID.
    - `email` string, email: Email of the invited user. Only a user with this email can join using the invitation. The email is stored in a lowercase form.
    - `createdAt` string, date-time: Invitation creation timestamp. ISO-8601.
    - `expireAt` string, date-time: Timestamp the invitation expires. ISO-8601.
    - `assignedRoles` AssignedRole[]: Custom roles and System roles that will be assigned to the user when they accept the invitation
      - `roleId` string, uuid: Unique identifier of the role
      - `roleName` string: Human-readable name of the role
      - `roleType` 'system' | 'custom': Type of role: system (predefined) or custom (organization-defined)

## Other responses

- `400`: The request cannot be processed due to a client error. Please verify your request parameters and try again.
- `500`: An internal server error has occurred. If this issue persists, please contact ClickHouse Cloud support for assistance.

---

[API](https://skmtc.dev/clickhouse/apis/openapi-spec-for-clickhouse-cloud.md) - [All operations](https://skmtc.dev/clickhouse/apis/openapi-spec-for-clickhouse-cloud/llms.txt) - [OpenAPI document](https://skmtc.dev/clickhouse/apis/openapi-spec-for-clickhouse-cloud/revisions/eac345053548?raw)
