OpenAgentOpenAgent

Webhooks

Signed HTTP POSTs when things happen: lead created, conversation ended, action run. HMAC-SHA256 signatures with timing-safe verification.

View as Markdown

Webhooks push events to your systems in real time. Add one under Settings → Integrations → Webhooks: an endpoint URL, an optional signing secret, and the events you want (or * for all). Webhooks are workspace-wide.

Events

EventFires when
lead.createdA visitor submits the in-chat lead form / the lead tool captures.
conversation.endedA conversation is closed or resolved.
action.runA custom action/tool runs.

Workflow webhook steps are separate and more flexible — any URL, any payload, per-flow — see Steps & nodes. Post-call webhooks fire from the receptionist with the call summary.

Payload envelope

{
  "event": "lead.created",
  "data": {
    "leadId": 123,
    "agentId": 1,
    "fields": { "name": "Jane Doe", "email": "jane@example.com", "phone": "+1 555 0100" }
  },
  "ts": 1717800000000
}

Verifying the signature

With a signing secret set, each request carries X-OpenAgent-Signature: sha256=<hex> — an HMAC-SHA256 of the raw body. Recompute and compare timing-safely:

const crypto = require('crypto');

function verify(rawBody, header, secret) {
  const expected = 'sha256=' + crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
  const a = Buffer.from(header || ''), b = Buffer.from(expected);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}
Respond fast

Return 200 quickly and do slow work (CRM sync, emails) asynchronously. Delivery is best-effort and non-blocking on OpenAgent's side.