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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
WimEling
Regular Visitor

Cannot create workspace via Power Pi Api http 500

Hello,

 

I am using the Power Bi Api to try and create a new workspace v2 (https://docs.microsoft.com/en-us/rest/api/power-bi/groups/creategroup#example-creating-a-workspace-v...). But when i try and do this i get an error http 500.

What i am doing is the following:

 

I do a http post call to https://api.powerbi.com/v1.0/myorg/groups?workspaceV2=true  with in de body of the call this:

 

{
  "name": "test"
}

but it always returns a http 500 error code 

 

with this as result 

 

48
{
  "error":{
    "code":"","message":"An error has occurred."
  }
}
0

The app registration that i use to make the call has all the permissions needed to create a workspace. And the app registration also seems to work because other calls do work correctly. 

 

What is wrong with the call and how can i debug this issue ? 

3 REPLIES 3
narayanadvl
New Member

@WimEling I am also getting the same issue. Did you find the solution?

Hi @narayanadvl ,

I would use the PowerBIClient to make the API call a little easier. The PowerBIClient is in the Microsoft.PowerBI.Api namespace. The following code works for me as long as you have a valid PowerBIClient. 

try_catch.PNG

WimEling
Regular Visitor

Maybe I should at the fact that i am using the Service Principal way to connect to the api. So i created and App Registration in Azure with the appropriate permissions. And I added the Service Principal account to the group of users that can use the Power Bi Api. And all other calls are being handled correctly so for example i have created a Workspace by hand and when I import the pbix via the api and set paramaters etc. This all works like a charm. Only creating workspaces via the Api is not working. Has anybody any information of what i am missing here ? 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.