Skip to main content

Overview

Rewrite sends webhook deliveries as HTTPS POST requests with a JSON body. Current public event families are:

Registering a webhook

You can create webhooks in the dashboard or through POST /webhooks. Example create request:

Delivery request shape

Rewrite currently sends:
  • Content-Type: application/json
  • User-Agent: rewrite-webhooks/1.0
  • svix-id
  • svix-timestamp
  • svix-signature
Example payload:
  • data.contact and data.contactId are always present. They become null when the original send did not target a saved contact.
  • sandbox on the event envelope indicates the originating project mode.
  • data.sandbox repeats that signal inside message payloads.
  • Webhook resource reads return retries and timeout at the top level, while create/update requests accept them inside delivery.

Signature validation

Validate webhook signatures before trusting the body. Important implementation details:
  • Use the raw request body.
  • Read svix-id, svix-timestamp, and svix-signature from headers.
  • Verify against the webhook secret returned by POST /webhooks or GET /webhooks/{id}.
For the full verification flow, canonical signed string, and a Node example, see Signature.

Handler guidance

  • Return any 2xx response quickly.
  • Process heavy work asynchronously.
  • Deduplicate by webhook event id.
  • Persist the raw payload for debugging and replays.