Forcing Approval Revocation with the Teams HTTP API
The standard approval connector doesn't expose a cancel method, but a direct HTTP call to the Microsoft Teams Approvals backend makes it possible. Here's a safe, production-ready approach.
Power Automate ships with a solid set of approval actions that handle most of the lifecycle: sending requests, waiting for responses, and acting on outcomes. One significant omission, however, is the ability to cancel a pending request. Whether a user submitted the wrong document or an employee departs while a request is in flight, an unmet need for administrative cancellation exists. This gap can be filled by calling the Microsoft Teams Approvals API directly via a pre-authorized HTTP request. This article guides you through building a custom Flow that safely and effectively revokes a pending approval.
Why a Standard Cancel Action Is Missing
The built-in Approvals and Teams connectors were designed for active participants in a workflow: requesters submit, responders approve or reject. Cancelling an approval that was initiated by someone else is an administrative or lifecycle management action. The Teams Approvals backend does support this operation through its REST API, but Microsoft chose not to surface it in the standard connector palette. This forces us to call the backend ourselves, adding a small infrastructure step but giving us full control over the cancellation process.
Your Scenario: Correcting a Mistaken Request
Imagine a sales team using a standard Teams approval flow to authorize discounts. A sales rep submits a request for a 15% discount, but realizes they selected the wrong client tier. The request sits in the manager's queue. Instead of waiting for a rejection (which pollutes the audit trail), the sales operations admin runs a Power Automate flow that cancels the request entirely, allowing the rep to resubmit correctly.
Step 1: Collecting the Required Identifiers
Your Flow needs two specific pieces of data to locate and cancel the right approval.
- The Approval GUID: This is the unique identifier of the target pending request. Open the Approvals table within your Power Platform environment's Dataverse instance. Use an advanced find or a Power Fx filter on the Title column to locate your request. The GUID is stored in the Approval (Id) column.
- The Environment GUID: The API needs to know exactly which Power Platform environment contains the approval record. The Flow runtime exposes this value through a workflow metadata tag.
Create two variables in your Instant Flow to hold these values.
strApprovalId: "YOUR_TARGET_APPROVAL_GUID" strEnvironmentId: workflow()?['tags']?['environmentName']
Step 2: Setting Up the HTTP with Microsoft Entra ID Action
Add the HTTP with Microsoft Entra ID (Pre-authorized) action to your Flow. When prompted to create a new connection:
- Set Base Resource URL to
https://approvals.teams.microsoft.com - Set Microsoft Entra ID Resource URI to the same value.
- Sign in with a user account (or configure a Service Principal) that has the appropriate permissions on the Approvals service.
This connection is the bridge between your Flow and the protected Teams backend API.
Step 3: Executing the Cancellation Request
Configure the HTTP action with the parameters below. The call performs a DELETE operation, which tells the API to void the specified approval.
Method: DELETE
URI: https://approvals.teams.microsoft.com/api/cancelApproval/@{variables('strApprovalId')}?flowEnvironment=@{variables('strEnvironmentId')}
Headers:
{
"Accept": "application/json"
}The query parameter flowEnvironment maps the approval ID to the correct Dataverse environment. If this parameter is missing or incorrect, the API returns a 404 error even if the GUID itself is valid.
Step 4: Running and Validating the Result
Save the Flow and run a test, providing a valid Approval GUID as input. A successful run returns a 200 OK response from the API.
Immediately after:
- The approval status in the Dataverse Approvals table changes to Cancelled.
- The request disappears from the Microsoft Teams Approvals Center for the manager.
- All participants receive a notification that the request was voided.
Security and Governance Considerations
Calling a "cancel any approval" endpoint is a powerful action. You must restrict its use carefully.
- Run Context: The flow executes in the security context of the connection owner (or the user triggering it if configured for run-only). This identity must have appropriate permissions on the Approvals service and Dataverse.
- Audit Trail: Add a step to your Flow that logs each cancellation to a custom Dataverse table or SharePoint list. Record who triggered it, the target approval GUID, and a timestamp.
- Access Control: Do not expose this flow via a Power App accessible to all employees. Instead, grant access to a specific SharePoint group or Microsoft Entra security group containing only authorized administrators.
Troubleshooting Common Issues
- Approval Not in Cancelable State: The API only voids approvals with a status of Pending (Requested). Already approved or rejected requests cannot be cancelled this way. Check your filter condition before passing the GUID.
- Environment ID Mismatch: A 404 error usually means the
flowEnvironmentparameter doesn't match the environment hosting the approval record. Verify the expressionworkflow()?['tags']?['environmentName']returns the correct GUID. - Authentication Errors: The connection may expire. Ensure your HTTP connection is valid and the identity used has not been blocked by a Conditional Access policy targeting the Resource URI
https://approvals.teams.microsoft.com. - Rate Limiting / Throttling: If you run this flow against many approvals in quick succession, the Teams API may throttle your requests. Configure an Exponential Backoff Retry Policy in the HTTP action settings to handle transient 429 responses gracefully.
Final Recommendation
Using an HTTP request to cancel an approval is a robust workaround for a missing native feature. It is ideal for administrative dashboards, error correction workflows, and data clean-up tasks. However, it should not be used as a primary approval management path for end users without strict controls. Combine it with proper error handling, logging, and security groups to ensure it fits seamlessly into your enterprise Power Platform governance framework.
References
- Matthew Devaney, Cancel An Approval In Power Automate (Original concept)
- Microsoft Learn: Approvals actions in Power Automate (Placeholder)
- Microsoft Learn: HTTP with Microsoft Entra ID connector (Placeholder)
Core principles for resilient, maintainable, and efficient cloud flows, distilled from real-world implementations.
Build flows that gracefully handle failures and automatically notify you with run details.
Discover the trade-offs between Content-ID, Base64, and the Microsoft Graph API for embedding images in Power Automate emails. This guide covers which method works best for Outlook, Gmail, and more.