---
title: "Rotate webhook signing secret"
method: POST
path: "/webhooks/v1/endpoints/{id}/rotate_secret"
tags: ["Webhooks"]
---

# Rotate webhook signing secret

`POST /webhooks/v1/endpoints/{id}/rotate_secret`

Generates a new signing secret for the endpoint. The previous secret remains valid until `previousSecretExpiresInSec` elapses (default 24h, max 30 days). During the grace window deliveries are signed with both secrets so receivers can migrate without downtime. Returns the new secret — this is the only time it is shown in plaintext.

## Path parameters

- `id` string, required

## Request body

- object
  - `previousSecretExpiresInSec` integer — How long (seconds) the old secret continues to be accepted. 0 invalidates immediately. Default: 86400 (24h).

## Response `200`

Secret rotated

## Other responses

- `401` — Invalid API key
- `403` — API key lacks write access
- `404` — Endpoint not found

---

[API](https://skmtc.net/casemark/apis/case-dev-api.md) · [All operations](https://skmtc.net/casemark/apis/case-dev-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/casemark/case-dev-api/revisions/5b7e64e6d6f9/schema)
