Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

How to get current login-user's workspace

I would like to automate the capacity ordering and assignment process instead of admin manually assignment.


Step1: End user open an order form, and it will display all his workspace he own as admin

Step2: He could select relevant workspace and our orgnization owned capacity and click submit

Step3: After necessary approval, assignment would be processed automatically.


But I stuck in how to get current login user's workspace.


Below API can only return back all the workspaces, not easily to return login-users workspace.


Below is an API to return back API caller's workspace. But how to get current login-user's token to call such API is a problem.


Anyone has idea about it?

Super User
Super User

Even when you do that you won't know if they are admin or editor/contributor.  We use the Tenant Audit log (WorkspacesUsers)  for these purposes. That log includes the role type.

Could use below api to get user role.


May I know how to get "Tenant Audit log", what are those details inside?

Hi @frankyhc ,

Please open Admin Portal by using  global admin account to enter.


Please refer to the following document about audit logs to see if it helps you.


Best Regards

Community Support Team _ Polly


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



Actually my question is how to get current login user's workspace, not ask how to get audit log.

I am Power BI Service admin, and then not able to get audit log. I viewed the documentation you sent, it seems like only get user's recent activity.

I assume you are on Premium. You need to include a step to promote you users' workspaces from shared to premium.

Don't allow your users to pick a capacity. That is a job for the Power BI service admin.

I am Power BI Service admin, i want to automate the assignment process instead of my manual operation.

I would like to implement an order form to trigger REST API, let user to select workspace from their owned or accessiable ones, submit form and after approval, capacity is assigned automatically

I would propose you look into the tenant inventory logs again. WorkspacesUsers has the mapping. Then you could use a PowerApp to collect their input and Power Automate to run the approval workflow.

Ask your tenant admin to help you.

Helpful resources

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.