---
title: "Rotate Key"
method: POST
path: "/api/v1/admin/api-keys/{key_id}/rotate"
tags: ["admin-api-keys"]
---

# Rotate Key

`POST /api/v1/admin/api-keys/{key_id}/rotate`

## Request

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

輪替 API Key（撤銷舊 key + 建新 key）

## Path parameters

- `key_id` string, required

## Headers

- `Authorization` string, nullable

## Response `200`

Successful Response

- ApiKeyCreateResponse
  - `id` string, required
  - `key` string, required
  - `key_prefix` string, required
  - `name` string, required

## Other responses

- `422`: Validation Error

---

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