# Rotate a signing secret

> For the complete documentation index, see [llms.txt](https://www.shortsintel.com/llms.txt). Every docs page is also available as markdown: add .md to its URL. To connect, read [agents.md](https://www.shortsintel.com/agents.md).

POST `/v1/webhooks/{id}/rotate`

Mints a new signing secret. The old one keeps working for 24 h.

- Overlap: during that window every delivery is signed with both. The header carries two `v1=` values over the same `t` and body.
- Verifiers: a verifier written the documented way (does any `v1` match?) needs no change at all.
- Access: Owner or admin only: a MEMBER's key or connection gets 403 `forbidden`.

## Price

Free.

## Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `id` | path | `string` | Required | — | Webhook endpoint id. |

## Responses

### 200 OK

`{ webhook, secret, overlap_expires_at }` — `secret` shown once.

object

- `webhook` object required
  - `id` string required
  - `url` string required
  - `status` string required one of `pending`, `active`, `failed`, `disabled`
  - `description` string required nullable
  - `secret_prefix` string required The first characters of the signing secret, to tell two apart.
  - `previous_secret_expires_at` string required nullable
  - `created_at` string required
  - `activated_at` string required nullable
  - `last_delivery_at` string required nullable
- `secret` string required
- `overlap_expires_at` string required nullable Until then, every delivery is signed with both secrets.

### 401 Unauthorized

Codes: `missing_authorization`, `invalid_key`, `key_revoked`, `key_expired`, `invalid_token`. The problem body and every code are on [Errors](https://www.shortsintel.com/docs/reference/errors).

### 403 Forbidden

`forbidden` — the key's or connection's user is a MEMBER; only an owner or admin manages webhooks.

Code: `forbidden`. The problem body and every code are on [Errors](https://www.shortsintel.com/docs/reference/errors).

### 409 Conflict

`webhook_rotation_in_progress` while a previous overlap is open.

Code: `webhook_rotation_in_progress`. The problem body and every code are on [Errors](https://www.shortsintel.com/docs/reference/errors).

## Related guides

- [Webhooks](https://www.shortsintel.com/docs/concepts/webhooks): The events we send, how to verify a signature, what happens when your endpoint is down, and how to rotate a secret.

## Request samples

curl:

```bash
curl -X POST "https://www.shortsintel.com/v1/webhooks/whe_6d2f10ab44/rotate" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"
```

TypeScript:

```typescript
const response = await fetch(
  "https://www.shortsintel.com/v1/webhooks/whe_6d2f10ab44/rotate",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer sk_live_YOUR_KEY",
    },
  },
);

if (!response.ok) {
  throw new Error(`ShortsIntel ${response.status}`);
}

const data = await response.json();
```

Python:

```python
import requests

response = requests.post(
    "https://www.shortsintel.com/v1/webhooks/whe_6d2f10ab44/rotate",
    headers={
        "Authorization": "Bearer sk_live_YOUR_KEY",
    },
)
response.raise_for_status()

data = response.json()
```

200 · `{ webhook, secret, overlap_expires_at }` — `secret` shown once.

```json
{
  "webhook": {
    "id": "whe_6d2f10ab44",
    "url": "https://hooks.example.com/shortsintel",
    "status": "active",
    "description": "production receiver",
    "secret_prefix": "whsec_d4e5f6",
    "previous_secret_expires_at": "2026-09-09T09:14:02.418Z",
    "created_at": "2026-09-08T09:14:02.418Z",
    "activated_at": "2026-09-08T09:14:03.006Z",
    "last_delivery_at": "2026-09-08T09:14:03.006Z"
  },
  "secret": "whsec_Lm2Rv8ZaQe5tYb1nXc7pKd3sWu9jHg6F",
  "overlap_expires_at": "2026-09-09T09:14:02.418Z"
}
```

[Previous Delete a webhook endpoint](https://www.shortsintel.com/docs/reference/webhooks/delete-webhook)[Next List deliveries](https://www.shortsintel.com/docs/reference/webhooks/list-webhook-deliveries)
