Share via

Why am i getting "RequestEntityTooLarge" while sending adaptive card using Microsoft Teams Bot API Framework?

Abhishek Dalbanjan 40 Reputation points
2025-09-25T07:47:53.1566667+00:00

I'm sending messages using the Microsoft Teams Bot Framework REST API, but I'm encountering a RequestEntityTooLarge error even though my payload is around 70KB. According to the documentation (https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/format-your-bot-messages), the message size limit is 100KB, Can someone please let us know what could be the reason?

Earlier it used to be around 40KB, now it has been increased to 100KB, Can someone let us know when did this limit got increased?

I see that the similar question is asked - https://learn.microsoft.com/en-us/answers/questions/2277315/im-receiving-a-requestentitytoolarge-error-when-se

I am using the similar kind of payload and same bot framework api endpoint(https://smba.trafficmanager.net/teams/v3/conversations/<<conversationId>>/activities)

one more question, If my message JSON is about 50KB, is there a way to calculate or estimate the additional request overhead (like headers/serialization), or does the Bot Framework/Teams size limit only apply to the raw JSON body?

Microsoft Teams | Development
Microsoft Teams | Development

Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs

0 comments No comments

Answer accepted by question author

Kudos-Ng 15,050 Reputation points Microsoft External Staff Moderator
2025-09-25T09:45:58.9866667+00:00

Hi Abhishek Dalbanjan,

Thank you for posting your question in the Microsoft Q&A forum. 

Based on your description, I understand you're encountering a RequestEntityTooLarge error when sending messages via the Microsoft Teams Bot Framework REST API, even though your payload is around 70KB. You've also referenced the official Microsoft documentation confirming the message size limit is 100KB, and linked to a similar thread discussing the same issue.

After reviewing the documentation and doing some additional research, here are a few insights that may help clarify things:

The documentation you referenced includes the following note:

"The bot message size limit is 100 KB. If the bot message size limit exceeds 100 KB, bot receives a 413 status code (RequestEntityTooLarge), which contains the error code MessageSizeTooBig. The bot message size limit includes the entire message payload encoded as UTF-16 and doesn't include Base64 encoded images."

This note answers your question about when the limit was increased: since it's now reflected in the official documentation, we can understand that the 100KB limit is currently in effect and actively enforced.

Regarding your other question:

"If my message JSON is about 50KB, is there a way to calculate or estimate the additional request overhead (like headers/serialization), or does the Bot Framework/Teams size limit only apply to the raw JSON body?"

Also, you mentioned your payload is "around 70KB"—could you share how you're calculating that size? According to the documentation, the size limit applies only to the message payload, not to HTTP headers or transport-level metadata. It also excludes Base64-encoded images. However, the key detail is that the payload is measured after being encoded in UTF-16.

This is important because UTF-16 encoding typically increases the size compared to UTF-8. For example, ASCII characters take 1 byte in UTF-8 but 2 bytes in UTF-16. If your message contains emojis, multilingual text, or formatting tags (like Markdown or XML), the size can increase even more.

To accurately estimate your payload size, you should serialize your message and measure it using UTF-16 encoding. In Node.js, you can use:

Buffer.byteLength(JSON.stringify(payload), 'utf16le')

Note that 'utf16le' (UTF-16 Little Endian) is the correct encoding to use here—'utf16' is not a valid option in Node.js.

By the way, have you tried reducing the message content to see at what point the error disappears? That could help pinpoint the actual threshold being hit in your case.

Hope this helps clarify the issue! If you have any further questions, please feel free to share.


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".         

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.