Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Retrieve a ChatKit thread

client.beta.chatkit.threads.retrieve(stringthreadID, RequestOptionsoptions?): ChatKitThread { id, created_at, object, 3 more }
GET/chatkit/threads/{thread_id}

Retrieve a ChatKit thread by its identifier.

ParametersExpand Collapse
threadID: string
ReturnsExpand Collapse
ChatKitThread { id, created_at, object, 3 more }

Represents a ChatKit thread and its current status.

id: string

Identifier of the thread.

created_at: number

Unix timestamp (in seconds) for when the thread was created.

formatunixtime
object: "chatkit.thread"

Type discriminator that is always chatkit.thread.

status: Active { type } | Locked { reason, type } | Closed { reason, type }

Current status for the thread. Defaults to active for newly created threads.

title: string | null

Optional human-readable title for the thread. Defaults to null when no title has been generated.

user: string

Free-form string that identifies your end user who owns the thread.

Retrieve a ChatKit thread

import OpenAI from 'openai';

const client = new OpenAI();

const chatkitThread = await client.beta.chatkit.threads.retrieve('cthr_123');

console.log(chatkitThread.id);
{
  "id": "cthr_abc123",
  "object": "chatkit.thread",
  "title": "Customer escalation",
  "created_at": 1712345600,
  "status": {
    "type": "active"
  },
  "user": "user_123"
}
Returns Examples
{
  "id": "cthr_abc123",
  "object": "chatkit.thread",
  "title": "Customer escalation",
  "created_at": 1712345600,
  "status": {
    "type": "active"
  },
  "user": "user_123"
}