Skip to main content

Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

Set user quiet hours

Set a user's Do Not Disturb quiet hours and notification level.

  • This creates a recurring daily time window. The quiet hours repeat daily until updated or deleted. For example, to set all-day DND, set startTime to 00:00:00 and period to 1439.
  • Each user supports only one quiet hours window. Setting new quiet hours overwrites the previous configuration.

Request

POST: https://[Base URL](/platform-chat-api/base-url)/user/blockPushPeriod/set.json

Rate limit: 100 requests per second

Authentication: All server API requests require signature verification. See API request signing.

Request body

Content type: application/x-www-form-urlencoded

ParameterTypeRequiredDescription
userIdStringYesUser ID.
startTimeStringYesStart time in HH:MM:SS format (e.g., 22:00:00). UTC.
periodNumberYesDuration of the quiet hours window in minutes. Range: 1–1439. 0 means not set.
levelNumberYesDND level. 1: notify only for @ messages. 5: suppress all notifications.
timezoneStringNoTime zone (e.g., Asia/Shanghai or UTC). Defaults to the data center's time zone.

Request example

HTTP
POST /user/blockPushPeriod/set.json HTTP/1.1
Host: api.sg-light-api.com
App-Key: uwd1c0soslx2
Nonce: 14314
Timestamp: 1408710653491
Signature: 45beb7as7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/x-www-form-urlencoded

userId=userId&startTime=23:59:59&period=120&level=1

Response

PropertyTypeDescription
codeNumberStatus code. 200 indicates success.

Response example

HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{"code":200}