---
title: "Rotate scoped sub-key"
method: POST
path: "/v1/keys/{key_id}/rotate"
tags: ["keys"]
---

# Rotate scoped sub-key

`POST /v1/keys/{key_id}/rotate`

## Request

- Base URL: `https://api.lithtrix.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.lithtrix.ai/v1/keys/{key_id}/rotate`
- Auth: none declared

Requires the **root** API key. Issues fresh material for the same scope; previous key honors ``grace_hours``. Root mirror rows cannot rotate here.

## Path parameters

- `key_id` string, required

## Headers

- `authorization` string, nullable

## Request body

- ScopedKeyRotate: Rotate options for an existing sub-key.
  - `grace_hours` integer: Hours the prior key remains valid after rotation (default 24).

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

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