List Run Messages

GET
/v1/runs/:run_id/messages

Get messages associated with a run with filtering options.

Args: run_id: ID of the run before: A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. after: A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. limit: Maximum number of messages to return order: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. 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

beforestringOptional

Cursor for pagination

afterstringOptional

Cursor for pagination

limitintegerOptional

Maximum number of messages to return

orderstringOptionalDefaults to desc

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

roleenumOptional

Filter by role

Allowed values: assistantusertoolfunctionsystem

Response

Successful Response

System Messageobject or null
OR
User Messageobject or null
OR
Reasoning Messageobject or null
OR
Tool Call Messageobject or null
OR
Tool Return Messageobject or null
OR
Assistant Messageobject or null

Errors

Built with