Skip to content

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

Terminal window
curl -X POST "https://api.formatjet.com/v1/webhooks/wh_01JBXA6K8M0P2R4S6T8V0W2X4Y/rotate-secret" \
-H "Authorization: Bearer $FORMATJET_API_KEY"

Path parameters

FieldTypeDescription
id requiredstring

Headers

FieldTypeDescription
Idempotency-KeystringUp 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

FieldTypeDescription
Example
{
"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.

StatusCodeWhen
400invalid_requestAn Idempotency-Key that isn’t 1 to 255 printable characters.
401unauthorizedNo API key, or one that’s unknown or revoked.
403forbiddenThe key lacks the webhooks scope, or the plan has no API.
404not_foundNo webhook endpoint of this key’s mode has this ID.
409idempotency_conflictThe Idempotency-Key was used for a different request in the last 24 hours, or its first request is still running.
429rate_limitedMore requests than the plan allows in 10 seconds: wait Retry-After seconds.