Retrieves one of the caller's AI chat threads with its messages. A thread id that has no stored thread yet returns the thread's welcome messages instead of an error. Long threads are trimmed to their most recent entries. A thread owned by another user returns an access-denied error.
Response
Returns an AiThread!
Arguments
| Name | Description |
|---|---|
threadId - AiThreadId!
|
The thread ID. |
Example
Query
query aiThread($threadId: AiThreadId!) {
aiThread(threadId: $threadId) {
id
name
threadType
objectId
entries {
timestamp
isFromUser
message
}
timestamp
}
}
Variables
{"threadId": AiThreadId}
Response
{
"data": {
"aiThread": {
"id": AiThreadId,
"name": "abc123",
"threadType": "GENERAL",
"objectId": "abc123",
"entries": [AiThreadEntry],
"timestamp": "2021-10-07T18:23:25.829Z"
}
}
}
Related operations
aiThreadClearquery: Removes every message from one of the caller's AI chat threads and returns the now-empty thread.aiThreadCreatequery: 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,…aiThreadsquery: Lists the caller's AI chat threads in an organization that contain at least one message, most recently updated first.