- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Upload a JSON file using Power BI API
Hi,
I'm trying to upload a small json file to create a new dataset using the import API with Postman but I always get 400 Bad Request (RequestedFileIsEncryptedOrCorrupted) as response.
Here is the response
{
"error": {
"code": "RequestedFileIsEncryptedOrCorrupted",
"pbi.error": {
"code": "RequestedFileIsEncryptedOrCorrupted",
"parameters": {},
"details": [],
"exceptionCulprit": 1
}
}
}
The content of my json
[
{
"id": 1,
"name": "Luke",
"randomNumber" : 5.854668
},
{
"id": 2,
"name": "Lisa",
"randomNumber" : 10.3846846
},
{
"id": 3,
"name": "Tom",
"randomNumber" : 52.36541
}
]
Postman snapshots
I also tried with others .json and .xlsx but I get the same error and I don't know why, maybe I missed something in the doc.
Thanks for help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@FelixC I thought json files were only for importing dataflows.
Imports - Post Import - REST API (Power BI Power BI REST APIs) | Microsoft Docs
Is this being set? Hard to see in your screen shots:
- To import a file, specify the content type multipart/form-data in the request headers and encode the file as form data in the request body.
Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!: Power BI Cookbook Third Edition (Color)
DAX is easy, CALCULATE makes DAX hard...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Greg_Deckler
Yes, Content-Type is set to "multipart/form-data", you can click on screenshot to open image.
I'm new with PowerBi and this API so maybe it's not the good way to create dataset.
I just want to create new dataset in Power BI online service from a web server with json or directly from my database. This has to be automatic so I can't use Power BI Desktop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@FelixC Here's what I would try. Create a small, couple MB PBIX file and see if you can post it as a dataset using the API. This should remove any doubt about whether it is something you are doing wrong in postman or it is simply that you are trying to do something that is not supported with a JSON file. I can't find any information about using JSON to create datasets other than maybe Push datasets. This article claims to do what you want to do but doesn't actually use the Power BI REST API, I think the author is confused.
Importing data from JSON files and Power BI Rest APIs into Power BI (sqlshack.com)
Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!: Power BI Cookbook Third Edition (Color)
DAX is easy, CALCULATE makes DAX hard...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Greg_Deckler
I just tried and it works with a PBIX file so maybe it's not possible with json.
I read this article but the author use an external api to generate data and connect PowerBI desktop on it and that's not what I want.
It's really strange there is no way to add new data from json or database to PowerBI online like in PowerBI desktop.
Maybe I sould create a new ticket for this question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @FelixC
I think you can try Post Import or Post Import in Group Rest API to import Json File in your My Workspace or App Workspaces.
For reference:
Imports - Post Import In Group
To use this Rest API, you need Dataset.ReadWrite.All permission. You can select it in API Permission in Azure portal.
You can use "Try it" to have a test from Link. If you configure your APP correctly, you should succeed.
I suggest you to check your Authorization Bear token. I can get access token by API in Postman then copy this bear token into Authorization pane instead of adding it in Header pane.
For reference: Power BI REST API using postman - generate embed token.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
how in the "Try it" I can upload my json file?
Thanks for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @FelixC
According to the blog, Power BI supports us to create a dataflow from a model.json file.
- To import a file, specify the content type multipart/form-data in the request headers and encode the file as form data in the request body.
- To create a dataflow from a model.json file, set
datasetDisplayName
to model.json, as described in URI parameters.
We can use dataflow as the datasource to create a dataset.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, but here
I can't add my file and I don't know how to encode the file as form data in this form.
In postman there is a section for "form data" file and it works for pbix file but not for json.
Félix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @FelixC
I find a post with similar requirement like yours. I hope it could help you.
For reference: Power BI API Dataflow Import Operation
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Anonymous,
Thanks for the link, I'll give it a try.
So after multiple research it is not possible to add data in dataset from a json. This API route is used to create dataflow!
Best Regards
Félix

Helpful resources
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.
Power BI Monthly Update - June 2025
Check out the June 2025 Power BI update to learn about new features.

User | Count |
---|---|
11 | |
6 | |
6 | |
2 | |
2 |
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
3 |