Search the docs
Menu
Updated Edit on GitHub

Server API: enrollment

Copy as Markdown

These routes are on the server API, port 21114 (21121 in Docker). They take an API key in X-API-Key or a sign-in token; see The HTTP API.

The enrollment queue of the server API: devices that wait for approval, the decisions, and the enrollment mode.

POST /api/enrollment/approve/{id}

Approve a waiting device.

Adds the device from its enrollment request and removes any earlier rejection. A display name also becomes its note. The route needs a JSON body; send {} for none of the fields.

On the server API, port 21114. Needs enrollment.approve.

Parameter In Type Required What it is
id path string yes The device ID

Request body, application/json:

Field Type What it is
display_name string
sync_mode string, one of silent, standard, turbo default "standard"
tags string Comma-separated tags that replace the ones the device asked for

200: Done (application/json)

Field Type
success true
device_id string
sync_mode string
Error When
400 Invalid JSON or an unknown sync_mode
401 No credential, or one that is not valid
403 The credential's role lacks the permission
404 Device not found in pending list
500 Failed to approve device

POST /api/enrollment/clear-rejection/{id}

Let a rejected device ask again.

Removes the rejection so the device lands in the queue again when it next asks. A device row the rejection made is removed; a device that existed before loses the rejection's ban.

On the server API, port 21114. Needs enrollment.approve.

Parameter In Type Required What it is
id path string yes The device ID

200: Done (application/json)

Field Type What it is
success true
device_id string
unbanned boolean
peer_removed boolean Whether the device row the rejection made was removed
Error When
401 No credential, or one that is not valid
403 The credential's role lacks the permission
404 No enrollment rejection found for device

GET /api/enrollment/history

List approved and rejected devices.

On the server API, port 21114. Needs enrollment.approve.

Parameter In Type What it is
status query string, one of approved, rejected Keep only these decisions; all of them when missing

200: Done (application/json)

Field Type What it is
devices array of EnrollmentDecision or null null when there is none
count integer
Error When
400 The status is not approved or rejected
401 No credential, or one that is not valid
403 The credential's role lacks the permission

GET /api/enrollment/mode

Show the enrollment mode.

On the server API, port 21114. Only for the role admin.

200: Done (application/json)

EnrollmentModeInfo.

Error When
401 No credential, or one that is not valid
403 The credential's role lacks the permission

PUT /api/enrollment/mode

Set the enrollment mode.

On the server API, port 21114. Only for the role admin.

Request body, application/json:

Field Type Required
mode string, one of open, managed, locked yes

200: Done (application/json)

Field Type
success true
mode string
description string
Error When
400 Invalid JSON or an unknown mode
401 No credential, or one that is not valid
403 The credential's role lacks the permission
409 ENROLLMENT_MODE_ENV_OVERRIDE sets the mode from the environment
500 Internal server error

GET /api/enrollment/pending

List devices waiting for approval.

On the server API, port 21114. Needs enrollment.approve.

200: Done (application/json)

Field Type What it is
devices array of PendingEnrollment or null null when no device waits
count integer
Error When
401 No credential, or one that is not valid
403 The credential's role lacks the permission

POST /api/enrollment/reject/{id}

Reject a waiting device.

Only a waiting device can be rejected; ban or delete an enrolled device through the device routes. With ban the device is also banned and shows under the banned devices.

On the server API, port 21114. Needs enrollment.approve.

Parameter In Type Required What it is
id path string yes The device ID

Request body, application/json:

Field Type What it is
ban boolean Also ban the device so it cannot ask again; default false

200: Done (application/json)

Field Type
success true
banned boolean
Error When
401 No credential, or one that is not valid
403 The credential's role lacks the permission
404 No pending enrollment for device
500 Internal server error

Type to search pages, sections, commands and settings.