---
title: "Rename an API key"
method: PUT
path: "/v1/keys/{key_id}"
tags: ["Keys"]
---

# Rename an API key

`PUT /v1/keys/{key_id}`

## Request

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

Changes the label only. A key's scopes are fixed for its life: the secret is bound to the grants it was minted with, so widening one in place would give new reach to every holder of a credential issued narrow. To change what a key may do, mint its replacement and revoke it. A key may rename itself.

## Path parameters

- `key_id` string, required

## Request body

- object
  - `name` string, required: The new label. Trimmed, and truncated to 60 characters. Must not be blank.

## Response `200`

Renamed

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

## Other responses

- `400`: A missing or blank name, or a body that is not JSON
- `401`: Missing, invalid or expired key
- `403`: Key does not carry keys:write
- `404`: No live key with that id in this team

---

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