PowerApps Portals API – Clear Cache

The cache has been the achilles heel sometimes of the Dynamics 365 portal and now Power Portals. A common function is to clear or reset the cache of the portal so you can see your changes and you can now do that through a hidden API call.

Most of us Dynamics 365 portal users know of the /about/_services method when logged in as an administrator to the portal but now also this API to perform the same function.

In the still yet to be released podcast Dileep mentions that clear cache is initiated when you browse the site from the Portals Design Studio. As when you click browse your are expecting to see your changes you just made clearing the cache prior to navigating your there is a good procedure.

Looking into how it occurs also reveals the portal has an admin API that can be accessed programmatically and you can call clear cache easily from POST call providing the right parameters and authentication token.

How do you use outside of the design studio?!

The various portal regions all have a infrastructure API, below is the root address for Canada (you will need to determine your region URL):


After this root address there are various actions like…ClearCache! It takes a single parameter of the portal add-on Id. You will also need to provide a Bearer token that has access to the resource https://portal.dynamics.com for authentication as you don’t want just anyone being able to do this.

If you paste the following into your browser you can retrieve the response and copy the access_token parameter to include in your later request as your authentication.


You will get back a URL that includes #access_token=, copy the value from here and save to include in your clear cache request.

From POSTMAN a great tool for doing sample HTTP requests you can create a new request to and set the method to POST, then use the following address:


You will need to fill-in your portal add-on ID which you can retrieve by going to the make.powerapps.com/apps (ensure you have the correct environment selected), select the ellipsis (…) beside the desired portal app and select details. From the URL at the top grab the PORTAL_ADDON_ID, i.e. /powerportals/{PORTAL_ADDON_ID}/details and replace in your URL.

Next you will need to include the access token from before, select the Authorization tab, change the type as Bearer Token and then paste in the token value.

Filled out POSTMAN request.

Once you have both the portal add-on Id filled and the bearer token entered then click send and this will nuke the full cache of your portal. Getting back ‘true’ means everything succeeded.

Yes it works also on non-CDS portals.

The bearer token you have will expire every 3600 seconds, aka 60 minutes so you will need to refresh this token to continue to use the API action.

What other APIs exist is probably your next question. Well there is one for listing all the Portals by organization (or environment):


This provides a very detailed output of the portal add-ons or apps installed in your environment.

      "Name":"handlebars-cds-preview portal",
      "PrimaryCertificateExpirationTime":"7/17/2021 9:06:23 AM",

There are likely lots of others as well that will need to be discovered

Eventually you will hopefully hear that podcast…working its way through the necessary hurdles 😊.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s