Skip to main content
POST
/
channel
/
blacklist_remove
curl -X POST "http://localhost:5001/channel/blacklist_remove" \
  -H "Content-Type: application/json" \
  -d '{
    "channel_id": "group123",
    "channel_type": 2,
    "uids": ["user1", "user2"]
  }'
{
  "status": "ok"
}

Overview

Remove specific users from channel blacklist. Removed users will regain normal permissions and can send and receive channel messages again. Related conversations will be restored if applicable.

Request Body

Required Parameters

channel_id
string
required
Channel ID, cannot be empty or contain special characters
channel_type
integer
required
Channel type
  • 1 - Person channel
  • 2 - Group channel
uids
array
required
List of user IDs to remove from blacklist
uids[]
string
User ID
curl -X POST "http://localhost:5001/channel/blacklist_remove" \
  -H "Content-Type: application/json" \
  -d '{
    "channel_id": "group123",
    "channel_type": 2,
    "uids": ["user1", "user2"]
  }'
{
  "status": "ok"
}

Response Fields

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

Status Codes

Status CodeDescription
200Users removed from blacklist successfully
400Request parameter error
403No management permission
404Channel does not exist
500Internal server error

Functionality

Remove Operation

The remove operation performs the following steps:
  1. Verify Users: Check if specified users are in the blacklist
  2. Remove Entries: Delete specified users from channel blacklist
  3. Restore Permissions: Users regain ability to send and receive messages
  4. Restore Conversations: Restore user’s related conversations if applicable

Permission Restoration

Removed users will regain:
PermissionDescriptionEffective Time
Send MessagesCan send messages to the channelImmediately
Receive MessagesCan receive channel messagesImmediately
Conversation AccessRestore channel conversations (if applicable)Immediately
Normal InteractionRestore all normal channel interaction permissionsImmediately

Special Cases

Live Channels

  • No Conversation Restoration: Live channels do not automatically restore conversations
  • Permissions Take Effect Immediately: Users can still immediately regain send and receive permissions

Person Channels

  • Blacklist Not Supported: Person channels do not support blacklist operations
  • Returns Error: Attempting operations will return corresponding error messages

Use Cases

Lift Mistaken Ban

# Remove users mistakenly added to blacklist
curl -X POST "/channel/blacklist_remove" -d '{
  "channel_id": "group123",
  "channel_type": 2,
  "uids": ["innocent_user"]
}'

Batch Restoration

# Batch remove multiple users
curl -X POST "/channel/blacklist_remove" -d '{
  "channel_id": "group123",
  "channel_type": 2,
  "uids": ["user1", "user2", "user3"]
}'

Temporary Unban

# Temporarily lift user restrictions
curl -X POST "/channel/blacklist_remove" -d '{
  "channel_id": "group123",
  "channel_type": 2,
  "uids": ["temp_banned_user"]
}'

Best Practices

  1. Permission Verification: Ensure operator has sufficient management permissions
  2. Operation Recording: Record all blacklist change operations
  3. Notification Mechanism: Notify relevant administrators and users
  4. Progressive Unbanning: For serious violators, consider progressive permission restoration
  5. Monitoring Mechanism: Continue monitoring user behavior after removal
  6. Backup Strategy: Backup current blacklist state before bulk operations

Error Handling

Common Errors

Error MessageCauseSolution
Channel ID cannot be emptyNo channel ID providedEnsure valid channel ID is provided
Channel type cannot be 0Invalid channel typeUse valid channel type (1 or 2)
uids cannot be emptyNo user list providedProvide list of user IDs to remove
Remove blacklist failedRemove operation failedCheck if users are in blacklist
Add conversation failedConversation restoration failedCheck conversation system status