Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Email step: unauthorized error. Failed to retrieve token for resource=https://outlook.office365.com

(0) ShareShare
ReportReport
Posted on by 149

Hello,

 

I have a flow that ends by sending an email.  Occasionally, with no real pattern discernable, the flow fails at the email step with the error message "Unauthorized" and the following message in the response:

 

"body": {
"status": 400,
"source": "https://unitedstates-002.consent.azure-apim.net:443/api/tokens/exchange?api-version=2015-11-01-preview",
"message": "Failed to retrieve token for resource=https://outlook.office365.com. Message=An internal error occurred.\r\n"
}

 

The email is simply a message with a link to a document.  No attachments.

 

Has anyone run into this issue in the past?  If so, any workarounds?  Is it possible to continue trying to send the email should the unauthorized error occur?  This seems to be an issue on the office 365 side of things rather than an issue in my flow.

 

 

Thanks for any advice.

 

Dan

 

  • mumcs01 Profile Picture
    10 on at
    Re: Email step: unauthorized error. Failed to retrieve token for resource=https://outlook.office365.com

    This is an automated flow. I'm using 'Send an email (v2)'. And my connections are Microsoft Forms and Office 365 Outlook, both of which show a checkmark in connections in 'My Flows'. The flow is actually quite simple. I'm taking in a form, and checking if a statement is true, then kicking off an email. 

     

    I'm the developer of it, and I have not changed my password in several months. again, the very strange there here is that I use this same style of flow a lot with no problems. The only difference in this automated flow is the fact that the TO: field is to an external party. (All my other uses of Send an email v2 are to internal emails on my domain. 

     

    Also, this only recently started in September, and I didn't change the flow for at least a month. 

  • Mitanshu Profile Picture
    1,614 Super User 2025 Season 1 on at
    Re: Email step: unauthorized error. Failed to retrieve token for resource=https://outlook.office365.com

    Is this an automated Flow, Scheduled Flow or Instant Flow?

    For Instant Flow - can you check that if the person (who is triggering the Flow and resulting in error) has changed their account password recently?

    If this Automated or Scheduled Flow - can you check if the developer (Flow owner) has changed their password recently?

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.

  • mumcs01 Profile Picture
    10 on at
    Re: Email step: unauthorized error. Failed to retrieve token for resource=https://outlook.office365.com

    Same exact problem here. 

     

    Failed to retrieve token for resource=https://outlook.office365.com. Message=An internal error occurred.

     

    In tips it offers:

    You should be able to fix this by verifying your account with . You may need to re-enter your password.
     
    Of course, according to the flow, all of my connections are authenticated and valid. This is a new thing. Emails worked fine until about the beginning of September. I will add one thing to this, however. I noticed that this failure only occurs when attempting to send emails outside of my domain. I have a flow that sends several emails, many internal. They all work. It's only the email to an external domain that gets this error, and it's highly inconsistent as to when it happens. Sometimes the flow just works fine and sends it... other times it doesn't;
     
  • Community Power Platform Member Profile Picture
    on at
    Re: Email step: unauthorized error. Failed to retrieve token for resource=https://outlook.office365.com

    The same "Action 'Send_an_email_(V2)_Clearance' failed" error started appearing randomly on my flows on 9/5/2021.  "Failed to retrieve token for resource=https://outlook.office365.com. Message=An internal error occurred" It's impacting about 2% of the flow runs, on multiple flows, with no discernable pattern yet.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow