Skip to main content

Send a system channel message

Send a system channel message from a specified user to one or more recipients. System channel messages can only be sent via the server API. Recipients cannot reply to system channel messages.

  • Supports built-in and custom message types.
  • Send to up to 100 users per request.
  • The message type determines push behavior, client display, and local storage.

For example, sending a text message (RC:TxtMsg):

  • Online recipients receive the message immediately in a system channel (channel type: SYSTEM) with the sender ID as the channel target.
  • Offline recipients receive a push notification (if push is integrated and enabled).

Request

POST: https://[Base URL](/platform-chat-api/base-url)/v4/system-channel/message/send

Rate limit: 100 messages per second. Sending to 100 users in one request counts as 100 messages.

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

Request body

Content type: application/json

ParameterTypeRequiredDescription
fromUserIdStringYesSender user ID. Must have obtained an access token.
toUserIdsString[]YesRecipient user IDs. Max 100 per request.
messageTypeStringYesMessage type. Accepts a built-in message type or custom type. Custom types must not start with RC: and must not exceed 32 characters.
contentStringYesMessage content, max 128 KB. For built-in types, pass the content JSON serialized as a string. For custom types, any format is accepted.
pushContentStringNoPush notification content for offline recipients. Required for notification/signal types and custom types that need push.
pushDataStringNoCustom data in the push payload. Accessible as appData on iOS and Android.
shouldPersistNumberNoWhether to store in cloud message history. 0: no. 1 (default): yes. Requires Direct and Group Channel Cloud Message Storage.
contentAvailableNumberNoiOS only. Enables silent push. 1: enable. 0 (default): disable.
disablePushBooleanNoSuppress push notifications. Default: false.
pushExtStringNoPush configuration (title, template, provider channels). See pushExt parameters. Ignored when disablePush is true.
disableUpdateLastMsgBooleanNoWhether to prevent updating the last message in the channel list.

Request example

HTTP
POST /v4/system-channel/message/send HTTP/1.1
Host: api.sg-light-api.com
App-Key: uwd1c0sxdlx2
Timestamp: 1585127132438
Nonce: 14314
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/json

{
"fromUserId": "2191",
"toUserIds": ["2191", "2192"],
"messageType": "RC:TxtMsg",
"content": "{\"content\":\"hello\"}",
"pushContent": "thisisapush",
"pushData": "hello"
}

Response

PropertyTypeDescription
codeNumberStatus code. 0 indicates success. See Server API status codes.
resultObjectResponse data.
result.messageUIDsArrayList of message UIDs.
result.messageUIDs[i].userIdStringRecipient user ID.
result.messageUIDs[i].messageUIDStringUnique message ID for the corresponding recipient.

Response example

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

{
"code": 0,
"result": {
"messageUIDs": [
{
"userId": "uid1",
"messageUID": "XXXX-JJJJ-KKK-LLLL"
},
{
"userId": "uid2",
"messageUID": "XXXX-JJJJ-KKK-LLKL"
}
]
}
}