Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Chat Limits



Programmable Chat has been deprecated and is no longer supported. Instead, we'll be focusing on the next generation of chat: Twilio Conversations. Find out more about the EOL process here(link takes you to an external page).

If you're starting a new project, please visit the Conversations Docs to begin. If you've already built on Programmable Chat, please visit our Migration Guide to learn about how to switch.

Twilio Programmable Chat has a number of limits in place which will constrain certain elements of the system and how it is used. Some limits have default values and can be configured, others are not able to be changed.

The Chat limits are enforced at Service instance, User and Channel levels. These limits are set within a Service instance scope.

Counter Limits

counter-limits page anchor

Counter limits are related on object list counts/maximum enforced length. If an enforced count count limit will be exceeded by means of a command, this command will be rejected with a 403 status code along with a more specific chat error code and description.

Channels per User

channels-per-user page anchor

Default: 250 Maximum: 1,000

Configured via: Service Instance configuration: Limits.UserChannels

Default: 100 Maximum: 1,000

Configured via: Service Instance configuration: Limits.ChannelMembers

Channels per Chat Service Instance

channels-per-chat-service-instance page anchor

Unlimited. Each Chat Service Instance can hold as many channels as you wish!

Limits of this type will impact the number of simultaneous actions that can be performed within a Service Instance.

Actions per Second (APS) is a maximum request rate that governs your chat applications. This limit is specifically enforced for mutation commands such as sending a Message or creating a Channel, both via the REST API and from the front-end Chat SDKs (iOS, Android, Browser). Read actions are not limited under APS.

The following operations are rate-limited per channel, with a default maximum set at 30 APS separately for each channel:

  • Channel update
  • Member create, update, delete
  • Message create, update, delete
  • Invite create, delete

The following operations are governed globally, with a single 30 APS limit applying to each Chat Service as a whole:

  • Channel create, delete
  • User create, update, delete
  • Role create, update, delete
  • Binding delete

How This Works

how-this-works page anchor

The Chat backend measures the average request rate over a 5s sliding window. This means in a particular second, you could actually execute 150 APS even though your limit is 30.

When the Throughput is Exceeded

when-the-throughput-is-exceeded page anchor

Requests that go over APS threshold are rejected with HTTP status code 429 Too Many Requests. After this your application client request logic needs to wait until the average goes below threshold to make any command requests again. We recommend exponential backoff of such requests, ideally with jitter to decrease overall latency. We recommend that every Chat application should implement retry logic.

If your application's sustained request rate is getting close to the limit and throttling becomes commonplace, the APS cap may need to be increased for that service instance. Please contact support(link takes you to an external page) in this case.

Data Length/Size Limits

data-lengthsize-limits page anchor

Limits for user-provided data are herein specified in UTF-8 character counts. If a payload limit is specified in bytes, we assume that the data is serialized using UTF-8 encoding where each character (e.g. emoticon) may take more than one byte.

Resource Property Limits

resource-property-limits page anchor
ResourceFieldMaximum length / Size
ServiceInstanceFriendlyName256 characters
ChannelFriendlyName256 characters
ChannelUniqueName256 characters
ChannelAttributes32 KiB
ChannelCreatedBy256 characters
UserIdentity256 characters
UserAttributes32 KiB
UserFriendlyName256 characters
MessageBody32 KiB
MessageAttributes4 KiB
MessageCreatedBy256 characters
MessageLastUpdatedBy256 characters
RoleFriendlyName256 characters
CredentialFriendlyName64 characters

Maximum Media file size: 150 MiB

Twilio Programmable Chat also apply rate limits to the actions (reads/writes/updates) in order to ensure quality of service for all our customers.

The following tables summarize the various connection limits that are applied for SDKs:

Limited QuantityPrescribed LimitNotes
Number of Concurrent Connectionsup to 7,000 in each Twilio Subaccount and 100,000 overall, shared among all your Subaccounts.The number of concurrent connections through Twilio's internal websockets.
Rate of Connection Establishmentup to 110/s in each Twilio Subaccount and 1,000/s overall, shared among all your Subaccounts.The number of new or re-established connections per second through Twilio's internal websockets.
Rate of Upstream Requestsup to 2,000/s per connection and up to 20,000/s per SubaccountsThe number of upstream requests per second that pass through Twilio's internal websockets.

Rate this page: