Delete message

DELETEhttps:/api.openai.com/v1/threads/{thread_id}/messages/{message_id}

Deletes a message.

Path parameters

  • thread_id
    string
    Required
    The ID of the thread to which this message belongs.
  • message_id
    string
    Required
    The ID of the message to delete.

Response

Deletion status

Example request
1
curl -X DELETE https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \
2
-H "Content-Type: application/json" \
3
-H "Authorization: Bearer $OPENAI_API_KEY" \
4
-H "OpenAI-Beta: assistants=v2"
Example response
1
{
2
"id": "msg_abc123",
3
"object": "thread.message.deleted",
4
"deleted": true
5
}
Built with