Skip to main content
GET
/
api
/
threads
curl "https://your-worker.workers.dev/api/threads?user_id=user_abc123&limit=20"
{
  "threads": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "agent_id": "support_agent",
      "user_id": "user_abc123",
      "tags": ["support", "web"],
      "created_at": 1699900000,
      "agent": {
        "title": "Support Agent",
        "type": "ai_human",
        "description": "Handles customer inquiries and resolves support issues",
        "icon": "https://your-worker.workers.dev/icons/support.svg"
      }
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "agent_id": "support_agent",
      "user_id": null,
      "tags": [],
      "created_at": 1699800000,
      "agent": {
        "title": "Support Agent",
        "type": "ai_human",
        "description": "Handles customer inquiries and resolves support issues",
        "icon": "https://your-worker.workers.dev/icons/support.svg"
      }
    }
  ],
  "total": 2,
  "hasMore": false
}
Lists all threads, optionally filtered by agent or user.
agent_id
string
Filter threads by agent name
user_id
string
Filter threads by user identifier
limit
number
default:"50"
Maximum number of threads to return (1-100)
offset
number
default:"0"
Number of threads to skip for pagination
threads
array
required
Array of thread objects
total
number
required
Total number of threads matching the filter
hasMore
boolean
required
Whether more threads exist beyond the current page

Thread Object

threads[].id
string
required
Unique thread identifier
threads[].agent_id
string
required
The agent name associated with this thread
threads[].user_id
string | null
User identifier if set
threads[].tags
array
required
Array of string tags
threads[].created_at
number
required
Unix timestamp in seconds
threads[].agent
object
Agent details including title, type, description, and icon
threads[].agent.title
string
Human-readable agent title
threads[].agent.type
string
Agent type: ai_human or dual_ai
threads[].agent.description
string
Agent description if set
threads[].agent.icon
string
Full URL to agent icon (absolute paths are resolved to full URLs)
curl "https://your-worker.workers.dev/api/threads?user_id=user_abc123&limit=20"
{
  "threads": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "agent_id": "support_agent",
      "user_id": "user_abc123",
      "tags": ["support", "web"],
      "created_at": 1699900000,
      "agent": {
        "title": "Support Agent",
        "type": "ai_human",
        "description": "Handles customer inquiries and resolves support issues",
        "icon": "https://your-worker.workers.dev/icons/support.svg"
      }
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "agent_id": "support_agent",
      "user_id": null,
      "tags": [],
      "created_at": 1699800000,
      "agent": {
        "title": "Support Agent",
        "type": "ai_human",
        "description": "Handles customer inquiries and resolves support issues",
        "icon": "https://your-worker.workers.dev/icons/support.svg"
      }
    }
  ],
  "total": 2,
  "hasMore": false
}