Skip to content

Send Limits ​

The project owner can limit how many realtime messages and notifications one user of the project sends in a minute. This keeps a single user from flooding others with messages or push notifications.

Setting the Limits ​

Open your project in the Skapi dashboard and go to the Users page. The Realtime Limits card above the user list has two settings:

SettingWhat it countsEmpty0
Messages per UserRealtime messages one user sends in a minute with postRealtime, to other users or to a group.No limit (the default)Users cannot send realtime messages.
Notifications per UserNotifications one user sends in a minute with their postRealtime messages.No limit (the default)Users cannot send notifications. Their messages still go.

Click [Edit], enter a whole number, or leave it empty for no limit, and save. A change reaches every connection within a minute.

The Skapi MCP server can set them too, with setProjectSettings (realtime_message_limit, realtime_notification_limit; null for no limit).

The limits are checked on the server, so they apply to every SDK version.

Who Is Limited ​

Only users of the project. Admins (access group 90 to 99) and the project owner are never limited, so an admin can still reach everyone when users are set to 0.

How Messages Are Counted ​

  • Each message counts once, whether it goes to a user or to a group.
  • Messages skapi-kotlin sends together to a busy group still count one by one.
  • A notification counts only when it is sent. Without "always" to true, a notification is sent only when the recipient is not connected, so a message to a connected user uses no notification.
  • The count starts over every minute.

What the Sender Sees ​

postRealtime still returns Message sent. when the message leaves your app. The server checks the limit, and a refusal reaches the sender's connectRealtime callback as an "error" event:

CasemessageWhat happens
Over the message limitLimit reached: a user can send 30 realtime messages a minute.The message is not delivered.
Messages set to 0This project does not allow users to send realtime messages.The message is not delivered.
Over the notification limitLimit reached: a user can send 5 notifications a minute. The notification was not sent.The message is delivered, without its notification.
Notifications set to 0This project does not allow users to send notifications. The notification was not sent.The message is delivered, without its notification.
kotlin
skapi.connectRealtime { rt ->
    if (rt["type"]?.jsonPrimitive?.contentOrNull == "error") {
        // e.g. "Limit reached: a user can send 30 realtime messages a minute."
        showWarning(rt["message"]?.jsonPrimitive?.contentOrNull)
        return@connectRealtime
    }
    // ...
}
java
skapi.connectRealtime(rt -> {
    if ("error".equals(rt.get("type"))) {
        // e.g. "Limit reached: a user can send 30 realtime messages a minute."
        showWarning((String) rt.get("message"));
        return;
    }
    // ...
}).get();

An "error" event also comes when the connection drops (Skapi: WebSocket unexpected close.), so tell them apart by the message.

Telling Users Apart ​

The receiver can tell an admin's message from a user's with sender_type, which the server sets. See Trusting the Sender.

skapi-kotlin 2.7.0