Extending the swagger file for the Approval custom connector

Posted by

In the official Power Apps blog post ‘Building an Approval experience in Canvas Apps‘ (published on April 15, 2020) there’s a link to the swagger file for the Approval custom connector that exposes the operations to retrieve sent and received approvals, and to approve or reject an approval request. From the Approvals action center in Power Automate it’s also possible to cancel an approval (as owner) and to reassign approval requests. So I’ve decided to extend the swagger file with these additional operations. The cancel operation is now part of the extended swagger file.

Get the extended swagger file for the Approval custom connector here: https://2die4it.com/swaggerapprovalextended

Edit the values for the host and default name for your environment:

"host": "emea.api.flow.microsoft.com",
            "name": "environment_name",
            "in": "path",
            "required": true,
            "type": "string",
            "default": "72e87f56-e215-43d4-8883-5cf7ff5550f5"

Follow the instruction of the original blog post for the custom connector deployment. Once the custom connector is created based on the swagger file, the Cancel Approval action can be added to your flow.

Here’s just a simple test to show that it works.

The cancel action is added as activity to the approval history in the Approvals action center of Power Automate.

Next step is to add the reassign operation to the extended swagger file. To be continued.


  1. Please, we try to call GET /approvalViews from our SPFX application to visualize who the document approval is pending on.
    But we are facing an issue now to setup proper Authorization. All attempts ends:
    “error”: {
    “code”: “InvalidAuthenticationTokenAudience”,
    “message”: “The access token has been obtained from wrong audience or resource ‘00000002-0000-0000-c000-000000000000’. It should exactly match (including forward slash) with one of the allowed audiences ‘https://service.flow.microsoft.com/’,’https://management.core.windows.net/’,’https://management.azure.com/’,’https://service.powerapps.com/’,’https://service.kratosapps.com/’,’637fcc9f-4a9b-4aaa-8713-a2a3cfda1505′.”

    Thanks for any help.

Leave a Reply

Your email address will not be published. Required fields are marked *