List ChatKit threads
client.beta.chatkit.threads.list(ThreadListParams { after, before, limit, 2 more } query ?, RequestOptionsoptions ?): ConversationCursorPage<ChatKitThread { id, created_at, object, 3 more } >
GET
/chatkit/threadsList ChatKit threads
import OpenAI from 'openai';
const client = new OpenAI();
// Automatically fetches more pages as needed.
for await (const chatkitThread of client.beta.chatkit.threads.list()) {
console.log(chatkitThread.id);
}
Response example
{
"data": [
{
"id": "cthr_abc123",
"object": "chatkit.thread",
"title": "Customer escalation",
"created_at": 1712345600,
"status": {
"type": "active"
},
"user": "user_123"
},
{
"id": "cthr_def456",
"object": "chatkit.thread",
"title": "Demo feedback",
"created_at": 1712345600,
"status": {
"type": "active"
},
"user": "user_456"
}
],
"has_more": false,
"object": "list",
"first_id": "cthr_abc123",
"last_id": "cthr_def456"
}
Returns Examples
Response example
{
"data": [
{
"id": "cthr_abc123",
"object": "chatkit.thread",
"title": "Customer escalation",
"created_at": 1712345600,
"status": {
"type": "active"
},
"user": "user_123"
},
{
"id": "cthr_def456",
"object": "chatkit.thread",
"title": "Demo feedback",
"created_at": 1712345600,
"status": {
"type": "active"
},
"user": "user_456"
}
],
"has_more": false,
"object": "list",
"first_id": "cthr_abc123",
"last_id": "cthr_def456"
}