SPB Git

Repository Public

create.md 3.1 KB 150 lines markdown

1---2title: Create Invite3url: https://platform.claude.com/docs/en/api/beta/organization/invites/create4---56# Create Invite78**POST** `/v1/organizations/invites`910Invite a user to join the organization by email.1112On plans that draw members from a finite pool of purchased seats, the invite automatically consumes a seat from the lowest tier with availability; there is no seat-tier parameter. When no seat is free the request fails with a 400 error rather than purchasing a seat.1314## Body parameters1516- `email: string`1718  Email of the User.1920  format: email2122- `role: "billing" or "claude_code_user" or "developer" or 2 more`2324  Role for the invited User.2526  The accepted values depend on the organization type. Console and API organizations accept `user`, `developer`, `billing`, and `claude_code_user`; `admin` cannot be assigned through the API. Claude Enterprise organizations accept `user` and `managed`.2728  - `"billing"`2930  - `"claude_code_user"`3132  - `"developer"`3334  - `"managed"`3536  - `"user"`3738- `rbac_group_ids: optional array of string`3940  RBAC group IDs to assign to the User when the Invite is accepted. A non-empty array is accepted only for a Claude Enterprise organization with RBAC groups, and requires the key to carry the `write:rbac_groups` scope.4142  maxItems: 1004344## Returns4546- `BetaOrganizationInvite object`4748  - `type: "invite"`4950    Object type.5152    For Invites, this is always `"invite"`.5354    default: invite5556  - `id: string`5758    ID of the Invite.5960  - `accepted_at: string or null`6162    RFC 3339 datetime string indicating when the Invite was accepted, or null.6364    format: date-time6566  - `email: string`6768    Email of the User being invited.6970  - `expires_at: string`7172    RFC 3339 datetime string indicating when the Invite expires.7374    format: date-time7576  - `invited_at: string`7778    RFC 3339 datetime string indicating when the Invite was created.7980    format: date-time8182  - `rbac_group_ids: array of string`8384    RBAC group IDs recorded on the Invite (Claude Enterprise organizations), to be assigned to the User when the Invite is accepted. `[]` when none.8586  - `role: BetaOrganizationRole`8788    Organization role of the User.8990    - `"admin"`9192    - `"billing"`9394    - `"claude_code_user"`9596    - `"developer"`9798    - `"managed"`99100    - `"membership_admin"`101102    - `"owner"`103104    - `"primary_owner"`105106    - `"user"`107108  - `status: "accepted" or "deleted" or "expired" or "pending"`109110    Status of the Invite.111112    - `"accepted"`113114    - `"deleted"`115116    - `"expired"`117118    - `"pending"`119120## Example121122```bash123curl https://api.anthropic.com/v1/organizations/invites \124    -H 'Content-Type: application/json' \125    -H 'anthropic-version: 2023-06-01' \126    -H "X-Api-Key: $ANTHROPIC_API_KEY" \127    -d '{128          "email": "user@emaildomain.com",129          "role": "user"130        }'131```132133### Response (200)134135```json136{137  "id": "invite_015gWxCN9Hfg2QhZwTK7Mdeu",138  "accepted_at": "2019-12-27T18:11:19.117Z",139  "email": "user@emaildomain.com",140  "expires_at": "2024-11-20T23:58:27.427722Z",141  "invited_at": "2024-10-30T23:58:27.427722Z",142  "rbac_group_ids": [143    "string"144  ],145  "role": "admin",146  "status": "pending",147  "type": "invite"148}149```150
Files main
Menu

Theme