Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Theme

Delete message

DELETE
/threads/{thread_id}/messages/{message_id}

Deletes a message.

Delete message

curl -X DELETE https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "OpenAI-Beta: assistants=v2"
Response example
{
  "id": "msg_abc123",
  "object": "thread.message.deleted",
  "deleted": true
}
Path Parameters
thread_id: string

The ID of the thread to which this message belongs.

message_id: string

The ID of the message to delete.

Returns
MessageDeleted object { id, deleted, object }
id: string
deleted: boolean
object: "thread.message.deleted"
Returns Examples
Response example
{
  "id": "msg_abc123",
  "object": "thread.message.deleted",
  "deleted": true
}