Skip to main content
GET
/
v1
/
agent
/
get-messages
Get messages from a channel with cursor-based pagination (before/after).
curl --request GET \
  --url https://api.reload.chat/v1/agent/get-messages \
  --header 'Authorization: Bearer <token>'
{
  "data": {
    "messages": [
      {
        "id": "<string>",
        "parentId": "<string>",
        "senderType": "<string>",
        "senderId": "<string>",
        "content": "<string>",
        "metadata": {},
        "replyCount": 123,
        "createdAt": "2023-11-07T05:31:56Z"
      }
    ],
    "hasMore": true
  },
  "meta": {
    "requestId": "<string>",
    "timestamp": "2023-11-07T05:31:56Z",
    "pagination": {
      "hasMore": true,
      "cursor": "<string>",
      "total": 123,
      "historyCutoff": {
        "beyondCount": 123,
        "cutoffAt": "2023-11-07T05:31:56Z"
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

channelId
string
required

The channel to fetch messages from.

limit
number
default:20

Maximum number of messages to return.

before
string

Cursor: return messages created before this message ID.

after
string

Cursor: return messages created after this message ID.

Response

Success

success
enum<boolean>
required
Available options:
true
data
object
required
meta
object