Permanently delete a message and every message that follows it in the conversation. This action cannot be undone.
Deletion is cascading. The target message and all messages after it are removed to keep the conversation context consistent. Use this carefully — there is no way to recover deleted messages.
Bearer token obtained from the authenticate endpoint.
Unique identifier of the chat containing the message.
Unique identifier of the message to delete.
Response
Returns 204 No Content on success — no response body.
curl -X DELETE "https://api.trellis.sh/v1/chats/chat_abc123/messages/msg_xyz789" \
-H "Authorization: Bearer YOUR_TOKEN"
import requests
response = requests.delete(
"https://api.trellis.sh/v1/chats/chat_abc123/messages/msg_xyz789",
headers={"Authorization": "Bearer YOUR_TOKEN"}
)
# 204 No Content on success
assert response.status_code == 204
const response = await fetch(
"https://api.trellis.sh/v1/chats/chat_abc123/messages/msg_xyz789",
{
method: "DELETE",
headers: { Authorization: "Bearer YOUR_TOKEN" },
}
);
// 204 No Content on success
{
"detail": "Message not found"
}
{
"detail": "Access denied"
}