POST
/
v2
/
threads
curl --request POST \
  --url https://api.langtail.com/v2/threads \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <x-api-key>' \
  --data '{
  "metadata": {
    "user_id": "user_123",
    "conversation_topic": "product_inquiry",
    "priority": "high"
  },
  "createLog": {}
}'
{
  "id": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "projectId": "<string>",
  "metadata": {},
  "deletedAt": "2023-11-07T05:31:56Z",
  "createLog": {}
}

This endpoint creates a new thread. It allows you to initialize a conversation thread, optionally providing metadata to associate with it.

Headers

X-API-Key
string
required

Your Langtail API Key

Example:

"<LANGTAIL_API_KEY>"

Body

application/json

Response

200
application/json
Successfully created thread

The response is of type object.