Skip to main content
A webhook makes anything that can POST a source for Sonar: a site’s contact form, a Zapier zap, your backend. Each delivery becomes an event, which Sonar reads beside the webhook’s name and description, so it can open a company, a contact and a deal from it like from any other message. Webhooks are inbound only: Sonar receives deliveries, it does not send any.

Create a webhook

In the dashboard, open your organization’s Sonar, go to the System tab and connect a Webhook. You give it:
  • a name and a description of what it receives, in your words. Sonar’s agent reads both with every delivery;
  • the allowed sites a browser may post from, such as https://example.com;
  • optionally, a thank-you page for a plain HTML form, and a record ID field: the body field (dotted for nesting, such as contact.id) that names the record a delivery is about. A delivery that names a record an earlier one named is read as a new version of that record, the way a calendar edit is.
You get the webhook’s URL and its signing secret. The secret is shown once, and again only when you rotate the webhook. Rotating gives it a new URL and a new secret, and the old URL stops answering at once.

Send from a server

Sign the raw body with the signing secret, and send the signature in X-Sonar-Signature:
A valid signature is the whole proof, wherever the request comes from. A signature that does not match answers 401.

Send from a browser form

A browser cannot keep a secret, so an unsigned delivery is taken in only from one of the webhook’s allowed sites: its Origin, or its Referer’s. Browser deliveries are also rate-limited per address. A form can carry two reserved fields beside its own. Neither becomes part of the delivery.
A plain form submission is answered with a 303 to the redirect, or with a short confirmation page when there is none. A script posting with fetch gets {"ok": true}.

Bodies

  • application/json: an object is read as sent, and anything else as {"body": …}.
  • application/x-www-form-urlencoded and multipart/form-data: the form’s fields. A field sent several times becomes a list, and files are left out.
  • Any other content type: the body as text, under body.

Deduplicate retries

Send an Idempotency-Key header of up to 200 characters. Deliveries with the same key are one event, so a retry never makes a second. Without a key, every delivery is its own event.

Limits

  • A body of at most 64 KB, and at most 200 form fields.
  • 100 deliveries a day per webhook. Past that, deliveries are refused with 429 until the day’s count drops.
  • Browser deliveries are rate-limited per address.

Responses

A webhook you switched off answers like a success, and the delivery is dropped.

Read what arrived

Read what your webhooks received with List Webhook Deliveries (GET /webhooks/deliveries).