Group management endpoints for creating, updating, and managing user groups.
List Groups
curl -X GET "https://your-domain.com/api/groups" \
-H "Authorization: Bearer YOUR_TOKEN"
Retrieves all groups accessible to the authenticated user.
Query Parameters
Filter by share permission. For non-admin users, filters groups based on membership and share settings.
Response
Array of group objects
ID of user who created the group
Additional group data including configuration
Configuration settingsShare permission: true, false, or members
Group-specific permissions
Number of members in the group
Unix timestamp of creation
Unix timestamp of last update
Create Group
curl -X POST "https://your-domain.com/api/groups/create" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Engineering Team",
"description": "Engineering department group",
"permissions": {},
"data": {
"config": {
"share": "members"
}
}
}'
Creates a new group. Requires admin authentication.
Request Body
Group-specific permissions
Additional group data. If not provided, default share configuration is applied.
Get Group
curl -X GET "https://your-domain.com/api/groups/id/group-123" \
-H "Authorization: Bearer YOUR_TOKEN"
Retrieves detailed information about a specific group. Requires admin authentication.
Path Parameters
The unique identifier of the group
Update Group
curl -X POST "https://your-domain.com/api/groups/id/group-123/update" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Group Name",
"description": "Updated description",
"permissions": {}
}'
Updates group information. Requires admin authentication.
Request Body
Updated group description
Add Users to Group
curl -X POST "https://your-domain.com/api/groups/id/group-123/users/add" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"user_ids": ["user-1", "user-2", "user-3"]
}'
Adds users to a group. Requires admin authentication.
Request Body
Array of user IDs to add to the group. Invalid user IDs are automatically filtered out.
Remove Users from Group
curl -X POST "https://your-domain.com/api/groups/id/group-123/users/remove" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"user_ids": ["user-1", "user-2"]
}'
Removes users from a group. Requires admin authentication.
Request Body
Array of user IDs to remove from the group
Get Group Users
curl -X POST "https://your-domain.com/api/groups/id/group-123/users" \
-H "Authorization: Bearer YOUR_TOKEN"
Retrieves all users in a specific group. Requires admin authentication.
Response
Returns an array of user objects with basic information:
[
{
"id": "user-123",
"name": "John Doe",
"email": "john@example.com",
"role": "user",
"bio": "Software developer",
"groups": [],
"is_active": true
}
]
Export Group
curl -X GET "https://your-domain.com/api/groups/id/group-123/export" \
-H "Authorization: Bearer YOUR_TOKEN"
Exports complete group information including all user IDs. Requires admin authentication.
Response
Returns group object with additional user_ids field:
Array of all user IDs in the group
Delete Group
curl -X DELETE "https://your-domain.com/api/groups/id/group-123/delete" \
-H "Authorization: Bearer YOUR_TOKEN"
Deletes a group and all member associations. Requires admin authentication.
Response
Returns true if successful, error otherwise.
Notes
- Admin users can access all groups regardless of membership
- Non-admin users can only see groups they are members of (unless group share is set to
true)
- Group share settings:
true or "true": Anyone can share to this group
false or "false": Nobody can share to this group
"members": Only group members can share to this group
- Adding duplicate users to a group is silently ignored
- Invalid user IDs are automatically filtered when adding users
- All group operations update the
updated_at timestamp