---
title: aiThreadClear query | Wartiva GraphQL API
description: Removes every message from one of the caller's AI chat threads and returns the now-empty thread. The thread itself is kept; delete it with aiThreadDelete.
url: https://wartiva.com/api-docs/queries/ai-thread-clear.html
updated: 2026-10-07
---

AI · GraphQL query

# `aiThreadClear` query

Removes every message from one of the caller's AI chat threads and returns the now-empty thread. The thread itself is kept; delete it with [aiThreadDelete](https://wartiva.com/api-docs/queries/ai-thread-delete.html).

## Response

Returns an [`AiThread!`](https://wartiva.com/api-docs/types/ai-thread.html)

## Arguments

| Name | Description |
|---|---|
| `threadId` - [`AiThreadId!`](https://wartiva.com/api-docs/types/ai-thread-id.html) | The thread ID. |

## Example

### Query

```graphql
query aiThreadClear($threadId: AiThreadId!) {
  aiThreadClear(threadId: $threadId) {
    id
    name
    threadType
    objectId
    entries {
      timestamp
      isFromUser
      message
    }
    timestamp
  }
}

```

### Variables

```json
{"threadId": AiThreadId}

```

### Response

```json
{
  "data": {
    "aiThreadClear": {
      "id": AiThreadId,
      "name": "abc123",
      "threadType": "GENERAL",
      "objectId": "xyz789",
      "entries": [AiThreadEntry],
      "timestamp": "2021-10-07T18:23:25.829Z"
    }
  }
}

```

## Related operations

- [`aiThread`](https://wartiva.com/api-docs/queries/ai-thread.html) query: Retrieves one of the caller's AI chat threads with its messages.
- [`aiThreadCreate`](https://wartiva.com/api-docs/queries/ai-thread-create.html) query: Creates an AI chat thread of the requested type, or returns the existing one: a thread id is derived from the user, organization, thread type,…
- [`aiThreads`](https://wartiva.com/api-docs/queries/ai-threads.html) query: Lists the caller's AI chat threads in an organization that contain at least one message, most recently updated first.

---

Wartiva is in early access. Request access: https://wartiva.com/early-access.html  
All pages: https://wartiva.com/llms.txt
