SPB Git

Repository Public

users.md 7.0 KB 441 lines markdown

1---2title: Users3url: https://platform.claude.com/docs/en/api/beta/organization/users4---56# Users78## List Users910**GET** `/v1/organizations/users`1112List the organization's members.1314### Query parameters1516- `after_id: optional string`1718  ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.1920- `before_id: optional string`2122  ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.2324- `email: optional string`2526  Filter by user email.2728  format: email2930- `limit: optional number`3132  Number of items to return per page.3334  Defaults to `20`. Ranges from `1` to `1000`.3536  default: 20, maximum: 1000, minimum: 13738- `roles: optional array of string`3940  Filter to items whose `role` equals one of the supplied values. Repeatable; values are OR'ed together.4142  Accepted values depend on the organization type: Console and API organizations accept `user`, `developer`, `billing`, `admin`, and `claude_code_user`; Claude Enterprise organizations accept `user`, `owner`, `primary_owner`, `membership_admin`, and `managed`.4344### Returns4546- `data: array of BetaOrganizationUser`4748  - `type: "user"`4950    Object type.5152    For Users, this is always `"user"`.5354    default: user5556  - `id: string`5758    ID of the User.5960  - `added_at: string`6162    RFC 3339 datetime string indicating when the User joined the Organization.6364    format: date-time6566  - `email: string`6768    Email of the User.6970  - `name: string`7172    Name of the User.7374  - `role: BetaOrganizationRole`7576    Organization role of the User.7778    - `"admin"`7980    - `"billing"`8182    - `"claude_code_user"`8384    - `"developer"`8586    - `"managed"`8788    - `"membership_admin"`8990    - `"owner"`9192    - `"primary_owner"`9394    - `"user"`9596- `first_id: string or null`9798  First ID in the `data` list. Can be used as the `before_id` for the previous page.99100- `has_more: boolean`101102  Indicates if there are more results in the requested page direction.103104- `last_id: string or null`105106  Last ID in the `data` list. Can be used as the `after_id` for the next page.107108### Example109110```bash111curl https://api.anthropic.com/v1/organizations/users \112    -H 'anthropic-version: 2023-06-01' \113    -H "X-Api-Key: $ANTHROPIC_API_KEY"114```115116#### Response (200)117118```json119{120  "data": [121    {122      "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",123      "added_at": "2024-10-30T23:58:27.427722Z",124      "email": "user@emaildomain.com",125      "name": "Jane Doe",126      "role": "admin",127      "type": "user"128    }129  ],130  "first_id": "first_id",131  "has_more": true,132  "last_id": "last_id"133}134```135136## Get User137138**GET** `/v1/organizations/users/{user_id}`139140Retrieve a member of the organization by user ID.141142### Path parameters143144- `user_id: string`145146  ID of the User.147148### Returns149150- `BetaOrganizationUser object`151152  - `type: "user"`153154    Object type.155156    For Users, this is always `"user"`.157158    default: user159160  - `id: string`161162    ID of the User.163164  - `added_at: string`165166    RFC 3339 datetime string indicating when the User joined the Organization.167168    format: date-time169170  - `email: string`171172    Email of the User.173174  - `name: string`175176    Name of the User.177178  - `role: BetaOrganizationRole`179180    Organization role of the User.181182    - `"admin"`183184    - `"billing"`185186    - `"claude_code_user"`187188    - `"developer"`189190    - `"managed"`191192    - `"membership_admin"`193194    - `"owner"`195196    - `"primary_owner"`197198    - `"user"`199200### Example201202```bash203curl https://api.anthropic.com/v1/organizations/users/$USER_ID \204    -H 'anthropic-version: 2023-06-01' \205    -H "X-Api-Key: $ANTHROPIC_API_KEY"206```207208#### Response (200)209210```json211{212  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",213  "added_at": "2024-10-30T23:58:27.427722Z",214  "email": "user@emaildomain.com",215  "name": "Jane Doe",216  "role": "admin",217  "type": "user"218}219```220221## Update User222223**POST** `/v1/organizations/users/{user_id}`224225Update a member's organization role.226227### Path parameters228229- `user_id: string`230231  ID of the User.232233### Body parameters234235- `role: "billing" or "claude_code_user" or "developer" or 2 more`236237  New role for the User.238239  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`.240241  - `"billing"`242243  - `"claude_code_user"`244245  - `"developer"`246247  - `"managed"`248249  - `"user"`250251### Returns252253- `BetaOrganizationUser object`254255  - `type: "user"`256257    Object type.258259    For Users, this is always `"user"`.260261    default: user262263  - `id: string`264265    ID of the User.266267  - `added_at: string`268269    RFC 3339 datetime string indicating when the User joined the Organization.270271    format: date-time272273  - `email: string`274275    Email of the User.276277  - `name: string`278279    Name of the User.280281  - `role: BetaOrganizationRole`282283    Organization role of the User.284285    - `"admin"`286287    - `"billing"`288289    - `"claude_code_user"`290291    - `"developer"`292293    - `"managed"`294295    - `"membership_admin"`296297    - `"owner"`298299    - `"primary_owner"`300301    - `"user"`302303### Example304305```bash306curl https://api.anthropic.com/v1/organizations/users/$USER_ID \307    -H 'Content-Type: application/json' \308    -H 'anthropic-version: 2023-06-01' \309    -H "X-Api-Key: $ANTHROPIC_API_KEY" \310    -d '{311          "role": "user"312        }'313```314315#### Response (200)316317```json318{319  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",320  "added_at": "2024-10-30T23:58:27.427722Z",321  "email": "user@emaildomain.com",322  "name": "Jane Doe",323  "role": "admin",324  "type": "user"325}326```327328## Remove User329330**DELETE** `/v1/organizations/users/{user_id}`331332Remove a member from the organization.333334### Path parameters335336- `user_id: string`337338  ID of the User.339340### Returns341342- `type: "user_deleted"`343344  Deleted object type.345346  For Users, this is always `"user_deleted"`.347348  default: user_deleted349350- `id: string`351352  ID of the User.353354### Example355356```bash357curl https://api.anthropic.com/v1/organizations/users/$USER_ID \358    -X DELETE \359    -H 'anthropic-version: 2023-06-01' \360    -H "X-Api-Key: $ANTHROPIC_API_KEY"361```362363#### Response (200)364365```json366{367  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",368  "type": "user_deleted"369}370```371372## Domain types373374### Beta Organization User375376- `BetaOrganizationUser object`377378  - `type: "user"`379380    Object type.381382    For Users, this is always `"user"`.383384    default: user385386  - `id: string`387388    ID of the User.389390  - `added_at: string`391392    RFC 3339 datetime string indicating when the User joined the Organization.393394    format: date-time395396  - `email: string`397398    Email of the User.399400  - `name: string`401402    Name of the User.403404  - `role: BetaOrganizationRole`405406    Organization role of the User.407408    - `"admin"`409410    - `"billing"`411412    - `"claude_code_user"`413414    - `"developer"`415416    - `"managed"`417418    - `"membership_admin"`419420    - `"owner"`421422    - `"primary_owner"`423424    - `"user"`425426### User Remove Response427428- `UserRemoveResponse object`429430  - `type: "user_deleted"`431432    Deleted object type.433434    For Users, this is always `"user_deleted"`.435436    default: user_deleted437438  - `id: string`439440    ID of the User.441
Files main
Menu

Theme