Skip to main content
POST

Overview

Clear the unread message count for a specified conversation, resetting the unread count to 0.

Request Body

Required Parameters

uid
string
required
User ID
channel_id
string
required
Channel ID
channel_type
integer
required
Channel type
  • 1 - Personal channel
  • 2 - Group channel

Optional Parameters

message_seq
integer
Message sequence number, specifies up to which message to clear

Response Fields

status
string
required
Operation status, returns "ok" on success

Status Codes

Use Cases

Chat Interface Integration

Mark Messages as Read:
Mark Read Up to Specific Message:

Batch Operations

Clear Multiple Conversations:

Auto-Read Functionality

Auto-mark as Read on Focus:

Read Receipt Integration

Combine with Read Receipts:

Best Practices

  1. User Intent: Only clear unread when user actually views the messages
  2. Batch Operations: Use batch clearing for better performance when possible
  3. Error Handling: Handle network errors gracefully without affecting UI
  4. Real-time Updates: Combine with WebSocket events for real-time unread updates
  5. Offline Support: Queue clear operations when offline and sync when reconnected
  6. Performance: Avoid excessive API calls by debouncing clear operations
  7. User Experience: Provide visual feedback when clearing unread counts