Share via

issue when using the Microsoft Graph API to create a draft message in a shared mailbox.

Thomas LOEB 40 Reputation points
2026-01-05T08:56:38.69+00:00

Hello,

I am encountering an issue when using the Microsoft Graph API to create a draft message in a shared mailbox.

The following request consistently fails:

Method: POST

URL: https://graph.microsoft.com/v1.0/users/[Moderator note: personal info removed]/messages

Tracking ID: [Moderator note: personal info removed]

The OAuth token is valid and generated using the client_credentials flow.

The application has the following application permissions:

  • Mail.ReadWrite
  • Mail.Send
  • MailboxSettings.Read

The shared mailbox is correctly configured:

  • My account has both “Send As” and “Full Access” permissions in Exchange Online
  • The JSON payload is valid and has been tested independently
  • The same token works for other Graph operations

The API returns:

500 Internal Server Error

with the tracking ID above.

All client-side elements (token, permissions, JSON, mailbox delegation) have been verified and are correct.

This appears to be an internal Microsoft Graph or Exchange Online backend issue.

Could you please investigate this error on the server side using the tracking ID?

Thank you,

[Moderator note: personal info removed]

Outlook | Windows | Classic Outlook for Windows | For business
0 comments No comments

Answer accepted by question author

Vasil Michev 127K Reputation points MVP Volunteer Moderator
2026-01-05T09:21:18.8533333+00:00

When using the client credentials flow, user identities are not in the picture. Can you clarify what permissions have you granted to the app (delegate or application ones), and also share the sanitized access token you obtained. Use tools such as jwt.ms to decode it.

In addition, permissions on Exchange Online side can affect the behavior here. You, or your admin, should check for any application access policies configured, as well as the RBAC for apps configuration: https://learn.microsoft.com/en-us/exchange/permissions-exo/application-rbac

That said, 500 Bad Request error might be related to something other than permissions, so please share the full request/payload.

Was this answer helpful?

0 comments No comments

Answer accepted by question author

AI answer

2026-01-05T08:57:49.63+00:00

It seems you are encountering a 500 Internal Server Error when trying to create a draft message in a shared mailbox using the Microsoft Graph API. This error typically indicates an issue on the server side, which may not be directly related to your request or configuration.

Here are a few steps you can take to troubleshoot this issue:

  1. Check Permissions: Ensure that the permissions granted to your application are sufficient. You mentioned you have Mail.ReadWrite and Mail.Send, which should generally be adequate for creating drafts. However, verify that these permissions are correctly assigned and consented to in the Azure portal.
  2. Validate the Shared Mailbox Configuration: Confirm that your account indeed has the necessary permissions (Send As and Full Access) on the shared mailbox. Sometimes, permissions might not propagate correctly.
  3. Inspect the JSON Payload: Although you mentioned that the JSON payload is valid, double-check for any subtle issues or required fields that might be missing.
  4. Use the Correct API Endpoint: Ensure that you are using the correct endpoint for the shared mailbox. The format should be https://graph.microsoft.com/v1.0/users/{shared-mailbox-email}/messages.
  5. Retry the Request: Sometimes, server errors can be transient. Retry the request after a brief wait to see if the error persists.
  6. Contact Microsoft Support: Since you have a tracking ID, it may be beneficial to reach out to Microsoft support for further investigation. They can use the tracking ID to look into the server logs for more details on the error.

If the issue continues, it is likely necessary to escalate it to Microsoft support for a deeper investigation into the backend systems.


References:

AI-generated content may be incorrect. Read our transparency notes for more information.

Was this answer helpful?

1 additional answer

Sort by: Most helpful
  1. Kudos-Ng 15,050 Reputation points Microsoft External Staff Moderator
    2026-01-05T10:31:14.8966667+00:00

    Hi Thomas LOEB,

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

    Please note that our forum is a public platform, and we will modify your question to hide your personal information in the description. Kindly ensure that you hide any personal or organizational information the next time you post an error or other details to protect personal data.

    From what you’ve described, you are consistently receiving HTTP 500 Internal Server Error. This status code typically indicates a fault on the service side and requires backend tracking and log analysis to troubleshoot the issue. While you have rightly requested an investigation using the tracking ID, I regret to inform you that this Microsoft Q&A forum is a user‑to‑user support channel. Moderators, contributors, and external Microsoft employees participating here do not have access to backend systems nor the ability to intervene directly in Microsoft product features. Our role is limited to offering technical guidance and sharing best practices based on reported issues, requests, or ideas.

    Therefore, please consider opening a support ticket directly with Microsoft through your Azure portal. A Microsoft support engineer, equipped with the necessary internal telemetry and tooling, can review the tracking/request IDs and service logs to assist you most effectively.

    However, I'd like to contribute some troubleshooting suggestions to help narrow the scope while you await support:

    1. According to the endpoint documentation you’re using: https://learn.microsoft.com/en-us/graph/api/user-post-messages?view=graph-rest-1.0&tabs=http#request-headers this API requires:
      • Content-Type
      • Content-Length User's image In many cases, missing or invalid headers result in 400 Bad Request rather than 500, but since your post does not mention the exact headers sent, please double‑check that Content-Type is present and correct and that your client is setting Content-Length appropriately.
    2. Try the same operation against a non‑shared (user) mailbox to isolate whether the error is specific to the shared mailbox configuration or more general service behavior, please attempt the same POST (/users/{id}/messages) with a regular user mailbox.
      • If the user mailbox succeeds while the shared mailbox fails, that points to a shared mailbox–specific issue or configuration nuance.
      • If both fail with 500, it more strongly suggests a service‑side problem requiring investigation by Microsoft Support.

    I hope this helps, and I appreciate your patience while the issue is investigated.


    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?


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.