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.
POST/v2.0/web-chat/messages

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:

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

ParameterTypeDescription
conversationIdstringThe web chat conversation to reply in
textstringThe message, up to 2,000 characters. Spaces at the start and end are removed. Line breaks are kept
senderNamestringWho 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.

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

StatusCodeMeaning
400CONVERSATION_ID_REQUIREDconversationId is missing
400INVALID_CONVERSATION_IDconversationId is not a valid id
400TEXT_REQUIREDtext is missing or empty
400TEXT_TOO_LONGtext is over 2,000 characters
400INVALID_SENDER_NAMEsenderName is not text, or is over 40 characters
400NOT_A_WEB_CHAT_CONVERSATIONThe conversation is on another channel, such as WhatsApp. Use that channel’s send endpoint
403CONTACT_BLOCKEDThe visitor is blocked
403PRIVATE_CONTACTThe contact is private. Sendiee does not send or store messages for them
404CONVERSATION_NOT_FOUNDNo conversation with that id on this account
404CHANNEL_NOT_FOUNDThe conversation’s web chat channel was deleted
502SEND_FAILEDNothing was sent. The visitor may be blocked or no longer exist
502UPSTREAM_ERRORThe web chat service did not answer. Try again shortly

Plus the errors every web chat endpoint can return.

Try It

Try it — API Playground