Skip to main content
GET
/
api
/
threads
curl "https://your-worker.workers.dev/api/threads?userId=user_abc123&limit=20"
{
  "threads": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "agentName": "support_agent",
      "created_at": 1699900000000,
      "metadata": {
        "title": "Support Conversation"
      }
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "agentName": "support_agent",
      "created_at": 1699800000000,
      "metadata": {}
    }
  ],
  "total": 2,
  "hasMore": false
}
Lists all threads, optionally filtered by user.
userId
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
curl "https://your-worker.workers.dev/api/threads?userId=user_abc123&limit=20"
{
  "threads": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "agentName": "support_agent",
      "created_at": 1699900000000,
      "metadata": {
        "title": "Support Conversation"
      }
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "agentName": "support_agent",
      "created_at": 1699800000000,
      "metadata": {}
    }
  ],
  "total": 2,
  "hasMore": false
}