Chatbot Operations

Add a webhook

Add 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.

post/add-webhook

Request

  • Base URL: https://api.chat-data.com/api/v2
  • URL: https://api.chat-data.com/api/v2/add-webhook
  • Auth: HTTP bearer

Request body

chatbotIdstring required

The ID of the chatbot the webhook belongs to.

urlstring required

The URL endpoint that the chatbot delivers events to.

event'chat' | 'live-chat-escalation' | 'lead-submission' | 'user-online' | 'user-offline' required

The type of event the webhook subscribes to. See Webhooks for the chat, 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.

contentType'text/plain' | 'application/json'

The Content-Type of the deliveries. Endpoints on hook.make.com, hook.*.make.com, n8n.cloud and *.n8n.cloud always receive text/plain. Re-adding an existing url updates its content type.

Example request

{
  "chatbotId": "6650f1c2a9e4b83d2c7a1f05",
  "url": "https://example.com/webhooks/chat-data"
}

Response

Successful response.

status'success' required

Example response

{
  "webhooks": [
    {
      "endpoint": "https://example.com/webhooks/chat-data",
      "secret": "4f9a2c7e1b8d3f6a0c5e9b2d7a1f4c8e3b6d9f2a5c8e1b4d7f0a3c6e9b2d5f8a",
      "enable": true,
      "contentType": "text/plain"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.