Groups API
Create, read, update, and delete groups via the REST API.
Written By Erdinc Akay
Last updated 26 days ago
The Groups API lets you create, read, update, and delete groups. Groups combine a permission set with a member list, so assigning a user to a group grants that user the group's permissions.
All endpoints require a valid JWT in the Authorization: Bearer <token> header.
For the complete, always-current list of endpoints, parameters, and response fields for the version you are running, use the interactive OpenAPI (Swagger) interface at https://<your-octoja-instance>/openapi/index.html.
Endpoints
Updates use POST /api/groups/{id}. PUT and PATCH are not registered on this resource and return 404 Not Found.
Fields worth knowing
isAdministratorGroup— marks the group as an administrator group. When an octoja upgrade introduces new permissions, they are granted automatically to every group with this flag.
Update a group
Only send the fields you want to change. Each field is wrapped in an UpdateValue<T> envelope of the shape { "hasValue": true, "value": <T> }; omit the field entirely to leave it untouched. Sending a bare value (for example "newName": "Support") is rejected as a deserialization error. newPermissions and newMemberUserIds each replace the full list rather than merging.
{ "newName": { "hasValue": true, "value": "Support" }, "newPermissions": { "hasValue": true, "value": ["tickets.manage", "customers.manage"] }}Validation:
newNamesent with an empty or whitespace-onlyvaluereturns400 Bad Request.- An unknown permission ID in
newPermissionsreturns400 Bad Request. - An unknown user ID in
newMemberUserIdsreturns400 Bad Request. - Removing the last effective
groups.managecapability is rejected by the safety guard.
Delete a group
Deleting a group removes it from all member users automatically. The safety guard also prevents deleting a group if that would leave no group able to manage groups.