---
title: "Update API Key"
method: POST
path: "/v1/organizations/api_keys/{api_key_id}"
---

# Update API Key

`POST /v1/organizations/api_keys/{api_key_id}`

## Request

- Base URL: `https://api.anthropic.com`
- URL: `https://api.anthropic.com/v1/organizations/api_keys/{api_key_id}`
- Auth: none declared

## Path parameters

- `api_key_id` string, required: ID of the API key.

## Headers

- `anthropic-version` string: The version of the Claude API you want to use. Read more about versioning and our version history [here](https://platform.claude.com/docs/en/api/versioning).

## Request body

- ApiKeyUpdateParams
  - `name` string, nullable: Name of the API key.
  - `status` 'active' | 'archived' | 'inactive', nullable: Status of the API key.

## Response `200`

Successful Response

- ApiKey
  - `created_at` string, date-time, required: RFC 3339 datetime string indicating when the API Key was created.
  - `created_by` CreatedBy, required
    - `id` string, required: ID of the actor that created the object.
    - `type` 'service_account' | 'user', required: Type of the actor that created the object.
  - `expires_at` string, date-time, nullable, required: RFC 3339 datetime string indicating when the API Key expires, or `null` if it never expires.
  - `id` string, required: ID of the API key.
  - `name` string, required: Name of the API key.
  - `partial_key_hint` string, nullable, required: Partially redacted hint for the API key.
  - `principal` union, required: The principal the API key acts as (a User or a Service Account), or `null` if the API key is not bound to a principal.
    - ApiKeyUserActor
      - `type` 'user_actor', required: Principal type. Always `"user_actor"` for a User.
      - `user_id` string, required: ID of the User the API key acts as.
    - ApiKeyServiceAccountActor
      - `service_account_id` string, required: ID of the Service Account the API key acts as.
      - `type` 'service_account_actor', required: Principal type. Always `"service_account_actor"` for a Service Account.
  - `scope` union, required: Where the API key belongs: its Workspace (`{"type": "workspace", "workspace_id": "wrkspc_..."}`, with the Workspace's real ID even when it is the organization's default Workspace), or the organization (`{"type": "organization"}`) for a principal-bound API key that has no Workspace.
    - ApiKeyOrganizationScope
      - `type` 'organization', required: Scope type. Always `"organization"`: the API key has no Workspace. Only a principal-bound API key can have this scope.
    - ApiKeyWorkspaceScope
      - `type` 'workspace', required: Scope type. Always `"workspace"`: the API key belongs to one Workspace.
      - `workspace_id` string, required: ID of the Workspace the API key belongs to, including when it is the organization's default Workspace.
  - `status` 'active' | 'archived' | 'expired' | 'inactive', required: Status of the API key.
  - `type` 'api_key', required: Object type. For API Keys, this is always `"api_key"`.

## Other responses

- `400`: Invalid argument - The client specified an invalid argument
- `401`: Unauthenticated - The request does not have valid authentication credentials
- `403`: Permission denied - The caller does not have permission to execute the specified operation
- `404`: Not found - Some requested entity was not found
- `408`: Deadline exceeded - The deadline expired before the operation could complete
- `409`: Aborted - The operation was aborted due to concurrency issue
- `412`: Failed precondition - Operation was rejected because the system is not in required state
- `413`: Out of range - Operation was attempted past the valid range
- `429`: Resource exhausted - Some resource has been exhausted (rate limiting)
- `431`: Request header fields too large - Request metadata was too large
- `499`: Cancelled - The operation was cancelled by the client
- `500`: Internal - Internal server error
- `501`: Unimplemented - The operation is not implemented or supported
- `503`: Unavailable - The service is currently unavailable
- `504`: Deadline exceeded - Upstream service did not respond in time
- `529`: Overloaded - The service is temporarily overloaded

## Changes

- **2026-10-21** `94c83daca660`: 1 breaking
  - removed the required property `workspace_id` from the response with the `200` status
- **2026-10-09** `a71b45011694`: 1 breaking, 5 info
  - the `error` response's property type changed from no type to `object` for status `400`
  - added the optional property `error/details` to the response with the `400` status
  - removed discriminator from `error` response property for the response status `400`
  - removed `#/components/schemas/InvalidRequestError, #/components/schemas/AuthenticationError, #/components/schemas/BillingError, #/components/schemas/PermissionError, #/components/schemas/NotFoundError, #/components/schemas/RateLimitError, #/components/schemas/GatewayTimeoutError, #/components/schemas/APIError, #/components/schemas/OverloadedError` from the `error` response property `oneOf` list for the response status `400`
  - …2 more
- **2026-09-30** `51c5260134e8`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/anthropics/apis/anthropic-api/changes/v1/organizations/api_keys/:api_key_id/post.md)

---

[API](https://skmtc.dev/anthropics/apis/anthropic-api.md) - [All operations](https://skmtc.dev/anthropics/apis/anthropic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/anthropics/apis/anthropic-api/revisions/328591af84ad?raw)
