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

# Update a thread

> Update a thread

### Path parameters

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

### Request body

`ThreadPatch`

<ParamField body="status" type="string">
  e.g. `closed`
</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 PATCH \
    --url 'https://api.example.com/api/threads/{id}' \
    --header 'x-widget-token: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "status": "pending"
  }'
  ```
</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>
