Delete Thread langbase.threads.delete()

You can use the threads.delete() function to remove threads that are no longer needed. This helps you manage your conversation history and clean up unused threads.


Generate a User/Org API key

You will need to generate an API key to authenticate your requests. For more information, visit the User/Org API key documentation.


API reference

langbase.threads.delete(options)

Delete a thread by its ID.

Function Signature

langbase.threads.delete(options);

// with types
langbase.threads.delete(options: DeleteThreadOptions);

options

  • Name
    options
    Type
    DeleteThreadOptions
    Description

    DeleteThreadOptions Object

    interface DeleteThreadOptions {
    	threadId: string;
    }
    

Delete Example

const result = await langbase.threads.delete({
	threadId: "thread_123"
});

Response

The response of the langbase.threads.delete() function is a JSON object with the following structure:

DeleteResponse

interface DeleteResponse {
	success: boolean;
}

The response will contain a success property indicating whether the thread was successfully deleted.

Response Example

{
	"success": true
}