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.

Response

Returns an AiThread!

Arguments

Name Description
threadId - AiThreadId! The thread ID.

Example

Query

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

Variables

{"threadId": AiThreadId}

Response

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

Related operations

  • aiThread query: Retrieves one of the caller's AI chat threads with its messages.
  • aiThreadCreate 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 query: Lists the caller's AI chat threads in an organization that contain at least one message, most recently updated first.