SPB Git

Repository Public

service_accounts.md 41.2 KB 1,790 lines markdown

1---2title: Service Accounts3url: https://platform.claude.com/docs/en/api/beta/organization/service_accounts4---56# Service Accounts78## Create Service Account910**POST** `/v1/organizations/service_accounts`1112**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).1314Create a service account.1516A service account is a named workload identity that federation rules17target. `organization_role` is `developer` (default) or `admin`; a rule18may only be created or retargeted to grant `org:admin` scope when the19target's `organization_role` is `admin`. Creating an `admin`-role service20account requires an interactive credential (a user OAuth token or a21Console session) — a workload may only create `developer`-role service22accounts.2324### Headers2526- `"anthropic-beta": optional array of AnthropicBeta`2728  Optional header to specify the beta version(s) you want to use.2930  - `string`3132  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`3334    - `"message-batches-2024-09-24"`3536    - `"prompt-caching-2024-07-31"`3738    - `"computer-use-2024-10-22"`3940    - `"computer-use-2025-01-24"`4142    - `"pdfs-2024-09-25"`4344    - `"token-counting-2024-11-01"`4546    - `"token-efficient-tools-2025-02-19"`4748    - `"output-128k-2025-02-19"`4950    - `"files-api-2025-04-14"`5152    - `"mcp-client-2025-04-04"`5354    - `"mcp-client-2025-11-20"`5556    - `"dev-full-thinking-2025-05-14"`5758    - `"interleaved-thinking-2025-05-14"`5960    - `"code-execution-2025-05-22"`6162    - `"extended-cache-ttl-2025-04-11"`6364    - `"context-1m-2025-08-07"`6566    - `"context-management-2025-06-27"`6768    - `"model-context-window-exceeded-2025-08-26"`6970    - `"skills-2025-10-02"`7172    - `"fast-mode-2026-02-01"`7374    - `"output-300k-2026-03-24"`7576    - `"user-profiles-2026-03-24"`7778    - `"user-profiles-2026-08-18"`7980    - `"user-profiles-2026-09-04"`8182    - `"advisor-tool-2026-03-01"`8384    - `"managed-agents-2026-04-01"`8586    - `"cache-diagnosis-2026-04-07"`8788    - `"dreaming-2026-04-21"`8990    - `"thinking-token-count-2026-05-13"`9192    - `"server-side-fallback-2026-06-01"`9394    - `"server-side-fallback-2026-07-01"`9596    - `"fallback-credit-2026-06-01"`9798    - `"fallback-credit-2026-07-01"`99100    - `"agent-memory-2026-07-22"`101102    - `"mid-conversation-tool-changes-2026-07-01"`103104    - `"compact-2026-01-12"`105106    - `"computer-use-2025-11-24"`107108    - `"mcp-tunnels-2026-06-22"`109110    - `"structured-outputs-2025-11-13"`111112    - `"task-budgets-2026-03-13"`113114    - `"thinking-display-updates-2026-08-18"`115116    - `"ce-user-management-2026-07-13"`117118    - `"mid-conversation-output-config-2026-07-01"`119120    - `"thinking-binding-controls-2026-08-01"`121122    - `"mid-conversation-system-clear-at-2026-08-21"`123124    - `"compact-2026-09-04"`125126### Body parameters127128- `name: string`129130  Slug identifier (lowercase, digits, hyphens). Unique within the organization; a duplicate name returns 409.131132  maxLength: 255, minLength: 1133134- `description: optional string or null`135136  Optional free-text description.137138  maxLength: 2000139140- `organization_role: optional "admin" or "developer"`141142  Org-level role. Defaults to `developer`.143144  - `"admin"`145146  - `"developer"`147148### Returns149150- `BetaServiceAccount object`151152  Named non-human identity within the caller's organization.153154  A service account is a pure identity: name + org. Authorization lives on155  whatever references it (federation rules).156157  - `type: "service_account"`158159    default: service_account160161  - `id: string`162163    Tagged ID of the service account.164165  - `archived_at: string or null`166167    If set, this service account is archived.168169    format: date-time170171  - `archived_by_actor_id: string or null`172173    Tagged ID (`user_`/`svac_`) of the actor that archived this service account.174175  - `created_at: string`176177    When this service account was created.178179    format: date-time180181  - `created_by_actor_id: string or null`182183    Tagged ID (`user_`/`svac_`) of the actor that created this service account.184185  - `description: string or null`186187    Optional free-text description.188189  - `name: string`190191    Admin-chosen slug identifier.192193  - `organization_role: "admin" or "developer"`194195    Org-level role. A federation rule may only be created or retargeted to grant `org:admin` scope when this is `admin`. A rule granting `org:admin` whose target is later demoted to `developer` is rejected at token exchange. Rules granting `org:admin` are managed in the Console.196197    - `"admin"`198199    - `"developer"`200201  - `updated_at: string`202203    When this service account was last updated.204205    format: date-time206207  - `updated_by_actor_id: string or null`208209    Tagged ID (`user_`/`svac_`) of the actor that last updated this service account.210211### Example212213```bash214curl https://api.anthropic.com/v1/organizations/service_accounts \215    -H 'Content-Type: application/json' \216    -H 'anthropic-version: 2023-06-01' \217    -H "X-Api-Key: $ANTHROPIC_API_KEY" \218    -d '{219          "name": "ci-deploy-bot"220        }'221```222223#### Response (200)224225```json226{227  "id": "svac_01SDCCSbTxrXDpWc1phhtcfK",228  "archived_at": "2019-12-27T18:11:19.117Z",229  "archived_by_actor_id": "archived_by_actor_id",230  "created_at": "2024-10-30T23:58:27.427722Z",231  "created_by_actor_id": "created_by_actor_id",232  "description": "description",233  "name": "ci-deploy-bot",234  "organization_role": "admin",235  "type": "service_account",236  "updated_at": "2024-10-30T23:58:27.427722Z",237  "updated_by_actor_id": "updated_by_actor_id"238}239```240241## List Service Accounts242243**GET** `/v1/organizations/service_accounts`244245**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).246247List service accounts in the caller's organization.248249Results are ordered by creation time, newest first. Use `limit` and the250`next_page` cursor to paginate; set `include_archived=true` to include251archived service accounts.252253### Query parameters254255- `include_archived: optional boolean`256257  Include archived resources. Defaults to false.258259  default: false260261- `limit: optional number`262263  Number of results per page.264265  default: 20, maximum: 100, minimum: 1266267- `page: optional string`268269  Opaque cursor from a previous response's `next_page`.270271### Headers272273- `"anthropic-beta": optional array of AnthropicBeta`274275  Optional header to specify the beta version(s) you want to use.276277  - `string`278279  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`280281    - `"message-batches-2024-09-24"`282283    - `"prompt-caching-2024-07-31"`284285    - `"computer-use-2024-10-22"`286287    - `"computer-use-2025-01-24"`288289    - `"pdfs-2024-09-25"`290291    - `"token-counting-2024-11-01"`292293    - `"token-efficient-tools-2025-02-19"`294295    - `"output-128k-2025-02-19"`296297    - `"files-api-2025-04-14"`298299    - `"mcp-client-2025-04-04"`300301    - `"mcp-client-2025-11-20"`302303    - `"dev-full-thinking-2025-05-14"`304305    - `"interleaved-thinking-2025-05-14"`306307    - `"code-execution-2025-05-22"`308309    - `"extended-cache-ttl-2025-04-11"`310311    - `"context-1m-2025-08-07"`312313    - `"context-management-2025-06-27"`314315    - `"model-context-window-exceeded-2025-08-26"`316317    - `"skills-2025-10-02"`318319    - `"fast-mode-2026-02-01"`320321    - `"output-300k-2026-03-24"`322323    - `"user-profiles-2026-03-24"`324325    - `"user-profiles-2026-08-18"`326327    - `"user-profiles-2026-09-04"`328329    - `"advisor-tool-2026-03-01"`330331    - `"managed-agents-2026-04-01"`332333    - `"cache-diagnosis-2026-04-07"`334335    - `"dreaming-2026-04-21"`336337    - `"thinking-token-count-2026-05-13"`338339    - `"server-side-fallback-2026-06-01"`340341    - `"server-side-fallback-2026-07-01"`342343    - `"fallback-credit-2026-06-01"`344345    - `"fallback-credit-2026-07-01"`346347    - `"agent-memory-2026-07-22"`348349    - `"mid-conversation-tool-changes-2026-07-01"`350351    - `"compact-2026-01-12"`352353    - `"computer-use-2025-11-24"`354355    - `"mcp-tunnels-2026-06-22"`356357    - `"structured-outputs-2025-11-13"`358359    - `"task-budgets-2026-03-13"`360361    - `"thinking-display-updates-2026-08-18"`362363    - `"ce-user-management-2026-07-13"`364365    - `"mid-conversation-output-config-2026-07-01"`366367    - `"thinking-binding-controls-2026-08-01"`368369    - `"mid-conversation-system-clear-at-2026-08-21"`370371    - `"compact-2026-09-04"`372373### Returns374375- `data: array of BetaServiceAccount`376377  - `type: "service_account"`378379    default: service_account380381  - `id: string`382383    Tagged ID of the service account.384385  - `archived_at: string or null`386387    If set, this service account is archived.388389    format: date-time390391  - `archived_by_actor_id: string or null`392393    Tagged ID (`user_`/`svac_`) of the actor that archived this service account.394395  - `created_at: string`396397    When this service account was created.398399    format: date-time400401  - `created_by_actor_id: string or null`402403    Tagged ID (`user_`/`svac_`) of the actor that created this service account.404405  - `description: string or null`406407    Optional free-text description.408409  - `name: string`410411    Admin-chosen slug identifier.412413  - `organization_role: "admin" or "developer"`414415    Org-level role. A federation rule may only be created or retargeted to grant `org:admin` scope when this is `admin`. A rule granting `org:admin` whose target is later demoted to `developer` is rejected at token exchange. Rules granting `org:admin` are managed in the Console.416417    - `"admin"`418419    - `"developer"`420421  - `updated_at: string`422423    When this service account was last updated.424425    format: date-time426427  - `updated_by_actor_id: string or null`428429    Tagged ID (`user_`/`svac_`) of the actor that last updated this service account.430431- `next_page: string or null`432433  Opaque cursor for the next page, or null if no more results.434435### Example436437```bash438curl https://api.anthropic.com/v1/organizations/service_accounts \439    -H 'anthropic-version: 2023-06-01' \440    -H "X-Api-Key: $ANTHROPIC_API_KEY"441```442443#### Response (200)444445```json446{447  "data": [448    {449      "id": "svac_01SDCCSbTxrXDpWc1phhtcfK",450      "archived_at": "2019-12-27T18:11:19.117Z",451      "archived_by_actor_id": "archived_by_actor_id",452      "created_at": "2024-10-30T23:58:27.427722Z",453      "created_by_actor_id": "created_by_actor_id",454      "description": "description",455      "name": "ci-deploy-bot",456      "organization_role": "admin",457      "type": "service_account",458      "updated_at": "2024-10-30T23:58:27.427722Z",459      "updated_by_actor_id": "updated_by_actor_id"460    }461  ],462  "next_page": "next_page"463}464```465466## Get Service Account467468**GET** `/v1/organizations/service_accounts/{service_account_id}`469470**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).471472Retrieve a service account by its ID (`svac_...`).473474### Path parameters475476- `service_account_id: string`477478  ID of the service account.479480### Headers481482- `"anthropic-beta": optional array of AnthropicBeta`483484  Optional header to specify the beta version(s) you want to use.485486  - `string`487488  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`489490    - `"message-batches-2024-09-24"`491492    - `"prompt-caching-2024-07-31"`493494    - `"computer-use-2024-10-22"`495496    - `"computer-use-2025-01-24"`497498    - `"pdfs-2024-09-25"`499500    - `"token-counting-2024-11-01"`501502    - `"token-efficient-tools-2025-02-19"`503504    - `"output-128k-2025-02-19"`505506    - `"files-api-2025-04-14"`507508    - `"mcp-client-2025-04-04"`509510    - `"mcp-client-2025-11-20"`511512    - `"dev-full-thinking-2025-05-14"`513514    - `"interleaved-thinking-2025-05-14"`515516    - `"code-execution-2025-05-22"`517518    - `"extended-cache-ttl-2025-04-11"`519520    - `"context-1m-2025-08-07"`521522    - `"context-management-2025-06-27"`523524    - `"model-context-window-exceeded-2025-08-26"`525526    - `"skills-2025-10-02"`527528    - `"fast-mode-2026-02-01"`529530    - `"output-300k-2026-03-24"`531532    - `"user-profiles-2026-03-24"`533534    - `"user-profiles-2026-08-18"`535536    - `"user-profiles-2026-09-04"`537538    - `"advisor-tool-2026-03-01"`539540    - `"managed-agents-2026-04-01"`541542    - `"cache-diagnosis-2026-04-07"`543544    - `"dreaming-2026-04-21"`545546    - `"thinking-token-count-2026-05-13"`547548    - `"server-side-fallback-2026-06-01"`549550    - `"server-side-fallback-2026-07-01"`551552    - `"fallback-credit-2026-06-01"`553554    - `"fallback-credit-2026-07-01"`555556    - `"agent-memory-2026-07-22"`557558    - `"mid-conversation-tool-changes-2026-07-01"`559560    - `"compact-2026-01-12"`561562    - `"computer-use-2025-11-24"`563564    - `"mcp-tunnels-2026-06-22"`565566    - `"structured-outputs-2025-11-13"`567568    - `"task-budgets-2026-03-13"`569570    - `"thinking-display-updates-2026-08-18"`571572    - `"ce-user-management-2026-07-13"`573574    - `"mid-conversation-output-config-2026-07-01"`575576    - `"thinking-binding-controls-2026-08-01"`577578    - `"mid-conversation-system-clear-at-2026-08-21"`579580    - `"compact-2026-09-04"`581582### Returns583584- `BetaServiceAccount object`585586  Named non-human identity within the caller's organization.587588  A service account is a pure identity: name + org. Authorization lives on589  whatever references it (federation rules).590591  - `type: "service_account"`592593    default: service_account594595  - `id: string`596597    Tagged ID of the service account.598599  - `archived_at: string or null`600601    If set, this service account is archived.602603    format: date-time604605  - `archived_by_actor_id: string or null`606607    Tagged ID (`user_`/`svac_`) of the actor that archived this service account.608609  - `created_at: string`610611    When this service account was created.612613    format: date-time614615  - `created_by_actor_id: string or null`616617    Tagged ID (`user_`/`svac_`) of the actor that created this service account.618619  - `description: string or null`620621    Optional free-text description.622623  - `name: string`624625    Admin-chosen slug identifier.626627  - `organization_role: "admin" or "developer"`628629    Org-level role. A federation rule may only be created or retargeted to grant `org:admin` scope when this is `admin`. A rule granting `org:admin` whose target is later demoted to `developer` is rejected at token exchange. Rules granting `org:admin` are managed in the Console.630631    - `"admin"`632633    - `"developer"`634635  - `updated_at: string`636637    When this service account was last updated.638639    format: date-time640641  - `updated_by_actor_id: string or null`642643    Tagged ID (`user_`/`svac_`) of the actor that last updated this service account.644645### Example646647```bash648curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID \649    -H 'anthropic-version: 2023-06-01' \650    -H "X-Api-Key: $ANTHROPIC_API_KEY"651```652653#### Response (200)654655```json656{657  "id": "svac_01SDCCSbTxrXDpWc1phhtcfK",658  "archived_at": "2019-12-27T18:11:19.117Z",659  "archived_by_actor_id": "archived_by_actor_id",660  "created_at": "2024-10-30T23:58:27.427722Z",661  "created_by_actor_id": "created_by_actor_id",662  "description": "description",663  "name": "ci-deploy-bot",664  "organization_role": "admin",665  "type": "service_account",666  "updated_at": "2024-10-30T23:58:27.427722Z",667  "updated_by_actor_id": "updated_by_actor_id"668}669```670671## Update Service Account672673**POST** `/v1/organizations/service_accounts/{service_account_id}`674675**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).676677Update a service account.678679Only `description` and `organization_role` are mutable; `name` cannot be680changed. Archived service accounts cannot be updated; this returns 400.681Setting `organization_role` to `admin` (even when unchanged) requires an682interactive credential (a user OAuth token or a Console session).683684### Path parameters685686- `service_account_id: string`687688  ID of the service account to update.689690### Headers691692- `"anthropic-beta": optional array of AnthropicBeta`693694  Optional header to specify the beta version(s) you want to use.695696  - `string`697698  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`699700    - `"message-batches-2024-09-24"`701702    - `"prompt-caching-2024-07-31"`703704    - `"computer-use-2024-10-22"`705706    - `"computer-use-2025-01-24"`707708    - `"pdfs-2024-09-25"`709710    - `"token-counting-2024-11-01"`711712    - `"token-efficient-tools-2025-02-19"`713714    - `"output-128k-2025-02-19"`715716    - `"files-api-2025-04-14"`717718    - `"mcp-client-2025-04-04"`719720    - `"mcp-client-2025-11-20"`721722    - `"dev-full-thinking-2025-05-14"`723724    - `"interleaved-thinking-2025-05-14"`725726    - `"code-execution-2025-05-22"`727728    - `"extended-cache-ttl-2025-04-11"`729730    - `"context-1m-2025-08-07"`731732    - `"context-management-2025-06-27"`733734    - `"model-context-window-exceeded-2025-08-26"`735736    - `"skills-2025-10-02"`737738    - `"fast-mode-2026-02-01"`739740    - `"output-300k-2026-03-24"`741742    - `"user-profiles-2026-03-24"`743744    - `"user-profiles-2026-08-18"`745746    - `"user-profiles-2026-09-04"`747748    - `"advisor-tool-2026-03-01"`749750    - `"managed-agents-2026-04-01"`751752    - `"cache-diagnosis-2026-04-07"`753754    - `"dreaming-2026-04-21"`755756    - `"thinking-token-count-2026-05-13"`757758    - `"server-side-fallback-2026-06-01"`759760    - `"server-side-fallback-2026-07-01"`761762    - `"fallback-credit-2026-06-01"`763764    - `"fallback-credit-2026-07-01"`765766    - `"agent-memory-2026-07-22"`767768    - `"mid-conversation-tool-changes-2026-07-01"`769770    - `"compact-2026-01-12"`771772    - `"computer-use-2025-11-24"`773774    - `"mcp-tunnels-2026-06-22"`775776    - `"structured-outputs-2025-11-13"`777778    - `"task-budgets-2026-03-13"`779780    - `"thinking-display-updates-2026-08-18"`781782    - `"ce-user-management-2026-07-13"`783784    - `"mid-conversation-output-config-2026-07-01"`785786    - `"thinking-binding-controls-2026-08-01"`787788    - `"mid-conversation-system-clear-at-2026-08-21"`789790    - `"compact-2026-09-04"`791792### Body parameters793794- `description: optional string or null`795796  Replaces the description. Omit to leave unchanged; send `null` to clear (the field is stored as an empty string).797798  maxLength: 2000799800- `organization_role: optional "admin" or "developer" or null`801802  Replaces the org-level role. Omit or send `null` to leave unchanged.803804  - `"admin"`805806  - `"developer"`807808### Returns809810- `BetaServiceAccount object`811812  Named non-human identity within the caller's organization.813814  A service account is a pure identity: name + org. Authorization lives on815  whatever references it (federation rules).816817  - `type: "service_account"`818819    default: service_account820821  - `id: string`822823    Tagged ID of the service account.824825  - `archived_at: string or null`826827    If set, this service account is archived.828829    format: date-time830831  - `archived_by_actor_id: string or null`832833    Tagged ID (`user_`/`svac_`) of the actor that archived this service account.834835  - `created_at: string`836837    When this service account was created.838839    format: date-time840841  - `created_by_actor_id: string or null`842843    Tagged ID (`user_`/`svac_`) of the actor that created this service account.844845  - `description: string or null`846847    Optional free-text description.848849  - `name: string`850851    Admin-chosen slug identifier.852853  - `organization_role: "admin" or "developer"`854855    Org-level role. A federation rule may only be created or retargeted to grant `org:admin` scope when this is `admin`. A rule granting `org:admin` whose target is later demoted to `developer` is rejected at token exchange. Rules granting `org:admin` are managed in the Console.856857    - `"admin"`858859    - `"developer"`860861  - `updated_at: string`862863    When this service account was last updated.864865    format: date-time866867  - `updated_by_actor_id: string or null`868869    Tagged ID (`user_`/`svac_`) of the actor that last updated this service account.870871### Example872873```bash874curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID \875    -H 'Content-Type: application/json' \876    -H 'anthropic-version: 2023-06-01' \877    -H "X-Api-Key: $ANTHROPIC_API_KEY" \878    -d '{}'879```880881#### Response (200)882883```json884{885  "id": "svac_01SDCCSbTxrXDpWc1phhtcfK",886  "archived_at": "2019-12-27T18:11:19.117Z",887  "archived_by_actor_id": "archived_by_actor_id",888  "created_at": "2024-10-30T23:58:27.427722Z",889  "created_by_actor_id": "created_by_actor_id",890  "description": "description",891  "name": "ci-deploy-bot",892  "organization_role": "admin",893  "type": "service_account",894  "updated_at": "2024-10-30T23:58:27.427722Z",895  "updated_by_actor_id": "updated_by_actor_id"896}897```898899## Archive Service Account900901**POST** `/v1/organizations/service_accounts/{service_account_id}/archive`902903**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).904905Archive a service account.906907Idempotent; re-archiving returns the service account with its original908`archived_at`. Rejected with 400 if any live (non-archived) federation909rule still targets this service account, same as issuer archival; archive910those rules first or change their target to another service account.911912### Path parameters913914- `service_account_id: string`915916  ID of the service account to archive.917918### Headers919920- `"anthropic-beta": optional array of AnthropicBeta`921922  Optional header to specify the beta version(s) you want to use.923924  - `string`925926  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`927928    - `"message-batches-2024-09-24"`929930    - `"prompt-caching-2024-07-31"`931932    - `"computer-use-2024-10-22"`933934    - `"computer-use-2025-01-24"`935936    - `"pdfs-2024-09-25"`937938    - `"token-counting-2024-11-01"`939940    - `"token-efficient-tools-2025-02-19"`941942    - `"output-128k-2025-02-19"`943944    - `"files-api-2025-04-14"`945946    - `"mcp-client-2025-04-04"`947948    - `"mcp-client-2025-11-20"`949950    - `"dev-full-thinking-2025-05-14"`951952    - `"interleaved-thinking-2025-05-14"`953954    - `"code-execution-2025-05-22"`955956    - `"extended-cache-ttl-2025-04-11"`957958    - `"context-1m-2025-08-07"`959960    - `"context-management-2025-06-27"`961962    - `"model-context-window-exceeded-2025-08-26"`963964    - `"skills-2025-10-02"`965966    - `"fast-mode-2026-02-01"`967968    - `"output-300k-2026-03-24"`969970    - `"user-profiles-2026-03-24"`971972    - `"user-profiles-2026-08-18"`973974    - `"user-profiles-2026-09-04"`975976    - `"advisor-tool-2026-03-01"`977978    - `"managed-agents-2026-04-01"`979980    - `"cache-diagnosis-2026-04-07"`981982    - `"dreaming-2026-04-21"`983984    - `"thinking-token-count-2026-05-13"`985986    - `"server-side-fallback-2026-06-01"`987988    - `"server-side-fallback-2026-07-01"`989990    - `"fallback-credit-2026-06-01"`991992    - `"fallback-credit-2026-07-01"`993994    - `"agent-memory-2026-07-22"`995996    - `"mid-conversation-tool-changes-2026-07-01"`997998    - `"compact-2026-01-12"`9991000    - `"computer-use-2025-11-24"`10011002    - `"mcp-tunnels-2026-06-22"`10031004    - `"structured-outputs-2025-11-13"`10051006    - `"task-budgets-2026-03-13"`10071008    - `"thinking-display-updates-2026-08-18"`10091010    - `"ce-user-management-2026-07-13"`10111012    - `"mid-conversation-output-config-2026-07-01"`10131014    - `"thinking-binding-controls-2026-08-01"`10151016    - `"mid-conversation-system-clear-at-2026-08-21"`10171018    - `"compact-2026-09-04"`10191020### Returns10211022- `BetaServiceAccount object`10231024  Named non-human identity within the caller's organization.10251026  A service account is a pure identity: name + org. Authorization lives on1027  whatever references it (federation rules).10281029  - `type: "service_account"`10301031    default: service_account10321033  - `id: string`10341035    Tagged ID of the service account.10361037  - `archived_at: string or null`10381039    If set, this service account is archived.10401041    format: date-time10421043  - `archived_by_actor_id: string or null`10441045    Tagged ID (`user_`/`svac_`) of the actor that archived this service account.10461047  - `created_at: string`10481049    When this service account was created.10501051    format: date-time10521053  - `created_by_actor_id: string or null`10541055    Tagged ID (`user_`/`svac_`) of the actor that created this service account.10561057  - `description: string or null`10581059    Optional free-text description.10601061  - `name: string`10621063    Admin-chosen slug identifier.10641065  - `organization_role: "admin" or "developer"`10661067    Org-level role. A federation rule may only be created or retargeted to grant `org:admin` scope when this is `admin`. A rule granting `org:admin` whose target is later demoted to `developer` is rejected at token exchange. Rules granting `org:admin` are managed in the Console.10681069    - `"admin"`10701071    - `"developer"`10721073  - `updated_at: string`10741075    When this service account was last updated.10761077    format: date-time10781079  - `updated_by_actor_id: string or null`10801081    Tagged ID (`user_`/`svac_`) of the actor that last updated this service account.10821083### Example10841085```bash1086curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/archive \1087    -X POST \1088    -H 'anthropic-version: 2023-06-01' \1089    -H "X-Api-Key: $ANTHROPIC_API_KEY"1090```10911092#### Response (200)10931094```json1095{1096  "id": "svac_01SDCCSbTxrXDpWc1phhtcfK",1097  "archived_at": "2019-12-27T18:11:19.117Z",1098  "archived_by_actor_id": "archived_by_actor_id",1099  "created_at": "2024-10-30T23:58:27.427722Z",1100  "created_by_actor_id": "created_by_actor_id",1101  "description": "description",1102  "name": "ci-deploy-bot",1103  "organization_role": "admin",1104  "type": "service_account",1105  "updated_at": "2024-10-30T23:58:27.427722Z",1106  "updated_by_actor_id": "updated_by_actor_id"1107}1108```11091110## Domain types11111112### Beta Service Account11131114- `BetaServiceAccount object`11151116  Named non-human identity within the caller's organization.11171118  A service account is a pure identity: name + org. Authorization lives on1119  whatever references it (federation rules).11201121  - `type: "service_account"`11221123    default: service_account11241125  - `id: string`11261127    Tagged ID of the service account.11281129  - `archived_at: string or null`11301131    If set, this service account is archived.11321133    format: date-time11341135  - `archived_by_actor_id: string or null`11361137    Tagged ID (`user_`/`svac_`) of the actor that archived this service account.11381139  - `created_at: string`11401141    When this service account was created.11421143    format: date-time11441145  - `created_by_actor_id: string or null`11461147    Tagged ID (`user_`/`svac_`) of the actor that created this service account.11481149  - `description: string or null`11501151    Optional free-text description.11521153  - `name: string`11541155    Admin-chosen slug identifier.11561157  - `organization_role: "admin" or "developer"`11581159    Org-level role. A federation rule may only be created or retargeted to grant `org:admin` scope when this is `admin`. A rule granting `org:admin` whose target is later demoted to `developer` is rejected at token exchange. Rules granting `org:admin` are managed in the Console.11601161    - `"admin"`11621163    - `"developer"`11641165  - `updated_at: string`11661167    When this service account was last updated.11681169    format: date-time11701171  - `updated_by_actor_id: string or null`11721173    Tagged ID (`user_`/`svac_`) of the actor that last updated this service account.11741175### Beta Service Account Workspace Member11761177- `BetaServiceAccountWorkspaceMember object`11781179  - `type: "service_account_workspace_member"`11801181    default: service_account_workspace_member11821183  - `created_by_actor_id: string or null`11841185    Tagged ID (`user_...`/`svac_...`) of the actor who created this membership.11861187  - `implicit: boolean or null`11881189    True when this is the implicit default-workspace membership every service account has when no explicit membership exists. Implicit memberships have role `workspace_user` and cannot be removed.11901191  - `service_account_id: string`11921193    Tagged service account ID (`svac_...`).11941195  - `workspace_id: string`11961197    Tagged workspace ID (`wrkspc_...`).11981199  - `workspace_role: BetaWorkspaceRole`12001201    Role of the service account in this workspace. Service accounts cannot hold the `workspace_billing` role.12021203    - `"workspace_admin"`12041205    - `"workspace_billing"`12061207    - `"workspace_developer"`12081209    - `"workspace_restricted_developer"`12101211    - `"workspace_user"`12121213## Service Accounts › Workspaces12141215### Add Workspace To Service Account12161217**POST** `/v1/organizations/service_accounts/{service_account_id}/workspaces`12181219**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).12201221Add a service account to a workspace with the given `workspace_role`.12221223Mirror of `POST /workspaces/{workspace_id}/service_accounts`, addressed1224from the service-account side; both create the same membership. If the1225service account is already an explicit member of the workspace, its1226`workspace_role` is replaced with the value supplied here. Archived1227workspaces return 400. Archived service accounts cannot be added and are1228rejected.12291230#### Path parameters12311232- `service_account_id: string`12331234  ID of the service account.12351236#### Headers12371238- `"anthropic-beta": optional array of AnthropicBeta`12391240  Optional header to specify the beta version(s) you want to use.12411242  - `string`12431244  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`12451246    - `"message-batches-2024-09-24"`12471248    - `"prompt-caching-2024-07-31"`12491250    - `"computer-use-2024-10-22"`12511252    - `"computer-use-2025-01-24"`12531254    - `"pdfs-2024-09-25"`12551256    - `"token-counting-2024-11-01"`12571258    - `"token-efficient-tools-2025-02-19"`12591260    - `"output-128k-2025-02-19"`12611262    - `"files-api-2025-04-14"`12631264    - `"mcp-client-2025-04-04"`12651266    - `"mcp-client-2025-11-20"`12671268    - `"dev-full-thinking-2025-05-14"`12691270    - `"interleaved-thinking-2025-05-14"`12711272    - `"code-execution-2025-05-22"`12731274    - `"extended-cache-ttl-2025-04-11"`12751276    - `"context-1m-2025-08-07"`12771278    - `"context-management-2025-06-27"`12791280    - `"model-context-window-exceeded-2025-08-26"`12811282    - `"skills-2025-10-02"`12831284    - `"fast-mode-2026-02-01"`12851286    - `"output-300k-2026-03-24"`12871288    - `"user-profiles-2026-03-24"`12891290    - `"user-profiles-2026-08-18"`12911292    - `"user-profiles-2026-09-04"`12931294    - `"advisor-tool-2026-03-01"`12951296    - `"managed-agents-2026-04-01"`12971298    - `"cache-diagnosis-2026-04-07"`12991300    - `"dreaming-2026-04-21"`13011302    - `"thinking-token-count-2026-05-13"`13031304    - `"server-side-fallback-2026-06-01"`13051306    - `"server-side-fallback-2026-07-01"`13071308    - `"fallback-credit-2026-06-01"`13091310    - `"fallback-credit-2026-07-01"`13111312    - `"agent-memory-2026-07-22"`13131314    - `"mid-conversation-tool-changes-2026-07-01"`13151316    - `"compact-2026-01-12"`13171318    - `"computer-use-2025-11-24"`13191320    - `"mcp-tunnels-2026-06-22"`13211322    - `"structured-outputs-2025-11-13"`13231324    - `"task-budgets-2026-03-13"`13251326    - `"thinking-display-updates-2026-08-18"`13271328    - `"ce-user-management-2026-07-13"`13291330    - `"mid-conversation-output-config-2026-07-01"`13311332    - `"thinking-binding-controls-2026-08-01"`13331334    - `"mid-conversation-system-clear-at-2026-08-21"`13351336    - `"compact-2026-09-04"`13371338#### Body parameters13391340- `workspace_id: string`13411342  Tagged workspace ID to add the service account to.13431344- `workspace_role: BetaNoBillingWorkspaceRole`13451346  Role to assign to the service account in this workspace.13471348  - `"workspace_admin"`13491350  - `"workspace_developer"`13511352  - `"workspace_restricted_developer"`13531354  - `"workspace_user"`13551356#### Returns13571358- `BetaServiceAccountWorkspaceMember object`13591360  - `type: "service_account_workspace_member"`13611362    default: service_account_workspace_member13631364  - `created_by_actor_id: string or null`13651366    Tagged ID (`user_...`/`svac_...`) of the actor who created this membership.13671368  - `implicit: boolean or null`13691370    True when this is the implicit default-workspace membership every service account has when no explicit membership exists. Implicit memberships have role `workspace_user` and cannot be removed.13711372  - `service_account_id: string`13731374    Tagged service account ID (`svac_...`).13751376  - `workspace_id: string`13771378    Tagged workspace ID (`wrkspc_...`).13791380  - `workspace_role: BetaWorkspaceRole`13811382    Role of the service account in this workspace. Service accounts cannot hold the `workspace_billing` role.13831384    - `"workspace_admin"`13851386    - `"workspace_billing"`13871388    - `"workspace_developer"`13891390    - `"workspace_restricted_developer"`13911392    - `"workspace_user"`13931394#### Example13951396```bash1397curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/workspaces \1398    -H 'Content-Type: application/json' \1399    -H 'anthropic-version: 2023-06-01' \1400    -H "X-Api-Key: $ANTHROPIC_API_KEY" \1401    -d '{1402          "workspace_id": "workspace_id",1403          "workspace_role": "workspace_admin"1404        }'1405```14061407##### Response (200)14081409```json1410{1411  "created_by_actor_id": "created_by_actor_id",1412  "implicit": true,1413  "service_account_id": "service_account_id",1414  "type": "service_account_workspace_member",1415  "workspace_id": "workspace_id",1416  "workspace_role": "workspace_admin"1417}1418```14191420### List Workspaces For Service Account14211422**GET** `/v1/organizations/service_accounts/{service_account_id}/workspaces`14231424**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).14251426List the workspaces a service account is a member of.14271428Each entry includes the service account's `workspace_role` in that1429workspace. Use `limit` and the `next_page` cursor to paginate. When the1430service account has no explicit default-workspace membership, the1431implicit (`implicit: true`) membership is returned as the first entry on1432the first page; with `limit=1` the first page may return up to 2 entries1433(the implicit entry plus one explicit membership) so a pagination cursor1434can be derived. Memberships are returned only while1435the service account is active. Without a `page` cursor, an archived1436service account returns an empty list. A `page` cursor that does not1437match an active membership returns a 400 invalid-request error. A cursor1438stops matching when the membership is removed, the workspace is deleted,1439or the service account is archived. Restart pagination from the first1440page to recover.14411442#### Path parameters14431444- `service_account_id: string`14451446  ID of the service account.14471448#### Query parameters14491450- `limit: optional number`14511452  Number of results per page.14531454  default: 20, maximum: 100, minimum: 114551456- `page: optional string`14571458  Opaque cursor from a previous response's `next_page`.14591460#### Headers14611462- `"anthropic-beta": optional array of AnthropicBeta`14631464  Optional header to specify the beta version(s) you want to use.14651466  - `string`14671468  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`14691470    - `"message-batches-2024-09-24"`14711472    - `"prompt-caching-2024-07-31"`14731474    - `"computer-use-2024-10-22"`14751476    - `"computer-use-2025-01-24"`14771478    - `"pdfs-2024-09-25"`14791480    - `"token-counting-2024-11-01"`14811482    - `"token-efficient-tools-2025-02-19"`14831484    - `"output-128k-2025-02-19"`14851486    - `"files-api-2025-04-14"`14871488    - `"mcp-client-2025-04-04"`14891490    - `"mcp-client-2025-11-20"`14911492    - `"dev-full-thinking-2025-05-14"`14931494    - `"interleaved-thinking-2025-05-14"`14951496    - `"code-execution-2025-05-22"`14971498    - `"extended-cache-ttl-2025-04-11"`14991500    - `"context-1m-2025-08-07"`15011502    - `"context-management-2025-06-27"`15031504    - `"model-context-window-exceeded-2025-08-26"`15051506    - `"skills-2025-10-02"`15071508    - `"fast-mode-2026-02-01"`15091510    - `"output-300k-2026-03-24"`15111512    - `"user-profiles-2026-03-24"`15131514    - `"user-profiles-2026-08-18"`15151516    - `"user-profiles-2026-09-04"`15171518    - `"advisor-tool-2026-03-01"`15191520    - `"managed-agents-2026-04-01"`15211522    - `"cache-diagnosis-2026-04-07"`15231524    - `"dreaming-2026-04-21"`15251526    - `"thinking-token-count-2026-05-13"`15271528    - `"server-side-fallback-2026-06-01"`15291530    - `"server-side-fallback-2026-07-01"`15311532    - `"fallback-credit-2026-06-01"`15331534    - `"fallback-credit-2026-07-01"`15351536    - `"agent-memory-2026-07-22"`15371538    - `"mid-conversation-tool-changes-2026-07-01"`15391540    - `"compact-2026-01-12"`15411542    - `"computer-use-2025-11-24"`15431544    - `"mcp-tunnels-2026-06-22"`15451546    - `"structured-outputs-2025-11-13"`15471548    - `"task-budgets-2026-03-13"`15491550    - `"thinking-display-updates-2026-08-18"`15511552    - `"ce-user-management-2026-07-13"`15531554    - `"mid-conversation-output-config-2026-07-01"`15551556    - `"thinking-binding-controls-2026-08-01"`15571558    - `"mid-conversation-system-clear-at-2026-08-21"`15591560    - `"compact-2026-09-04"`15611562#### Returns15631564- `data: array of BetaServiceAccountWorkspaceMember`15651566  - `type: "service_account_workspace_member"`15671568    default: service_account_workspace_member15691570  - `created_by_actor_id: string or null`15711572    Tagged ID (`user_...`/`svac_...`) of the actor who created this membership.15731574  - `implicit: boolean or null`15751576    True when this is the implicit default-workspace membership every service account has when no explicit membership exists. Implicit memberships have role `workspace_user` and cannot be removed.15771578  - `service_account_id: string`15791580    Tagged service account ID (`svac_...`).15811582  - `workspace_id: string`15831584    Tagged workspace ID (`wrkspc_...`).15851586  - `workspace_role: BetaWorkspaceRole`15871588    Role of the service account in this workspace. Service accounts cannot hold the `workspace_billing` role.15891590    - `"workspace_admin"`15911592    - `"workspace_billing"`15931594    - `"workspace_developer"`15951596    - `"workspace_restricted_developer"`15971598    - `"workspace_user"`15991600- `next_page: string or null`16011602  Opaque cursor for the next page, or null if no more results.16031604#### Example16051606```bash1607curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/workspaces \1608    -H 'anthropic-version: 2023-06-01' \1609    -H "X-Api-Key: $ANTHROPIC_API_KEY"1610```16111612##### Response (200)16131614```json1615{1616  "data": [1617    {1618      "created_by_actor_id": "created_by_actor_id",1619      "implicit": true,1620      "service_account_id": "service_account_id",1621      "type": "service_account_workspace_member",1622      "workspace_id": "workspace_id",1623      "workspace_role": "workspace_admin"1624    }1625  ],1626  "next_page": "next_page"1627}1628```16291630### Remove Workspace From Service Account16311632**DELETE** `/v1/organizations/service_accounts/{service_account_id}/workspaces/{workspace_id}`16331634**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).16351636Remove a service account from a workspace.16371638Mirror of `DELETE /workspaces/{workspace_id}/service_accounts/{service_account_id}`,1639addressed from the service-account side. Removal is idempotent (returns1640200 even if the membership was already removed). A DELETE against the1641implicit default-workspace membership returns 200 but is a no-op and the1642membership persists; deleting an explicit default-workspace row reverts1643to the implicit `workspace_user` membership. Archived workspaces return1644400.16451646#### Path parameters16471648- `service_account_id: string`16491650  ID of the service account.16511652- `workspace_id: string`16531654  ID of the workspace.16551656#### Headers16571658- `"anthropic-beta": optional array of AnthropicBeta`16591660  Optional header to specify the beta version(s) you want to use.16611662  - `string`16631664  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`16651666    - `"message-batches-2024-09-24"`16671668    - `"prompt-caching-2024-07-31"`16691670    - `"computer-use-2024-10-22"`16711672    - `"computer-use-2025-01-24"`16731674    - `"pdfs-2024-09-25"`16751676    - `"token-counting-2024-11-01"`16771678    - `"token-efficient-tools-2025-02-19"`16791680    - `"output-128k-2025-02-19"`16811682    - `"files-api-2025-04-14"`16831684    - `"mcp-client-2025-04-04"`16851686    - `"mcp-client-2025-11-20"`16871688    - `"dev-full-thinking-2025-05-14"`16891690    - `"interleaved-thinking-2025-05-14"`16911692    - `"code-execution-2025-05-22"`16931694    - `"extended-cache-ttl-2025-04-11"`16951696    - `"context-1m-2025-08-07"`16971698    - `"context-management-2025-06-27"`16991700    - `"model-context-window-exceeded-2025-08-26"`17011702    - `"skills-2025-10-02"`17031704    - `"fast-mode-2026-02-01"`17051706    - `"output-300k-2026-03-24"`17071708    - `"user-profiles-2026-03-24"`17091710    - `"user-profiles-2026-08-18"`17111712    - `"user-profiles-2026-09-04"`17131714    - `"advisor-tool-2026-03-01"`17151716    - `"managed-agents-2026-04-01"`17171718    - `"cache-diagnosis-2026-04-07"`17191720    - `"dreaming-2026-04-21"`17211722    - `"thinking-token-count-2026-05-13"`17231724    - `"server-side-fallback-2026-06-01"`17251726    - `"server-side-fallback-2026-07-01"`17271728    - `"fallback-credit-2026-06-01"`17291730    - `"fallback-credit-2026-07-01"`17311732    - `"agent-memory-2026-07-22"`17331734    - `"mid-conversation-tool-changes-2026-07-01"`17351736    - `"compact-2026-01-12"`17371738    - `"computer-use-2025-11-24"`17391740    - `"mcp-tunnels-2026-06-22"`17411742    - `"structured-outputs-2025-11-13"`17431744    - `"task-budgets-2026-03-13"`17451746    - `"thinking-display-updates-2026-08-18"`17471748    - `"ce-user-management-2026-07-13"`17491750    - `"mid-conversation-output-config-2026-07-01"`17511752    - `"thinking-binding-controls-2026-08-01"`17531754    - `"mid-conversation-system-clear-at-2026-08-21"`17551756    - `"compact-2026-09-04"`17571758#### Returns17591760- `type: "service_account_workspace_member_deleted"`17611762  default: service_account_workspace_member_deleted17631764- `service_account_id: string`17651766  Tagged service account ID (`svac_...`) named in the delete request. Removal is idempotent; see the endpoint description for the implicit-membership no-op.17671768- `workspace_id: string`17691770  Tagged workspace ID (`wrkspc_...`) named in the delete request.17711772#### Example17731774```bash1775curl https://api.anthropic.com/v1/organizations/service_accounts/$SERVICE_ACCOUNT_ID/workspaces/$WORKSPACE_ID \1776    -X DELETE \1777    -H 'anthropic-version: 2023-06-01' \1778    -H "X-Api-Key: $ANTHROPIC_API_KEY"1779```17801781##### Response (200)17821783```json1784{1785  "service_account_id": "service_account_id",1786  "type": "service_account_workspace_member_deleted",1787  "workspace_id": "workspace_id"1788}1789```1790
Files main
Menu

Theme