# `bird webhooks rotate-secret`

## Usage

```bash
bird webhooks rotate-secret <webhook-id> [flags]
```

## Description

Generates a new signing secret for the endpoint and returns it exactly once: store it
immediately, it cannot be retrieved after this response. For 24 hours every delivery
is signed with both the old and the new secret, so a receiver verifying with either
keeps working while you roll the new one out; after the window the old secret stops
signing. Verification details are in the [webhooks guide](/docs/guides/webhooks).

An endpoint holds at most 5 concurrently valid secrets, so rotating repeatedly within
the overlap window fails with `WebhookTooManySecrets` until an older secret expires.

## Examples

```bash
bird webhooks rotate-secret <id>
```

## Options

| Name                | Description                                                  |
| ------------------- | ------------------------------------------------------------ |
| `--idempotency-key` | Deduplication key; a retry with the same key won't act twice |
| `--response-schema` | Print the fields this command returns, then exit             |

## Related

| Name                                                              | Description               |
| ----------------------------------------------------------------- | ------------------------- |
| [`bird webhooks attempts`](/docs/cli/reference/webhooks-attempts) | List delivery attempts    |
| [`bird webhooks create`](/docs/cli/reference/webhooks-create)     | Create a webhook endpoint |
| [`bird webhooks delete`](/docs/cli/reference/webhooks-delete)     | Delete a webhook endpoint |
| [`bird webhooks get`](/docs/cli/reference/webhooks-get)           | Get a webhook endpoint    |
| [`bird webhooks list`](/docs/cli/reference/webhooks-list)         | List webhook endpoints    |
| [`bird webhooks test`](/docs/cli/reference/webhooks-test)         | Send a test event         |