cherami.
API referenceWebhooks

Rotate the signing secret

POST /v1/webhooks/{webhook_id}/secret/rotate

Read as Markdown ↗

POST /v1/webhooks/{webhook_id}/secret/rotate

Requires an API key: Authorization: Bearer YOUR_CREDENTIAL.

Creates a new signing secret and returns it. Unless immediate is true, the replaced secret keeps signing alongside the new one for 24 hours, until previous_secret_expires_at, so you can switch your receiver without rejecting deliveries.

Only the replaced secret is affected: a secret from an earlier rotation keeps its own 24-hour expiry, even with immediate: true. To stop every earlier secret now, delete the webhook and add it again.

If the response is lost, read the webhook before repeating: a new secret_rotated_at means the rotation happened, and retrieving the secret gives you the new one.

Parameters

ParameterLocationRequiredTypeMeaning
webhook_idpathYesstringCherami resource ID returned by the API.

Request body

JSON object, at most 4 KiB in total.

Schema: RotateWebhookSecret

FieldRequiredTypeMeaning and constraints
immediateNobooleantrue stops the replaced secret at once. default: false

Unknown fields are rejected.

curl example

Supply CHERAMI_API_KEY privately.

Save the payload as request.json, replacing the example values.

{
  "immediate": false
}
curl --silent --show-error --include --request POST \
  "https://cherami.to/v1/webhooks/WEBHOOK_ID/secret/rotate" \
  --header "Authorization: Bearer $CHERAMI_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-binary @request.json

Responses

HTTP 200

Success.

  • X-Request-ID: Identifies this request; include it when reporting a problem.

Content type: application/json.

WebhookRotation

{
  "id": "55555555-5555-4555-8555-555555555555",
  "secret": "whsec_EXAMPLE_NOT_A_REAL_SECRET",
  "secret_rotated_at": "2026-10-01T00:00:00.000Z",
  "previous_secret_expires_at": "2026-10-02T00:00:00.000Z"
}

HTTP 400

invalid_json: Send a valid UTF-8 JSON object, not an array or scalar.

invalid_webhook_rotation: Send an empty body or only a boolean immediate.

  • X-Request-ID: Identifies this request; include it when reporting a problem.

Content type: application/json.

Error

HTTP 401

unauthorized: Send a valid API key as Authorization: Bearer <key>. If the key stopped working, get a new one through recovery.

  • X-Request-ID: Identifies this request; include it when reporting a problem.
  • WWW-Authenticate: "Bearer"

Content type: application/json.

Error

HTTP 404

not_found: The resource does not exist or does not belong to this account. A reply or forward source must also be in the sending inbox.

  • X-Request-ID: Identifies this request; include it when reporting a problem.

Content type: application/json.

Error

HTTP 409

webhook_operation_in_progress: Another change to this webhook is in progress. Retry in a minute.

  • X-Request-ID: Identifies this request; include it when reporting a problem.

Content type: application/json.

Error

HTTP 413

body_too_large: Reduce the JSON request to the operation's body limit.

  • X-Request-ID: Identifies this request; include it when reporting a problem.

Content type: application/json.

Error

HTTP 415

unsupported_media_type: Send Content-Type: application/json.

  • X-Request-ID: Identifies this request; include it when reporting a problem.

Content type: application/json.

Error

HTTP 503

webhook_provider_unavailable: The request could not be completed, and nothing changed. Retry later.

webhook_rotation_uncertain: The rotation was not confirmed and finishes within a few minutes. Then read the webhook: a new secret_rotated_at means it rotated, and retrieving the secret gives you the new one.

webhooks_unavailable: Webhook management failed. If it was a change, it may have been applied: list or read the webhooks before repeating it.

  • X-Request-ID: Identifies this request; include it when reporting a problem.

Content type: application/json.

Error

Schema: WebhookRotation

FieldRequiredTypeMeaning and constraints
idYesstringCherami resource ID.
secretYesstringSigning secret for Standard Webhooks verification (whsec_...). Returned only on creation, retrieval and rotation.
secret_rotated_atYesstringUTC timestamp with milliseconds. format: date-time pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
previous_secret_expires_atYesstringUTC timestamp with milliseconds. format: date-time pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$

Schema: Error

FieldRequiredTypeMeaning and constraints
errorYesobject

error fields

FieldRequiredTypeMeaning and constraints
codeYesstringCode to handle. Handle a code you don't recognize by its HTTP status.
messageYesstringExplanation of this case; its wording can change.

Errors, limits and pagination · Download OpenAPI 3.1

On this page