List API Keys
api/admin/api_keys/list
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/list Changed · +16 / -15 lines
# List API Keys ## Query parameters ## Returns ## Example ### Response (200) ## List API Keys ### Query Parameters ### Returns ### Example #### Response
---- -title: List API Keys -url: https://platform.claude.com/docs/en/api/admin/api_keys/list ---- +# List API Keys -## List API Keys +**GET** `/v1/organizations/api_keys` -**get** `/v1/organizations/api_keys` - List API Keys -### Query Parameters +## Query parameters - `after_id: optional string`
Defaults to `20`. Ranges from `1` to `1000`. + default: 20, maximum: 1000, minimum: 1 + - `status: optional "active" or "archived" or "expired" or "inactive"` Filter by API key status.
Filter by Workspace ID. -### Returns +## Returns - `data: array of APIKey`
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`
Last ID in the `data` list. Can be used as the `after_id` for the next page. -### Example +## Example -```http +```bash curl https://api.anthropic.com/v1/organizations/api_keys \ -H 'anthropic-version: 2023-06-01' \ -H "Authorization: Bearer $ANTHROPIC_OAUTH_TOKEN" ``` -#### Response +### Response (200) ```json {