Skip to navigation

Save webhooks for campaigns and inbound lines

View as Markdown

Save a callback URL once, then pick it in campaigns and inbound lines instead of typing the URL each time. Sarvam signs every call result it sends to a saved webhook.

Add a webhook

  1. Open Settings → Webhooks in the dashboard.
  2. Click Add webhook.
  3. Fill in the form:
    • Name — a label you’ll recognise in pickers, for example CRM callback. Up to 50 characters: letters, numbers, hyphens, underscores, and spaces.
    • Callback URL — the endpoint that receives call results. Must start with https://, up to 2048 characters.
    • Headers — optional. Use them for your system’s login, for example Authorization: Bearer <token>. Add up to 10 headers; each needs a name and a value, and names must be unique.
  4. Click Create.
  5. Copy the signing secret shown in the next dialog and store it on your server.

The signing secret is shown only once, right after you create the webhook. You can’t see it again, so copy it before you click Done.

A workspace can have up to 5 webhooks. Add webhook is disabled once you reach the limit; delete one you no longer use to add another.

Verify deliveries

Every delivery to a saved webhook includes two headers:

HeaderContains
Sarvam-SignatureHMAC-SHA256 signature of the request
Sarvam-TimestampTimestamp used in the signature

To check that a request came from Sarvam, compute an HMAC-SHA256 of {timestamp}.{raw body} — the Sarvam-Timestamp value, a period, then the unmodified request body — using the full signing secret, including the whsec_ prefix. Compare the result to Sarvam-Signature and reject the request if they don’t match.

Compute the signature over the raw request body, before your framework parses it as JSON. Re-serialised JSON can differ byte-for-byte and fail verification.

Use a webhook in a campaign or inbound line

When you create or edit a campaign or an inbound line, the Webhook dropdown lists your saved webhooks by name and host. Pick one, and call results for that campaign or line are sent to it.

If you don’t pick a saved webhook, you can still type a one-off URL in Webhook URL. Use Manage webhooks under the dropdown to jump back to this page.

For the fields in each delivery, see the Campaigns webhook payload and Deployments webhook payload.

Edit or delete a webhook

The Webhooks table lists each webhook’s name, callback URL, header count, and last-updated date. Use the row actions to:

  • Edit — change the name, callback URL, or headers. Click Save to apply.
  • Delete — removes the webhook. Campaigns and inbound lines can’t use it after this.

Header values are masked in the form. If a token in a header may have been exposed, rotate it in your system, then edit the webhook with the new value.