Skip to main content
AlonChat

Webhook Events

Reference for the AlonChat webhook event types you can subscribe to and what they signal.

AlonChat sends real-time HTTP POST notifications when key events happen in your agent. Subscribe to the events you care about when you create a webhook under Settings > Webhooks.

Webhooks are available on Business and Enterprise plans. Active trials can test gated features during the trial, subject to trial limits.

Tip: Use the Test button on any webhook in the dashboard to see the exact payload for a given event before you build against it. A test delivery id starts with test_. Some sample payloads set _test: true inside payload. Not every event uses that flag.


Supported Events#

EventFires when
leads.submitA customer submits lead/contact details in a conversation
message.sentThe AI sends a message to a customer
tool.executedAn AI action/tool call completes successfully
booking.createdA booking/appointment is created
booking.cancelledA booking is cancelled
booking.rescheduledA booking is moved to a new time
order.confirmedA customer confirms an order
custom_form.submittedA custom form is submitted
google_form.submittedA connected Google Form answer is matched and recorded on customer history
payment.proof_receivedA customer submits proof of payment
payment.verification_pendingA payment is awaiting your approval
payment.verifiedA payment is approved/verified
payment.rejectedA payment is rejected
record.createdA new Data Log record is stored
procedure.alert.createdA Procedure notifies the owner or staff while the AI continues
procedure.approval.requestedA Procedure pauses for owner, teammate, or approval input
procedure.approval.resolvedThat approval is approved or rejected so the Procedure can resume
procedure.handoff.requestedA Procedure routes the conversation to a team
procedure.escalatedA Procedure reaches a configured escalation and the AI should stop

Subscribe to tool.executed. action.executed is an older internal name and is rejected on a new webhook. Existing deliveries of completed actions use tool.executed.

These map cleanly onto AlonChat's Actions — bookings, orders, payments, custom forms, and lead capture — so you can drive your own systems (CRM, accounting, fulfillment) off the work your agent does.


Payloads#

Every delivery uses a standard envelope: eventType, chatbotId (the agent ID), a payload with the event-specific data, and a timestamp. The HMAC signature is computed over this entire JSON body. Read eventType on the envelope. Some payloads also repeat the name in their own event field; that field is not a substitute for the envelope. The simplest example is a lead:

json
{
  "eventType": "leads.submit",
  "chatbotId": "agent-uuid",
  "timestamp": "2026-03-15T10:30:00Z",
  "payload": {
    "conversationId": "conv-uuid",
    "customerEmail": "john@example.com",
    "customerName": "John Doe",
    "customerPhone": "+639171234567"
  }
}

google_form.submitted#

This event identifies a connected Google Form answer recorded on customer history. Its payload includes formTitle, googleFormId, responseId, contactId, matchedBy, submittedAt, and an answers array. Each answer includes questionId, title, and string values.

matchedBy is personal_link, phone_or_email, or owner. Conversation and invite IDs can be absent. Matching describes how the answer was linked; it is not independent identity verification. Test answers and the internal reference answer are excluded. Read the underlying work item before treating the answer as an approved booking, refund, or other completed business result.

Google Forms answer operations currently serve signed-in dashboard/owner use. The webhook event does not make those private operations available to a project API key. Use the dashboard's event test for an example envelope before implementing your receiver.

custom_form.submitted#

The custom form event carries the submission, the resolved field values (by key and by label), and the form's field schema:

json
{
  "eventType": "custom_form.submitted",
  "chatbotId": "agent_123",
  "timestamp": "2026-05-28T10:30:00Z",
  "payload": {
    "formId": "form_123",
    "formKey": "refund_request",
    "formName": "Refund Request",
    "submissionId": "sub_123",
    "activityCaseId": "case_123",
    "conversationId": "conv_123",
    "contactId": "contact_123",
    "customerName": "Juan Dela Cruz",
    "customerEmail": "juan@example.com",
    "customerPhone": "09171234567",
    "sourcePlatform": "facebook",
    "fieldValues": { "order_reference": "REF-123", "reason": "Duplicate payment" },
    "fieldValuesByLabel": { "Order Reference": "REF-123", "Reason": "Duplicate payment" },
    "fieldSchema": [
      { "key": "order_reference", "label": "Order Reference", "type": "text", "required": true },
      { "key": "reason", "label": "Reason", "type": "textarea", "required": true }
    ],
    "notes": null,
    "submittedAt": "2026-05-28T10:30:00Z"
  }
}

Photos and files#

An image or file field holds one file object, or a list of up to five. Each object describes the file:

json
"store_photos": [
  {
    "kind": "image",
    "name": "storefront.jpg",
    "mimeType": "image/jpeg",
    "sizeBytes": 482113
  }
]

To receive the files themselves, turn on Include file download links on the webhook. It is off by default. Each file object then also carries a link you can fetch without credentials:

json
{
  "kind": "image",
  "name": "storefront.jpg",
  "mimeType": "image/jpeg",
  "sizeBytes": 482113,
  "downloadUrl": "https://…/storefront.jpg?token=…",
  "downloadUrlExpiresAt": "2026-05-28T11:30:00Z",
  "deleted": false
}
  • A link works for one hour. Every delivery, including retries and replays, carries fresh links.
  • Download the files when you receive the event and keep your own copy.
  • When a file has been deleted, downloadUrl is null and deleted is true.
  • Need the files later? Read the submission to get new links.
  • Webhook logs in your dashboard show [redacted] in place of each link.
  • The dashboard Test button sends a sample photo field so you can check how your endpoint handles files. Its sample link does not point to a real file.

Payload shapes vary by event — booking, order, and payment events carry the relevant record details. Use the dashboard Test button to inspect the exact fields for the event you're building against.


Common Fields#

FieldTypeDescription
eventTypestringEvent identifier (e.g., leads.submit)
chatbotIdUUIDThe agent that triggered the event
payloadobjectEvent-specific data (varies by event)
timestampISO 8601When the event occurred (UTC)

Timestamps use ISO 8601 with UTC, e.g. 2026-03-15T10:30:00Z.


Event Filtering#

When creating a webhook, choose which events to receive:

From the dashboard: go to Settings > Webhooks, click Add Webhook, and check the events you want.

Via the API:

json
{
  "name": "Order Notifications",
  "endpoint_url": "https://your-server.com/webhooks/alonchat",
  "events": ["order.confirmed", "payment.verified", "custom_form.submitted"]
}

Subscribe only to the events you need to reduce traffic and processing overhead.


Event Delivery#

Retries and duplicates#

Webhook deliveries can be repeated during retries. Use the x-alonchat-delivery-id header to deduplicate and inspect delivery history for the final result. An unreachable endpoint or exhausted retries can leave a failed delivery; the event does not guarantee your system received it.

javascript
const processedDeliveries = new Set()

app.post('/webhooks/alonchat', (req, res) => {
  const deliveryId = req.headers['x-alonchat-delivery-id']
  if (processedDeliveries.has(deliveryId)) {
    return res.status(200).json({ success: true, duplicate: true })
  }
  // Process event...
  processedDeliveries.add(deliveryId)
  res.status(200).json({ success: true })
})

For production, store delivery IDs in a database or Redis instead of an in-memory set.

Delivery Order#

Events arrive roughly in chronological order, but strict ordering isn't guaranteed. Use the timestamp to order events when it matters.


Next Steps#