# Konsole: enrollment

Quelle: https://docs.neode.sk/de/development/api-reference/console-enrollment/
Zuletzt geändert: 2026-12-03

> 7 Operationen. Who may join, and devices waiting for approval.

Diese Routen liegen auf der Konsole, Port 3375. Sie nehmen ein API-Token als `Authorization: Bearer ndt_...`; siehe [API-Tokens](https://docs.neode.sk/de/command-line/api-tokens.md). Die Beschreibungen stehen auf Englisch, wie in der OpenAPI-Beschreibung.

Who may join, and devices waiting for approval.

## POST /api/enrollment/approve/{id}

Approve a waiting device.

The server API adds the device. Then the device goes into the folder and the device groups. When those can't be assigned, the device stays approved and the route answers 500. On a failed call to the server API the answer is still 200, with success false and an error such as "Request failed with status code 404".

Needs `enrollment.approve`. `neodesk enrollment approve` calls it.

| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
| `id` | path | string | yes | The device ID (see enrollment pending) |

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 |
| `folder_id` | integer or string | Put the device into this folder |
| `group_guids` | array of string | Make the device a member of these manual device groups and of no other manual group the account sees; at most 100 |

**200**: Done (`application/json`)

| Field | Type | Required | What it is |
|---|---|---|---|
| `success` | boolean | yes |  |
| `data` | object |  |  |
| `data.success` | `true` |  |  |
| `data.device_id` | string |  |  |
| `data.sync_mode` | string |  |  |
| `error` | string |  | Only when success is false |

| Error | When |
|---|---|
| 400 | sync_mode is not text or group_guids is not a list of text |
| 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 |
| 500 | Approved, but the folder or the device groups could not be assigned |

## 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 a failed call to the server API the answer is still 200, with success false and an error such as "Request failed with status code 404".

Needs `enrollment.approve`. `neodesk enrollment unreject` calls it. It cannot be undone.

| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
| `id` | path | string | yes | The device ID (see enrollment history) |

**200**: Done (`application/json`)

| Field | Type | Required | What it is |
|---|---|---|---|
| `success` | boolean | yes |  |
| `data` | object |  |  |
| `data.success` | `true` |  |  |
| `data.device_id` | string |  |  |
| `data.unbanned` | boolean |  |  |
| `data.peer_removed` | boolean |  | Whether the device row the rejection made was removed |
| `error` | string |  | Only when success is false |

| 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/enrollment/history

List approved and rejected devices.

When the server API fails, success is false and data is empty.

Needs `enrollment.approve`. `neodesk enrollment history` calls it.

| 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 | Required | What it is |
|---|---|---|---|
| `success` | boolean | yes |  |
| `data` | array of [EnrollmentDecision](https://docs.neode.sk/de/development/api-reference/schemas.md#enrollmentdecision) | yes |  |
| `count` | integer | yes |  |
| `error` | string |  | Only when success is false |

| 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/enrollment/pending

List devices waiting for approval.

The server API's enrollment queue. When the server API fails, success is false and data is empty.

Needs `enrollment.approve`. `neodesk enrollment pending` calls it.

**200**: Done (`application/json`)

| Field | Type | Required | What it is |
|---|---|---|---|
| `success` | boolean | yes |  |
| `data` | array of [PendingEnrollment](https://docs.neode.sk/de/development/api-reference/schemas.md#pendingenrollment) | yes |  |
| `count` | integer | yes |  |
| `error` | string |  | Only when success is false |

| 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/enrollment/reject/{id}

Reject a waiting device.

Only a waiting device can be rejected. With ban the device is banned and the device tokens the console issued for it are revoked. On a failed call to the server API the answer is still 200, with success false and an error such as "Request failed with status code 404".

Needs `enrollment.approve`. `neodesk enrollment reject` calls it. It cannot be undone.

| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
| `id` | path | string | yes | The device ID (see enrollment pending) |

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 | Required | What it is |
|---|---|---|---|
| `success` | boolean | yes |  |
| `data` | object |  |  |
| `data.success` | `true` |  |  |
| `data.banned` | boolean |  |  |
| `error` | string |  | Only when success is false |

| 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/enrollment/mode

Show the enrollment mode: open, managed or locked.

Needs `enrollment.manage`. `neodesk enrollment mode` calls it.

**200**: Done (`application/json`)

| Field | Type | Required |
|---|---|---|
| `success` | `true` | yes |
| `data` | [EnrollmentModeInfo](https://docs.neode.sk/de/development/api-reference/schemas.md#enrollmentmodeinfo) |  |

| 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 |
| 502 | The server API did not answer |

## PUT /api/panel/enrollment/mode

Set the enrollment mode.

Needs `enrollment.manage`. `neodesk enrollment mode-set` calls it.

Request body, `application/json`:

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

**200**: Done (`application/json`)

| Field | Type | Required |
|---|---|---|
| `success` | `true` | yes |
| `data` | object |  |
| `data.success` | `true` |  |
| `data.mode` | string |  |
| `data.description` | 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 |
| 409 | The server's environment sets the enrollment mode (ENROLLMENT_MODE_ENV_OVERRIDE) |
| 502 | The server API did not answer |
