Get Run Messages

GET
/v1/runs/:run_id/messages

Get messages associated with a run with filtering options.

Args: run_id: ID of the run cursor: Cursor for pagination limit: Maximum number of messages to return ascending: Sort order by creation time role: Filter by role (user/assistant/system/tool) return_message_object: Whether to return Message objects or LettaMessage objects user_id: ID of the user making the request

Returns: A list of messages associated with the run. Default is List[LettaMessage].

Path parameters

run_idstringRequired

Query parameters

cursorstringOptional

Cursor for pagination

limitintegerOptional

Maximum number of messages to return

ascendingbooleanOptionalDefaults to true

Sort order by creation time

roleenumOptional

Filter by role

Allowed values: assistantusertoolfunctionsystem

Response

Successful Response

System Message

A message generated by the system. Never streamed back on a response, only used for cursor pagination.

Attributes: message (str): The message sent by the system id (str): The ID of the message date (datetime): The date the message was created in ISO format

OR
User Message

A message sent by the user. Never streamed back on a response, only used for cursor pagination.

Attributes: message (str): The message sent by the user id (str): The ID of the message date (datetime): The date the message was created in ISO format

OR
Reasoning Message

Representation of an agent’s internal reasoning.

Attributes: reasoning (str): The internal reasoning of the agent id (str): The ID of the message date (datetime): The date the message was created in ISO format

OR
Tool Call Message

A message representing a request to call a tool (generated by the LLM to trigger tool execution).

Attributes: tool_call (Union[ToolCall, ToolCallDelta]): The tool call id (str): The ID of the message date (datetime): The date the message was created in ISO format

OR
Tool Return Message

A message representing the return value of a tool call (generated by Letta executing the requested tool).

Attributes: tool_return (str): The return value of the tool status (Literal[“success”, “error”]): The status of the tool call id (str): The ID of the message date (datetime): The date the message was created in ISO format tool_call_id (str): A unique identifier for the tool call that generated this message stdout (Optional[List(str)]): Captured stdout (e.g. prints, logs) from the tool invocation stderr (Optional[List(str)]): Captured stderr from the tool invocation

OR
Assistant Message

Errors

Built with