users
Creates, updates, deletes, gets or lists a users resource.
Overview
| Name | users |
| Type | Resource |
| Id | anthropic_admin.organization.users |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the User. |
name | string | Name of the User. |
added_at | string | RFC 3339 datetime string indicating when the User joined the Organization. |
email | string | Email of the User. |
role | string | Organization role of the User. (admin, billing, claude_code_user, developer, user) |
type | string | Object type. Always `user`. (user) |
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the User. |
name | string | Name of the User. |
added_at | string | RFC 3339 datetime string indicating when the User joined the Organization. |
email | string | Email of the User. |
role | string | Organization role of the User. (admin, billing, claude_code_user, developer, user) |
type | string | Object type. Always `user`. (user) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | user_id | Get an organization member by ID. | |
list | select | before_id, after_id, email | List members of the organization. | |
update | update | user_id, role | Update an organization member's role. The role cannot be set to admin via the API. | |
delete | delete | user_id | Remove a member from the organization. Members with the admin role cannot be removed via the API. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
user_id | string | ID of the User. |
after_id | string | ID of the object to use as a cursor for pagination. Returns the page of results immediately after this object. |
before_id | string | ID of the object to use as a cursor for pagination. Returns the page of results immediately before this object. |
email | string | Filter by user email. |
SELECT examples
- get
- list
Get an organization member by ID.
SELECT
id,
name,
added_at,
email,
role,
type
FROM anthropic_admin.organization.users
WHERE user_id = '{{ user_id }}' -- required
;
List members of the organization.
SELECT
id,
name,
added_at,
email,
role,
type
FROM anthropic_admin.organization.users
WHERE before_id = '{{ before_id }}'
AND after_id = '{{ after_id }}'
AND email = '{{ email }}'
;
UPDATE examples
- update
Update an organization member's role. The role cannot be set to admin via the API.
UPDATE anthropic_admin.organization.users
SET
role = '{{ role }}'
WHERE
user_id = '{{ user_id }}' --required
WHERE role = '{{ role }}' --required
RETURNING
id,
name,
added_at,
email,
role,
type;
DELETE examples
- delete
Remove a member from the organization. Members with the admin role cannot be removed via the API.
DELETE FROM anthropic_admin.organization.users
WHERE user_id = '{{ user_id }}' --required
;