Hello folks. Are there any workspace level APIs th...
# general
i
Hello folks. Are there any workspace level APIs that I can use to get all users and their roles across different projects? The purpose is to get this data to be uploaded to our compliance software for auditing purposes.
d
Hi @Imran Bohoran, If you mean end users of your app (not workspace admins), use:
GET /v2/facts/{proj_id}/{env_id}/role_assignments
— or
/role_assignments/detailed
for inlined user/role/tenant objects. Each result includes
user
,
role
,
tenant
,
resource_instance
,
project_id
, and
environment_id
— ideal for a compliance export. A few notes: • It's scoped per environment, so loop over each project/env pair (
GET /v2/projects
, then
GET /v2/projects/{proj_id}/envs
). • Paginate with
page
/
per_page
(max 100); use
include_total_count=true
. • Use a project- or org-scoped API key. Reference: List Role Assignments
o
you can use the members API to list users in Permit itself @Ask Inkeep
a
Thanks for tagging me @Or Weis. I'll look through relevant sources and get back to you shortly.
Based on the available sources, I can confirm information about workspace member management through the Permit.io dashboard. (1) For ​*workspace-level member management*​, you can access this through the Settings screen by choosing the Members tab. This allows you to manage team members and their access within your workspace. The workspace supports different member roles including: • ​*Workspace Owner*​ - can create new roles, resources and policies, change workspace settings and invite new members • ​*Workspace Editor*​ - can create new roles, resources and policies but cannot invite or change access of other team members • ​*Workspace Viewer*​ - can only view roles, resources and policies, cannot invite or change access of other team members However, the available sources don't provide specific API endpoints for programmatically retrieving all workspace members and their roles across projects for compliance purposes. The documentation I have access to focuses on the UI-based member management rather than API endpoints for this functionality. For your compliance software integration needs, you may want to reach out over Email to inquire about specific API endpoints for workspace-level member data export. **
To learn more, see the sources I considered: [[1] Workspace Settings](https://docs.permit.io/manage-your-account/workspace-settings)
o
a
Thanks for tagging me @Or Weis. I'll look through relevant sources and get back to you shortly.
Thank you for providing that API endpoint! Based on the conversation thread, there are two different types of users you might need to export for compliance: ​*1. Workspace Members (Permit.io team members) :*​ Use the Members API endpoint you shared:
GET /v2/orgs/{org_id}/members
This returns workspace members (developers, admins managing Permit.io itself) with their workspace-level roles like Workspace Owner, Workspace Editor, or Workspace Viewer. (1) ​*2. End Users (application users with role assignments) :*​ For your application's end users and their assigned roles across projects/environments, use:
GET /v2/facts/{proj_id}/{env_id}/role_assignments/detailed
(2) This returns role assignments with user, role, tenant, resource_instance, project_id, and environment_id information. Since this is scoped per environment, you'll need to loop through each project and environment to get complete coverage. (3) For compliance auditing purposes, you'll likely need ​*both*​ datasets: • Workspace members (who manages your authorization system) • End user role assignments (who has access to what in your application) The
To learn more, see the sources I considered: [[1] Workspace Settings](https://docs.permit.io/manage-your-account/workspace-settings) [[2] GET /v2/facts/{proj_id}/{env_id}/role_assignments/detailed](https://api.permit.io/v2/redoc#tag/Role-Assignments/operation/list_role_assignments_detailed) [[3] Overview](https://docs.permit.io/api/examples/filter-role-associations)