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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
gautamj
New Member

REST API - Remove User Access Not Working

I want to revoke user access to a dataset using REST APIs. According to the documentation, I can use this API endpoint with `datasetUserAccessRight: None` to remove all the dataset permissions of the specified user.

 

Upon using this API endpoint, I get a 200 successful response, but the user still has access to the dataset. I also tried refreshing the user permissions as mentioned here.

 

Is there a bug in the API itself or is my request wrong?

EDIT: This issue happens only when I first grant access to a user via this API endpoint. After this, I can confirm that the user has been given the permissions using this API endpoint as well as by manually checking in PowerBI under Manage Permissions. Now, if I try to revoke access using this API endpoint, the user permission IS removed when checking using this API endpoint as well as in PowerBI Manage Permissions. However, the user still has access to the dataset.

 

SOLUTION: There was a link configured for the dataset that allowed Read access to everyone in the organization. Thus, even though I revoked the permission individually for the user, they were still able to view because of the link. Removing the global read access link solved the issue.

 

 

 

    headers = {
        'Content-Type': 'application/json',
        'Authorization': f'Bearer {access_token}'
    }

    api_url = f'https://api.powerbi.com/v1.0/myorg/groups/{group_id}/datasets/{dataset_id}/users'

    share_details = {
        "identifier": user,
        "principalType": "User",
        "datasetUserAccessRight": "None"
    }

    response = requests.put(api_url, headers=headers,
                            data=json.dumps(share_details))

 

 

1 ACCEPTED SOLUTION
gautamj
New Member

SOLUTION: There was a link configured for the dataset that allowed Read access to everyone in the organization. Thus, even though I revoked the permission individually for the user, they were still able to view because of the link. Removing the global read access link solved the issue.

View solution in original post

5 REPLIES 5
gautamj
New Member

SOLUTION: There was a link configured for the dataset that allowed Read access to everyone in the organization. Thus, even though I revoked the permission individually for the user, they were still able to view because of the link. Removing the global read access link solved the issue.

aj1973
Community Champion
Community Champion

Hi @gautamj 

Are you the Dataset owner? Do you have all rights on the folder of the dataset? Please read the limitations of the API you might fall into one of them 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

I've updated my post. I am able to remove the user permissions, but it looks like the user still has access to the dataset.

lbendlin
Super User
Super User

did you wait the recommended two minutes?

Yes, the user is indeed removed from the list of users with access to the dataset under Manage Permissions in PowerBI. However, the user still has access to it.

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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

Top Kudoed Authors