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

# Alias of DELETE /api/threads/{id}

> For an existing protected thread, send its x-widget-thread-token capability in addition to widget identity…

For an existing protected thread, send its `x-widget-thread-token` capability in addition to widget identity. Widget identity is verified when signing is configured; tokenless compatibility does not establish tenant ownership. See the authentication and recovery guide for credential and retry rules.

### Path parameters

**id** `string` *required*

Thread id (`thr_&lt;uuid>`).

### Headers

**x-widget-thread-token** `string`

Capability required for an existing thread that has an issued token. Legacy capability-less threads are denied when STATESET\_THREAD\_TOKEN\_REQUIRED=true.

### Response

`object`

**ok** `boolean` *required*

### Status codes

| Code | Meaning |
| - | - |
| `200` | Deletion outcome (`ok: false` when the id was unknown) |
| `401` | Widget token missing, malformed, expired, from the future, or badly signed |
| `403` | Thread capability missing/wrong, thread owner mismatch, or token identity mismatch |
| `429` | Too many requests for this IP (scoped by verified org/agent) |
| `500` | Unhandled error |

### Using this contract

Read the [source OpenAPI document](https://docs.stateset.com/spec/chat-widget.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

```bash cURL theme={null}
curl --silent --show-error --fail-with-body --request DELETE \
  --url 'https://api.example.com/api/response/threads/{id}' \
  --header 'x-widget-token: YOUR_API_KEY' \
  --header 'x-widget-thread-token: REPLACE_WITH_X_WIDGET_THREAD_TOKEN'
```

```json 200 theme={null}
{
  "ok": true
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.