Skip to main content
POST
/
api
/
webhook
/
webchat
Handle inbound webchat message
curl --request POST \
  --url https://your-instance.example.com/api/webhook/webchat \
  --header 'Content-Type: application/json' \
  --data '
{
  "webchatId": "wc_8f3d1b9c-2e7a-4f0b-9a4d-2c1e6e2f8c01",
  "webchatConfigId": "5f7b1c2e8a1d4e0012c3b4a5",
  "message": "Hi, do you ship to Canada?",
  "deviceId": "dev_4f9a-8c1b-2e3d-7a01",
  "visitorName": "Alex Morgan",
  "visitorEmail": "alex@example.com",
  "visitorPhone": "+14165550100",
  "metadata": {
    "page": "/pricing",
    "referrer": "https://google.com"
  }
}
'
{
  "message": "Webchat webhook received"
}

Body

application/json
webchatId
string
required

Per-conversation widget session identifier generated client-side.

webchatConfigId
string
required

WebchatConfig _id that identifies which embedded widget sent the message.

message
string
required

Visitor message body.

deviceId
string

Stable per-browser device identifier used to deduplicate visitors across sessions.

visitorName
string

Optional visitor display name captured by the widget pre-chat form.

visitorEmail
string

Optional visitor email captured by the widget pre-chat form.

visitorPhone
string

Optional visitor phone number captured by the widget pre-chat form.

metadata
object

Free-form context the widget attaches (referrer, page URL, UTM params, etc.).

Response

Message accepted (processed asynchronously)

Ack returned to the embedded webchat widget after queuing an inbound message for async processing.

message
string
required