Skip to content
Primary navigation

Delete ChatKit thread

client.Beta.ChatKit.Threads.Delete(ctx, threadID) (*BetaChatKitThreadDeleteResponse, error)
DELETE/chatkit/threads/{thread_id}

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

ParametersExpand Collapse
threadID string
ReturnsExpand Collapse
type BetaChatKitThreadDeleteResponse struct{…}

Confirmation payload returned after deleting a thread.

ID string

Identifier of the deleted thread.

Deleted bool

Indicates that the thread has been deleted.

Object ChatKitThreadDeleted

Type discriminator that is always chatkit.thread.deleted.

Delete ChatKit thread

package main

import (
  "context"
  "fmt"

  "github.com/openai/openai-go"
)

func main() {
  client := openai.NewClient()
  thread, err := client.Beta.ChatKit.Threads.Delete(context.TODO(), "cthr_123")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", thread.ID)
}
{
  "id": "id",
  "deleted": true,
  "object": "chatkit.thread.deleted"
}
Returns Examples
{
  "id": "id",
  "deleted": true,
  "object": "chatkit.thread.deleted"
}