Skip to main content
POST

Overview

Set the unread message count for a specified conversation, used for manually adjusting the unread status of conversations.

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)
unread
integer
required
Unread count to set

Response Fields

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

Status Codes

Use Cases

Manual Unread Management

Mark Conversation as Important:
Reset Unread Count:

Notification Management

Custom Notification Badges:

Batch Unread Operations

Batch Set Unread Counts:

Priority Management

Set Priority-based Unread Counts:

Sync and Recovery

Sync Unread Counts from External Source:

Testing and Development

Test Unread Scenarios:

Best Practices

  1. Validation: Validate unread count values (non-negative integers)
  2. UI Consistency: Ensure UI updates match the set unread count
  3. Error Handling: Handle API errors gracefully without breaking UI
  4. Performance: Batch operations when setting multiple unread counts
  5. User Experience: Use meaningful unread counts that help users prioritize
  6. Sync Strategy: Implement proper sync mechanisms for unread counts
  7. Testing: Test various unread count scenarios during development