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:
- Reduce the size: Ensure that attachments or other data included in the request are within the size limit.
- 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.