---
title: "Rotate signing secret"
method: POST
path: "/alerts-api/webhooks/rotate-secret"
tags: ["alerts-api---webhooks"]
---

# Rotate signing secret

`POST /alerts-api/webhooks/rotate-secret`

## Request

- Base URL: `https://api.casafari.com`
- URL: `https://api.casafari.com/alerts-api/webhooks/rotate-secret`
- Auth: HTTP bearer

Issues a new current signing secret. By default the previous secrets stay valid for a **24-hour grace window** so you can install the new key before removing the old one. Pass `{"immediate": true}` to revoke all previous secrets right away — use this only when a secret is compromised.

## Request body

- AlertsApiRotateSecretRequestSchema
  - `immediate` boolean: When false (default), the previous secrets keep working for a 24-hour grace window so you can switch the new secret before the old one stops signing; deliveries carry a signature for each active secret meanwhile. When true, the previous secrets are revoked immediately and only the new one signs — use this only when a secret is compromised.

## Response `200`

Successful Response

- AlertsApiRotateSecretResponseSchema
  - `secret` string, required

## Other responses

- `422`: Validation Error

---

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