Menu

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Chat Limits

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 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

Default: 250 Maximum: 1,000

Configured via: Service Instance configuration: Limits.UserChannels

Members per Channel

Default: 100 Maximum: 1,000

Configured via: Service Instance configuration: Limits.ChannelMembers

Throughput Limits

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

Actions Per Second

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, update, 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

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

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 in this case.

Data Length/Size Limits

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 Field Maximum length / Size
ServiceInstance FriendlyName 256 characters
Channel FriendlyName 256 characters
Channel UniqueName 256 characters
Channel Attributes 32 KiB
Channel CreatedBy 256 characters
User Identity 256 characters
User Attributes 32 KiB
User FriendlyName 256 characters
Message Body 32 KiB
Message Attributes 4 KiB
Message CreatedBy 256 characters
Message LastUpdatedBy 256 characters
Role FriendlyName 256 characters
Credential FriendlyName 64 characters

Media Messaging

Maximum Media file size: 150 MiB

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.