Rotate a webhook signing secret
On this page
POST
/v1/webhook-endpoints/{endpoint_id}/rotate-secretrotate_webhook_secret| Risk | write |
| Authentication | API key or OAuth access token |
| Scopes | webhooks:write |
| Idempotency | supported: send an Idempotency-Key header to make retries safe |
| Dry run | not applicable |
| Success status | 200 |
| Response type | application/json |
What it does#
- Use when: A secret may have leaked or you rotate secrets on a schedule.
- Do not use when: you only changed the address (call update_webhook_endpoint).
- Side effects: Issues a new secret, returned once; The old secret keeps signing beside the new one for 24 hours.
- Reversible: No.
- Required scope: webhooks:write.
- Idempotency: supported (Idempotency-Key header).
- Typical next step: deploy the new secret to your receiver within 24 hours, then call send_test_webhook.
Scopes#
webhooks:write: Create, change and delete webhook endpoints.
Side effects#
- Issues a new secret, returned once
- The old secret keeps signing beside the new one for 24 hours
Request#
Path parameters#
| Field | Type | Description |
|---|---|---|
endpoint_id | string |
Query parameters#
None.
Response#
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
secret | string | yes | whsec_... Shown only in this response. |
previous_secret_expires_at | string | yes | RFC 3339 UTC timestamp. |
Examples#
rotated#
Request:
curl -X POST 'https://api.seemly.com/v1/webhook-endpoints/whe_4d8x2p0q7r3m9k1v5t6w8y0z/rotate-secret' \
-H "Authorization: Bearer $SEEMLY_API_KEY"const response = await fetch("https://api.seemly.com/v1/webhook-endpoints/whe_4d8x2p0q7r3m9k1v5t6w8y0z/rotate-secret", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SEEMLY_API_KEY}`,
},
});
const result = await response.json();
console.log(response.status, result);import os
import requests
response = requests.post(
"https://api.seemly.com/v1/webhook-endpoints/whe_4d8x2p0q7r3m9k1v5t6w8y0z/rotate-secret",
headers={
"Authorization": f"Bearer {os.environ['SEEMLY_API_KEY']}",
},
)
print(response.status_code, response.json())Response: 200:
{
"id": "whe_4d8x2p0q7r3m9k1v5t6w8y0z",
"secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw",
"previous_secret_expires_at": "2026-12-03T09:30:00Z"
}Errors#
Every error is an application/problem+json body with a code, a fix sentence and next_actions. See reading a problem response.