Back in July we released to Public Preview a set of APIs to retrieve user permissions (see this blog post for details). Today, I’m excited to tell you about another nifty API to help you better manage your Power BI asset inventory. The Get User Artifact Access As Admin API takes the graph ID of a user and returns lists of assets that the user has access to. The results are paginated by a continuation token, with each page corresponding to one type of asset.
How can this API be useful to you as a Power BI service administrator? Consider the scenario in which an employee leaves the company. In such cases, there is often a need to examine and reassign all assets owned by the employee.
The API call looks like this:
GET https://api.powerbi.com/v1.0/myorg/admin/users/{userGraphId}/artifactAccess
And the result looks like this:
{ "artifactAccessEntities": [ { "artifactId": "<redacted>", "displayName": "test report", "artifactType": "Report", "accessRight": "ReadWrite" } ], "continuationUri": "https://api.powerbi.com/v1.0/myorg/admin/activityevents?continuationToken='<redacted>'", "continuationToken": "<redacted>" }
A few more notes about this API:
- If a user has access to multiple types of artifacts, the response will be separated into different artifact types, each of which requires a new API call using a continuation token at the end of each result payload. This is the same pattern used in the Get Activity Events API
- This API supports reports (including paginated reports), dashboards, datasets, dataflows, personal workspaces, shared workspaces (both classic and new), capacities, and apps. The graph ID can be that of an AAD user or AAD guest user, a Distribution Group, a Security Group, or a Microsoft 365 Group
- This API can also be called via Service Principal, along with all other read-only Admin APIs
Learn more about this API on the documentation page.
On a related subject, I would also like to call out to all Power BI Service Administrators to upgrade their classic workspace ahead of the upcoming deadlines using the new ‘Upgrade all’ feature via the “Workspaces” tab of the Admin Portal.
As always, leave any feedback or questions in the comments below. We are always looking forward to hearing from you!