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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
frbastos
New Member

How to enable profile permission workspace Power Bi API

Hi guys, could anyone help me?

I'm developing a SAAS (Software as a Service) application and I want to incorporate Power BI.

I'm following the documentation: https://docs.microsoft.com/pt-br/power-bi/developer/embedded/embed-multi-tenancy, but I'm not able to assign permission to the profiles created.

To release the permissions I'm using the Power BI API. To send the request I am using Postman, as shown below:

1) GET https://api.powerbi.com/v1.0/myorg/groups/{{mygroupid}/users
Header: X-PowerBI-Profile-Id=myprofileid
Response:

 

{
    "value": [
        {
            "groupUserAccessRight": "Admin",
            "displayName": "Numpe",
            "identifier": "326de76f-de5d-46ac-aa03-d88a09149723",
            "principalType": "App",
            "profile": {
                "id": "8c04ccc3-ad55-4add-b0b9-5e294dadac69",
                "displayName": "BaruelVanProfile"
            }
        }
    ]
}

 

 

2) PUT https://api.powerbi.com/v1.0/myorg/groups/{{baruelvan_workspace_id}}/users
Without X-PowerBI-Profile-Id Header
Body: 

 

 

{
    "groupUserAccessRight": "Admin",
    "identifier": "326de76f-de5d-46ac-aa03-d88a09149723",
    "principalType": "App",
    "profile": {
        "id": "8c04ccc3-ad55-4add-b0b9-5e294dadac69"
    }
}

 

 

Response:

 

{
    "error": {
        "code": "PowerBIEntityNotFound",
        "pbi.error": {
            "code": "PowerBIEntityNotFound",
            "parameters": {},
            "details": [],
            "exceptionCulprit": 1
        }
    }
}

 

 

3) 2) PUT https://api.powerbi.com/v1.0/myorg/groups/{{baruelvan_workspace_id}}/users
Header: X-PowerBI-Profile-Id=myprofileid
Body:

 

{
    "groupUserAccessRight": "Admin",
    "identifier": "326de76f-de5d-46ac-aa03-d88a09149723",
    "principalType": "App",
    "profile": {
        "id": "8c04ccc3-ad55-4add-b0b9-5e294dadac69"
    }
}

 

Response:

 

{
    "error": {
        "code": "PowerBINotAuthorizedException",
        "pbi.error": {
            "code": "PowerBINotAuthorizedException",
            "parameters": {},
            "details": [],
            "exceptionCulprit": 1
        }
    }
}

 

 

I would like to know what would be the correct way to make the request to allow access to the workspace.

1 REPLY 1
v-jayw-msft
Community Support
Community Support

Hi @frbastos ,

 

Did you use it immediately after assigning it?

Perhaps you could call the Refresh User Permissions API then try again.

https://docs.microsoft.com/en-us/rest/api/power-bi/users/refresh-user-permissions .

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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