Skip to main content
POST
/
v2
/
threads
/
{threadId}
/
messages
/
{messageId}
cURL
curl --request POST \
  --url https://api.langtail.com/v2/threads/{threadId}/messages/{messageId} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <x-api-key>' \
  --data '{
  "metadata": {
    "my_key": "my key value"
  }
}'
{
  "id": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "deletedAt": "2023-11-07T05:31:56Z",
  "threadId": "<string>",
  "content": [
    {
      "role": "user",
      "content": "Hello"
    }
  ],
  "metadata": {
    "my_key": "my key value"
  },
  "requestLogId": "<string>"
}
This endpoint allows you to update the metadata of a specific message within a thread. It’s useful for adding or modifying additional information associated with a message without changing its core content.

Headers

X-API-Key
string
required

Your Langtail API Key

Example:

"<LANGTAIL_API_KEY>"

Path Parameters

threadId
string
required

The ID of the thread containing the message.

messageId
string
required

The ID of the message to update.

Body

application/json
metadata
object
required

Set of key-value pairs that you can attach to the message. This can be useful for storing additional information about the message in a structured format.

Example:
{ "my_key": "my key value" }

Response

Successful response

id
string
required

The unique identifier for the message.

createdAt
string<date-time>
required

The timestamp when the message was created.

threadId
string
required

The ID of the thread this message belongs to.

metadata
object | null
required

A set of key-value pairs that can be attached to the message.

Example:
{ "my_key": "my key value" }
deletedAt
string<date-time> | null

The timestamp when the message was deleted.

content
object[]

Additional messages. These will be appended to the Prompt Template.

Example:
[{ "role": "user", "content": "Hello" }]
requestLogId
string | null

The ID of the associated request log, if available.

I