Server-API: enrollment
Als Markdown kopierenDiese Routen liegen auf der Server-API, Port 21114 (21121 in Docker). Sie nehmen einen API-Schlüssel in X-API-Key oder ein Anmelde-Token; siehe Die HTTP-API. Die Beschreibungen stehen auf Englisch, wie in der OpenAPI-Beschreibung.
The enrollment queue of the server API: devices that wait for approval, the decisions, and the enrollment mode.
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 |
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 |
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 |
Show the enrollment mode.
On the server API, port 21114. Only for the role admin.
200: Done (application/json)
| Error | When |
|---|---|
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
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 |
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 |
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 |