Delete Thread
Conversation Threads
Delete Thread
Manually end and delete a conversation thread
DELETE
Delete Thread
Overview
Manually deletes a conversation thread before its automatic 30-minute expiration. Use this to:- End conversations when users log out
- Clean up threads when a session ends
- Protect privacy by removing conversation history
- Free up server resources
Authentication
string
required
Your Cura API key
Path Parameters
string
required
The 5-digit thread ID to delete (e.g.,
82451)Request Example
Response
boolean
Whether the deletion was successful
string
Confirmation message
Success Response (200)
Error Responses
When to Delete Threads
User Logs Out
Delete threads when users end their session for privacy
Conversation Complete
Clean up when the conversation naturally concludes
Starting Fresh
Delete old thread before creating a new one for the same user
Error Recovery
Remove problematic threads to start clean
Common Use Cases
1. Delete on Logout
2. Delete on Browser Close
3. Auto-Delete After Success
4. Replace Expired Thread
Best Practices
Always clean up on logout
Always clean up on logout
Delete threads when users log out or close sessions to protect privacy:
Handle deletion failures gracefully
Handle deletion failures gracefully
Don’t block user actions if thread deletion fails:
Use sendBeacon for browser close
Use sendBeacon for browser close
For reliable cleanup on page unload, use
navigator.sendBeacon():Track deletion in analytics
Track deletion in analytics
Monitor how users are ending conversations:
Automatic Deletion
Reminder: Threads automatically delete after 30 minutes of inactivity. You don’t need to manually delete every thread - this endpoint is for when you want to end a conversation early.
- Runs every 10 minutes on the server
- Deletes threads inactive for 30+ minutes
- Resets the timer every time a message is sent
- Permanently removes all conversation data
Related Endpoints
Create Thread
Start a new conversation
Get Thread
Check thread status
Chat
Send messages to a thread
Next Steps
Conversation Threads Guide
Learn about thread lifecycle and management
Best Practices
Tips for production applications

