POST /v2/threads/{threadId}/messages

Create a new message in a thread.

Request

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

Path parameters

threadIdstring required

The ID of the thread.

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 message.

Example request

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

Response

Successful response

idstring required

The unique identifier for the message.

createdAtstring date-time required

The timestamp when the message was created.

threadIdstring required

The ID of the thread this message belongs to.

metadataobject nullable

A key-value store for additional metadata associated with the message.

requestLogIdstring nullable

The unique identifier for the request log, if available.

Example response

{
  "content": [
    {
      "role": "user",
      "content": "Hello"
    }
  ]
}

Changes

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