Skip to content

sessions module route (requires sessions:run:read)

GET
/v1/m/sessions/runs/{ref}/messages
curl --request GET \
--url 'https://example.com/v1/m/sessions/runs/example/messages?role=user&order=asc&text=1' \
--header 'Authorization: Bearer <token>'

Lists, searches and anchors by time the messages of one Claude Code or Codex session, read from the transcript its tool keeps: the person’s own messages (the tool’s answers with role=all), each with its id, time and first line, in pages from either end, narrowed by a phrase or a start time; one message whole by id; read-only.

ref
required
string

Path parameter ref.

X-Olivares-Tenant
string format: uuid

Target tenant id; required when the principal can act in more than one tenant.

role
string
Allowed values: user all

User (default) lists what the person sent; all adds the tool’s answers.

order
string
Allowed values: asc desc

Asc (default) pages from the first message, desc from the newest. Items are always oldest first.

q
string
<= 256 characters

Keeps messages with this phrase anywhere in them, case-insensitive.

at
string format: date-time

Keeps messages at or after this time.

limit
integer
>= 1

Page size; default 50, at most 200.

cursor
integer

The id a page continues from: next of the previous page.

id
integer
>= 1

Reads one message whole, with text and later_same; the filters do not apply.

text
string
Allowed values: 1

1: every item of the page carries its whole text, bounded at 64 KiB per message as a read by id is, and the page holds at most 50 messages; later_same is not added.

OK

Media type application/json
object
Example generated
{}

Bad request

Media type application/json
object
Example generated
{}

Unauthenticated

Media type application/json
object
Example generated
{}

Forbidden

Media type application/json
object
Example generated
{}

Not found

Media type application/json
object
Example generated
{}

Conflict / setup required

Media type application/json
object
Example generated
{}

Rate limited

Media type application/json
object
Example generated
{}