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
argometrix
New Member

Powerbi api Admin - Capacities AssignWorkspacesToCapacity capacityMigrationAssignments data

I wanted to set power bi capacity to a specific workspace using this https://api.powerbi.com/v1.0/myorg/admin/capacities/AssignWorkspaces api. I have the request body set as
{
"capacityMigrationAssignments": [
{
"workspacesToAssign": "worspace_id",
"targetCapacityObjectId": "capacity id"
}
]
}
I also tried to pass it as object but doesn't seem to be working. What type of data does capacityMigrationAssignments take and how is the data passed in postman?

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @argometrix ,

If you want to assign the provided workspaces to the specified capacity, there're some notes:

Note: The user must have administrator rights (such as Office 365 Global Administrator or Power BI Service Administrator) to call this API.

Required scope: Tenant.Read.All or Tenant.ReadWrite.All
To set the permissions scope, see Register an app.

This is the example Request:

curl --location --request POST 'https://api.powerbi.com/v1.0/myorg/admin/capacities/AssignWorkspaces' \
--header 'Content-Type: application/json' \
--data-raw '{
	"capacityMigrationAssignments": ""
}'

Reference: Power BI REST API v1

Admin - Capacities AssignWorkspacesToCapacity - REST API (Power BI Power BI REST APIs) | Microsoft D...

 

Best Regards,
Community Support Team _ kalyj

 

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

 

 

 

View solution in original post

6 REPLIES 6
PrashantNagouda
Frequent Visitor

Even I'm facing same issue, How to pass workspace ID and capacity ID. Can you share sample request body?

asarraf21
Frequent Visitor

this is the payload that worked for me:

{
	"capacityMigrationAssignments": 
	[
		{
			"targetCapacityObjectId": "capacity-id",
			"workspacesToAssign": [
				"workspace-id"
			]
		}
	]
}

 

argometrix
New Member

I wanted to set power bi capacity to a specific workspace using this https://api.powerbi.com/v1.0/myorg/admin/capacities/AssignWorkspaces api. I have the request body set as
{
"capacityMigrationAssignments": [
{
"workspacesToAssign": "worspace_id",
"targetCapacityObjectId": "capacity id"
}
]
}
I also tried to pass it as object but doesn't seem to be working. What type of data does capacityMigrationAssignments take and how is the data passed in postman?

Hi @argometrix 

This thread is same as https://community.powerbi.com/t5/Service/Powerbi-api-Admin-Capacities-AssignWorkspacesToCapacity/m-p..., they will be merged later, thanks for your understanding.

 

Best Regards,

Community Support Team _Tang

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

v-yanjiang-msft
Community Support
Community Support

Hi @argometrix ,

If you want to assign the provided workspaces to the specified capacity, there're some notes:

Note: The user must have administrator rights (such as Office 365 Global Administrator or Power BI Service Administrator) to call this API.

Required scope: Tenant.Read.All or Tenant.ReadWrite.All
To set the permissions scope, see Register an app.

This is the example Request:

curl --location --request POST 'https://api.powerbi.com/v1.0/myorg/admin/capacities/AssignWorkspaces' \
--header 'Content-Type: application/json' \
--data-raw '{
	"capacityMigrationAssignments": ""
}'

Reference: Power BI REST API v1

Admin - Capacities AssignWorkspacesToCapacity - REST API (Power BI Power BI REST APIs) | Microsoft D...

 

Best Regards,
Community Support Team _ kalyj

 

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

 

 

 

Your solution -clearly- does not address the problem, you keep the capacityMigrationAssignments block empty. 

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.

60 days of Data Days Carousel

Data Days 2026

Join Fabric 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.