Search the docs
Menu
Updated Edit on GitHub

Console: device-groups

Copy as Markdown

These routes are on the console, port 3375. They take an API token as Authorization: Bearer ndt_...; see API tokens.

Device groups (manual and by tag).

GET /api/device-groups

List device groups.

Answers the groups the account may see, without the groups that hold a folder's access list. A field group carries field_filter (the conditions on fields the account sees), field_filter_hidden (how many it doesn't see) and filter_locked; its tag_filter holds only the conditions the account sees.

Needs device.view. neodesk device-groups list calls it.

200: Done (application/json)

Field Type Required
success true yes
data object yes
data.groups array of DeviceGroup yes
data.total integer yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token

POST /api/device-groups

Create a device group, or change one when guid is given.

Without guid it makes a group; with guid it changes that one and keeps a note and team ID the body leaves out. Changing the access lists needs the right to change the group's access. A folder's group can't be changed here. A field group (source_type field) takes in the devices whose device field values meet its conditions; an account that sees only part of the devices makes no tag or field group.

Needs device.edit. neodesk device-groups save calls it.

Request body, application/json:

Field Type Required What it is
guid string The group to change; at most 80 characters
name string yes at most 80 characters
note string at most 512 characters
team_id string at most 64 characters
source_type string, one of manual, tag, field tag makes a group that holds every device with its tag, field one that holds every device whose device field values meet field_filter; default "manual"
dynamic boolean true does the same as source_type tag
tag_filter string The tag of a tag group; required with source_type tag; at most 50 characters
tag string Another name for tag_filter
allowed_users array of string Usernames that may see the group's devices; at most 100 items
allowed_groups array of string GUIDs of the user groups whose members may see the group's devices; at most 100 items
field_filter array of string or object or string The conditions of a field group: a list of key:op:value (ops eq, contains, min, max; key:empty and key:notempty) or of {key, op, value}, or text with one condition per line. A device joins when it meets every one. Only fields the account sees may be named; a stored filter that names fields the account doesn't see stays and must be sent as the list shows it (else 403 device_field_group_filter_locked).

200: Done (application/json)

Field Type Required What it is
success true yes
data object yes
data.allowed_groups array of string
data.allowed_users array of string
data.created boolean true for a new group
data.created_at string (date-time)
data.guid string
data.id integer
data.name string
data.note string
data.source_type string
data.tag_filter string
data.team_id string
Error When
400 The request is not valid
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such item, or the account does not see it

DELETE /api/device-groups/{guid}

Delete a device group.

A folder's group can't be deleted here.

Needs device.edit. neodesk device-groups delete calls it. It cannot be undone.

Parameter In Type Required What it is
guid path string yes The group's GUID; at most 80 characters

200: Done (application/json)

Field Type Required
success true yes
Error When
400 The request is not valid
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such item, or the account does not see it

Type to search pages, sections, commands and settings.