Add a webhook
https://api.chat-data.com/ api/ v2/ add- webhook/ add-webhookAdd a webhook endpoint that receives real-time events from the chatbot: chat, live-chat-escalation, lead-submission, user-online or user-offline. Your plan must include webhooks. A chatbot can have up to 5 webhook endpoints; adding an event to an existing url subscribes that endpoint to one more event.
The Webhooks page documents every event's body and how to verify deliveries. A chat event triggered by a /chat request with skipCache: true carries regenerate: true (the field is absent otherwise). A live-chat-escalation matches its chat event by conversation_id; a lead-submission has no conversation_id, so pass its lead.uuid as leadId to Get conversations.
Request body
Sending 3 of 4 fieldschatbotIdstringurlstringeventstringchat, live-chat-escalation and lead-submission bodies. user-online and user-offline fire when the user joins or leaves a live chat session and carry chatbot_id, chatbot_name, conversation_id and, when known, the user's name, email, phone, source and user_uuid. If a webhook with this url already exists, the event is added to its subscriptions.Only these fields are sent (application/json).