PubNub API Limits
General API limits
All API requests, made either by the SDK or directly through the REST interface, can be throttled if Requests Per Second (RPS) exceed 25. This limit applies to every PubNub API. Contact PubNub Support if you need more than 25 requests per second.
These global limits apply alongside the feature‑specific limits below.
Keysets
Account Tier | Soft Limit | Hard Limit | If hard limited is exceeded? |
---|---|---|---|
Free | 3 | 3 | You can't exceed the limit. Limit of 3 keysets for Free tier accountsEffective February 3, 2025, all Free tier accounts will be limited to a maximum of three keysets. If your account exceeds this limit, you must delete existing keysets to create new ones. |
Starter | unlimited | unlimited | n/a |
Pro | unlimited | unlimited | n/a |
Publish
Function | Soft Limit (Best Practices) | Hard Limit | If hard limited is exceeded |
---|---|---|---|
Publish Rate |
| No throttling for keys in good standing (paid plan present or Free Tier within allowed limits). Use HTTP pipelining for higher throughput. | Free Tier accounts can upgrade for higher usage. For a first overage, we attempt to contact you before taking action. Error message (Channel quota exceeded) |
# of users (publishers) per channel or keyset | Unlimited | N/A | |
Message Size | Less than < 30 KiB to be safe. | Length of GET request, including HTTP headers & URI encoding overhead (~32 KiB) | HTTP 400 error |
Channel Name Length | 2,048 characters | ||
Channel ID Length | 92 characters | ||
User ID Length | 92 characters | ||
# of API keys per PubNub account? | An API is available if you need to manage an large number of keys (> 50). Contact us at support@pubnub.com if you need access to the Key Provisioning API. | Unlimited | N/A |
Subscribe
Function | Soft Limit | Hard Limit | If hard limited is exceeded? |
---|---|---|---|
Subscribe Rate | Soft limit depends on subscriber constraints (buffer, round trips). | No limit Use HTTP Streaming for maximum throughput | N/A |
# of Channels | Unlimited | N/A | |
# of Subscribers per channel or keyset | Unlimited | N/A | |
Message Buffer Cache | Size: 100 message queue. TTL: up to 16 minutes (can be shorter). If disconnect > 8–10 minutes, use Message Persistence. NOTE:
| Size: configurable on our end (may add costs). TTL: hard limit 20 minutes. Effective percent 90% → 18 minutes. Currently 80% → 16 minutes. | N/A |
Catch-Up | 100 messages (or size of buffer cache) | N/A | |
Channel Name Length | 2,048 characters | ||
# of Sockets/Instances per client | PubNub does not limit sockets/instances. Devices or platforms often limit TCP connections (some browsers allow ~40). Each PubNub client instance uses two TCP sockets: one for subscribes and one for non‑subscribe operations. | Unlimited | N/A |
Multiplexing (available without Stream Controller) | 10 to 50 channels When subscribing to many channels, channel groups allows for the persistence of channel lists. | No limit in client SDKs, but we advertise a hard limit of 100 channels. No server side limit, only limited by URI length of 32 KiB. | |
Channel Groups | Up to 10 channel groups, each with 100 channels for a total of 1,000 channels. You can change the limit of channels in the Admin Portal under your app's keyset configuration. Paid customers can increase the limit to up to 2,000 channels per channel group, for a total of 20,000 channels. | If subscribing to more than 10 channel groups, receive 400 HTTP status code with description Maximum channel registry count exceeded | |
Wildcard Subscribe | Depends on subscribe rate NOTE: refer to the note for Publish Rate | 3 levels (2 dots) of wildcards: a. a.b. No limit to # of channels able to subscribe to in a wildcard subscribe. Wildcard Channel Names aren't allowed in Channel Groups. | |
Channel Group Name Length | 92 Characters |
File sharing
Function | Soft Limit | If hard limited is exceeded? |
---|---|---|
File Size | 5 MB | Contact us at support@pubnub.com to increase the file size limit. |
File Retention | 1, 3, 7, 15, or 30 days, or Unlimited |
Presence
Function | Soft Limit | Hard Limit |
---|---|---|
Heartbeat | Minimum: 1 minute heartbeat & 29 second interval | Minimum: heartbeat:10; interval: 4 (lowest common denominator across 3.x SDKs; each have different hard limits) 4.x SDKs do not currently have limitations. |
Presence Announce Max | 100 | We can adjust this limit, but there are considerations |
Webhook Retries | Presence webhooks will try to POST to your URL endpoint for a maximum of 4 times, each with a 5s timeout; Ensure that the customer's server (REST endpoint) returns 200 NOTE: If a channel has reached the Presence Announce Max limit, we will not send webhook requests for that channel | If webhook has reached maximum number of retries, the request is lost. |
Message Persistence
Function | Soft Limit | Hard Limit |
---|---|---|
Data Retention | 1 day, 7 days, 30 days, 3 months, 6 months, 1 year, or Unlimited | 7 days for Free tier customers |
Maximum # of channels with message count | 100 channels per a single API call | N/A |