org:admin OAuth token.The Admin API allows you to programmatically manage your organization's resources, including organization members, workspaces, and API keys. This provides programmatic control over administrative tasks that would otherwise require manual configuration in the Claude Console.
Authenticate with either credential. An Admin API key covers most endpoints; the service-account, federation-issuer, and federation-rule endpoints accept only an org:admin OAuth token. The following examples call the organization info endpoint both ways.
Log in with the ant CLI under a dedicated profile, requesting the org:admin scope (see Admin access), then export the bearer token. A dedicated profile keeps your routine commands from running with elevated access:
ant auth login --profile admin --scope "org:admin"
export ANTHROPIC_OAUTH_TOKEN=$(ant auth print-credentials --profile admin --access-token)Interactive tokens are short-lived; if requests start returning 401, re-run the export command, which refreshes the token automatically.
Call the Admin API with the exported token:
curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/me" \
--header "anthropic-version: 2023-06-01" \
--header "authorization: Bearer $ANTHROPIC_OAUTH_TOKEN"An org:admin token grants access to the whole organization, regardless of the workspace the underlying profile or federation rule is bound to.
For CI and other non-interactive workloads, mint the token with Workload Identity Federation instead of logging in interactively. See Manage WIF with the Admin API.
To create an Admin API key for your organization type, see Create an Admin API key.
curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/me" \
--header "anthropic-version: 2023-06-01" \
--header "x-api-key: $ANTHROPIC_ADMIN_KEY"When you use the Admin API:
org:admin OAuth token; Admin API keys are not accepted)This is useful for:
There are five organization-level roles. See more details in the API Console roles and permissions article.
| Role | Permissions |
|---|---|
| user | Can use Playground |
| claude_code_user | Can use Playground and Claude Code |
| developer | Can use Playground and manage API keys |
| billing | Can use Playground and manage billing details |
| admin | Can do all of the preceding, plus manage users |
Organization owners and primary owners have all admin permissions and can additionally manage admins. All references to the admin role on this page also apply to owners and primary owners.
You can list organization members, update member roles, and remove members.
# List organization members
curl "https://api.anthropic.com/v1/organizations/users?limit=10" \
--header "anthropic-version: 2023-06-01" \
--header "x-api-key: $ANTHROPIC_ADMIN_KEY"
# Update member role
curl "https://api.anthropic.com/v1/organizations/users/{user_id}" \
--header "anthropic-version: 2023-06-01" \
--header "content-type: application/json" \
--header