---
title: "Update an API key"
method: PATCH
path: "/v1/api-keys/{id}"
---

# Update an API key

`PATCH /v1/api-keys/{id}`

## Request

- Base URL: `https://api.runbear.io`
- URL: `https://api.runbear.io/v1/api-keys/{id}`
- Auth: HTTP bearer

Update an API key's capabilities, agent allowlist, or description. Only the fields you send are changed; the secret token is never rotated and the key id is stable. Requires a key with the manage-API-keys capability.

## Path parameters

- `id` string, uuid, required: The API key id to update

## Request body

- object
  - `description` string, nullable: Human-readable label for the key. Send null to clear it; omit to leave it unchanged.
  - `canChat` boolean: Allow the key to run threads, chat, and upload files
  - `canManageAgents` boolean: Allow the key to create/update/delete agents and org config
  - `canManageApiKeys` boolean: Allow the key to manage the organization's API keys. The highest-privilege capability — grant only to trusted internal keys.
  - `allowedAgentIds` string[]: Replaces the key's agent (App) allowlist. Send an empty array to allow all agents; omit to leave the allowlist unchanged.

## Response `200`

Default Response

- ApiKey
  - `id` string, uuid, required: Unique identifier of the API key
  - `description` string, nullable, required: Human-readable label for the key
  - `canChat` boolean, required: Whether the key may run threads, chat, and upload files
  - `canManageAgents` boolean, required: Whether the key may create/update/delete agents and org configuration
  - `canManageApiKeys` boolean, required: Whether the key may create/list/revoke the organization's API keys
  - `allowedAgentIds` string[], required: Agent (App) ids the key is restricted to. Empty = all agents.
  - `createdAt` string, required: ISO 8601 creation timestamp
  - `lastUsedAt` string, nullable, required: ISO 8601 timestamp the key was last used, if ever

## Other responses

- `404`: Default Response

---

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