How Webhooks Work
Setting Up a Webhook
Via the Dashboard
- Go to Settings > Webhooks in your workspace
- Click Create Webhook
- Enter your endpoint URL (must be HTTPS)
- Select the events you want to subscribe to
- Save
Via the API
Event Types
| Event | Description |
|---|---|
chat.message.created | A new message was sent in a conversation |
chat.session.created | A new chat session started |
ticket.created | A support ticket was created |
ticket.updated | A ticket status or assignment changed |
lead.captured | A lead was captured from the widget |
contact.created | A new contact was added |
Payload Format
Every webhook delivery includes a JSON payload with a consistent structure:| Field | Type | Description |
|---|---|---|
event | string | The event type |
timestamp | string | ISO 8601 timestamp of when the event occurred |
workspaceId | string | The workspace where the event originated |
data | object | Event-specific payload |
Handling Webhooks
Basic Express Server
Next.js API Route
Best Practices
Respond quickly
Respond quickly
Return a
200 response as soon as possible. Process the event asynchronously if your logic takes more than a few seconds. IllumiChat may time out and retry if your endpoint does not respond promptly.Handle duplicates
Handle duplicates
Webhook deliveries can occasionally be duplicated. Use the event
timestamp and resource id to deduplicate on your end.Use HTTPS
Use HTTPS
Webhook URLs must use HTTPS. For local development, use a tunneling service like ngrok to expose your local server.
Log payloads during development
Log payloads during development
Log the full payload while building your integration so you can inspect the exact structure of each event type.
Retry Policy
If your endpoint returns a non-2xx status code or times out, IllumiChat retries the delivery with exponential backoff:| Attempt | Delay |
|---|---|
| 1st retry | 1 minute |
| 2nd retry | 5 minutes |
| 3rd retry | 30 minutes |