Messages
Refer to our message definition for more information.
#
ListPOST /messages.list
This is a paginated endpoint. Messages are sorted from oldest to latest.
Sample request
Sample response
#
SendPOST /messages.send
Sends a message to a conversation and returns a payload. Whatever is put on the
message
field will be forwarded "as-is" to the source's message endpoint. Therefore,
the payload will look differently for each source. Refer to each source's documentation
to see learn how to send text, media, and many more message types.
Sample request
Sample response (202)
Because of the nature of being an asynchronous system, sometimes the conversation is not ready at the time of
sending the message. The status code 202
indicates that this is the case and also does not include a response body.
In case the conversation was eventually not found error metadata will be delivered asynchronously using the
webhook and websocket.
Sample response (200) The conversation was found and the message is pending to be delivered.
#
ResendPOST /messages.resend
In case a message was failed to send ("state": "failed"
), this endpoint can be used to resend it.
Sample request
Sample response (409)
Sample response (200)
Message was marked as pending and will be retried by the responsible source.
#
Starting a conversationThe previous flow covers the use cases of most messaging sources. However, some sources such as SMS or Whatsapp also
allow you to send messages to contacts that did not previously message you first. This means that you can create new conversations with them if you know their source recipient id
.
Sample request
Sample response
#
Error handlingSince outbound messages are delegated to the source apps we don't implement synchronous error replies. Instead, errors are sent asynchronously as updates to the message's metadata. Those updates can be consumed with either the webhook or the websocket.
The message's state will also change to failed
. Both changes will be visible in the conversation and messages query endpoints.
Sample metadata websocket update
Sample message webhook update
#
Suggest repliesPOST /messages.suggest-replies
Suggest a set of replies for a given message ID. UI clients can then show these replies to agents to help them respond to user inquiries.
Sample request
Sample response
The updated message including the suggested replies.