Manage Your Organization with the Claude Admin API
- The Admin API manages your organization, not your prompts: members and their roles, invites, workspaces and workspace members, and API keys. It is unavailable for individual accounts.
- An Admin API key (starts with
sk-ant-admin..., sent in thex-api-keyheader) is different from a regular workspace key. Only Console members with the admin role can create one, on the Admin keys page. The docs also list two other credentials: an OAuth bearer token with theorg:adminscope, and a personal or service account key that is not scoped to a workspace. - Console Admin keys have no selectable scopes: every key has full access to all endpoints that accept Admin API keys. The secret is shown only once, so store it in a secrets manager.
- The Admin API cannot create API keys (you do that in the Console). It can read, rename and change the status of existing keys. It also cannot remove members with the admin role.
- Requests carry
x-api-keyandanthropic-versionheaders. The docs’ examples useanthropic-version: 2026-10-21. Some endpoints are beta and need an extraanthropic-betaheader (for example the sign-out endpoint for Claude Enterprise). - Usage and cost reports are covered in Dev 11; this lesson is about members, workspaces and keys.
- On 2026-11-06 I read four official pages. I did not call the API (no Admin key); the Python example only passed a syntax check, so no output is shown. Write calls below are not run.
What you’ll be able to do after this tutorial
Section titled “What you’ll be able to do after this tutorial”- Explain the difference between an Admin API key, a regular API key and an
org:adminOAuth token. - Create an Admin key safely and keep it out of code and repositories.
- List organization members, workspaces and API keys with read-only calls.
- Know which changes the Admin API can make (roles, invites, workspace members, key status) and which it cannot.
Concepts to know first
Section titled “Concepts to know first”| Term | Meaning |
|---|---|
| Organization | The top-level account in the Claude Console that holds members, workspaces and billing. |
| Workspace | A group inside an organization for separating projects, environments or teams. IDs start with wrkspc_. Every organization has a Default Workspace that cannot be renamed, archived or deleted. |
| Admin API key | A key for managing the organization. In a Console organization it starts with sk-ant-admin01-. |
| Regular API key | A key for calling models such as the Messages API. It is not what the Admin API expects. |
| Organization role | One of user, claude_code_user, developer, billing, admin (owners and primary owners also have all admin permissions). |
Step-by-step guide
Section titled “Step-by-step guide”-
Pick the right credential
The docs say the Admin API accepts any of three credentials:
Credential How it is sent Notes Admin API key ( sk-ant-admin...)x-api-keyheaderOnly members with the admin role can provision one. Covers most endpoints. OAuth bearer token with org:adminscopeauthorization: BearerheaderAdmin, owner or primary owner can obtain one. Needed for the service-account, federation-issuer and federation-rule endpoints, which accept only this token. Personal or service account key not scoped to a workspace x-api-keyheaderHas the same permissions as the linked account. For Claude Enterprise (claude.ai) organizations the key comes from claude.ai instead (prefix
sk-ant-api01-) and does have selectable scopes such asread:membersorwrite:members. From the Admin API page only the members and invites endpoints apply to them. This lesson focuses on a Console organization. -
Create an Admin key (Console)
Per the docs: sign in as an organization admin, open the Console’s Admin keys page, click Create admin key, name it, choose a key expiration, click Add, then copy the secret (starting
sk-ant-admin01-). The full secret is shown only once. -
Set the key and check who you are
Use a placeholder in notes and read the real value from your secrets manager:
Terminal window export ANTHROPIC_ADMIN_KEY="your-admin-key-here"curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/me" \-H "x-api-key: $ANTHROPIC_ADMIN_KEY" \-H "anthropic-version: 2026-10-21"The docs say this returns the organization your credential belongs to, with an
id, atypeoforganizationand aname. Status: not run here. If it works, you have confirmed the key and the organization in one read-only call. -
List members, workspaces and keys (read-only)
These are the docs’ own list requests. They return one page each.
Terminal window # Memberscurl "https://api.anthropic.com/v1/organizations/users?limit=10" \-H "x-api-key: $ANTHROPIC_ADMIN_KEY" \-H "anthropic-version: 2026-10-21"# Workspaces (the Default Workspace appears only with include_default=true)curl "https://api.anthropic.com/v1/organizations/workspaces?limit=10&include_archived=false" \-H "x-api-key: $ANTHROPIC_ADMIN_KEY" \-H "anthropic-version: 2026-10-21"# Active API keyscurl "https://api.anthropic.com/v1/organizations/api_keys?limit=10&status=active" \-H "x-api-key: $ANTHROPIC_ADMIN_KEY" \-H "anthropic-version: 2026-10-21"Each API key in the response includes its
expires_at(nullwhen there is no expiration) andprincipal, the identity it acts as. Status: not run. The docs’ own key example also filters withworkspace_id=wrkspc_....The SDK exposes the same endpoints under
client.organization. Save this asadmin_audit.py. It is read-only and uses a separate variable name so an Admin key is never confused with your normal model key:import osimport anthropicclient = anthropic.Anthropic(api_key=os.environ["ANTHROPIC_ADMIN_KEY"])org = client.organization.retrieve()print(f"organization: {org.name} ({org.id})")for key in client.organization.api_keys.list(limit=10, status="active"):print(f"{key.id}: {key.name} ({key.status})")Status: not run. It passed
python3 -I -m py_compileonly. The docs note that list iteration fetches more pages automatically, solimitis the page size, not the total. -
Understand what you could change
Resource What the docs say you can do Members List, update role, remove. Cannot remove members with the admin role. Invites Create (email and role), list, delete. Invites expire after 21 days, not configurable. Workspaces Create, get, list, update, archive. Up to 100 workspaces per organization by default (archived ones do not count). Workspace members Add, list, update role, remove. Roles: Workspace User, Limited Developer, Developer, Admin (Workspace Billing is inherited, not assignable). API keys List, get, update name and status. Cannot create keys. Role inheritance matters: organization admins automatically get Workspace Admin on every workspace, and organization users and developers must be added to each workspace explicitly. Removing a user has side effects on keys: personal keys stop working, service account keys keep working unless the service account is archived, and workspace keys continue to work.
-
Write calls: confirm first
Write calls change real access, so check IDs and ask a second person for anything destructive. The docs’ request shapes:
Terminal window # Invite a user (example address and role from the docs)curl "https://api.anthropic.com/v1/organizations/invites" \-H "x-api-key: $ANTHROPIC_ADMIN_KEY" \-H "anthropic-version: 2026-10-21" \-H "content-type: application/json" \-d '{"email": "user@example.com", "role": "developer"}'# Deactivate a key (look up the real ID with a list call first)curl "https://api.anthropic.com/v1/organizations/api_keys/apikey_EXAMPLE" \-H "x-api-key: $ANTHROPIC_ADMIN_KEY" \-H "anthropic-version: 2026-10-21" \-H "content-type: application/json" \-d '{"status": "inactive"}'Status: not run.
apikey_EXAMPLEis a placeholder. The docs’ own update example sends bothstatusandname; whetherstatusalone is accepted I did not confirm, so check the API reference.For Claude Enterprise organizations, the User management page documents a beta endpoint that signs a member out everywhere:
POST /v1/organizations/users/{id}/sign_outwith the headeranthropic-beta: admin-user-sign-out-2026-10-08and a key with thewrite:membersscope. It reaches the person’s whole Claude account, does not stop API keys, and cannot be used on the primary owner. I did not call it.Copy and paste this promptI manage a Claude Console organization. Help me write an offboarding checklist for someone who leaves the team. Cover: removing them from the organization, what happens to their personal API keys versus service account keys and workspace keys, how to audit keys they created, and what a second person should confirm before I run any delete call. Do not invent API fields; where you are unsure, tell me to check the official Admin API reference. Do not include any real keys or IDs: use placeholders.
Quick reference
Section titled “Quick reference”| Item | Value (official docs, as of 2026-11-06) |
|---|---|
| Base URL | https://api.anthropic.com/v1/organizations/... |
| Admin key | Console: sk-ant-admin01-..., admin role creates it, no selectable scopes, shown once |
| Headers | x-api-key (or authorization: Bearer), anthropic-version (docs use 2026-10-21) |
| Beta endpoints | Extra anthropic-beta header, for example admin-user-sign-out-2026-10-08 |
| Org roles | user, claude_code_user, developer, billing, admin |
| Not possible | Creating API keys; removing admin members |
| Related | Usage and cost reports: Dev 11 |
Common sticking points
Section titled “Common sticking points”The call returns 401 or an authentication error
Section titled “The call returns 401 or an authentication error”- Cause: A regular workspace key was used, or the header is wrong.
- Fix: Use an Admin key (or another accepted credential) in
x-api-key. Interactive OAuth tokens are short-lived; the docs say to rerun the export command if requests start returning 401.
Individual account, no Admin API
Section titled “Individual account, no Admin API”- Cause: The docs say the Admin API is unavailable for individual accounts.
- Fix: Set up an organization on the Console’s Organization page first.
A 403 on an Enterprise key
Section titled “A 403 on an Enterprise key”- Cause: The key lacks a scope the endpoint needs.
- Fix: The docs say the 403 message lists the key’s scopes and the needed ones. Scopes are fixed at creation, so create a new key.
A deleted user’s keys behave differently
Section titled “A deleted user’s keys behave differently”- Cause: Key type decides it (personal, service account, workspace).
- Fix: Audit keys with a list call before and after offboarding.
Practical tips
Section titled “Practical tips”- Do a read-only audit first. Compare the member list, key list and
expires_atvalues with what you expect. - Keep the Admin key out of CI logs and screenshots. This is general security practice, not a statement from the docs beyond their “store it in a secrets manager” advice.
- For short-lived, automated access the docs point to Workload Identity Federation instead of long-lived keys; I did not cover that page.
- If a person is leaving, remember removal and key cleanup are separate steps.
Next tutorials
Section titled “Next tutorials”- 11. Team usage dashboard with the usage and cost API — report on spend per workspace and key
- C16. Getting started with the API — regular API keys
- 20. Errors and retries — handling 401, 403 and 429
Sources
Last verified: Nov 9, 2026
- Admin API platform.claude.com
- Create an Admin API key platform.claude.com
- Workspaces platform.claude.com
- User management (sign a member out everywhere) platform.claude.com
Prices, limits, and menu names change often. Before making an important decision, check the official pages above for the latest details.
Finished this tutorial?
Progress is saved only in this browser and never sent anywhere.