> ## Documentation Index
> Fetch the complete documentation index at: https://docs.standardagentbuilder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Threads

Lists all threads, optionally filtered by agent or user.

<ParamField query="agent_id" type="string">
  Filter threads by agent name
</ParamField>

<ParamField query="user_id" type="string">
  Filter threads by user identifier
</ParamField>

<ParamField query="limit" type="number" default="50">
  Maximum number of threads to return (1-100)
</ParamField>

<ParamField query="offset" type="number" default="0">
  Number of threads to skip for pagination
</ParamField>

<ResponseField name="threads" type="array" required>
  Array of thread objects
</ResponseField>

<ResponseField name="total" type="number" required>
  Total number of threads matching the filter
</ResponseField>

<ResponseField name="hasMore" type="boolean" required>
  Whether more threads exist beyond the current page
</ResponseField>

### Thread Object

<ResponseField name="threads[].id" type="string" required>
  Unique thread identifier
</ResponseField>

<ResponseField name="threads[].agent_id" type="string" required>
  The agent name associated with this thread
</ResponseField>

<ResponseField name="threads[].user_id" type="string | null">
  User identifier if set
</ResponseField>

<ResponseField name="threads[].tags" type="array" required>
  Array of string tags
</ResponseField>

<ResponseField name="threads[].created_at" type="number" required>
  Unix timestamp in seconds
</ResponseField>

<ResponseField name="threads[].agent" type="object">
  Agent details including title, type, description, and icon
</ResponseField>

<ResponseField name="threads[].agent.title" type="string">
  Human-readable agent title
</ResponseField>

<ResponseField name="threads[].agent.type" type="string">
  Agent type: `ai_human` or `dual_ai`
</ResponseField>

<ResponseField name="threads[].agent.description" type="string">
  Agent description if set
</ResponseField>

<ResponseField name="threads[].agent.icon" type="string">
  Full URL to agent icon (absolute paths are resolved to full URLs)
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://your-worker.workers.dev/api/threads?user_id=user_abc123&limit=20"
  ```

  ```typescript JavaScript theme={null}
  const response = await fetch(
    'https://your-worker.workers.dev/api/threads?user_id=user_abc123&limit=20'
  );
  const result = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "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
  }
  ```
</ResponseExample>
