Rotate an organization webhook's signing secret
POST/api/v1/organizations/{id}/webhooks/{webhook_id}/rotate-secret
POST /organizations/{id}/webhooks/{webhook_id}/rotate-secret
curl -X POST 'https://www.unitpost.com/api/v1/organizations/org_123/webhooks/wh_123/rotate-secret' \
-H 'Authorization: Bearer YOUR_ORG_KEY' \
-H 'User-Agent: my-app/1.0'Response · 200
{
"object": "webhook",
"id": "id_123",
"name": "Example",
"url": "https://example.com",
"events": [
"email.sent"
],
"status": "enabled",
"include_text": false,
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z",
"backlog": {
"queued": 0,
"failed": 0
},
"signing_secret": "string",
"previous_secret_expires_at": "2026-01-01T00:00:00.000Z"
}A new signing secret, returned once. For 24 hours (until previous_secret_expires_at) every delivery is signed with the new and the old secret, so switch your receiver inside that window. Takes an organization key (ok_live_…) with organizations:write.
Parameters2 fields
| Field | Type | Description |
|---|---|---|
idrequired | string · path | The organization's id (`org_…`), from `GET /whoami` or Organization → API. |
webhook_idrequired | string · path | The organization webhook endpoint's id (`wh_…`). |
Response · 200 fields1 field
| Field | Type | Description |
|---|---|---|
previous_secret_expires_atrequired | string | Until this time deliveries are signed with the new AND the old secret, so switch your receiver to the new one before then. |
200401403404409429