Send a Web Chat Message
Sends a text message into an existing web chat conversation, as your business. It goes out exactly like a reply typed in Teambox:
- It shows in the visitor’s chat window right away if they have it open, and in Teambox for your team.
- If the visitor has left and has a verified email, they get the reply by email with a button to continue the chat, when Email replies to visitors who left is on for the channel. At most one such email goes out per chat every 30 minutes.
- If the channel’s assistant has Disable on Manual Reply on, the assistant pauses for this visitor.
Scope, access and plan
web_chat:write on scoped keys, web chat on for your account, and a plan that includes web chat (otherwise 403 FEATURE_NOT_ENABLED).Finding the conversation
You need the conversationId of the visitor’s web chat. A visitor gets a conversation once they send their first message. You can find it in:
- GET /v2.0/chats/conversations?platform=web, the
conversationIdof each row. - Live Visitors, the
conversationIdof a visitor on your site now.
To message someone who is on your site but has not chatted yet, use Start chat in the dashboard or Teambox. See Live visitors and Start chat.
Body Parameters
| Parameter | Type | Description |
|---|---|---|
| conversationId | string | The web chat conversation to reply in |
| text | string | The message, up to 2,000 characters. Spaces at the start and end are removed. Line breaks are kept |
| senderName | string | Who the visitor sees as the sender, up to 40 characters. The chat shows the first word, like "Priya". Left out, the chat shows your channel's display name |
Formatting and links
The chat window shows simple formatting in the text: *bold* or **bold**, _italic_, ~strike~, lines starting with - as a bulleted list and 1. as a numbered list. Web addresses starting with https:// or http:// become links, and [Track your order](https://example.com/track) shows “Track your order” as a link.
Text only
Code Example
curl -X POST "https://api.sendiee.com/v2.0/web-chat/messages" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"conversationId": "6724c2d19d2b4e0011ab7702",
"text": "Your order KL-2291 has shipped. It should reach Bengaluru by Thursday.",
"senderName": "Priya"
}'Response — 201 Created
{
"success": true,
"data": {
"conversationId": "6724c2d19d2b4e0011ab7702",
"channelId": "6720b1c09d2b4e0011ab5501",
"visitorId": "wv_m3qk7d2xr5ta6nh4vb2we7cy",
"type": "text",
"text": "Your order KL-2291 has shipped. It should reach Bengaluru by Thursday."
}
}201 means the message was saved to the conversation and sent on to the visitor’s chat. Read it back with GET /v2.0/chats/history?conversationId=.
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | CONVERSATION_ID_REQUIRED | conversationId is missing |
| 400 | INVALID_CONVERSATION_ID | conversationId is not a valid id |
| 400 | TEXT_REQUIRED | text is missing or empty |
| 400 | TEXT_TOO_LONG | text is over 2,000 characters |
| 400 | INVALID_SENDER_NAME | senderName is not text, or is over 40 characters |
| 400 | NOT_A_WEB_CHAT_CONVERSATION | The conversation is on another channel, such as WhatsApp. Use that channel’s send endpoint |
| 403 | CONTACT_BLOCKED | The visitor is blocked |
| 403 | PRIVATE_CONTACT | The contact is private. Sendiee does not send or store messages for them |
| 404 | CONVERSATION_NOT_FOUND | No conversation with that id on this account |
| 404 | CHANNEL_NOT_FOUND | The conversation’s web chat channel was deleted |
| 502 | SEND_FAILED | Nothing was sent. The visitor may be blocked or no longer exist |
| 502 | UPSTREAM_ERROR | The web chat service did not answer. Try again shortly |
Plus the errors every web chat endpoint can return.