Skip to main content
Polling tells you what changed only as often as you ask. A webhook has Circularo call you instead, the moment a document event happens in your organization. Registering one takes a single call; securing the deliveries, and receiving them safely, is the rest of this guide.

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 https URLs only; an http callback is rejected with 400.

What a delivery looks like

Circularo sends a JSON POST 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
  • hmacSecret signs each payload: the delivery carries the HMAC-SHA256 of the raw body in an X-Circularo-Signature header, which also proves nothing altered it in transit.
  • basicAuth takes a username and a password and puts an ordinary Authorization: Basic header 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/webhooks is rejected with 400.
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
Use this to reconcile what your integration believes it registered with what Circularo will actually call — and to find the 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 null to remove it.
  • Omitting basicAuth.password keeps the stored one, so you can send back the object you just read; include password to 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 callbackUrl re-sends basicAuth in full or drops it.
Response
A webhook delivers every document event in the organization — there is no narrower scope to configure, so an update is about where deliveries go and how they authenticate.

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 an X-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