Webhooks
Webhooks let Aimdoc send real-time JSON events to your systems whenever important conversation activity happens.
Creating a webhook
You can configure webhooks from the Aimdoc dashboard:
- Navigate to Integrations
- Click Webhooks
- Click Create new webhook
- Add your Endpoint URL and choose the event types you want
Event types
Aimdoc currently supports these webhook events:
new-session: a visitor starts a new conversation.new-contact: contact details are captured.session-active: an existing conversation becomes active again.session-escalated: a conversation is escalated to a human.buyer-intent-detected: buyer intent is detected.new-question: a question is flagged.
new-lead is still present in the API docs for backward compatibility, but new-contact is the canonical event name moving forward.
Payload shape
Payload fields vary by event type. Most events include some combination of:
agent_idandagent_nameconversation(with IDs/timestamps and optionalmessages)leadfor contact-capture events- event-specific fields like
escalation_reasonorbuyer_intent_reason
Here is a simplified new-contact style payload:
Example: new_contact/new_lead payload (simplified)
{
"lead": {
"id": "lead-uuid",
"email": "jane.smith@example.com",
"first_name": "Jane",
"last_name": "Smith",
"company": "Tech Solutions",
"attributes": {}
},
"messages": [
{
"role": "user",
"content": "Can you share pricing?",
"created_at": "2023-08-15T14:30:45.123Z"
}
],
"agent_id": "agent-uuid",
"agent_name": "Sales Assistant"
}
For canonical schemas and full examples, use:
Delivery behavior
- Aimdoc sends webhook payloads as
POSTrequests with JSON bodies. - Return a
2xxresponse quickly to acknowledge receipt. - If delivery fails, Aimdoc retries up to 3 times with exponential backoff.
- If your endpoint is permanently decommissioned, return
410 Goneto remove the webhook subscription automatically.
Use the dashboard test/send-sample tooling while building your receiver so you can validate payload handling before production traffic.
Security notes
- Use HTTPS endpoints only.
- Treat your webhook URL as a secret (use an unguessable path).
- Validate request payloads server-side before processing.