POST /v2/threads

Create a new thread. This endpoint allows you to initialize a conversation thread, optionally providing metadata or an initial log.

Request

  • Base URL
    https://api.langtail.com
  • Auth
    none declared. Required headers: X-API-Key

Headers

X-API-Keystring required
Example:<LANGTAIL_API_KEY>

Your Langtail API Key

Request body

metadataobject

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.

createLogobject

A log object that can be passed to create an initial log for the thread.

Example request

{
  "metadata": {
    "user_id": "user_123",
    "conversation_topic": "product_inquiry",
    "priority": "high"
  }
}

Response

Successfully created thread

idstring required

The unique identifier for the created thread.

createdAtstring date-time required

The timestamp when the thread was created.

projectIdstring required

The ID of the project this thread belongs to.

metadataobject nullable

The metadata associated with the thread, if provided.

deletedAtstring date-time nullable

The timestamp when the thread was deleted, if applicable.

createLogobject nullable

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

Changes

No recorded changes to this operation across all 1 revision of this API.