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.visitor-identified: a visitor is identified or materially enriched with person/company data.
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_namevisitorfor visitor-identity snapshotsconversation(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:
Here is a simplified visitor-identified style payload:
Example: visitor_identified payload (simplified)
{
"visitor": {
"visitor_id": "visitor-uuid",
"lead_id": "lead-uuid",
"latest_conversation_id": "conversation-uuid",
"summary": {
"status": "identified",
"display_name": "Jane Doe",
"subtitle": "VP Marketing at Acme"
},
"person": {
"email": "jane.doe@example.com",
"title": "VP Marketing"
},
"company": {
"name": "Acme",
"domain": "acme.com"
}
},
"conversation": {
"id": "conversation-uuid",
"created_at": "2023-08-15T14:30:45.123Z",
"last_activity": "2023-08-15T14:32:10.000Z"
},
"agent_id": "agent-uuid",
"agent_name": "Sales Assistant"
}
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.