Graph API - user: sendMail - Request size limit

Peter 40 Reputation points
2024-07-18T23:08:50.3666667+00:00

Based on https://learn.microsoft.com/en-us/graph/errors we assume we need to handle a 413 error when calling this endpoint https://learn.microsoft.com/en-us/graph/api/user-sendmail however we are not sure what request size triggers this error

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,120 questions
0 comments No comments
{count} votes

Accepted answer
  1. Hitesh Pachipulusu - MSFT 2,225 Reputation points Microsoft Vendor
    2024-07-30T08:06:19.8866667+00:00

    Hello Peter,

    Thank you for contacting Microsoft Support!

    A 413 error, or “Request Entity Too Large,” occurs when the request size exceeds the maximum limit allowed by the server. For the Microsoft Graph API, particularly the user: sendMail endpoint, the request size limit is generally around 4 MB. If your request exceeds this size, you will encounter a 413 error. https://learn.microsoft.com/en-us/graph/use-the-api

    To avoid this, you can:

    1. Reduce the size: Ensure that attachments or other data included in the request are within the size limit.
    2. Use an upload session: For larger files, consider using an upload session, which allows you to upload files in chunks. https://learn.microsoft.com/en-us/graph/outlook-large-attachments?tabs=http

    Hope this helps.

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

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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