POST
/
v2
/
threads
/
{threadId}
curl --request POST \
  --url https://api.langtail.com/v2/threads/{threadId} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <x-api-key>' \
  --data '{
  "metadata": {
    "user_id": "user_123",
    "conversation_topic": "product_inquiry",
    "priority": "high"
  }
}'
{
  "id": "<string>",
  "createdAt": 123,
  "projectId": "<string>",
  "createLog": {
    "id": "<string>",
    "url": "<string>",
    "stream": true,
    "metadata": "<string>",
    "promptId": "<string>",
    "threadId": "<string>",
    "assistant": true,
    "projectId": "<string>",
    "requestIP": "<string>",
    "startedAt": "2023-11-07T05:31:56Z",
    "variables": "<string>",
    "parameters": "<string>",
    "promptSlug": "<string>",
    "doNotRecord": true,
    "environment": "<string>",
    "openAIKeyId": "<string>",
    "projectSlug": "<string>",
    "requestData": "<string>",
    "deploymentId": "<string>",
    "organizationId": "<string>",
    "projectAPIKeyId": "<string>",
    "organizationSlug": "<string>",
    "deploymentVersion": "<string>",
    "promptHistoryHash": "<string>",
    "openAIOrganization": "<string>"
  },
  "metadata": {
    "user_id": "user_123",
    "conversation_topic": "product_inquiry",
    "priority": "high"
  }
}

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

Example:

"<LANGTAIL_API_KEY>"

Path Parameters

threadId
string
required

The ID of the thread to update.

Body

application/json

Response

200
application/json
Successfully updated thread

The response is of type object.