The Admin API is unavailable for individual accounts. To collaborate with teammates and add members, set up your organization in Console → Settings → Organization.
The Admin API requires special accessThe Admin API requires a special Admin API key (starting with
sk-ant-admin...
) that differs from standard API keys. Only organization members with the admin role can provision Admin API keys through the Claude Console.How the Admin API works
When you use the Admin API:- You make requests using your Admin API key in the
x-api-key
header - The API allows you to manage:
- Organization members and their roles
- Organization member invites
- Workspaces and their members
- API keys
- Automating user onboarding/offboarding
- Programmatically managing workspace access
- Monitoring and managing API key usage
Organization roles and permissions
There are five organization-level roles. See more details here.Role | Permissions |
---|---|
user | Can use Workbench |
claude_code_user | Can use Workbench and Claude Code |
developer | Can use Workbench and manage API keys |
billing | Can use Workbench and manage billing details |
admin | Can do all of the above, plus manage users |
Key concepts
Organization Members
You can list organization members, update member roles, and remove members.Organization Invites
You can invite users to organizations and manage those invites.Workspaces
Create and manage workspaces (console) to organize your resources:Workspace Members
Manage user access to specific workspaces:API Keys
Monitor and manage API keys:Accessing organization info
Get information about your organization programmatically with the/v1/organizations/me
endpoint.
For example:
Accessing usage and cost reports
To access usage and cost reports for your organization, use the Usage and Cost API endpoints:- The Usage endpoint (
/v1/organizations/usage_report/messages
) provides detailed usage data, including token counts and request metrics, grouped by various dimensions such as workspace, user, and model. - The Cost endpoint (
/v1/organizations/cost_report
) provides cost data associated with your organization’s usage, allowing you to track expenses and allocate costs by workspace or description.
Accessing Claude Code analytics
For organizations using Claude Code, the Claude Code Analytics API provides detailed productivity metrics and usage insights:- The Claude Code Analytics endpoint (
/v1/organizations/usage_report/claude_code
) provides daily aggregated metrics for Claude Code usage, including sessions, lines of code, commits, pull requests, tool usage statistics, and cost data broken down by user and model.
Best practices
To effectively use the Admin API:- Use meaningful names and descriptions for workspaces and API keys
- Implement proper error handling for failed operations
- Regularly audit member roles and permissions
- Clean up unused workspaces and expired invites
- Monitor API key usage and rotate keys periodically
FAQ
What permissions are needed to use the Admin API?
What permissions are needed to use the Admin API?
Only organization members with the admin role can use the Admin API. They must also have a special Admin API key (starting with
sk-ant-admin
).Can I create new API keys through the Admin API?
Can I create new API keys through the Admin API?
No, new API keys can only be created through the Claude Console for security reasons. The Admin API can only manage existing API keys.
What happens to API keys when removing a user?
What happens to API keys when removing a user?
API keys persist in their current state as they are scoped to the Organization, not to individual users.
Can organization admins be removed via the API?
Can organization admins be removed via the API?
No, organization members with the admin role cannot be removed via the API for security reasons.
How long do organization invites last?
How long do organization invites last?
Organization invites expire after 21 days. There is currently no way to modify this expiration period.
Are there limits on workspaces?
Are there limits on workspaces?
Yes, you can have a maximum of 100 workspaces per Organization. Archived workspaces do not count towards this limit.
What's the Default Workspace?
What's the Default Workspace?
Every Organization has a “Default Workspace” that cannot be edited or removed, and has no ID. This Workspace does not appear in workspace list endpoints.
How do organization roles affect Workspace access?
How do organization roles affect Workspace access?
Organization admins automatically get the
workspace_admin
role to all workspaces. Organization billing members automatically get the workspace_billing
role. Organization users and developers must be manually added to each workspace.Which roles can be assigned in workspaces?
Which roles can be assigned in workspaces?
Organization users and developers can be assigned
workspace_admin
, workspace_developer
, or workspace_user
roles. The workspace_billing
role can’t be manually assigned - it’s inherited from having the organization billing
role.Can organization admin or billing members' workspace roles be changed?
Can organization admin or billing members' workspace roles be changed?
Only organization billing members can have their workspace role upgraded to an admin role. Otherwise, organization admins and billing members can’t have their workspace roles changed or be removed from workspaces while they hold those organization roles. Their workspace access must be modified by changing their organization role first.
What happens to workspace access when organization roles change?
What happens to workspace access when organization roles change?
If an organization admin or billing member is demoted to user or developer, they lose access to all workspaces except ones where they were manually assigned roles. When users are promoted to admin or billing roles, they gain automatic access to all workspaces.