Forum Discussion
Approvals API only working in the default environment
The approvals are created by a Power Automate flow with the Approvals connector (Create an approval).We want to complete or cancel the approval from outside Power Automate. For this we call the beta Graph approvals API from a custom connector, with the delegated permission ApprovalSolutionResponse.ReadWrite:
- POST /beta/solutions/approval/approvalItems/{id}/responses
Observation:
- Tenant A: the flow runs in the default environment. The calls work, and the operation ends with status succeeded.
- Tenant B: the flow runs in a production (non-default) environment. For an approval that the user can see in Teams, GET returns 404 NotFound with inner code ApprovalItemNotFoundOrNotAccessible. POST responses returns 202, and the operation then stays inProgress or ends with status failed and the same error. The approval is not completed.
Questions:
1. Does the beta Graph approvals API support approvals created in non-default environments? Is this behavior intended?
2. Does the calling user need any specific Dataverse security role in the environment? We could not find documentation for this.
3 Replies
- VagAll1Copper Contributor
Thank you, that matches what we see. In tenant B the flows run in a production environment that the customer manages. In tenant A they run in the default environment, where the calls work.
I do not know yet why the flows are in production. I will ask the customer's admin whether running them in the default environment is acceptable, since default environments are often restricted by policy.
Two follow-up questions, if you know:
1. Is this limitation documented anywhere, or does it come from testing? We could not find it in the Microsoft documentation.
2. The endpoint is beta, so it is not supported for production use in any environment, including the default one. Is there a supported (non-beta) way to respond to and cancel approvals from an external system?
- AmezingtechsataraIron Contributor
Yes, that's the environment, not the permission. Power Automate approvals are stored in the Dataverse of the environment the flow runs in, and the beta Graph approvals API only sees approvals in the default environment — for anything else it returns exactly the 404 ApprovalItemNotFoundOrNotAccessible you're getting, even though the Teams Approvals app shows the same approval fine because it reads across environments. A Dataverse role won't fix it, since the API doesn't look in the non-default environment at all. The quick check is the environment picker at the top right in Power Automate: if the flow isn't in the default environment, that's your answer. And since it's a beta endpoint, it's not supported for production use — the supported route is moving those flows into the default environment. Is that an option for tenant B, or are the flows pinned to production for another reason?
- VagAll1Copper Contributor
Thank you, that matches what we see. In tenant B the flows run in a production environment.
I do not know yet why the flows are in production. I will ask the admin whether running them in the default environment is acceptable.
Two follow-up questions, if you know:
1. Is this limitation documented anywhere, or does it come from testing? We could not find it in the Microsoft documentation.
2. The endpoint is beta, so it is not supported for production use in any environment, including the default one. Is there a supported (non-beta) way to respond to and cancel approvals from an external system?