AnytimeReply

Developers

Webhooks

Events we send, the payload format and how to verify the signature.

Add a webhook URL under your agent's Integrations. We send a POST with a JSON body for each event you select.

Events

  • conversation.created — a new conversation started.
  • lead.created — a form was submitted or a contact captured.
  • handoff.requested — the chat was handed to your team.
  • conversation.closed — a conversation was closed.
  • csat.received — the customer rated the chat.

Headers

  • X-AnytimeReply-Event — the event name.
  • X-AnytimeReply-Signature — sha256= followed by the HMAC-SHA256 of the raw body, using your webhook's secret.

Verify the signature (Node.js)

const crypto = require("crypto");
function verify(rawBody, header, secret) {
  const expected = "sha256=" + crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
  return header && header.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(header), Buffer.from(expected));
}

Reply with any 2xx status within 10 seconds. Failed deliveries are retried a few times with increasing delays.

All docs