Overview
Groups are smaller communities within spaces. Each group belongs to a space and has its own members and moderators. Groups can be public or private.
Groups are accessed via the PocketBase REST API groups collection. There are no custom /api/groups endpoints - all operations use standard PocketBase collection endpoints documented below.
Group Object
A group object contains the following fields:
Whether the group is publicly accessible
Array of user IDs who moderate the group
ISO 8601 timestamp of creation
ISO 8601 timestamp of last update
List Groups
Retrieve all groups, optionally filtered by space.
Request
curl -X GET "https://your-domain.com/api/collections/groups/records?filter=space='SPACE_ID'&page=1&perPage=30" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"
Page number for pagination
Number of groups per page
Filter expression (e.g., space='SPACE_ID', isPublic=true)
Response
{
"page": 1,
"perPage": 30,
"totalItems": 3,
"totalPages": 1,
"items": [
{
"id": "GROUP_ID",
"collectionId": "groups_collection_id",
"collectionName": "groups",
"name": "Machine Learning Club",
"description": "Group for ML enthusiasts",
"space": "SPACE_ID",
"isPublic": true,
"moderators": ["USER_ID"],
"created": "2026-01-15 00:00:00.000Z",
"updated": "2026-03-01 00:00:00.000Z"
}
]
}
Get Group
Retrieve a single group by ID.
Request
curl -X GET "https://your-domain.com/api/collections/groups/records/{id}" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"
Response
{
"id": "GROUP_ID",
"collectionId": "groups_collection_id",
"collectionName": "groups",
"name": "Machine Learning Club",
"description": "Group for ML enthusiasts",
"space": "SPACE_ID",
"isPublic": true,
"moderators": ["USER_ID"],
"created": "2026-01-15 00:00:00.000Z",
"updated": "2026-03-01 00:00:00.000Z"
}
Create Group
Create a new group within a space.
Request
curl -X POST "https://your-domain.com/api/collections/groups/records" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "New Study Group",
"description": "Group for studying together",
"space": "SPACE_ID",
"isPublic": true,
"moderators": ["USER_ID"]
}'
Whether the group is publicly accessible
Array of user IDs who will moderate the group
Response
{
"id": "GROUP_ID",
"collectionId": "groups_collection_id",
"collectionName": "groups",
"name": "New Study Group",
"description": "Group for studying together",
"space": "SPACE_ID",
"isPublic": true,
"moderators": ["USER_ID"],
"created": "2026-03-03 12:00:00.000Z",
"updated": "2026-03-03 12:00:00.000Z"
}
Update Group
Update an existing group. Requires space moderator or group moderator permissions.
Request
curl -X PATCH "https://your-domain.com/api/collections/groups/records/{id}" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"description": "Updated group description"
}'
Response
{
"id": "GROUP_ID",
"collectionId": "groups_collection_id",
"collectionName": "groups",
"name": "New Study Group",
"description": "Updated group description",
"space": "SPACE_ID",
"isPublic": true,
"moderators": ["USER_ID"],
"created": "2026-03-03 12:00:00.000Z",
"updated": "2026-03-03 13:00:00.000Z"
}
Delete Group
Delete a group. Requires space moderator or group moderator permissions.
Request
curl -X DELETE "https://your-domain.com/api/collections/groups/records/{id}" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"
Response
HTTP 204 No Content
Group Membership
Group membership is managed through the group_members collection.
List Group Members
curl -X GET "https://your-domain.com/api/collections/group_members/records?filter=group='GROUP_ID'&expand=user" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"
Response
{
"page": 1,
"perPage": 30,
"totalItems": 5,
"totalPages": 1,
"items": [
{
"id": "MEMBER_ID",
"collectionId": "group_members_collection_id",
"collectionName": "group_members",
"group": "GROUP_ID",
"user": "USER_ID",
"role": "member",
"created": "2026-02-01 00:00:00.000Z",
"updated": "2026-02-01 00:00:00.000Z",
"expand": {
"user": {
"id": "USER_ID",
"username": "username",
"email": "[email protected]"
}
}
}
]
}
Add Group Member
curl -X POST "https://your-domain.com/api/collections/group_members/records" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"group": "GROUP_ID",
"user": "USER_ID",
"role": "member"
}'
Member role: member or moderator
Response
{
"id": "MEMBER_ID",
"collectionId": "group_members_collection_id",
"collectionName": "group_members",
"group": "GROUP_ID",
"user": "USER_ID",
"role": "member",
"created": "2026-03-03 12:00:00.000Z",
"updated": "2026-03-03 12:00:00.000Z"
}
Update Member Role
curl -X PATCH "https://your-domain.com/api/collections/group_members/records/{id}" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"role": "moderator"
}'
Remove Group Member
curl -X DELETE "https://your-domain.com/api/collections/group_members/records/{id}" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"
Group Posts
To retrieve posts for a specific group, use the Posts API with group filtering:
curl -X GET "https://your-domain.com/api/posts?scope=group&group=GROUP_ID" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"
See the Posts API documentation for more details.
Permissions
- Group Moderator: Can manage group content and members
- Space Moderator: Can manage all groups within their space
- Group Member: Can view and post content in the group