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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
jaryszek
Post Prodigy
Post Prodigy

REST APIs to upload pbix into specific folder

Hi Guys,

I am trying to publish report into specific folder using this rest api:
https://learn.microsoft.com/en-us/rest/api/power-bi/imports/post-import-in-group 

 

there is :

subfolderObjectId query
string (uuid)

The subfolder ID to import the file to subfolder.

so my code is:

# @name getGroups
GET https://api.powerbi.com/v1.0/myorg/groups?$filter=name%20eq%20'{{groupName}}'
Authorization: Bearer {{$aadV2Token appOnly}}

@groupId = {{getGroups.response.body.$.value[0].id}}

POST https://api.powerbi.com/v1.0/myorg/groups/{{groupId}}/imports?datasetDisplayName={{fileDisplayName}}&nameConflict=CreateOrOverwrite&subfolderObjectId=12634
Authorization: Bearer {{$aadV2Token appOnly}}
Content-Type: multipart/form-data; boundary=MfnBoundry

--MfnBoundry
Content-Disposition: form-data; name="files"; filename="{{filename}}"
Content-Type: application/octet-stream

< ./{{filename}}
--MfnBoundry--

and is saying that:

{ "code": "ArgumentException", "message": "Invalid format for selected SubfolderObjectId:'12634'" }

why?

it seems that it is treting it as string...

https://app.powerbi.com/groups/2dfe441c-8be6-xxxx-yyyy-e2363bdfc737/list?experience=power-bi&subfolderId=12634

i tried to use this folder id from path but this is not working.

Why? 
Without sunfolderId is working.

Best,
Jacek




1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

The folder ID is a uuid, not what you see in the URL.  Use

 

Items - List Reports - REST API (Report) | Microsoft Learn

 

to figure out the actual folder ID.

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

The folder ID is a uuid, not what you see in the URL.  Use

 

Items - List Reports - REST API (Report) | Microsoft Learn

 

to figure out the actual folder ID.

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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