Skip to main content

List Messages

Get messages in a conversation thread.

GET /api/v1/threads/:id/messages

Required Scope: threads:read

Request

Path Parameters

ParameterTypeDescription
idstringThread ID

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number
per_pagenumber20Items per page (max 100)

Example

curl "https://api.flowmaestro.io/api/v1/threads/thread_xyz789/messages" \
-H "X-API-Key: fm_live_your_api_key"

Response

{
"data": [
{
"id": "msg_001",
"role": "user",
"content": "What is my order status?",
"created_at": "2024-01-15T10:30:00.000Z"
},
{
"id": "msg_002",
"role": "assistant",
"content": "I'd be happy to help! Could you provide your order number?",
"tool_calls": null,
"created_at": "2024-01-15T10:30:02.000Z"
},
{
"id": "msg_003",
"role": "user",
"content": "Order #12345",
"created_at": "2024-01-15T10:30:15.000Z"
},
{
"id": "msg_004",
"role": "assistant",
"content": "Your order #12345 is currently being shipped...",
"tool_calls": [
{
"id": "call_001",
"name": "search_orders",
"arguments": { "order_id": "12345" }
}
],
"created_at": "2024-01-15T10:30:18.000Z"
}
],
"pagination": {
"page": 1,
"per_page": 20,
"total_count": 4,
"total_pages": 1,
"has_next": false,
"has_prev": false
},
"meta": {
"request_id": "...",
"timestamp": "..."
}
}

Message Roles

RoleDescription
userMessage from the user
assistantResponse from the AI agent
systemSystem message

Errors

StatusCodeDescription
404resource_not_foundThread not found