how to fix "OrganizationFromTenantGuidNotFound" while sending Email using Graph API

Umer Zahoor 25 Reputation points
2024-08-29T13:09:21.8333333+00:00

I am trying to send an email using graph APIs and keep receiving "OrganizationFromTenantGuidNotFound" not found. I am attaching the entire error message below:

{"error":{"code":"OrganizationFromTenantGuidNotFound","message":"The tenant for tenant guid
'6550df3....' does not
exist.","innerError":{"oAuthEventOperationId":"292c502.......","oAuthEventcV":"bMbl6GVQFjl......","errorUrl":"https://aka.ms/autherrors#error-InvalidTenant","requestId":"b6a75333-cd2a-438.....","date":"2024-08-29T12:53:50"}}}

Here is what I have done so far:

I have received code using

https://login.microsoftonline.com/{tenant/oauth2/v2.0/authorize?client_id={client}f&response_type=code&response_mode=query&scope=offline_access%20User.Read%20Mail.Send&state=12345

received bearer auth using

https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token

and finally when I make a request to

https://graph.microsoft.com/v1.0/me/sendMail


it gives me the above error. I have a personal microsoft 365 subscription enable on my personal microsoft account that I am using for the entire process

any help in this regard would be great, thanks

Outlook | Windows | Classic Outlook for Windows | For business
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,376 Reputation points
    2024-08-30T06:46:22.0833333+00:00

    Hi @Umer Zahoor

    If you are trying to send an email on behalf of a personal account, do not use the /{tenant id} endpoint to request a token, as it only supports organizational identity login. You should use the /common endpoint to log in to a personal account, and you also need to ensure that your application supports personal account login.

    User's image

    Additionally, if you are sending an email on behalf of an account within an organization (tenant), you will need an enterprise-grade MS 365 license, as accounts within an organization are work accounts.

    Hope this helps.

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

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Andy David - MVP 157.8K Reputation points MVP Volunteer Moderator
    2024-08-29T13:32:00.9166667+00:00
    0 comments No comments

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.