List Messages

Retrieve the message history for a channel. Messages are returned in chronological order. Use cursor-based pagination for large histories.

Overview

The message list includes all messages sent and received in a channel, across all sessions. Filter by session_id to retrieve messages for a specific conversation. Filter by role to retrieve only user messages or only assistant messages.

Pagination

Results are paginated using a cursor. The response includes a next_cursor field when there are more results. Pass this value as the cursor query parameter in the next request. An absent or null next_cursor indicates the last page.

Message Shape

Each message includes:

  • id — stable message identifier
  • session_id — the session this message belongs to
  • roleuser or assistant
  • content — the message text
  • created_at — ISO 8601 timestamp
  • tokens — token count for cost attribution (assistant messages only)

Endpoints

GET/v1/channels/{channel_id}/messagesBeta

List messages in a channel

Retrieve the message history for a channel. Results are paginated using a cursor. Filter by session_id or role.

Parameters

NameTypeInRequiredDescription
channel_idstringpathYesThe unique identifier of the channel.
session_idstringqueryNoFilter messages to a specific session.
rolestringqueryNoFilter by role: user or assistant.
cursorstringqueryNoPagination cursor from a previous response.
limitintegerqueryNoNumber of results to return (default 20, max 100).

Response

{
  "messages": [
    {
      "id": "msg_01hxyz",
      "session_id": "ses_01hxyz",
      "role": "user",
      "content": "string",
      "created_at": "2026-03-19T12:00:00Z"
    }
  ],
  "next_cursor": "cur_01hxyz",
  "has_more": true
}