---
title: "Rename a key"
method: PATCH
path: "/v1/keys/{key_id}"
tags: ["Account"]
---

# Rename a key

`PATCH /v1/keys/{key_id}`

## Request

- Base URL: `https://api.placementapi.com`
- URL: `https://api.placementapi.com/v1/keys/{key_id}`
- Auth: HTTP bearer

Changes a key's label and nothing else: a name is not a capability, so (unlike revocation) this is safe on the key you are holding. Scoped to your own ACTIVE keys — a revoked key, or one belonging to another buyer, answers 404 rather than confirming the id exists. The name is trimmed to 1-80 characters.

## Path parameters

- `key_id` string, required

## Request body

- object
  - `name` string, required: The new label, required and non-blank after trimming.

## Response `200`

OK

- object
  - `key_id` string
  - `name` string

## Other responses

- `400`: Malformed request. `error` is `bad_request` (with a zod `detail`), `invalid_json`, or `unknown_parameter` / `unknown_field` (with `unknown[]` and `accepted[]`).
- `401`: Missing, malformed or revoked Bearer credential: `{ error: "unauthorized" }`.
- `403`: `insufficient_scope` when the key lacks the `order` scope; `customer_key_required` when the operator token is used where a customer must be attributable.
- `404`: `not_found`: no active key with that id belongs to you.
- `503`: `server_misconfigured` when the store is not configured; `upstream_unfunded` when the measurement provider's prepaid balance is exhausted (fresh profiles, gap maps and SERPs pause; cached results and catalogue are unaffected); `upstream_unavailable` on a provider error; `payments_unavailable` when card payments are not configured.

---

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