Skip to main content
POST
/
api
/
threads
curl -X POST https://your-worker.workers.dev/api/threads \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "support_agent",
    "user_id": "user_abc123",
    "tags": ["support", "web"]
  }'
{
  "threadId": "550e8400-e29b-41d4-a716-446655440000",
  "agent_id": "support_agent",
  "message": "Thread created successfully"
}
Creates a new conversation thread with the specified agent.
agent_id
string
required
The name of the agent to use for this thread. Must match an agent defined in agents/agents/.
user_id
string
Optional user identifier for tracking and authorization.
tags
array
Optional array of string tags for categorizing and filtering threads.
threadId
string
required
Unique thread identifier (UUID)
agent_id
string
required
The agent name associated with this thread
message
string
required
Confirmation message
curl -X POST https://your-worker.workers.dev/api/threads \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "support_agent",
    "user_id": "user_abc123",
    "tags": ["support", "web"]
  }'
{
  "threadId": "550e8400-e29b-41d4-a716-446655440000",
  "agent_id": "support_agent",
  "message": "Thread created successfully"
}