DELETE
/
v2
/
threads
/
{threadId}
/
messages
/
{messageId}
curl --request DELETE \
  --url https://api.langtail.com/v2/threads/{threadId}/messages/{messageId} \
  --header 'X-API-Key: <x-api-key>'
{
  "id": "<string>",
  "object": "thread.message.deleted",
  "deleted": true
}

This endpoint allows you to delete specific message within a thread.

It’s useful if your thread gets too large for LLM’s context.

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

Response

200
application/json
Successfully deleted message
id
string
required

The unique identifier of the deleted message.

object
string
required

The object type, which is always 'thread.message.deleted' for this response.

Example:

"thread.message.deleted"

deleted
boolean
required

Indicates that the message was successfully deleted.

Example:

true