Skip to content

Messages

GET /api/messages

Terminal window
GET /api/messages?task_id=task_abc&limit=50
ParamRequiredDescription
task_idThe task to retrieve messages for
limitNumber of messages (default: 50, max: 200)
beforeCursor for pagination
include_tool_callsInclude tool calls inline (default: false)

Response:

{
"messages": [
{
"message_id": "msg_001",
"role": "user",
"content": "Review the open GitHub issues",
"created_at": "2025-04-01T09:00:00Z"
},
{
"message_id": "msg_002",
"role": "assistant",
"content": "I found 5 open issues. Here's the summary...",
"created_at": "2025-04-01T09:00:45Z",
"run_id": "run_xyz",
"credits_used": 6
}
],
"has_more": false
}

Message roles

RoleDescription
userMessage from the user
assistantResponse from the agent
toolTool call result (visible when include_tool_calls=true)