> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cleo-pay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rotate a webhook secret

> POST /v1/webhook-endpoints/{webhookEndpointId}/rotate-secret replaces the signing secret at once and returns the new one.

```
POST /v1/webhook-endpoints/{webhookEndpointId}/rotate-secret
```

**Scope:** `webhooks:manage`  ·  **Idempotency-Key:** not accepted

<ParamField path="webhookEndpointId" type="string" required>The endpoint.</ParamField>

```bash theme={null}
curl -X POST https://api.stg.cleo-pay.com/v1/webhook-endpoints/3c1f9e2d-4b5a-4c6d-8e7f-9a0b1c2d3e4f/rotate-secret \
  --header "Authorization: Bearer $CLEO_API_KEY"
```

## Response

`200` with the endpoint and its new `secret`. Rotation takes effect at once, with no overlap: a delivery in flight that was signed with the old secret fails verification against the new one. Retries of that event are signed with the new secret.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.