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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. 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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.