Overview
The Groups API provides endpoints for managing user groups. Groups allow you to organize users and assign roles at the group level, making it easier to manage permissions for multiple users.List Groups
Retrieve all groups for the current tenant with optional search filtering.HTTP Request
GET /api/v1/identity/groups
Authorization
RequiresPermissions.Groups.View permission.
Query Parameters
Optional search term to filter groups by name or description
Response
Returns an array ofGroupDto objects.
Group’s unique identifier
Group name
Group description (optional)
Whether this is a default group (new users are automatically added)
Whether this is a system-managed group (cannot be deleted)
Number of users in the group
Array of role IDs assigned to the group
Array of role names assigned to the group
Timestamp when the group was created
Response Example
Get Group by ID
Retrieve a specific group by its unique identifier.HTTP Request
GET /api/v1/identity/groups/{id}
Authorization
RequiresPermissions.Groups.View permission.
Path Parameters
The unique identifier of the group
Response
Returns aGroupDto object with group details.
Create Group
Create a new group with optional role assignments.HTTP Request
POST /api/v1/identity/groups
Authorization
RequiresPermissions.Groups.Create permission.
Request Body
Group name (must be unique within the tenant)
Group description (optional)
Whether new users should be automatically added to this group
Array of role IDs to assign to the group (optional)
Response
Returns the createdGroupDto object.
Response Example
Update Group
Update an existing group’s details and role assignments.HTTP Request
PUT /api/v1/identity/groups/{id}
Authorization
RequiresPermissions.Groups.Update permission.
Path Parameters
The unique identifier of the group to update
Request Body
Same as Create Group request body.Response
Returns200 OK on successful update.
Delete Group
Soft delete a group. System groups cannot be deleted.HTTP Request
DELETE /api/v1/identity/groups/{id}
Authorization
RequiresPermissions.Groups.Delete permission.
Path Parameters
The unique identifier of the group to delete
Response
Returns200 OK on successful deletion.
Notes
- System groups (where
isSystemGroup = true) cannot be deleted - Deleting a group does not delete its members, only their group membership
- Users in the deleted group will lose permissions derived from group role assignments
Get Group Members
Retrieve all members of a specific group.HTTP Request
GET /api/v1/identity/groups/{id}/members
Authorization
RequiresPermissions.Groups.View permission.
Path Parameters
The unique identifier of the group
Response
Returns an array ofGroupMemberDto objects containing user information.
Add Users to Group
Add one or more users to a group.HTTP Request
POST /api/v1/identity/groups/{groupId}/members
Authorization
RequiresPermissions.Groups.ManageMembers permission.
Path Parameters
The unique identifier of the group
Request Body
Array of user IDs to add to the group
Response
Returns information about the operation, including:- Count of users successfully added
- List of users already in the group (if any)
Remove User from Group
Remove a specific user from a group.HTTP Request
DELETE /api/v1/identity/groups/{groupId}/members/{userId}
Authorization
RequiresPermissions.Groups.ManageMembers permission.
Path Parameters
The unique identifier of the group
The unique identifier of the user to remove
Response
Returns200 OK on successful removal.
Get User Groups
Retrieve all groups that a specific user belongs to.HTTP Request
GET /api/v1/identity/users/{userId}/groups
Authorization
RequiresPermissions.Users.View permission.
Path Parameters
The unique identifier of the user
Response
Returns an array ofGroupDto objects representing the user’s group memberships.
Group-Based Permissions
Groups provide an efficient way to manage permissions at scale:- Role Assignment: Roles are assigned to groups, not individual users
- Permission Inheritance: Users inherit all permissions from their group’s roles
- Centralized Management: Update permissions for multiple users by modifying group roles
- Default Groups: Automatically add new users to specific groups
Example Workflow
Best Practices
System groups are protected and cannot be deleted. Use them for critical organizational structures.
