Skip to content

Webhooks

The events the PMS Ichelon and ZinQ AI apps send, verifying signatures, and surviving retries.

3 min read

Outbound webhooks come from two apps with fixed events: connect App store → PMS Ichelon or App store → ZinQ AI and enter the webhook URL. (Settings → Integrations holds inbound webhooks, which receive leads.)

Events

EventFires when
lead.createdA lead is created by any route (sent to ZinQ AI)
lead.updatedA lead's details are edited, not a stage move (sent to ZinQ AI)
appointment.bookedAn appointment is booked (sent to PMS Ichelon)

Payload

json
{
  "name": "Anika Kapoor",
  "phone": "+919258813876"
}

That is the whole PMS Ichelon body for appointment.booked; the event name and delivery id ride in the X-Nexus-Event and X-Nexus-Delivery headers. ZinQ AI instead receives event (ONCRMLEAD_ADD or ONCRMLEAD_UPDATE), ts, data.fields with the lead's details, and an auth block. The PMS Ichelon body carries no lead id, so match on the phone number; for ZinQ AI, data.fields.id is the lead's public id if you need its current state from the API.

Verifying the signature

When a PMS Ichelon signing secret is set, every delivery carries X-Nexus-Signature: sha256=<hex>, an HMAC-SHA256 of the raw request body keyed with that secret. Strip the sha256= prefix before comparing. ZinQ AI has no signing-secret field; ZinQ checks the auth block in the body instead.

js
const expected = crypto
  .createHmac('sha256', process.env.NEXUS_WEBHOOK_SECRET)
  .update(rawBody)            // the raw bytes — NOT a re-serialised object
  .digest('hex');

if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(received))) {
  return res.status(400).end();
}
Warning
Verify against the raw body. Re-serialising the parsed JSON changes key order and whitespace, so the signature will never match. This is the single most common webhook integration failure, and it looks exactly like a wrong secret.

Use a constant-time comparison. A plain === on a signature leaks, one byte at a time, how much of a guess was correct.

Retries and idempotency

A non-2xx response, a timeout or a connection failure is retried: five attempts in all, 30 seconds, 2 minutes, 10 minutes and 30 minutes apart.

Deduplicate on the X-Nexus-Delivery header. A retry sent after your handler succeeded but timed out will deliver the same event again, and processing it twice is a problem only your side can prevent — we cannot know whether your work completed.

Return 200 as soon as you have durably recorded the event, then do the work afterwards. Requests time out after ten seconds, so a handler that takes longer to respond is counted as a failure and retried even if it went on to succeed.

The delivery log

App store → [app] → Deliveries shows the latest 50 deliveries, filterable by status, each with its last response code, attempt count and an excerpt of the response body, so a failing endpoint is visible rather than silently dropping events. Nothing is disabled or emailed automatically: a delivery that runs out of retries is marked failed and stays so until someone presses Retry now, which sends the same payload with a fresh set of retries.

Stuck on a response you did not expect? Send us the request_id from the error body and we can trace the exact call — contact support.

Webhooks — API reference — atomcrm.ai