Creates a new conversation thread with the specified agent.
The name of the agent to use for this thread. Must match an agent defined in agents/agents/.
Optional user identifier for tracking and authorization.
Optional metadata object to store with the thread.
Unique thread identifier (UUID)
The agent name associated with this thread
Unix timestamp in milliseconds
curl -X POST https://your-worker.workers.dev/api/threads \
-H "Content-Type: application/json" \
-d '{
"agentName": "support_agent",
"userId": "user_abc123",
"metadata": {
"source": "web"
}
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"agentName": "support_agent",
"created_at": 1699900000000,
"metadata": {
"source": "web"
}
}