Retrieves all messages in a thread.
The unique thread identifier (UUID)
Maximum number of messages to return
Return messages before this message ID (for pagination)
Return messages after this message ID (for pagination)
Include silent messages (used for lifecycle/status/subagent communication)
Whether more messages exist beyond the current page
Message Object
Unique message identifier
Message role: "system", "user", "assistant", or "tool"
Message content (null for tool calls without text)
Display name (e.g., agent label for assistant messages)
JSON string of tool calls made by assistant
ID linking tool result to its call (for tool role messages)
Unix timestamp in milliseconds
Message status: "pending", "completed", or "failed"
Nesting depth for sub-prompt messages (0 for top-level)
Array of file attachments. Each attachment object:
id (string): Unique attachment identifier
type (string): Always "file"
path (string): File path in thread storage (e.g., /attachments/123-abc.jpg)
name (string): Original filename
mimeType (string): MIME type
width (number): Image width (images only)
height (number): Image height (images only)
Subagent reference UUID associated with this message (when present)
Projected child agent name from parent registry
messages[].subagent_title
Projected child agent title from parent registry
messages[].subagent_status
Projected child runtime status (e.g. running, idle, terminated, or custom)
Message metadata. Runtime lifecycle markers may appear here (for example status_kind).
curl "https://your-worker.workers.dev/api/threads/550e8400-e29b-41d4-a716-446655440000/messages?limit=50"
{
"messages": [
{
"id": "msg_001",
"role": "user",
"content": "Here's a photo of the damaged item",
"created_at": 1699900000000,
"status": "completed",
"attachments": [
{
"id": "att_abc123",
"type": "file",
"path": "/attachments/1699900000-abc123.jpg",
"name": "damaged-item.jpg",
"mimeType": "image/jpeg",
"width": 2048,
"height": 1536
}
]
},
{
"id": "msg_002",
"role": "assistant",
"content": "I can see the damage in your photo. I'll process a replacement for you.",
"created_at": 1699900001000,
"status": "completed",
"name": "Support Agent"
}
],
"hasMore": false
}