Today when i tried to save my flow I got the following error message Request to XRM API failed with error. What to do when you get this error?
Request to XRM API failed with error
Table of Contents
The full error message that I got looked like this:

Request to XRM API failed with error: ‘Message: Flow client error returned with status code “BadRequest” and details “{“error”:{“code”:”FlowMissingConnection”,”message”:”The flow is missing a connection for api ‘<null>’. Reauthenticate the connection or remove from the flow and re-save.”}}”. Code: 0x80060467 InnerError: ‘.
Looking at my flow, nothing seem to be wrong. As I opened a new tab to open the solution containing my flow I could see that my flow hadn’t saved for 24 minutes.

Now I could of course just reopen the flow that I saved 24 minutes ago but that is a bit of a pain. I hate doing the same thing twice!
So how to solve the problem?
This post is going to be a real SharePain as I will go through my attempts to resolve the issue. If you have come across the Request to XRM API failed with error message without the connector being mentioned then please let me know if you solved this in a better way. So far i’ve only found people reporting this problem related to specific connectors.
Attempt 1 – Failed
My flow from 24 minutes ago looks like this when I opened it in a new tab:

i don’t really want to redo my work as my flow with the updates, that haven’t been saved yet, looks like this:

The Try-Catch pattern could actually help me to fix my flow quickly as I can copy each scope box to my clipboard.

And then I can add the 3 scope boxes to my flow in my other tab of my browser. It’s quite useful that it is possible to use copy/paste of steps across multiple tabs.

All I now have to do is configure the runafter settings for the Catch and the Finally scope boxes and my flow can hopefully be saved again.

But no luck there! The problem was still there. Ok, this might be a failed attempt but it did make me understand that the problem is potentially related to copy/paste.
The Error message mentions XRM API so that means that the problem is something to do with solutions.
Attempt 3 – Getting closer!
So now we know that there is actually something wrong with the content of the flow after the copy pasting of actions.
The flow is still giving us the same error! It wasn’t until I looked at the solution that holds my flow that I found the issue.
My flow has an send an email action in it and the Connection status for the Outlook connector is set to Off.

I’m not that quickly beaten, so I looked for the option to enable the connection or to turn it on! But there doesn’t seem to be an option for that.

Then I looked at the flow itself using the New Connection reference.

But this resulted in a further mess within my flow.

We might need a different approach.
Attempt 3 – Success!
The final attempt now. I deleted the Send an email action and then re-added the send an email action and now it is possible to save my flow.

And once it the flow is saved, we will find an invalid connection for Office 365 Outlook. So we now know that there is a problem with the outlook connection!
And when we now select that invalid connection reference and save the flow all connections seem to be valid again.

You would now expect that the connection reference in the solution to be switched to on, but that is not the case. So it looks like the Status of a connection is just a red herring.
So what caused this problem? The Request to XRM API failed with error message is definitely annoying and even more annoying when the connector causing the problems isn’t mentioned in the error message.
The problem found!
So as a bumped into this problem a few more times, i wanted to know what caused this problem.
I created a totally new solution. Then I added a flow that looked like this.

I saved the flow and then added another flow to my solution. But this time I copied the Send an email action from my first flow ( yes I’m lazy and didn’t want to type the settings!)

The same error occurred again
Request to XRM API failed with error: ‘Message: Flow client error returned with status code “BadRequest” and details “{“error”:{“code”:”FlowMissingConnection”,”message”:”The flow is missing a connection for api ‘<null>’. Reauthenticate the connection or remove from the flow and re-save.”}}”. Code: 0x80060467 InnerError: ‘.
Now we are getting somewhere. Deleting the send an email and re-adding it doesn’t help. The only way I managed to make this work is add a second flow but do not use copy paste to create the send an email action in the second flow.
Hi Peter,
You article didn’t work for me but prompted me to find the solution that did. In the Email action in Power Automate if I click on the 3 dots to the right ( where you will find peek code) I also found the other connection references. A couple of my emails had the wrong connection reference which I changed and my pain went away.
Thank you for adding your solution to this post.