DELETE
/
v2
/
threads
/
{threadId}
/
messages
/
{messageId}
cURL
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

Successfully deleted message

The response is of type object.