---
title: "Update a key"
method: PATCH
path: "/client/keys/{id}"
tags: ["Keys"]
---

# Update a key

`PATCH /client/keys/{id}`

## Request

- Base URL: `https://api.roar-ai.com`
- URL: `https://api.roar-ai.com/client/keys/{id}`
- Auth: HTTP bearer

Rename, move project, change scopes, pause/resume (`disabled`), and — owner only — set the spend cap or expiry (`expiresAt`). A revoked key rejects `disabled`. Moving a key to another project is a person’s act in the console (403 for a key): the tools a key may use without approval depend on its project. An app’s own key moves only with its app (409 — move the app instead). Read the key back with `GET` to see the result.

## Path parameters

- `id` string, uuid, required

## Request body

- UpdateKeyRequest
  - `name` string, nullable
  - `projectId` string, uuid, nullable
  - `scopes` string[]
  - `expiresAt` string, date-time, nullable
  - `disabled` boolean: Pause or resume the key
  - `spendLimitUsd` number, nullable
  - `budgetPeriod` 'day' | 'week' | 'month' | 'total'

## Response `200`

Updated

- Ack
  - `ok` boolean, required

## Other responses

- `403`: A key cannot move a key to another project
- `404`: No such key
- `409`: The key belongs to an app — move the app instead

---

[API](https://skmtc.dev/roar-ai/apis/roar-ai-api.md) · [All operations](https://skmtc.dev/roar-ai/apis/roar-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/roar-ai/apis/roar-ai-api/revisions/37e4d0d5a7fe?raw)
