Search the docs
Menu
Updated Edit on GitHub

Console: fleet

Copy as Markdown

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

Fleet tasks, workflows, compliance and resources.

GET /api/panel/fleet/availability

Show whether the server API has fleet routes.

Asks the server API for its tasks. available is false only when the server API answers 404 there, as one that is too old does.

Needs org.manage_devices. neodesk fleet availability calls it.

200: Done (application/json)

Field Type Required
success true yes
available boolean 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

GET /api/panel/fleet/organizations

List the organizations whose fleet resources you manage.

The organizations of the server API that the account may reach under Fleet, Resources: every one for an admin, super admin or global admin, the ones it is a member of for any other account (limited).

Needs org.manage_devices. neodesk fleet organizations calls it.

200: Done (application/json)

Field Type Required What it is
success true yes
organizations array of Organization yes
limited boolean yes The list holds only the organizations the account is a member of
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

GET /api/panel/fleet/compliance

List the compliance state of devices.

Lists the devices the caller sees with the result of their last compliance scan.

Needs org.manage_devices. neodesk fleet compliance calls it.

Parameter In Type What it is
orgId query string Only the devices of this organization; without it every organization the caller is a member of

200: Done (application/json)

Field Type Required What it is
success true yes
devices array of object yes
devices[].id string
devices[].device_id string
devices[].org_id string
devices[].hostname string
devices[].os string
devices[].platform string
devices[].score integer or null Percent of checks passed, null before the first scan
devices[].issues integer or null Failed checks, null before the first scan
devices[].last_scan string "" before the first scan
devices[].status string pending, ok or error; "" when no scan was asked for
Error When
400 orgId is not one valid ID
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account may not do this, or not a member of this organization
404 There is no such organization

GET /api/panel/fleet/compliance/{deviceId}

Show a device's last compliance scan.

checks and software are empty before the first scan.

Needs org.manage_devices. neodesk fleet compliance-device calls it.

Parameter In Type Required What it is
deviceId path string yes The device's ID

200: Done (application/json)

Field Type Required What it is
success true yes
id string
device_id string
hostname string
os string
score integer or null
issues integer or null
last_scan string "" before the first scan
status string pending, ok or error; "" when no scan was asked for
checks array of object
checks[].key string
checks[].ok boolean
checks[].detail string
checks[].fixable boolean
software array of object
software[].name string
software[].version string
software[].publisher string
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account may not do this, or the device is not in the caller's organization or scope
404 There is no such device (error device_not_found)

POST /api/panel/fleet/compliance/{deviceId}/remediate

Fix what a device can fix, then scan it.

Queues a scan that first fixes the failed checks the device can fix. The result comes in when the device answers.

Needs org.manage_devices. neodesk fleet remediate calls it.

Parameter In Type Required What it is
deviceId path string yes The device's ID

202: The scan is queued (application/json)

Field Type Required
success true yes
accepted true yes
command_id integer yes
device_id string yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account may not do this, or the device is not in the caller's scope, or is NeoDesk Companion (error support_agent_restricted)
404 There is no such device (error device_not_found)
500 The command could not be queued (error command_queue_failed)

POST /api/panel/fleet/compliance/{deviceId}/scan

Ask a device for a compliance scan.

Queues the scan for the device; the result comes in when the device answers.

Needs org.manage_devices. neodesk fleet scan calls it.

Parameter In Type Required What it is
deviceId path string yes The device's ID

202: The scan is queued (application/json)

Field Type Required
success true yes
accepted true yes
command_id integer yes
device_id string yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account may not do this, or the device is not in the caller's scope, or is NeoDesk Companion (error support_agent_restricted)
404 There is no such device (error device_not_found)
500 The command could not be queued (error command_queue_failed)

GET /api/panel/fleet/resources/{orgId}

List an organization's resources.

devices counts the organization's devices that get each resource, applied those whose last list they applied. The caller must be a member of the organization, unless a super admin or global admin.

Needs org.manage_devices. neodesk fleet resources calls it.

Parameter In Type Required What it is
orgId path string yes The organization's ID

200: Done (application/json)

Field Type Required
success true yes
resources array of FleetResource and object yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account may not do this, or not a member of this organization
404 There is no such organization

POST /api/panel/fleet/resources/{orgId}

Add a resource to an organization.

Sends every device of the organization whose resource list changed its new list. The caller must be a member of the organization, unless a super admin or global admin.

Needs org.manage_devices. neodesk fleet resource-create calls it.

Parameter In Type Required What it is
orgId path string yes The organization's ID

Request body, application/json:

Field Type Required What it is
name string yes at most 120 characters
type string, one of printer, network_drive, dns, vpn, proxy yes
address string yes value is read when address is not given; at most 1024 characters
scope string, one of org, group, device org when not given
scope_value string For group the device group names, for device the device IDs of the organization, separated by commas; at most 1024 characters
active boolean or integer or string true when not given

201: Created (application/json)

Field Type Required What it is
success true yes
id integer yes
resource FleetResource yes
queued integer yes How many devices were sent their new list
Error When
400 The body is no JSON object, or a field is missing or 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 organization

PUT /api/panel/fleet/resources/{orgId}/{resourceId}

Change a resource of an organization.

Changes the fields the body has and sends the devices whose resource list changed their new list. The caller must be a member of the organization, unless a super admin or global admin.

Needs org.manage_devices. neodesk fleet resource-set calls it.

Parameter In Type Required What it is
orgId path string yes The organization's ID
resourceId path integer yes The resource's ID; at least 1

Request body, application/json:

Field Type What it is
name string at most 120 characters
type string, one of printer, network_drive, dns, vpn, proxy
address string value is read when address is not given; at most 1024 characters
scope string, one of org, group, device org when not given
scope_value string For group the device group names, for device the device IDs of the organization, separated by commas; at most 1024 characters
active boolean or integer or string

200: Done (application/json)

Field Type Required
success true yes
id integer yes
resource FleetResource yes
queued integer yes
Error When
400 The body is no JSON object, or a field 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 resource in the organization

DELETE /api/panel/fleet/resources/{orgId}/{resourceId}

Delete a resource of an organization.

The devices that had it are sent their new list. The caller must be a member of the organization, unless a super admin or global admin.

Needs org.manage_devices. neodesk fleet resource-delete calls it. It cannot be undone.

Parameter In Type Required What it is
orgId path string yes The organization's ID
resourceId path integer yes The resource's ID; at least 1

200: Done (application/json)

Field Type Required
success true yes
queued 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
404 There is no such resource in the organization

GET /api/panel/fleet/tasks

List fleet tasks.

Lists the tasks the caller sees: of its organization, or of no organization and of the organizations it is a member of.

Needs org.manage_devices. neodesk fleet tasks calls it.

Parameter In Type What it is
orgId query string Only the tasks of this organization
status query string Only the tasks in this state (at most 64 characters)
deviceId query string Only the tasks that run on this device

200: Done (application/json)

Field Type Required
success true yes
tasks array of FleetTask yes
Error When
400 A filter is not one valid text
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account may not do this, or not a member of the organization of the filter

POST /api/panel/fleet/tasks

Create a fleet task.

An immediate task is sent to its devices at once; a once or cron task waits for its time. NeoDesk Companion devices take no fleet tasks. The task is created by the signed-in account.

Needs org.manage_devices. neodesk fleet task-create calls it.

Request body, application/json:

Field Type Required What it is
name string yes at most 120 characters
type string, one of script, restart, update, install, file_deploy, registry yes task_type is read when type is not given
targets string yes Device IDs and device group names, at most 500, separated by commas, semicolons or line breaks (or spaces when there are none); device_id is read when targets is not given; at most 8192 characters
schedule_type string, one of immediate, once, cron immediate when not given
schedule_value string For once an RFC 3339 time or a date and time in the server's time zone; for cron a cron expression. cron is read when not given
script string What the task runs, at most 32 kB: the script for script and registry, a package name or https installer address for install, {"url": "https://...", "path": "<absolute path>", "sha256": "<optional>"} for file_deploy. payload is read when not given
retries integer or string default 0, at least 0, at most 3
timeout_seconds integer or string Seconds; default 300, at least 10, at most 3600
hold_alerts boolean Types update, install, restart and script: every run of the task, whatever started it (made to run now, Run now or its schedule), holds the alerts of the devices it reaches with a maintenance window from its start until its last device reports, plus the grace time. A task that runs at once answers with its window as maintenance_window.
hold_grace_minutes integer The grace time of that window in minutes, 15 unless set; at least 0, at most 1440

201: Created (application/json)

Field Type Required What it is
success true yes
id integer yes
task FleetTask yes
devices array of string yes The device IDs the targets resolved to
queued integer yes How many devices the task was sent to now
skipped array of string yes Devices left out
Error When
400 The body is no JSON object, a field is missing or not valid, or the devices or groups are unknown (code unknown_targets, with names) or have no devices (code no_devices)
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account may not do this, or a device is NeoDesk Companion (code support_agent_restricted)

GET /api/panel/fleet/tasks/{taskId}

Show a fleet task with its runs.

Needs org.manage_devices. neodesk fleet task calls it.

Parameter In Type Required What it is
taskId path integer yes The task's ID; at least 1

200: Done (application/json)

Field Type Required
success true yes
task FleetTask yes
runs array of FleetRun 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
404 There is no such task, or the caller does not see it

PUT /api/panel/fleet/tasks/{taskId}

Change a fleet task.

Changes the fields the body has, with the checks of the create. It does not run the task.

Needs org.manage_devices. neodesk fleet task-set calls it.

Parameter In Type Required What it is
taskId path integer yes The task's ID; at least 1

Request body, application/json:

Field Type What it is
name string at most 120 characters
type string, one of script, restart, update, install, file_deploy, registry task_type is read when type is not given
targets string Device IDs and device group names, at most 500, separated by commas, semicolons or line breaks (or spaces when there are none); device_id is read when targets is not given; at most 8192 characters
schedule_type string, one of immediate, once, cron immediate when not given
schedule_value string For once an RFC 3339 time or a date and time in the server's time zone; for cron a cron expression. cron is read when not given
script string What the task runs, at most 32 kB: the script for script and registry, a package name or https installer address for install, {"url": "https://...", "path": "<absolute path>", "sha256": "<optional>"} for file_deploy. payload is read when not given
retries integer or string at least 0, at most 3
timeout_seconds integer or string Seconds; at least 10, at most 3600
hold_alerts boolean Types update, install, restart and script: every run of the task, whatever started it (made to run now, Run now or its schedule), holds the alerts of the devices it reaches with a maintenance window from its start until its last device reports, plus the grace time. Left as it is when not given.
hold_grace_minutes integer The grace time of that window in minutes, 15 unless set; at least 0, at most 1440

200: Done (application/json)

Field Type Required
success true yes
id integer yes
task FleetTask yes
Error When
400 The body is no JSON object, a field is not valid, or the devices or groups are unknown (code unknown_targets, with names) or have no devices (code no_devices)
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account may not do this, or a device is NeoDesk Companion
404 There is no such task, or the caller does not see it

DELETE /api/panel/fleet/tasks/{taskId}

Delete a fleet task.

Needs org.manage_devices. neodesk fleet task-delete calls it. It cannot be undone.

Parameter In Type Required What it is
taskId path integer yes The task's ID; at least 1

200: Done (application/json)

Field Type Required
success true 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
404 There is no such task, or the caller does not see it

GET /api/panel/fleet/tasks/{taskId}/output

Show a fleet task's output on each device.

Needs org.manage_devices. neodesk fleet task-output calls it.

Parameter In Type Required What it is
taskId path integer yes The task's ID; at least 1

200: Done (application/json)

Field Type Required What it is
success true yes
task_id integer yes
status string yes
batch integer yes
last_run string
next_run string
output string yes All devices' output as one text: a line per device with its state, then what it printed
runs array of FleetRun 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
404 There is no such task, or the caller does not see it

POST /api/panel/fleet/tasks/{taskId}/retry

Run a fleet task again on the devices where it failed.

Sends the task again to the devices whose run failed or timed out, NeoDesk Companion devices left out.

Needs org.manage_devices. neodesk fleet task-retry calls it.

Parameter In Type Required What it is
taskId path integer yes The task's ID; at least 1

200: Done (application/json)

Field Type Required What it is
success true yes
queued integer yes
status string yes The task's state now
Error When
400 No failed or timed out runs to try again
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 task, or the caller does not see it

POST /api/panel/fleet/tasks/{taskId}/run

Run a fleet task now.

Starts the task once now on the devices it names, outside its schedule. Its schedule stays as it is. A device that is a NeoDesk Companion is left out.

Needs org.manage_devices. neodesk fleet task-run calls it.

Parameter In Type Required What it is
taskId path integer yes The task's ID; at least 1

200: Done (application/json)

Field Type Required What it is
success true yes
queued integer yes How many devices got the task
skipped array of string yes Devices left out: NeoDesk Companion devices, and devices that have not finished an earlier run
status string yes The task's state now
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
404 There is no such task, or the caller does not see it
409 The task is still running

POST /api/panel/fleet/tasks/{taskId}/cancel

Cancel the run of a fleet task.

Cancels the open runs of the task's last run: a device that has not started it skips it, and the answer of a device that has is not taken. The runs and the task show as cancelled.

Needs org.manage_devices. neodesk fleet task-cancel calls it.

Parameter In Type Required What it is
taskId path integer yes The task's ID; at least 1

200: Done (application/json)

Field Type Required What it is
success true yes
cancelled integer yes How many devices' runs were cancelled
status string yes The task's state now: cancelled
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
404 There is no such task, or the caller does not see it
409 The task is not running

GET /api/panel/fleet/workflows

List fleet workflows.

Lists the workflows the caller sees, without their steps.

Needs org.manage_devices. neodesk fleet workflows calls it.

200: Done (application/json)

Field Type Required What it is
success true yes
workflows array of object yes
workflows[].id integer
workflows[].name string
workflows[].created_by string
workflows[].created_at string (date-time)
workflows[].updated_at string (date-time)
workflows[].steps integer How many steps the workflow has
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/panel/fleet/workflows

Create a fleet workflow.

The workflow is created by the signed-in account.

Needs org.manage_devices. neodesk fleet workflow-create calls it.

Request body, application/json:

FleetWorkflowBody and object.

201: Created (application/json)

Field Type Required
success true yes
id integer yes
data FleetWorkflow yes
Error When
400 The body is no JSON object, the name is missing or too long, or the steps can't be saved
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

GET /api/panel/fleet/workflows/{workflowId}

Show a fleet workflow with its steps.

Needs org.manage_devices. neodesk fleet workflow calls it.

Parameter In Type Required What it is
workflowId path integer yes The workflow's ID; at least 1

200: Done (application/json)

Field Type Required
success true yes
data FleetWorkflow 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
404 There is no such workflow, or the caller does not see it

PUT /api/panel/fleet/workflows/{workflowId}

Change a fleet workflow.

Changes the name, the steps or the connections the body has.

Needs org.manage_devices. neodesk fleet workflow-set calls it.

Parameter In Type Required What it is
workflowId path integer yes The workflow's ID; at least 1

Request body, application/json:

FleetWorkflowBody.

200: Done (application/json)

Field Type Required
success true yes
id integer yes
data FleetWorkflow yes
Error When
400 The body is no JSON object, the name is not valid, or the steps can't be saved
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 workflow, or the caller does not see it

DELETE /api/panel/fleet/workflows/{workflowId}

Delete a fleet workflow.

Needs org.manage_devices. neodesk fleet workflow-delete calls it. It cannot be undone.

Parameter In Type Required What it is
workflowId path integer yes The workflow's ID; at least 1

200: Done (application/json)

Field Type Required
success true 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
404 There is no such workflow, or the caller does not see it

POST /api/panel/fleet/workflows/{workflowId}/execute

Run a fleet workflow, or try it with dry_run.

Walks the workflow from its triggers and creates a task for each action on the devices left at that step. With dry_run it only says what it would run. The steps of the body count when it has nodes; otherwise the saved ones do. A run of a saved workflow goes into its history.

Needs org.manage_devices. neodesk fleet workflow-run calls it.

Parameter In Type Required What it is
workflowId path string yes The workflow's ID, or draft for a workflow that was never saved

Request body, application/json:

Field Type Required What it is
dry_run boolean default false
name string The name of a draft
nodes array of object
nodes[].id string or number yes
nodes[].type string, one of action_file_deploy, action_install, action_message, action_restart, action_script, cond_os, cond_threshold, cond_time_window, result_alert, result_chain, result_log, transform_delay, transform_filter, transform_parse, trigger_event, trigger_manual, trigger_schedule yes
nodes[].label string
nodes[].config object The step's settings, such as targets and cron of a trigger
connections array of object
connections[].from string or number yes A step's id
connections[].to string or number yes A step's id; never a trigger

200: Done (application/json)

Field Type Required What it is
success true yes
dry_run boolean yes
output string yes What the run did or would do, a line per step
tasks array of integer yes The IDs of the tasks created
problems array of string yes What is wrong with the workflow; a dry run lists them here
Error When
400 The body is no JSON object, the steps can't be read, or a run that is not dry found problems (then with output and problems)
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 workflow, or the caller does not see it

GET /api/panel/fleet/workflows/{workflowId}/history

Show a fleet workflow's last 50 runs.

Needs org.manage_devices. neodesk fleet workflow-history calls it.

Parameter In Type Required What it is
workflowId path integer yes The workflow's ID; at least 1

200: Done (application/json)

Field Type Required What it is
success true yes
history array of object yes
history[].id integer
history[].workflow_id integer
history[].dry_run boolean
history[].status string, one of ok, problems
history[].output string
history[].tasks array of integer The IDs of the tasks the run created
history[].started_by string Who ran it; schedule:<creator> for a scheduled run
history[].created_at string (date-time)
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
404 There is no such workflow, or the caller does not see it

Type to search pages, sections, commands and settings.