Website chat widget
Public widget endpoints for visitor messaging on your site.
Overview
The website chat widget lets logged-out visitors message you from your site. It uses a public widget key shown in Settings → Integrations → Website chat - no user session is involved. These are the only client-side public endpoints.
Embed
<script src="https://app.kitodesk.com/widget.js" data-key="YOUR_WIDGET_KEY"></script>POST /api/widget/:key/messages
Submits a visitor message. Creates or continues a webchat conversation for the visitor.
| Field | Required | Type | Notes |
|---|---|---|---|
visitor_id | yes | string, 4-80 | Your anonymous id for the visitor |
body | yes | string, 1-5000 | The message text |
name | no | string, up to 120 | Display name |
curl -X POST https://api.kitodesk.com/api/widget/YOUR_KEY/messages \
-H "Content-Type: application/json" \
-d '{"visitor_id":"v-12345","body":"Where is my order?","name":"Ada"}'Errors: 400 invalid body · 404 unknown widget key.
GET /api/widget/:key/messages
Polls for new messages in the visitor's latest webchat conversation. Query: visitor_id (required), since (ISO timestamp, optional).
Returns { "conversation_id": "...", "messages": [{ "body", "direction", "created_at", "content_type", "content" }] } or { "messages": [] }.
Errors: 404 unknown widget key.
Rate limits
/api/widget allows 60 requests per minute per client.
