---
title: "Create a replacement and give the old key 24 hours of grace"
method: POST
path: "/v1/keys/{keyId}/rotate"
tags: ["Keys"]
---

# Create a replacement and give the old key 24 hours of grace

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

## Request

- Base URL: `https://api.scripthaul.com`
- URL: `https://api.scripthaul.com/v1/keys/{keyId}/rotate`
- Auth: HTTP bearer

## Request body

- KeyCreate
  - `name` string
  - `daily_credit_cap` integer, nullable

## Response `201`

Replacement key shown once

- KeyCreated
  - `ok` unknown, required
  - `api_key` string

## Other responses

- `400`: Typed API error
- `401`: Typed API error
- `403`: Typed API error
- `404`: Typed API error

---

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