Skip to main content
GET
/
api
/
threads
/
{threadId}
curl https://your-worker.workers.dev/api/threads/550e8400-e29b-41d4-a716-446655440000
{
  "thread": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "agent_id": "support_agent",
    "user_id": "user_abc123",
    "tags": ["support", "priority"],
    "created_at": 1699900000
  },
  "agent": {
    "id": "support_agent",
    "title": "Support Agent",
    "type": "ai_human",
    "description": "Handles customer inquiries and resolves support issues",
    "icon": "https://your-worker.workers.dev/icons/support.svg",
    "side_a_label": "Customer",
    "side_b_label": "Agent"
  },
  "stats": {
    "message_count": 12,
    "log_count": 3
  }
}
Retrieves thread details including metadata, agent info, and statistics.
threadId
string
required
The unique thread identifier (UUID)

Response Structure

thread
object
required
Thread metadata object
thread.id
string
required
Unique thread identifier
thread.agent_id
string
required
The agent name associated with this thread
thread.user_id
string | null
User identifier if set
thread.tags
array
required
Array of string tags for categorization
thread.created_at
number
required
Unix timestamp in seconds
agent
object | null
Agent definition details (null if agent no longer exists)
agent.id
string
Agent identifier (same as thread.agent_id)
agent.title
string
Human-readable agent title
agent.type
string
Agent type: ai_human or dual_ai
agent.description
string
Agent description if set
agent.icon
string
Full URL to agent icon (absolute paths are resolved to full URLs using the request origin)
stats
object
required
Thread statistics
stats.message_count
number
Total number of messages in the thread
stats.log_count
number
Total number of execution logs
curl https://your-worker.workers.dev/api/threads/550e8400-e29b-41d4-a716-446655440000
{
  "thread": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "agent_id": "support_agent",
    "user_id": "user_abc123",
    "tags": ["support", "priority"],
    "created_at": 1699900000
  },
  "agent": {
    "id": "support_agent",
    "title": "Support Agent",
    "type": "ai_human",
    "description": "Handles customer inquiries and resolves support issues",
    "icon": "https://your-worker.workers.dev/icons/support.svg",
    "side_a_label": "Customer",
    "side_b_label": "Agent"
  },
  "stats": {
    "message_count": 12,
    "log_count": 3
  }
}