Skip to main content
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
Permanent Deletion: This action cannot be undone. All messages in the thread will be permanently deleted.

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

Delete threads when users log out or close sessions to protect privacy:
Don’t block user actions if thread deletion fails:
For reliable cleanup on page unload, use navigator.sendBeacon():
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.
The auto-deletion system:
  • 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

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