---
title: "Rotate Endpoint Secret"
method: POST
path: "/endpoint/{endpoint_id}/secret/rotate"
tags: ["Endpoint"]
---

# Rotate Endpoint Secret

`POST /endpoint/{endpoint_id}/secret/rotate`

## Request

- Base URL: `https://api.sinay.ai/webhook/api/v1`
- URL: `https://api.sinay.ai/webhook/api/v1/endpoint/{endpoint_id}/secret/rotate`
- Auth: API key in header `API_KEY`

Rotates the endpoint's signing secret.  The previous secret will be valid for the next 24 hours.

## Path parameters

- `endpoint_id` string, required: The ep's ID or UID

## Headers

- `idempotency-key` string

## Request body

- EndpointSecretRotateIn
  - `key` string, nullable: The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24.

## Response `204`

No content. Your secret has been rotated, but we won't show it here.

## Other responses

- `400`: Bad request
- `403`: Forbidden
- `404`: Not Found. Endpoint not found
- `429`: Too Many Requests
- `500`: Internal Error

---

[API](https://skmtc.dev/safecube/apis/webhook-api.md) - [All operations](https://skmtc.dev/safecube/apis/webhook-api/llms.txt) - [OpenAPI document](https://skmtc.dev/safecube/apis/webhook-api/revisions/86d07c02c618?raw)
