---
title: "Update Api Key"
method: PATCH
path: "/admin/api-keys/{key_id}"
tags: ["API Keys"]
---

# Update Api Key

`PATCH /admin/api-keys/{key_id}`

## Request

- Base URL: `https://developer.claimmind.life` (the document declares no server; this is the origin it was published from)
- URL: `https://developer.claimmind.life/admin/api-keys/{key_id}`
- Auth: OAuth 2
  - Password
  - Token URL: `token`

Update an API key's name, scopes, or status.
Access validated based on user's role and scope.

## Path parameters

- `key_id` integer, required

## Query parameters

- `tenant_id` string, required: Tenant ID the API key belongs to

## Request body

- APIKeyUpdate: Request schema for updating an API key.
  - `name` string, nullable: New name for the key
  - `scopes` string[], nullable: Updated scopes
  - `status` string, nullable: Status: ENABLED or DISABLED

## Response `200`

Successful Response

- APIKeyResponse: Response schema for API key information.
  - `id` integer, required: Unique identifier for the API key
  - `description` string, required: Name of the API key
  - `key_identifier` string, required: Display identifier: sk-cm-abc..xyz
  - `scopes` string[], required: Permission scopes assigned to this key
  - `status` string, required: Key status: ENABLED or DISABLED
  - `organization_id` string, required: Organization this key belongs to
  - `is_org_key` boolean, required: True if organization-level key
  - `created_at` string, date-time, required: When the key was created
  - `updated_at` string, date-time, nullable: When the key was last updated

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/claimmind/apis/claimmind-open-api-service.md) - [All operations](https://skmtc.dev/claimmind/apis/claimmind-open-api-service/llms.txt) - [OpenAPI document](https://skmtc.dev/claimmind/apis/claimmind-open-api-service/revisions/ee8bfbeadb8a?raw)
