Skip to content
Primary navigation

Delete ChatKit thread

client.beta.chatkit.threads.delete(stringthreadID, RequestOptionsoptions?): ThreadDeleteResponse { id, deleted, object }
DELETE/chatkit/threads/{thread_id}

Delete a ChatKit thread along with its items and stored attachments.

ParametersExpand Collapse
threadID: string
ReturnsExpand Collapse
ThreadDeleteResponse { id, deleted, object }

Confirmation payload returned after deleting a thread.

id: string

Identifier of the deleted thread.

deleted: boolean

Indicates that the thread has been deleted.

object: "chatkit.thread.deleted"

Type discriminator that is always chatkit.thread.deleted.

Delete ChatKit thread

import OpenAI from 'openai';

const client = new OpenAI();

const thread = await client.beta.chat_kit.threads.delete('cthr_123');

console.log(thread.id);
{
  "id": "id",
  "deleted": true,
  "object": "chatkit.thread.deleted"
}
Returns Examples
{
  "id": "id",
  "deleted": true,
  "object": "chatkit.thread.deleted"
}