Set up a webhook
Use webhooks to keep your application in sync with message activity in Zorvia. When an event occurs, Zorvia sends an HTTP POST request to the endpoint configured for that channel.
Before you begin, create an HTTPS endpoint in your application that can accept JSON requests.
Create a channel webhook
If your endpoint requires an API key or another fixed value, add it as a custom header:
Header values must be strings, numbers, booleans, or null. Webhook bodies use Content-Type: application/json.
Receive webhook requests
For each delivery, your endpoint should:
- accept
POSTrequests with a JSON body; - verify the request signature when a signing secret is configured;
- process events idempotently; and
- return a
2xxresponse after accepting the event.
Zorvia retries a delivery when your endpoint times out or returns a non-2xx response. A delivery is attempted up to three times with exponential backoff, and each attempt has a 60-second timeout.
Return a response quickly and move long-running work to a background job. Because a delivery can be retried, use a combination of message.id, event.type, and event.occurred_at as an idempotency key. Including the event timestamp prevents a later edit to the same message from being mistaken for a duplicate.
Verify a signed request
When you configure a signing secret, each request includes a Signature header. The value is a lowercase hexadecimal HMAC-SHA256 digest of the raw request body, calculated with your signing secret.
Use the unmodified request bytes when calculating the digest. Parsing and serializing the JSON again can change the body and cause verification to fail.
Treat the signing secret and any credential in a custom header as sensitive. Store them in a secret manager and never expose them in browser code.
Requests also include a Timestamp header containing the Unix time at which the delivery attempt was made. If you do not configure a signing secret, the request does not include a Signature header.
The signature covers only the raw request body; it does not include the Timestamp header. It verifies that the body was signed with your secret, but it does not prevent a captured request from being replayed. Do not rely on the timestamp alone for replay protection. Process deliveries idempotently using the event fields described above.
Manage delivery
From Channel → Settings → Webhook, select Manage on a webhook to update its name, URL, signing secret, or static headers.
- Disable Webhook pauses delivery without removing the configuration.
- Enable resumes delivery for a draft or disabled webhook.
- Delete permanently removes the webhook from the channel.
The webhook events reference lists the event names and payload fields your endpoint can receive.
