Forum Discussion
API Call - Help with "Add Cache Refresh Plan"
- 1 year ago
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": [] }
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.