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()

Function Signature

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

options

  • Name
    options
    Type
    DeleteThreadOptions
    Description

    DeleteThreadOptions Object

    threadId: string;

threadId

  • Name
    threadId
    Type
    string
    Required
    Required
    Description

    The ID of the thread.

Usage example

Install the SDK

npm i langbase

Environment variables

Environment variables

LANGBASE_API_KEY="<USER/ORG-API-KEY>"

Delete a thread

Delete a thread on Langbase

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

Response

  • Name
    DeleteResponse
    Type
    object
    Description

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

    DeleteResponse

    success: boolean;

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

DeleteResponse type of langbase.threads.delete()

{ "success": true }