POST
/
v2
/
threads
/
{threadId}

This endpoint allows you to update the metadata of a thread by its unique identifier. Metadata is a key-value storage system that developers can use to store useful information associated with a thread.

Metadata Usage

Metadata can be used to store various types of information related to the thread, such as:

  • User information (e.g., user ID, name, preferences)
  • Conversation context (e.g., topic, category, priority)
  • Custom flags or tags
  • Timestamps for specific events
  • Any other relevant data for your application

Headers

X-API-Key
string
required

Your Langtail API Key

Path Parameters

threadId
string
required

The ID of the thread to update.

Body

application/json
metadata
object
required

A set of key-value pairs that can be attached to the thread. This can be used to store additional information about the thread to facilitate filtering or organization. Note that the new metadata provided will completely overwrite any existing metadata for the thread.

Response

200 - application/json
id
string
required

The unique identifier for the thread.

createdAt
integer
required

The Unix timestamp (in seconds) of when the thread was created.

projectId
string
required

The ID of the project this thread belongs to.

metadata
object
required

The updated set of key-value pairs attached to the thread.

createLog
object | null

A log created by the first message that creates the thread.