> ## 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.

# Get Thread

Retrieves thread details including metadata, agent info, and statistics.

<ParamField path="threadId" type="string" required>
  The unique thread identifier (UUID)
</ParamField>

### Response Structure

<ResponseField name="thread" type="object" required>
  Thread metadata object
</ResponseField>

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

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

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

<ResponseField name="thread.tags" type="array" required>
  Array of string tags for categorization
</ResponseField>

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

<ResponseField name="agent" type="object | null">
  Agent definition details (null if agent no longer exists)
</ResponseField>

<ResponseField name="agent.id" type="string">
  Agent identifier (same as `thread.agent_id`)
</ResponseField>

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

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

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

<ResponseField name="agent.icon" type="string">
  Full URL to agent icon (absolute paths are resolved to full URLs using the request origin)
</ResponseField>

<ResponseField name="stats" type="object" required>
  Thread statistics
</ResponseField>

<ResponseField name="stats.message_count" type="number">
  Total number of messages in the thread
</ResponseField>

<ResponseField name="stats.log_count" type="number">
  Total number of execution logs
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://your-worker.workers.dev/api/threads/550e8400-e29b-41d4-a716-446655440000
  ```

  ```typescript JavaScript theme={null}
  const response = await fetch(
    'https://your-worker.workers.dev/api/threads/550e8400-e29b-41d4-a716-446655440000'
  );
  const data = await response.json();
  ```
</RequestExample>

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

  ```json 404 theme={null}
  {
    "error": "Thread not found: 550e8400-e29b-41d4-a716-446655440000"
  }
  ```
</ResponseExample>
