## Node enrollment tokens (`node-enroll-tokens`)

Generates a one-time enrollment token and a one-line node install command, and looks up by id whether a node has used the token; the token is returned only once, when generated.

Authentication: Admin only · Docs: https://www.gocdn888.com/en/docs/api/node-enroll-tokens

### POST `/api/v2/node-enroll-tokens`

Create node enrollment token · Authentication: Admin only

```sh
curl -X POST "https://panel.example.com/api/v2/node-enroll-tokens" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

### GET `/api/v2/node-enroll-tokens/{token_id}`

Get node enrollment token status · Authentication: Admin only

```sh
curl "https://panel.example.com/api/v2/node-enroll-tokens/{token_id}" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

Node enrollment tokens object:

| Field | Type | Required | Description |
|---|---|---|---|
| `command` | string |  | One-line node install command, executable command only: includes the asset site URL, the control plane address and the trust root fingerprint --trust-sha256 (the node fetches the trust root bundle from control plane port 7444 and checks it against the fingerprint); the token is written by the shell builtin printf into a temporary directory created by mktemp -d and handed to the install script with --token-file, so it never appears in any process command line. Empty string when command_status is not ok. |
| `command_status` | string |  | Whether an install command could be built: ok = command is an executable command; no_mirror = the node package download URL is unavailable (no HTTPS asset site configured or it cannot be read, or this control plane does not yet have the signed release manifest of its own version to verify the install script); no_master_key = control plane keys are not initialized (rerun the control plane install command); master_addr_unknown = the control plane address could not be determined (set the node communication public address node.master_addr under System Admin › Upgrade & Maintenance › Node Communication, or open the panel through an address the nodes can reach). Values: ["ok","no_mirror","no_master_key","master_addr_unknown"] |
| `expires_at` | string |  | Expires at |
| `id` | string |  | Token id (not a credential): use it with GET /node-enroll-tokens/{token_id} to check whether a node has used the token. |
| `internal_master_host` | string |  | Set to the control plane address in the command when it is a loopback or private address (no node communication public address is configured and it was taken from the address used to open the panel), which nodes on other machines usually cannot reach; omitted otherwise. |
| `node_id` | integer |  | Id of the node that enrolled with it (it then shows in the pending node list); omitted if unused. |
| `token` | string |  | Plain text of the one-time enrollment token; shown only in this response. |
| `token_in_command` | boolean |  | Whether the command contains the plain token (true = the command itself is a credential; do not paste it into tickets or logs); false when command_status is not ok. |
| `used` | boolean |  | Whether a node has already enrolled with it (single use; void once used). |
| `used_at` | string |  | When a node enrolled with it; omitted if unused. |
