POST
/
v2
/
threads
/
{threadId}
/
messages

Use this endpoint to add a message to a thread without calling the LLM.

In most cases, you should use the Invoke Assistant API to add messages and get a response from the LLM. However, this endpoint is useful when you need to add messages without immediate LLM processing, such as for creating placeholder messages or updating thread content separately.

Headers

X-API-Key
string
required

Your Langtail API Key

Path Parameters

threadId
string
required

The ID of the thread.

Body

application/json
message
object
required

Message that will be added to the thread.

metadata
object

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

Response

200 - application/json
id
string
required

The unique identifier for the message.

createdAt
string
required

The timestamp when the message was created.

threadId
string
required

The ID of the thread this message belongs to.

content
object[]

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

metadata
object | null

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

requestLog
object | null

Information about the request log, if available.

requestLogId
string | null

The unique identifier for the request log, if available.