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

# Fetch a thread with its messages

> Return { thread, messages }. Exclude this route from rate limiting — the widget polls it to refresh.

Return `&#123; thread, messages &#125;`. Exclude this route from rate limiting — the widget polls it to refresh.

### Path parameters

<ParamField path="id" type="string" required>
  Thread id
</ParamField>

### Response

`ThreadWithMessages`

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

<ResponseField name="messages" type="Message[]" required>
  <Expandable title="Message">
    <ResponseField name="id" type="string" />

    <ResponseField name="sender" type="string" />

    <ResponseField name="text" type="string" />

    <ResponseField name="timestamp" type="string (date-time)" />
  </Expandable>
</ResponseField>

### Status codes

| Code  | Meaning |
| ----- | ------- |
| `200` | OK      |
| `400` | Error   |
| `401` | Error   |

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.example.com/api/threads/{id}' \
    --header 'x-widget-token: YOUR_API_KEY'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "thread": {},
    "messages": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "sender": "string",
        "text": "Two-person tent, green — replacement for damaged pole set.",
        "timestamp": "2026-08-31T14:22:05Z"
      }
    ]
  }
  ```
</ResponseExample>
