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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

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 ,

 

The docs are a bit lacking when it comes to real-world examples for the "Add Cache Refresh Plan" call. I ran into this myself and here’s what actually worked for me:

1. Use the official SwaggerHub for PBIRS: It’s much more helpful than the standard docs, and you can see exactly what the body should look like.


2. Sample JSON payload: When you create a scheduled refresh via the Report Server portal, the API call looks like this (you can check using browser dev tools):

{
  "Owner": null,
  "Description": "Your description here",
  "CatalogItemPath": "/your/path/to/report",
  "EventType": "DataModelRefresh",
  "Schedule": {
    "ScheduleID": null,
    "Definition": {
      "StartDateTime": "2025-07-01T04:00:00+10:00",
      "EndDateSpecified": false,
      "EndDate": "1981-02-01T00:00:00+10:00",
      "Recurrence": {
        "DailyRecurrence": {
          "DaysInterval": 1
        }
      }
    }
  },
  "ScheduleDescription": "",
  "ParameterValues": []
}

 

Heads up: Leave ScheduleID as null or just omit it. Make sure CatalogItemPath matches your report’s path exactly.

 


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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.