Read an agent session's messages
get_agent_session_history_messagesRead a page of an agent session's messages, a whole number of complete turns at a time, oldest first. Pass exactly one of before_sequence_id or after_sequence_id.
Instructions
Read a page of an agent session's messages, a whole number of complete turns at a time, oldest first. Pass exactly one of before_sequence_id or after_sequence_id. Every message carries a sequenceId of the form <unix-milliseconds>-<counter>, and sequence IDs order as strings. So before_sequence_id set to the current time in milliseconds reads the latest turns, and after_sequence_id=0 reads from the start of the session. Page back with nextBeforeSequenceId while hasPreviousPage is true, and forward with nextAfterSequenceId while hasNextPage is true. A turn still in progress is left out until it completes. Returns 404 for a session the caller cannot see, and 403 for one whose agent the caller cannot view. A session started by a user in the Orchestra UI is visible to that user alone, so an API key never sees one. Sessions started for a task run or an incident are visible to everyone in the workspace who can view the agent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | Agent session ID. | |
| turn_limit | No | Number of turns per page. Defaults to 3; maximum 10. | |
| after_sequence_id | No | Return the turns that start after this sequence ID, i.e. page forward in time. Cannot be combined with `before_sequence_id`. | |
| before_sequence_id | No | Return the turns that end before this sequence ID, i.e. page back in time. Cannot be combined with `after_sequence_id`. | |
| X-Orchestra-Account-Id | No | Act on this account rather than the one the credential resolves to. Omit it to use the credential's own account. An API key is issued to a single account, so it may only name that account; an OAuth token may name any account its grant covers. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||