Ban a participant
Ban one or more participants from a specific open channel.
- If the user is currently in the open channel, they are immediately removed.
- Banned users cannot rejoin the open channel during the ban period.
Request
POST: https://[Base URL](/platform-chat-api/base-url)/v4/open-channel/participant/ban-list/add
Rate limit: 100 per second
Signature: Required. See API request signature.
Request body
Content type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
participantIds | Array | Yes | User IDs to ban. Maximum 20 per request. |
channelId | String | Yes | The open channel ID. |
durationMinutes | Number | Yes | Ban duration in minutes. Maximum: 43,200 (30 days). |
extra | String | No | JSON-formatted extra data included in the notification. Only effective when needNotify is true. |
needNotify | Boolean | No | Whether to notify participants. Default: false. When true, the client SDK triggers a callback. Notification is sent to all participants, including the banned users. |
Request example
HTTP
POST /v4/open-channel/participant/ban-list/add HTTP/1.1
Host: api.sg-light-api.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408710653491
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/json
{
"channelId": "16",
"participantIds": ["2583", "2582"],
"durationMinutes": 1
}
Response
| Field | Type | Description |
|---|---|---|
code | Number | Return code. 0 indicates success. |
Response example
HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{"code":0}