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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
mbutler71
Advocate I
Advocate I

Has anyone gotten this API to disable a Direct Query refresh that is enabled?

Datasets - Update Direct Query Refresh Schedule

datasets/$DatasetId/directQueryRefreshSchedule

Has anyone got this to work?

Trying to run this API and using the example on the Microsoft site:

With this JSON Body: 
{ "value": { "enabled": false } }

This always brings back a 400 error:
{"error": {"code": "BadRequest","message": "Bad Request","details": [{"message": "Value cannot be null.\r\nParameter name: nullableType","target": "datasetDQRefreshSchedule"}]}}
2 REPLIES 2
mbutler71
Advocate I
Advocate I

Thanks for replying. 
I have reviewed all of the links you provided.
I tried the suggestions in all, with no success.

I am first trying to disable a scheduled Direct Query Refresh in the Leaning Microsoft test page.

And this is also not working here either.
I am using the exact JSON body in the example:

mbutler71_0-1717089677458.png

 

mbutler71_1-1717089773988.png

 

 

Anonymous
Not applicable

Hi  @mbutler71 ,

 

Make sure that your request contains all required parameters and that the access token used has the necessary permissions (The user must be the dataset owner).

There may be issues with the body of the request, be careful with how the attributes are set, make sure there are no trailing commas or syntax errors in the actual body of the request to be sent, and the JSON structure needs to conform to the API's expectations.

 

This is the related document, you can view this content:

Solved: Re: Power BI API doesn't disable Direct Query, but... - Microsoft Fabric Community

What is the correct JSON body to disable PowerBi Schedule Refresh via API - Stack Overflow

Solved: Keep getting a 400 Bad Request error when trying t... - Microsoft Fabric Community

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.