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

# Rotate Webhook Secret

> Replace a Tuco webhook's signing secret. The new secret is returned once; every delivery and replay after this is signed with it.

Generates a new signing secret for the webhook and returns it **once**. Every delivery
from now on, including [replays](/api-reference/endpoint/replay-webhook-delivery), is
signed with the new secret. Update your endpoint's verification before rotating, or
accept both secrets for a short overlap.

## Authentication

```bash theme={null}
Authorization: Bearer tuco_xxxxxxxxxxxxx
```

## Path parameters

<ParamField path="id" type="string" required>
  Webhook ID.
</ParamField>

## Response

<ResponseField name="id" type="string">Webhook ID.</ResponseField>
<ResponseField name="secret" type="string">The new secret. Store it now; it is never shown again.</ResponseField>
<ResponseField name="warning" type="string">Reminder that the secret is shown once.</ResponseField>

| Status | When |
| - | - |
| `200` | Rotated |
| `401` | Missing or invalid API key |
| `402` | Workspace is read-only (billing) |
| `404` | Webhook not found in your workspace |

## Example

```bash theme={null}
curl -X POST "https://app.tuco.ai/api/webhooks/680a1b2c3d4e5f6789012345/rotate-secret" \
  -H "Authorization: Bearer tuco_xxxxxxxxxxxxx"
```

```json theme={null}
{
  "id": "680a1b2c3d4e5f6789012345",
  "secret": "q1Vb3m8YqGv0pX7nKc2Zr5tLw9EaHd4JfU6sNyB0iOk=",
  "warning": "Save this secret now. You will not be able to see it again."
}
```


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