Before you begin
- An organization-administrator key. A webhook belongs to the whole organization, so a key issued to a regular member is refused with
403— and so is an administrator’s key when webhooks are not enabled for the organization. - An HTTPS endpoint that accepts POST requests. A webhook registered through the API delivers to
httpsURLs only; anhttpcallback is rejected with400.
What a delivery looks like
Circularo sends a JSONPOST to your callback URL with four fields, and nothing else:
The notification carries no document content — it is a pointer. Read the document itself when you need more than the fact that something changed.
Branch on the events you care about and ignore the rest: further event names exist and more can appear, so a receiver that treats an unrecognized
event as a no-op keeps working.
Step 1: Register the webhook
Give Circularo the URL, and choose how the deliveries should be secured:Request
hmacSecretsigns each payload: the delivery carries the HMAC-SHA256 of the raw body in anX-Circularo-Signatureheader, which also proves nothing altered it in transit.basicAuthtakes ausernameand apasswordand puts an ordinaryAuthorization: Basicheader on each delivery — usually the easier one to put in front of an existing endpoint.- A webhook uses one of the two, never both; sending both is rejected with
400. - Credentials do not belong in the callback URL —
https://user:password@example.com/webhooksis rejected with400.
Response
isHmacConfigured confirms the secret was stored. The secret itself is write-only — it is never returned again, here or anywhere else. The same holds for a basicAuth password: the response reports the user name and nothing else.
Keep the id; it is what you update and delete the webhook by.
Step 2: See the webhooks you have
The organization’s webhooks come back as an ordinary paged collection:Request
Response
id of a webhook somebody registered before you.
Step 3: Change how the webhook is secured
Send only what changes. Here the webhook stops being signed and starts authenticating with HTTP Basic instead:Request
- Omit a field to leave it as it is, send it to replace it, or send
nullto remove it. - Omitting
basicAuth.passwordkeeps the stored one, so you can send back the object you just read; includepasswordto rotate it. - Clearing one scheme and setting the other happens in a single request, because a webhook never has both.
- A stored password is never carried to a different endpoint, so a request that changes
callbackUrlre-sendsbasicAuthin full or drops it.
Response
Step 4: Remove the webhook
Deleting a webhook stops the deliveries:Request
Response
Complete example
Two things decide whether a webhook integration is trustworthy, and the receiver below does both. It verifies the signature, because a callback URL is reachable by anyone and a request arriving there proves nothing on its own. When a secret is configured, every delivery carries anX-Circularo-Signature header holding the HMAC-SHA256 of the raw request body, hex-encoded. Compute the same HMAC over the bytes you received — before parsing them, since re-serializing JSON changes them — and compare the two with a timing-safe comparison.
And it answers immediately, before doing any work of its own. A delivery is attempted once and is not repeated: a receiver that fails, or is too slow to answer, loses that notification.
With neither
hmacSecret nor basicAuth the deliveries are unauthenticated, and your endpoint cannot tell a genuine notification from a forged one. Configure one of them whenever the webhook triggers anything that matters.Next steps
- Watch a transaction move through its rounds, which is what most events report — Manage a running transaction.
- Read the document a notification points at — Create a document from a file.
- The webhook endpoints and their statuses are documented in the API reference.