Set DND for a channel
Set the Do Not Disturb (DND) notification level for a specific channel for a given user. Supports direct, group, community, and system channels. The SDK receives the updated DND status in real time.
tip
- This is a user-level setting.
- For community channels, you can also set a default DND level for all members at the community or subchannel level. See Set community channel DND.
Request
POST: https://[Base URL](/platform-chat-api/base-url)/v4/channel/push/set
Rate limit: 100 requests per second
Authentication: All server API requests require signature verification. See API request signing.
Request body
Content type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
channelType | String | Yes | Channel type. 1: direct. 3: group. 6: system. 10: community. |
requestId | String | Yes | User ID to configure DND for. |
channelId | String | Yes | Target channel ID (user ID, group ID, or community ID depending on channelType). |
isMuted | Number | Yes | DND status. 0: off. 1: on. Deprecated — use notificationLevel instead. If both are provided, notificationLevel takes precedence. |
subchannelId | String | No | Community subchannel ID. If provided, DND is set for the specified subchannel. |
notificationLevel | Number | Yes | Notification level:
|
Request example
HTTP
POST /v4/channel/push/set HTTP/1.1
Host: api.sg-light-api.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408710653491
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/json
{
"channelType": 1,
"requestId": "b5NwvIrW8",
"channelId": "UAhIaLkR0",
"notificationLevel": 0
}
Response
| Property | Type | Description |
|---|---|---|
code | Number | Status code. 0 indicates success. |
Response example
HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{"code":0}