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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.