Skip to content

Send an agent message (v2)

Request

Send an agent reply on any channel through a single endpoint. The target channel is set via the channel field (WHATSAPP, WEB, or FACEBOOK) and routing is handled server-side — replacing the per-channel v1 send endpoints. For a text message set text; for media, first upload the file via Upload media for an agent message and send the returned mediaUrl (the content type defaults to MEDIA when a mediaUrl is present). The agent is resolved from your API key / session and the participant is tenant-checked.

Security
apikeyAuth
Bodyapplication/jsonrequired
participantIdstring, (uuid)required

Chat participant to send to.

Example:"a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
channelstringrequired

Channel to route the message on.

Enum:"WHATSAPP""WEB""FACEBOOK"
Example:"WHATSAPP"
tempIdstring

Optional. Client-generated id echoed back on the response to correlate an optimistic UI message. Omit it if you don't need correlation.

Example:"c9f0b308-1a0d-3f3f-7912-464f06677c6b"
textstring

Message text, or the caption for a media send.

Example:"Thanks for reaching out — how can I help?"
contentTypestring

Optional. Defaults to TEXT, or MEDIA when a mediaUrl is present.

Enum:"TEXT""MEDIA"
Example:"TEXT"
mediaUrlstring

Hosted media URL from the media upload endpoint. Its presence makes this a media send.

Example:"https://cdn.example.com/uploads/quote-1234.pdf"
mediaTypestring

Media kind (from the upload response).

Enum:"DOCUMENT""IMAGE""VIDEO""NULL""BUTTON""FILE""AUDIO""VOICE"
Example:"DOCUMENT"
quotedExternalMessageIdstring

WhatsApp id of a message being quoted/replied to.

Example:"3EB0123456789ABCDEF0"
quotedTextstring

Snapshot of the quoted message's text.

Example:"Hi, is this about order #1234?"
curl -i -X POST \
  https://ecommunicate-api-docs.redocly.app/_mock/apis/omnichannel/pl4chat-service/api/v2/messages \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "participantId": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
    "channel": "WHATSAPP",
    "tempId": "c9f0b308-1a0d-3f3f-7912-464f06677c6b",
    "text": "Thanks for reaching out — how can I help?"
  }'

Responses

The stored message

Bodyapplication/json
idstring, (uuid)
Example:"c9d01234-e5f6-a7b8-c9d0-1234e5f6a7b8"
tempIdstring

Temporary client-generated id used to correlate a send request with its response. Present only when the sender supplied one.

Example:"c9f0b308-1a0d-3f3f-7912-464f06677c6b"
sequenceNumberinteger, (int64)

Monotonic ordering hint within the conversation.

Example:42
directionstring
Enum:"OUTGOING""INCOMING"
Example:"INCOMING"
contentTypestring
Enum:"BUTTON""CAROUSEL""DROPDOWN""IMAGE""TEXT""DATE""FILE""MEDIA""LOCATION""RATING"
Example:"TEXT"
channelstring
Enum:"WHATSAPP""WEB""FACEBOOK"
Example:"WHATSAPP"
textstring
Example:"Hello, I need help with my account."
createdTimestring, (date-time)
Example:"2026-01-15T10:30:00Z"
userOriginatedboolean

true when a human typed the message (agent or customer); false for bot-generated messages.

Example:true
messageOwnerstring
Enum:"agent""customer""system"
Example:"customer"
senderstring

Address the message was sent from (e.g. the customer's phone number for inbound, the business number for outbound).

Example:"+27987654321"
receiverstring

Address the message was delivered to.

Example:"+27123456789"
ctIdstring

Custom tracking id for the message, if one was supplied on send.

Example:"order-1234-confirm"
sentboolean
Example:true
deliveredboolean
Example:true
readboolean
Example:false
playedboolean

True when a voice note was played (listened to) by the recipient.

Example:false
sentTimestring, (date-time)
Example:"2026-01-15T10:30:01Z"
deliveredTimestring, (date-time)
Example:"2026-01-15T10:30:05Z"
readTimestring, (date-time)
Example:"2026-01-15T10:31:00Z"
playedTimestring, (date-time)

Timestamp the voice note was played.

Example:"2026-01-15T10:31:30Z"
mediaURLstring
Example:"https://example.com/media/photo.jpg"
fileExtensionstring

File extension of the attached media, when present.

Example:"jpg"
mediaTypestring
Enum:"DOCUMENT""IMAGE""VIDEO""NULL""BUTTON""FILE""AUDIO""VOICE"
Example:"IMAGE"
latitudestring
Example:"-26.2041"
longitudestring
Example:"28.0473"
addressstring
Example:"123 Main St, Johannesburg"
labelstring
Example:"Head Office"
agentobject(AgentSummary)

Lean reference to the agent who sent or owns a message.

reactionobject(Reaction)
whatsAppMessageIdstring

Provider (WhatsApp) message id.

Example:"3EB09839C39C57F54A9EC5"
facebookMessageIdstring

Provider (Facebook) message id.

Example:"m_AbCdEf123456"
quotedExternalMessageIdstring

WhatsApp id of the message this one replies to/quotes (present when the message is a reply).

Example:"3EB0123456789ABCDEF0"
quotedTextstring

Snapshot of the quoted message's text, captured at reply time.

Example:"Hi, is this about order #1234?"
Response
{ "id": "c9d01234-e5f6-a7b8-c9d0-1234e5f6a7b8", "tempId": "c9f0b308-1a0d-3f3f-7912-464f06677c6b", "sequenceNumber": 42, "direction": "INCOMING", "contentType": "TEXT", "channel": "WHATSAPP", "text": "Hello, I need help with my account.", "createdTime": "2026-01-15T10:30:00Z", "userOriginated": true, "messageOwner": "customer", "sender": "+27987654321", "receiver": "+27123456789", "ctId": "order-1234-confirm", "sent": true, "delivered": true, "read": false, "played": false, "sentTime": "2026-01-15T10:30:01Z", "deliveredTime": "2026-01-15T10:30:05Z", "readTime": "2026-01-15T10:31:00Z", "playedTime": "2026-01-15T10:31:30Z", "mediaURL": "https://example.com/media/photo.jpg", "fileExtension": "jpg", "mediaType": "IMAGE", "latitude": "-26.2041", "longitude": "28.0473", "address": "123 Main St, Johannesburg", "label": "Head Office", "agent": { … }, "reaction": { … }, "whatsAppMessageId": "3EB09839C39C57F54A9EC5", "facebookMessageId": "m_AbCdEf123456", "quotedExternalMessageId": "3EB0123456789ABCDEF0", "quotedText": "Hi, is this about order #1234?" }