Channel Management
Set Channel Blacklist
Set (replace) the entire blacklist for a channel
POST
Overview
Set (replace) the entire blacklist for a channel. This operation will first remove all existing blacklist entries and then add new ones. If UIDs is empty, the entire blacklist will be cleared.Request Body
Required Parameters
string
required
Channel ID, cannot be empty or contain special characters
integer
required
Channel type
1- Person channel2- Group channel
Optional Parameters
Response Fields
string
required
Operation status, returns
"ok" on successStatus Codes
Functionality
Set Operation
The set operation performs the following steps:- Clear Existing Blacklist: Remove all existing blacklist entries for the channel
- Add New Entries: Add the provided user ID list to the blacklist
- Delete Conversations: Automatically delete related conversations for blacklisted users
- Update Permissions: Take effect immediately, blacklisted users cannot send or receive messages
Clear Operation
Whenuids is an empty array:
- Clear all blacklist entries for the channel
- Restore normal permissions for all users
- Does not affect existing conversations
Blacklist Mechanism
Permission Restrictions
Blacklisted users are subject to the following restrictions:Special Cases
- Live Channels: Do not process conversation deletion
- Person Channels: Do not support blacklist operations
- System Users: May have special permissions, not affected by blacklist
Use Cases
Batch Management
Clear Blacklist
Reset Blacklist
Comparison with Other Blacklist Operations
Best Practices
- Use Carefully: Set operation clears all existing blacklist, ensure this is intended behavior
- Backup Existing Data: Get current blacklist before setting as backup
- Permission Verification: Ensure operator has sufficient management permissions
- Log Recording: Record blacklist changes for auditing
- Notification Mechanism: Consider notifying relevant administrators of blacklist changes
- Test Validation: Thoroughly test before using in production environment
Error Handling
Common Errors
Related APIs
- Add Channel Blacklist - Incrementally add blacklist users
- Remove Channel Blacklist - Remove specific blacklist users
- Add Channel Whitelist - Manage whitelist users

