Skip to main content

users

Creates, updates, deletes, gets or lists a users resource.

Overview

Nameusers
TypeResource
Idanthropic_admin.organization.users

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringID of the User.
namestringName of the User.
added_atstringRFC 3339 datetime string indicating when the User joined the Organization.
emailstringEmail of the User.
rolestringOrganization role of the User. (admin, billing, claude_code_user, developer, user)
typestringObject type. Always `user`. (user)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectuser_idGet an organization member by ID.
listselectbefore_id, after_id, emailList members of the organization.
updateupdateuser_id, roleUpdate an organization member's role. The role cannot be set to admin via the API.
deletedeleteuser_idRemove 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.

NameDatatypeDescription
user_idstringID of the User.
after_idstringID of the object to use as a cursor for pagination. Returns the page of results immediately after this object.
before_idstringID of the object to use as a cursor for pagination. Returns the page of results immediately before this object.
emailstringFilter by user email.

SELECT examples

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
;

UPDATE examples

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

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
;