JAI CRM
Home Documentation API Webhooks

Webhooks

Being told when something happens, instead of asking repeatedly.

Polling a list every minute to notice a new invoice is wasteful and slow. A webhook tells you instead.

Setting one up

  1. Go to Settings → API keys & webhooks and open the Webhooks tab.
  2. Add the URL we should post to. It must be HTTPS.
  3. Choose the events you want.
  4. Save. A secret is generated — you will use it to verify that a delivery came from us.
  5. Use Test to send a sample delivery immediately.

What a delivery looks like

POST https://your-server.example/hooks/jai
Content-Type: application/json
X-JAI-Event: invoice.created
X-JAI-Signature: sha256=…

{
  "event": "invoice.created",
  "at": "2026-09-03T09:14:22.000Z",
  "data": { "id": "…", "number": "INV-2042", … }
}

Verifying it

Compute an HMAC-SHA256 of the raw request body using your endpoint’s secret and compare it with the signature header. Compare the two in constant time, and reject anything that does not match — an unverified webhook endpoint is an open door.

Answering

  • Reply 2xx quickly. Do the work afterwards, not before replying.
  • A non-2xx is retried; a slow endpoint will time out and be retried too.
  • Deliveries can arrive more than once, so make your handler idempotent — key it on the event id.

Something missing or wrong here? Tell us — a question that needed asking usually means a page that needed writing.