---
title: "Update an API key"
method: PATCH
path: "/v1/api-keys/{label}"
tags: ["API Keys"]
---

# Update an API key

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

Updates an API key's metadata (currently only the label).

## Path parameters

- `label` string, required — Current label of the API key.

## Request body

- UpdateApiKeyRequest
  - `label` string — New label for the key.

## Response `200`

Updated API key metadata (never the full key)

- ApiKey
  - `label` string, required — Human-readable label. Unique per workspace.
  - `keyPrefix` string, required — Display prefix of the key (e.g. "monid_test_a1b2c3d4...").
  - `createdBy` string, required — User id of the creator.
  - `createdAt` string, date-time, required — Creation time (ISO 8601).
  - `lastUsedAt` string, date-time — Last time the key authenticated a request. Absent if never used.

## Other responses

- `400` — Bad request — input failed validation
- `401` — Unauthorized — missing or invalid credentials
- `403` — Forbidden — caller has no workspace or no access
- `404` — API key not found in this workspace
- `500` — Internal server error

---

[API](https://skmtc.net/monid/apis/monid-api.md) · [All operations](https://skmtc.net/monid/apis/monid-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/monid/monid-api/versions/164b6b6f2d36/schema)
