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.
Send from a server
Sign the raw body with the signing secret, and send the signature inX-Sonar-Signature:
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: itsOrigin, 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.
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-urlencodedandmultipart/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 anIdempotency-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
429until 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).
