Roles

The Roles API allows you to manage permissions within your group. A Role is a collection of settings (like viewVideo or remoteAssist) that can be assigned to users.

Use these endpoints to list, create, update, and delete roles.

Base URL

https://www.glance.net/api/v0

GET List Roles

Returns a list of all roles available within a specific group.

/api/v0/groups/{groupId}/roles

Path Parameters

Parameter Type Description
groupId integer Required. The ID of the group.

Response Schema

Returns an array of role objects.

Field Type Description
roleId integer The unique ID of the role.
name string Display name.
inUse boolean Is assigned to users?

Terminal
curl -X GET "[https://www.glance.net/api/v0/groups/12345/roles](https://www.glance.net/api/v0/groups/12345/roles)" \
  -H "Authorization: Bearer <token>"
Response
[
  {
    "name": "Administrator",
    "roleId": 10,
    "description": "Full access to all settings.",
    "inUse": true,
    "userCount": 5
  },
  {
    "name": "Standard User",
    "roleId": 11,
    "description": "Limited access.",
    "inUse": true,
    "userCount": 42
  }
]

POST Create Role

Create a new role for a group.

/api/v0/groups/{groupId}/roles

Request Body

Parameter Type Description
name string Required. Name (Max 70 chars).
settings object Permission settings.

Response Schema

Returns the newly created role object.

Field Type Description
roleId integer The ID generated for the new role.
name string The role name.

Terminal
curl -X POST "[https://www.glance.net/api/v0/groups/12345/roles](https://www.glance.net/api/v0/groups/12345/roles)" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '[{ "name": "Support", "settings": { "viewVideo": true } }]'
Response
[
  {
    "roleId": 55,
    "name": "Support",
    "inUse": true
  }
]

GET Role Details

Get detailed information about a specific role.

/api/v0/groups/{groupId}/roles/{roleId}

Path Parameters

Parameter Type Description
roleId integer Required. Role ID.

Response Schema

Field Type Description
roleId integer The unique ID of the role.
settings object Full list of permissions.

Terminal
curl -X GET "[https://www.glance.net/api/v0/groups/12345/roles/55](https://www.glance.net/api/v0/groups/12345/roles/55)" \
  -H "Authorization: Bearer <token>"
Response
{
  "roleId": 55,
  "name": "Support",
  "settings": { "viewVideo": true }
}

PUT Update Role

Update an existing role.

/api/v0/groups/{groupId}/roles

Request Body

Parameter Type Description
roleId integer Required. ID to update.

Response Schema

Field Type Description
status string Returns "ok" if successful.

Terminal
curl -X PUT "[https://www.glance.net/api/v0/groups/12345/roles](https://www.glance.net/api/v0/groups/12345/roles)" \
  -H "Authorization: Bearer <token>" \
  -d '[{ "roleId": 55, "name": "New Name" }]'
Response
{ "status": "ok" }

POST Delete Roles

Warning

Role must be unused before deletion.

/api/v0/groups/{groupId}/delete-roles

Request Body

Array of Role IDs.

Response Schema

Field Type Description
status string Returns "ok" if successful.

Terminal
curl -X POST "[https://www.glance.net/api/v0/groups/12345/delete-roles](https://www.glance.net/api/v0/groups/12345/delete-roles)" \
  -H "Authorization: Bearer <token>" \
  -d '[ 55, 56 ]'
Response
{ "status": "ok" }