Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
z-rmo
New Member

API Call - Help with "Add Cache Refresh Plan"

I'd like to be able to programmatically create a Cache Refresh Plan attached to a particular report hosted on our Report Server.

 

I can manually create a plan under "Scheduled refresh" when I manage the report via the Report Server web portal.

 

I have found documentation for the API here: https://learn.microsoft.com/en-us/rest/api/power-bi-report/cache-refresh-plans/add-cache-refresh-pla... ... However, there doesn't seem to be a sample body or template which I can model my own API call, and I don't seem to be able to catch the call in my browser network-watch dev tool . I have successfully done a few other API commands, like deleting and adding Power BI Reports.

 

Is there a location I can look for more thorough documentation, or can someone provide me with a sample?

1 ACCEPTED SOLUTION
d_gosbell
Super User
Super User

I'm not sure why they moved away from using SwaggerHub for documentation, but the docs there still have an example of how to call this api https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/CacheRefreshPlans/AddCacheRefreshPlan And when I use the browser tools in Edge it captures the POST call to create a cache refresh plan.

Below is an example I captured when creating a scheduled refresh for my Power BI report called "local Adv Works"

{
	"Owner": null,
	"Description": "test2",
	"CatalogItemPath": "/local Adv Wrks",
	"EventType": "DataModelRefresh",
	"Schedule": {
		"ScheduleID": null,
		"Definition": {
			"StartDateTime": "2025-07-01T04:00:00+10:00",
			"EndDateSpecified": false,
			"EndDate": "1901-02-01T00:00:00+10:00",
			"Recurrence": {
				"DailyRecurrence": {
					"DaysInterval": 1
				}
			}
		}
	},
	"ScheduleDescription": "",
	"ParameterValues": []
}

 

View solution in original post

4 REPLIES 4
rohit1991
Super User
Super User

Hi @z-rmo ,

It’s great that you’ve already started working with the Power BI REST API and have had success with other commands. For the “Add Cache Refresh Plan” endpoint, you’re right — the documentation lacks a clear example of the request body, which can make it tricky to implement. Typically, this call requires a JSON payload that includes parameters like datasetId, notifyOption, and a days and times object to define the refresh schedule.

 

While Microsoft’s docs don’t always include examples, a good way to reverse-engineer the body is by using Fiddler or Postman with logging enabled, especially since browser dev tools often don’t catch service-to-service traffic.

 

Alternatively, the official GitHub repos or Power BI developer community forums sometimes have community-shared payload examples. If you like, I can help draft a sample JSON payload structure based on what you’re trying to schedule.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
d_gosbell
Super User
Super User

I'm not sure why they moved away from using SwaggerHub for documentation, but the docs there still have an example of how to call this api https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/CacheRefreshPlans/AddCacheRefreshPlan And when I use the browser tools in Edge it captures the POST call to create a cache refresh plan.

Below is an example I captured when creating a scheduled refresh for my Power BI report called "local Adv Works"

{
	"Owner": null,
	"Description": "test2",
	"CatalogItemPath": "/local Adv Wrks",
	"EventType": "DataModelRefresh",
	"Schedule": {
		"ScheduleID": null,
		"Definition": {
			"StartDateTime": "2025-07-01T04:00:00+10:00",
			"EndDateSpecified": false,
			"EndDate": "1901-02-01T00:00:00+10:00",
			"Recurrence": {
				"DailyRecurrence": {
					"DaysInterval": 1
				}
			}
		}
	},
	"ScheduleDescription": "",
	"ParameterValues": []
}

 

Thank you for the Swagger link and the message body example! The Swagger will be a useful resource going forward--until Microsoft releases a new version of the API, I suppose.

 

Turns out that I was close, having modeled a JSON object from a GET response. However, I was providing a null "ID" value which was not wanted by the server for the POST.

z-rmo
New Member

I am using Power BI Report Server (January 2025), version 1.22.9153.7886.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.