Conversation Management
Delete Conversation
Delete a specified user’s conversation record
POST
Overview
Delete a specified user’s conversation record, clearing conversation history and status.Request Body
Required Parameters
User ID
Channel ID
Channel type (1=personal channel, 2=group channel)
Response Fields
Operation status, returns
"success" on successStatus Codes
| Status Code | Description |
|---|---|
| 200 | Conversation deleted successfully |
| 400 | Request parameter error |
| 403 | No deletion permission |
| 500 | Internal server error |
Deletion Impact
What Gets Deleted
When a conversation is deleted, the following data is removed:| Data Type | Scope | Impact |
|---|---|---|
| Conversation Record | User’s conversation list entry | Conversation disappears from chat list |
| Unread Count | User’s unread message count | Unread badge removed |
| Last Message Info | Last message and timestamp | No preview in conversation list |
| User Preferences | Conversation-specific settings | Notification settings reset |
What Remains Unchanged
- Channel Messages: Actual messages in the channel remain intact
- Other Users: Other users’ conversations with the same channel are unaffected
- Channel Membership: User remains a member of the channel
- Message History: User can still access messages by rejoining the conversation
Use Cases
Chat List Management
Remove Conversation from Chat List:Privacy and Data Management
User Privacy Control:Batch Operations
Batch Delete Conversations:Archive and Restore
Archive Conversation (Soft Delete):Administrative Operations
Admin Conversation Management:Important Notes
Message Preservation: Deleting a conversation does not delete the actual messages in the channel. Other users can still see all messages, and the user can still access message history through other means.
Best Practices
- User Confirmation: Always confirm with users before deleting conversations
- Soft Delete Option: Consider implementing archive functionality instead of permanent deletion
- Batch Operations: Use batch operations for better performance when deleting multiple conversations
- Error Handling: Handle deletion errors gracefully without breaking the UI
- Logging: Log conversation deletions for audit and support purposes
- UI Updates: Immediately update the UI to reflect conversation removal
- Data Backup: Consider backing up conversation metadata before deletion

