Groups API
Endpoints under /api/groups are the primary surface for managing the RBAC model. Frontend clients call /api/groups/me/permissions on login to bootstrap the permission cache. For the conceptual model, see Security → Users & Groups.
Endpoints
/api/groups🔒 authList all groups in the current organization. Returns an array of group objects with id, name, ldap_dn (nullable), and member_count.
/api/groups🔒 authCreate a new local group. Body: {name: string, description?: string}. Returns the created group. Requires group.admin.
/api/groups/:id🔒 authRead a single group by id, including its permission grants and members.
/api/groups/:id🔒 authUpdate a group's name, description, or LDAP mapping. Requires group.admin.
/api/groups/:id🔒 authDelete a group. Members lose any permissions granted only through this group. Requires group.admin.
/api/groups/:id/permissions🔒 authGrant a permission to a group. Body: {permission_type: string, target_id?: string}. See the Permissions Reference for valid permission_type strings.
/api/groups/:id/permissions/:permission_id🔒 authRevoke a specific permission grant from a group.
/api/groups/me/permissions🔒 authReturn the flattened permission set for the currently authenticated user, computed from all group memberships. Used by the frontend usePermission() hook to bootstrap the permission cache on login.
Membership
/api/groups/:id/members🔒 authAdd a user to a group. Body: {user_id: string}.
/api/groups/:id/members/:user_id🔒 authRemove a user from a group.
LDAP-mapped groups
When a group has a non-null ldap_dn, membership is read from the directory server and cannot be modified via the membership endpoints — those return 409 Conflict. To change membership of an LDAP-mapped group, modify the directory and wait for the next sync cycle.