Channel Management
Set Channel Whitelist
Set (replace) the entire whitelist for a channel
POST
Overview
Set (replace) the entire whitelist for a channel. This operation will first remove all existing whitelist entries and then add new ones. If UIDs is empty, the entire whitelist 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 Whitelist: Remove all existing whitelist entries for the channel
- Add New Entries: Add the provided user ID list to the whitelist
- Update Permissions: Take effect immediately, only whitelisted users can send messages (if whitelist mode is enabled)
- Conversation Management: Automatically create related conversations for person channels
Clear Operation
Whenuids is an empty array:
- Clear all whitelist entries for the channel
- Restore normal permissions for all users
- Disable whitelist mode
Whitelist Mechanism
Permission Features
Whitelisted users enjoy the following privileges:Whitelist Mode
- When Enabled: Only whitelisted users can send messages
- When Disabled: Whitelist does not affect message sending permissions
- Person Channels: Whitelisted users automatically create conversations
Use Cases
Batch Management
Clear Whitelist
Reset Whitelist
Comparison with Other Whitelist Operations
Permission Hierarchy
Whitelist position in the permission system:Conflict Handling
Best Practices
- Use Carefully: Set operation clears all existing whitelist, ensure this is intended behavior
- Backup Existing Data: Get current whitelist before setting as backup
- Permission Verification: Ensure operator has sufficient management permissions
- Progressive Management: For large channels, consider progressive whitelist management
- Monitor Effects: Monitor channel activity and user feedback after setting
- Document Records: Record whitelist change reasons and expected effects
Error Handling
Common Errors
Related APIs
- Add Channel Whitelist - Incrementally add whitelist users
- Remove Channel Whitelist - Remove specific whitelist users
- Get Channel Whitelist - Get current whitelist
- Set Channel Blacklist - Manage blacklist users

