Skip to main content
A webhook is an HTTP callback. When something happens to a document, Circularo sends a POST request to a URL you registered, so your system hears about it instead of asking. Webhooks can be registered in the Circularo web app or through the API (Webhooks endpoints) — this page describes what Circularo sends, whichever way the webhook was created.

Document events

A webhook belongs to an organization and receives the events of that organization’s documents. Branch on the events you care about and ignore the rest. More events can be added over time, so a receiver that treats an unrecognized event as a no-op keeps working.

The payload

Every delivery is a JSON POST carrying these fields, and nothing else:
documentId is the document the event happened to, event the name of the event from the list above, actor the user who caused it, and timestamp when it happened. actor is null when the event was caused by the system itself rather than a person — a recipient’s deadline passing, for example. The notification carries no document content — it is a pointer. Read the document itself when you need more than the fact that something changed.

Delivery

A delivery is attempted once and is not repeated: a receiver that fails, or does not answer promptly, loses that notification. Acknowledge the request first and do your own work afterwards. A webhook registered through the API delivers to https addresses only.

Securing the deliveries

To prevent spoofing, a webhook can authenticate its deliveries in one of two ways: with an HMAC signature of the payload, or with HTTP Basic credentials. Both are optional, and a webhook uses one of them, never both. To use the HMAC, specify the hmacSecret field when creating the webhook. HMAC uses the SHA256 algorithm and hexadecimal encoding, and is computed over the complete payload buffer. The hash is presented in the X-Circularo-Signature header. To verify that a callback request really comes from Circularo, compute your own HMAC hash over the received payload buffer — before parsing it, since re-serializing JSON changes the bytes — and check that it matches the signature in the header. The React to events with webhooks guide includes a receiver that does this, with a timing-safe comparison. With HTTP Basic authentication instead, specify basicAuth with a username and a password when creating the webhook, and every delivery carries them in an ordinary Authorization: Basic header. The password is write-only and never returned.

In this section

Manage webhooks in the web app

Create, edit and delete webhooks in the administration of the web app, without writing code.