curl -X POST https://api.telzino.com/v1/chat/messages \
-H "Authorization: Bearer pk_live_..." \
-H "Origin: https://example.com" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "3f1c2a4e-8b7d-4c3a-9e2f-1a2b3c4d5e6f",
"visitor_id": "v_9b1c5f3e2d1a0b9c",
"text": "Do you open on Sunday?",
"client_message_id": "c_01"
}'
{ "id": "6d0c8b8e-2f2a-4a8e-9b1c-5f3e2d1a0b9c", "duplicate": false }
{ "error": "chat_disabled", "error_description": "Chat is turned off for this agent" }
Chat
Send Chat Message
Send a website visitor’s chat message to an agent
POST
/
v1
/
chat
/
messages
curl -X POST https://api.telzino.com/v1/chat/messages \
-H "Authorization: Bearer pk_live_..." \
-H "Origin: https://example.com" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "3f1c2a4e-8b7d-4c3a-9e2f-1a2b3c4d5e6f",
"visitor_id": "v_9b1c5f3e2d1a0b9c",
"text": "Do you open on Sunday?",
"client_message_id": "c_01"
}'
{ "id": "6d0c8b8e-2f2a-4a8e-9b1c-5f3e2d1a0b9c", "duplicate": false }
{ "error": "chat_disabled", "error_description": "Chat is turned off for this agent" }
Called from the browser with a publishable key. The agent answers with the same setup that answers its text messages: its prompt, tools and model. Read the reply with List Chat Messages. The Chat SDK calls both endpoints for you.
The request
Origin must be one of the publishable key’s allowed origins, exactly as for Voice Sessions. Responses to an allowed origin carry CORS headers.
A random id you keep per visitor, 8 to 64 letters, digits,
_ or -. The same id continues the same conversation. The SDK stores one in localStorage.Up to 64 letters, digits,
_ or -. Sending the same id again is a no-op (duplicate: true), so a retried request never posts the message twice.curl -X POST https://api.telzino.com/v1/chat/messages \
-H "Authorization: Bearer pk_live_..." \
-H "Origin: https://example.com" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "3f1c2a4e-8b7d-4c3a-9e2f-1a2b3c4d5e6f",
"visitor_id": "v_9b1c5f3e2d1a0b9c",
"text": "Do you open on Sunday?",
"client_message_id": "c_01"
}'
{ "id": "6d0c8b8e-2f2a-4a8e-9b1c-5f3e2d1a0b9c", "duplicate": false }
{ "error": "chat_disabled", "error_description": "Chat is turned off for this agent" }
Errors
| Status | error | Meaning |
|---|---|---|
| 400 | invalid_request | The body failed validation. |
| 401 | invalid_key | Unknown or revoked publishable key. |
| 403 | origin_not_allowed | The Origin is not on the key. |
| 403 | embed_disabled | The SDK is turned off for the account. |
| 403 | chat_disabled | Chat is turned off for this agent. |
| 404 | agent_not_found | No such agent, outside the key’s scope or allowlist, or not live. |
| 429 | rate_limited | 60 messages per minute per key, or 10 per minute per key and IP. |
| 503 | temporarily_unavailable | Retry shortly with the same client_message_id. |
