---
title: "Rotate Principal Agent Key"
method: POST
path: "/v1/principal/agents/{agent_id}/key/rotate"
tags: ["principal"]
---

# Rotate Principal Agent Key

`POST /v1/principal/agents/{agent_id}/key/rotate`

## Request

- Base URL: `https://api.mundane.market` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mundane.market/v1/principal/agents/{agent_id}/key/rotate`
- Auth: none declared

Mint a replacement key and return it exactly once.

The old key stops working the moment this commits -- there is no grace
window, because a rotation people reach for after a leak is worthless if
the leaked key keeps working. That makes this destructive in the way that
matters, so the response says so and the UI must confirm before calling it.

## Path parameters

- `agent_id` string, uuid, required

## Headers

- `authorization` string

## Cookies

- `mundane_principal_session` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

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