Groups API
Create, read, update, and delete groups via the REST API.
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 access token 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, so a request that uses either verb never reaches the Groups API — it falls through to the catch-all route of the octoja web interface and comes back as 200 OK with an HTML page. Check the content type of the response, not the status code alone, if a client might be sending the wrong verb.
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.customerAccess— which customers the group reaches.globalcovers every customer; otherwise the group reaches the customers named incustomerIdsplus every customer matched by the rule set inmatchanditems.deviceAccess— which devices inside that customer scope the group reaches (global,match,items) and what members may do on them (actions). Device access narrows customer access rather than widening it, so a group that reaches no customers reaches no devices.
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. The updatable fields are newName, newPermissions, newMemberUserIds, newIsAdministratorGroup, newCustomerAccess, and newDeviceAccess. 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. - Rules in
newCustomerAccessmay only testCustomerTags,CustomField, orCustomerCustomField. Any other field returns400 Bad Request. - Rules in
newDeviceAccessmay not testCustomerTags— narrow by customer innewCustomerAccessinstead. Sending one returns400 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.
Related articles
Was this helpful?
More in API Reference
API AuthenticationAPI Design PrinciplesError CodesAbout APIStill need help? Ask the team