curl -X POST "http://localhost:5001/channel/blacklist_remove" \
-H "Content-Type: application/json" \
-d '{
"channel_id": "group123",
"channel_type": 2,
"uids": ["user1", "user2"]
}'
const response = await fetch('http://localhost:5001/channel/blacklist_remove', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
channel_id: 'group123',
channel_type: 2,
uids: ['user1', 'user2']
})
});
const data = await response.json();
console.log(data);
import requests
data = {
"channel_id": "group123",
"channel_type": 2,
"uids": ["user1", "user2"]
}
response = requests.post('http://localhost:5001/channel/blacklist_remove', json=data)
result = response.json()
print(result)
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
data := map[string]interface{}{
"channel_id": "group123",
"channel_type": 2,
"uids": []string{"user1", "user2"},
}
jsonData, _ := json.Marshal(data)
resp, err := http.Post(
"http://localhost:5001/channel/blacklist_remove",
"application/json",
bytes.NewBuffer(jsonData),
)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("%+v\n", result)
}
{
"status": "ok"
}
Channel Management
Remove Channel Blacklist
Remove specific users from channel blacklist
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"]
}'
const response = await fetch('http://localhost:5001/channel/blacklist_remove', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
channel_id: 'group123',
channel_type: 2,
uids: ['user1', 'user2']
})
});
const data = await response.json();
console.log(data);
import requests
data = {
"channel_id": "group123",
"channel_type": 2,
"uids": ["user1", "user2"]
}
response = requests.post('http://localhost:5001/channel/blacklist_remove', json=data)
result = response.json()
print(result)
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
data := map[string]interface{}{
"channel_id": "group123",
"channel_type": 2,
"uids": []string{"user1", "user2"},
}
jsonData, _ := json.Marshal(data)
resp, err := http.Post(
"http://localhost:5001/channel/blacklist_remove",
"application/json",
bytes.NewBuffer(jsonData),
)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("%+v\n", result)
}
{
"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
string
required
Channel ID, cannot be empty or contain special characters
integer
required
Channel type
1- Person channel2- Group channel
curl -X POST "http://localhost:5001/channel/blacklist_remove" \
-H "Content-Type: application/json" \
-d '{
"channel_id": "group123",
"channel_type": 2,
"uids": ["user1", "user2"]
}'
const response = await fetch('http://localhost:5001/channel/blacklist_remove', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
channel_id: 'group123',
channel_type: 2,
uids: ['user1', 'user2']
})
});
const data = await response.json();
console.log(data);
import requests
data = {
"channel_id": "group123",
"channel_type": 2,
"uids": ["user1", "user2"]
}
response = requests.post('http://localhost:5001/channel/blacklist_remove', json=data)
result = response.json()
print(result)
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
data := map[string]interface{}{
"channel_id": "group123",
"channel_type": 2,
"uids": []string{"user1", "user2"},
}
jsonData, _ := json.Marshal(data)
resp, err := http.Post(
"http://localhost:5001/channel/blacklist_remove",
"application/json",
bytes.NewBuffer(jsonData),
)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("%+v\n", result)
}
{
"status": "ok"
}
Response Fields
string
required
Operation status, returns
"ok" on successStatus Codes
| Status Code | Description |
|---|---|
| 200 | Users removed from blacklist successfully |
| 400 | Request parameter error |
| 403 | No management permission |
| 404 | Channel does not exist |
| 500 | Internal server error |
Functionality
Remove Operation
The remove operation performs the following steps:- Verify Users: Check if specified users are in the blacklist
- Remove Entries: Delete specified users from channel blacklist
- Restore Permissions: Users regain ability to send and receive messages
- Restore Conversations: Restore user’s related conversations if applicable
Permission Restoration
Removed users will regain:| Permission | Description | Effective Time |
|---|---|---|
| Send Messages | Can send messages to the channel | Immediately |
| Receive Messages | Can receive channel messages | Immediately |
| Conversation Access | Restore channel conversations (if applicable) | Immediately |
| Normal Interaction | Restore all normal channel interaction permissions | Immediately |
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
- Permission Verification: Ensure operator has sufficient management permissions
- Operation Recording: Record all blacklist change operations
- Notification Mechanism: Notify relevant administrators and users
- Progressive Unbanning: For serious violators, consider progressive permission restoration
- Monitoring Mechanism: Continue monitoring user behavior after removal
- Backup Strategy: Backup current blacklist state before bulk operations
Error Handling
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| Channel ID cannot be empty | No channel ID provided | Ensure valid channel ID is provided |
| Channel type cannot be 0 | Invalid channel type | Use valid channel type (1 or 2) |
| uids cannot be empty | No user list provided | Provide list of user IDs to remove |
| Remove blacklist failed | Remove operation failed | Check if users are in blacklist |
| Add conversation failed | Conversation restoration failed | Check conversation system status |
Related APIs
- Add Channel Blacklist - Add users to blacklist
- Set Channel Blacklist - Set complete blacklist
- Add Channel Whitelist - Manage whitelist users
- Remove Channel Whitelist - Remove whitelist users

