Skip to main content

User groups

Create group#

Creates a new group. Returns the created Group object.

Request body:

AttributeTypeDescriptionNullable
externalIdStringGroup external idtrue
nameStringName of the groupfalse
descriptionStringDescriptiontrue
blockWebAccessBooleanBlocks access to the web interface for all users of the groupfalse
activeBooleanWhether the group is active. Default truetrue
userIdsList of integersIdentifiers of users to add to the grouptrue
rolesList objectsRoles granted to every member of the group, as a list of {name, description} objectstrue

Examples

curl --request POST https://api.qvalon.com/v1/orgstruct/groups \
--header 'Authorization: Bearer <your_token>' \
--header 'Content-Type: application/json' \
-d '{"name":"Store Managers","description":"All store managers","blockWebAccess":false,"active":true,"userIds":[1609],"roles":[]}'
200 OK
{
"id": 301,
"name": "Store Managers",
"description": "All store managers",
"blockWebAccess": false,
"active": true
}

Update group#

Updates an existing group by id. Returns the updated Group object.
Both userIds and roles must be present in the body (use an empty array if there's nothing to set) โ€” omitting either one causes a 500 Internal Server Error.

Request body:

AttributeTypeDescriptionNullable
externalIdStringGroup external idtrue
nameStringName of the groupfalse
descriptionStringDescriptiontrue
blockWebAccessBooleanBlocks access to the web interface for all users of the groupfalse
activeBooleanWhether the group is activetrue
userIdsList of integersIdentifiers of users in the group. Required โ€” pass an empty array to keep the group emptyfalse
rolesList objectsRoles granted to every member of the group, as a list of {name, description} objects. Required โ€” pass an empty array for nonefalse

Examples

curl --request PUT https://api.qvalon.com/v1/orgstruct/groups/301 \
--header 'Authorization: Bearer <your_token>' \
--header 'Content-Type: application/json' \
-d '{"name":"Store Managers","description":"All store managers, updated","blockWebAccess":false,"active":true,"userIds":[1609],"roles":[]}'
200 OK
{
"id": 301,
"name": "Store Managers",
"description": "All store managers, updated",
"blockWebAccess": false,
"active": true
}

List groups#

Returns a list of Group objects

Request parameters:

Request ParameterTypeDescriptionRequired
nameStringFind group by namefalse
idsList of integersFind groups by idsfalse
fieldsList of stringAdditional group fields to include in the response object. Available values: roles, usersfalse
userIdIntegerFind groups the given user belongs tofalse
skipUserIdIntegerFind groups the given user does NOT belong tofalse
businessDirIdsList of integers (comma-separated)Find groups by business direction idsfalse
onlyActiveBooleanGet only active groups. Default truefalse

Examples

curl https://api.qvalon.com/v1/orgstruct/groups?onlyActive=false \
--header 'Authorization: Bearer <your_token>'
200 OK
[
{
"id": 301,
"name": "Store Managers",
"blockWebAccess": false,
"active": true
},
{
"id": 302,
"name": "Store Employees",
"blockWebAccess": false,
"active": true
}
]

Get user groups#

Returns a list of Group objects the given user belongs to.

Examples

curl https://api.qvalon.com/v1/orgstruct/users/1609/groups \
--header 'Authorization: Bearer <your_token>'
200 OK
[
{
"id": 301,
"name": "Store Managers",
"blockWebAccess": false,
"active": true
}
]

Get groups available to user#

Returns a list of Group objects the given user does not currently belong to โ€” useful for building an "add to group" picker.

Examples

curl https://api.qvalon.com/v1/orgstruct/users/1609/groups/available \
--header 'Authorization: Bearer <your_token>'
200 OK
[
{
"id": 302,
"name": "Store Employees",
"blockWebAccess": false,
"active": true
},
{
"id": 303,
"name": "Office workers",
"blockWebAccess": false,
"active": true
}
]

Add user to groups#

Adds the user to the given groups, in addition to the groups they already belong to.

Examples

curl --request POST https://api.qvalon.com/v1/orgstruct/users/id}/groups/{groupIds \
--header 'Authorization: Bearer <your_token>'
200 OK
{}

Replace user groups#

Replaces the user's groups with the given ones โ€” groups not in the list are removed.

Examples

curl --request PUT https://api.qvalon.com/v1/orgstruct/users/id}/groups/{groupIds \
--header 'Authorization: Bearer <your_token>'
200 OK
{}

Remove groups from user#

Removes the given groups from the user; other groups the user belongs to are left as is.

Examples

curl --request DELETE https://api.qvalon.com/v1/orgstruct/users/id}/groups/{groupIds \
--header 'Authorization: Bearer <your_token>'
200 OK
{}

Remove all groups from user#

Removes the user from all groups they belong to.

Examples

curl --request DELETE https://api.qvalon.com/v1/orgstruct/users/1609/groups \
--header 'Authorization: Bearer <your_token>'
200 OK
{}