Rotate a secret
POST /v1/webhooks/{id}/rotate-secret
Rotate an endpoint’s secret.
Deliveries are signed with both the new and the old secret for 24 hours (two v1 values), so your receiver can switch without missing one.
API key with the webhooks scope.
Request
curl -X POST "https://api.formatjet.com/v1/webhooks/wh_01JBXA6K8M0P2R4S6T8V0W2X4Y/rotate-secret" \ -H "Authorization: Bearer $FORMATJET_API_KEY"Path parameters
| Field | Type | Description |
|---|---|---|
id required | string |
Headers
| Field | Type | Description |
|---|---|---|
Idempotency-Key | string | Up to 255 printable ASCII characters, such as a UUID. A repeat of the same request within 24 hours gets the first one’s successful answer again (Idempotent-Replayed: true); the same key with a different request is a 409. |
Responses
200 OK
The endpoint and its new secret
| Field | Type | Description |
|---|
{ "id": "wh_01JBXA6K8M0P2R4S6T8V0W2X4Y", "url": "https://example.com/formatjet/events", "description": "Production receiver", "events": [ "job.completed", "job.failed", "job.canceled" ], "mode": "live", "enabled": true, "disabled_reason": null, "failing_since": null, "previous_secret_expires_at": null, "client": null, "conversions": null, "metadata": null, "created_at": "2026-10-24T09:12:40.000Z", "updated_at": "2026-10-24T09:12:40.000Z", "secret": "whsec_3fK8mQ2xV7nR1tY5wZ9bC4dG6hJ0kL2p"}Errors
Problem documents (application/problem+json); see Errors.
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | An Idempotency-Key that isn’t 1 to 255 printable characters. |
| 401 | unauthorized | No API key, or one that’s unknown or revoked. |
| 403 | forbidden | The key lacks the webhooks scope, or the plan has no API. |
| 404 | not_found | No webhook endpoint of this key’s mode has this ID. |
| 409 | idempotency_conflict | The Idempotency-Key was used for a different request in the last 24 hours, or its first request is still running. |
| 429 | rate_limited | More requests than the plan allows in 10 seconds: wait Retry-After seconds. |