Skip to main content

Create Thread

Create a new conversation thread for an agent. Threads maintain conversation history across multiple messages.

POST /api/v1/agents/:id/threads

Required Scopes: agents:read, threads:write

Request

Path Parameters

ParameterTypeDescription
idstringAgent ID

Example

curl -X POST "https://api.flowmaestro.io/api/v1/agents/agent_abc123/threads" \
-H "X-API-Key: fm_live_your_api_key"

Response

Status: 201 Created

{
"data": {
"id": "thread_xyz789",
"agent_id": "agent_abc123",
"status": "active",
"created_at": "2024-01-15T10:30:00.000Z"
},
"meta": {
"request_id": "...",
"timestamp": "..."
}
}

Next Steps

After creating a thread, use the Threads API to send messages and receive responses.

Errors

StatusCodeDescription
404resource_not_foundAgent not found