Update API Key
api/admin/api_keys/update
Nearest release: v2.1.245, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
api/admin/api_keys/update Changed · +18 / -17 lines
# Update API Key ## Path parameters ## Body parameters ## Returns ## Example ### Response (200) ## Update API Key ### Path Parameters ### Body Parameters ### Returns ### Example #### Response
---- -title: Update API Key -url: https://platform.claude.com/docs/en/api/admin/api_keys/update ---- +# Update API Key -## Update API Key +**POST** `/v1/organizations/api_keys/{api_key_id}` -**post** `/v1/organizations/api_keys/{api_key_id}` - Update API Key -### Path Parameters +## Path parameters - `api_key_id: string` ID of the API key. -### Body Parameters +## Body parameters - `name: optional string or null` Name of the API key. + maxLength: 500, minLength: 1 + - `status: optional "active" or "archived" or "inactive" or null` Status of the API key.
- `"inactive"` -### Returns +## Returns -- `APIKey object { id, created_at, created_by, 7 more }` +- `APIKey object` - `id: string`
RFC 3339 datetime string indicating when the API Key was created. - - `created_by: object { id, type } or null` + format: date-time + - `created_by: object or null` + The ID and type of the actor that created the API key, or `null` when the creator is not recorded (legacy, workload-identity-federated, or system-created keys).
RFC 3339 datetime string indicating when the API Key expires, or `null` if it never expires. + format: date-time + - `name: string` Name of the API key.
Partially redacted hint for the API key. - - `principal: object { id, type } or null` + - `principal: object or null` The ID and type of the principal the API key acts as, or `null` if the key is not bound to a principal.
For API Keys, this is always `"api_key"`. - - `"api_key"` + default: api_key - `workspace_id: string or null` ID of the Workspace associated with the API key, or `null` if the API key belongs to the default Workspace. -### Example +## Example -```http +```bash curl https://api.anthropic.com/v1/organizations/api_keys/$API_KEY_ID \ -H 'Content-Type: application/json' \ -H 'anthropic-version: 2023-06-01' \
-d '{}' ``` -#### Response +### Response (200) ```json {