# Delete thread div strong 🔨 In Development — This section is still being developed and may change. Permanently delete a thread and all associated messages. This operation cannot be undone. Permanently delete a thread and all associated messages. This operation cannot be undone. The thread and all its messages will be permanently removed from the system. #### Path Parameters **`thread_id`** string required The unique identifier of the thread to delete. Request ```bash curl -X DELETE "https://api.freddy.aitronos.com/v1/threads/thread_abc123" \ -H "Authorization: Bearer $FREDDY_API_KEY" ``` ```python import requests response = requests.delete( "https://api.freddy.aitronos.com/v1/threads/thread_abc123", headers={"Authorization": f"Bearer {api_key}"} ) if response.status_code == 200: print("Thread deleted successfully") else: print(f"Error: {response.json()}") ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/threads/thread_abc123', { method: 'DELETE', headers: { 'Authorization': `Bearer ${apiKey}` } }); if (response.ok) { console.log('Thread deleted successfully'); } else { const error = await response.json(); console.error('Error:', error); } ``` ## Response 200 OK ```json { "success": true, "threadId": "thread_abc123", "message": "Thread and all messages deleted successfully" } ``` Errors ```json 404 Not Found { "error": { "message": "Thread not found or access denied", "type": "not_found_error", "code": "thread_not_found" } } ``` ```json 401 Unauthorized { "error": { "message": "Authentication required", "type": "authentication_error", "code": "missing_authentication" } } ``` ```json 403 Forbidden { "error": { "message": "Access denied to thread", "type": "permission_error", "code": "insufficient_permissions" } } ``` ## Related Resources - [Threads Overview](/docs/documentation/core-concepts/threads-overview) - [List Threads](/docs/api-reference/threads/list) - [Create Thread](/docs/api-reference/threads/create) - [Thread Context Modes](/docs/documentation/core-concepts/thread-context-modes)