Skip to main content
Two endpoints share the same paginated response shape and query parameters. Use the first to list every message in a session; use the second to scope to a single thread (for example, to poll the latest follow-up’s reply).
Results are sorted by created_at (newest first by default). Soft-deleted messages are excluded.

Request

Path parameters

string (uuid)
required
The session ID. Required for both URL forms.
string (uuid)
required
The thread ID. Required only on the threaded URL form. The thread must belong to session_id.

Query parameters

string[]
default:"[\"message\", \"final_message\"]"
Repeat to combine. Allowed values: message, final_message, tool_call. Pass type=final_message to fetch only completed assistant replies.
string
default:"assistant"
Filter by sender. One of user, assistant.
string (uuid)
Filter to a single thread without using the threaded URL form. Ignored on the threaded URL.
number
Cursor for incremental polling, in epoch seconds. Returns only messages whose ts is strictly greater than this value. Use _links.new_messages.href from the previous page to get a pre-built URL with this cursor already set.
number
default:"1"
1-indexed page number. Minimum 1.
number
default:"50"
Page size. Minimum 1, maximum 100.
string
default:"desc"
Sort direction. One of asc, desc.

Response

object[]
Page of messages.
object
Pagination metadata.
HATEOAS links for the page.

Polling tips

  • For the assistant’s first reply, use the _links.final_message.href returned from Create Session — it already has the right filters applied.
  • For incremental polling, use _links.new_messages.href from the previous response. It encodes the gts cursor so each poll only returns new messages.

Errors