Skip to content
한국어

Manage Your Organization with the Claude Admin API

In short
  • 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 the x-api-key header) 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 the org:admin scope, 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-key and anthropic-version headers. The docs’ examples use anthropic-version: 2026-10-21. Some endpoints are beta and need an extra anthropic-beta header (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:admin OAuth 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.
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).
0/6 done
  1. 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-key header Only members with the admin role can provision one. Covers most endpoints.
    OAuth bearer token with org:admin scope authorization: Bearer header Admin, 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-key header Has 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 as read:members or write:members. From the Admin API page only the members and invites endpoints apply to them. This lesson focuses on a Console organization.

  2. 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.

  3. 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, a type of organization and a name. Status: not run here. If it works, you have confirmed the key and the organization in one read-only call.

  4. List members, workspaces and keys (read-only)

    These are the docs’ own list requests. They return one page each.

    Terminal window
    # Members
    curl "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 keys
    curl "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 (null when there is no expiration) and principal, the identity it acts as. Status: not run. The docs’ own key example also filters with workspace_id=wrkspc_....

    The SDK exposes the same endpoints under client.organization. Save this as admin_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 os
    import anthropic
    client = 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_compile only. The docs note that list iteration fetches more pages automatically, so limit is the page size, not the total.

  5. 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.

  6. 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_EXAMPLE is a placeholder. The docs’ own update example sends both status and name; whether status alone 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_out with the header anthropic-beta: admin-user-sign-out-2026-10-08 and a key with the write:members scope. 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 prompt

    I 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.

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

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.
  • Cause: The docs say the Admin API is unavailable for individual accounts.
  • Fix: Set up an organization on the Console’s Organization page first.
  • 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.
  • Do a read-only audit first. Compare the member list, key list and expires_at values 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.

Sources

Last verified: Nov 9, 2026

Prices, limits, and menu names change often. Before making an important decision, check the official pages above for the latest details.