Messages

The Messages API provides operations for retrieving, sending, searching, synchronizing, viewing message context, tracking seen state, deleting messages, and working with internal notes.

Message endpoints support both Visitor Session and Channel JWT authentication depending on the operation.

Endpoints

MethodPathPurpose
GET/conversations/:id/messagesGet Visitor-visible messages
GET/conversations/:id/messages/dashboardGet Agent workspace messages
GET/conversations/:id/messages/syncIncrementally synchronize messages
POST/conversations/:id/messagesSend a message
GET/conversations/:id/messages/searchSearch message text
GET/conversations/:id/messages/search-by-dateSearch by date
GET/conversations/:id/messages/search-combinedSearch by text and/or date
GET/conversations/:id/messages/:messageId/contextGet surrounding message context
GET/conversations/:id/messages/:messageId/seen-byGet users who viewed a message
DELETE/conversations/:id/messages/:messageIdDelete a message
POST/conversations/:id/email-submissionCapture Guest email
POST/conversations/:id/end-conversationEnd a chat
POST/internal-notesCreate an internal note
GET/internal-notesList internal notes

Message Retrieval

GET /conversations/:id/messages?limit=20&cursor=<CURSOR>

Supported thread parameters include:

threads

threadPageSize

limit

cursor

Send a Message

POST /conversations/:id/messages

The verified request fields include:

{

  “content”: “<MESSAGE_CONTENT>”,

  “mediaUrl”: “<MEDIA_URL>”,

  “parentId”: “<PARENT_MESSAGE_ID>”,

  “isInternalNote”: false,

  “clientMsgId”: “<CLIENT_MESSAGE_ID>”

}

Not every field is required for every request. The exact validation is defined by the current CreateMessageDto.

Incremental Synchronization

GET /conversations/:id/messages/sync?sinceId=<MESSAGE_ID>

Or:

GET /conversations/:id/messages/sync?since=<ISO_TIMESTAMP>

Message Status

The audit identifies:

PENDING

SENT

DELIVERED

SEEN

FAILED

Need Help?

Email: support@ysdesk.com

Documentation: https://docs.ysplugins.com/ys-desk

Next