# Delete message div strong 🔨 In Development — This section is still being developed and may change. Delete a specific message from a thread. NEW endpoint for selective message removal with proper authorization. Delete a specific message from a thread. This is a new endpoint that provides selective message removal capabilities with proper authorization and audit trails. #### Path Parameters **`thread_id`** string required The unique identifier of the thread containing the message. **`message_id`** string required The unique identifier of the message to delete. Request ```bash curl -X DELETE "https://api.freddy.aitronos.com/v1/threads/thread_abc123/messages/msg_abc123" \ -H "Authorization: Bearer $FREDDY_API_KEY" ``` ```python import requests response = requests.delete( "https://api.freddy.aitronos.com/v1/threads/thread_abc123/messages/msg_abc123", headers={"Authorization": f"Bearer {api_key}"} ) if response.status_code == 200: print("Message deleted successfully") else: print(f"Error: {response.json()}") ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/threads/thread_abc123/messages/msg_abc123', { method: 'DELETE', headers: { 'Authorization': `Bearer ${apiKey}` } }); if (response.ok) { console.log('Message deleted successfully'); } else { const error = await response.json(); console.error('Error:', error); } ``` ## Response 200 OK ```json { "success": true, "threadId": "thread_abc123", "message": "Thread messages deleted successfully" } ``` Errors ```json 404 Not Found { "error": { "message": "Message not found or access denied", "type": "not_found_error", "code": "message_not_found" } } ``` ```json 401 Unauthorized { "error": { "message": "Authentication required", "type": "authentication_error", "code": "missing_authentication" } } ``` ```json 403 Forbidden { "error": { "message": "Access denied to message", "type": "permission_error", "code": "insufficient_permissions" } } ``` ## Related Resources - [Threads Overview](/docs/documentation/core-concepts/threads-overview) - [Get Thread Messages](/docs/api-reference/threads/messages) - [Update Message](/docs/api-reference/threads/update-message) - [Thread Context Modes](/docs/documentation/core-concepts/thread-context-modes)