Console: invites
Copy as MarkdownThese routes are on the console, port 3375. They take an API token as Authorization: Bearer ndt_...; see API tokens.
Invites that add a computer to this server.
Accept the new key of a computer that joined with an invite and was reinstalled.
A reinstall or reset gives a computer a new key, and its join with the invite is refused until someone accepts the key. The computer then joins again with the same invite; its old tokens and sessions end.
Needs enrollment.approve. neodesk invites approve-key calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The device ID (see invites show, refused.device_id) |
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 | No new key of this device waits for approval |
| 500 | server_error |
List the open invites to add a computer.
The open invites of every account, newest first.
Needs enrollment.approve. neodesk invites list calls it.
200: Done (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
invites |
array of Invite | 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 |
| 500 | server_error |
Make an invite: a link and a code to add a computer to this server.
The answer holds the code, the only time it is shown: the server keeps only its hash. A computer that joins with it is approved, named and put into the folder, which must be open to the account. With send_email the link is also mailed to email; mailed and mail_error say how that went.
Needs enrollment.approve. neodesk invites create calls it.
Request body, application/json:
| Field | Type | What it is |
|---|---|---|
name |
string | At most 64 characters, no < > or line breaks; at most 64 characters |
folder_id |
integer | The folder computers that join go into; 0 or missing for none; at least 0 |
email |
string (email) | One plain address; at most 254 characters |
lifetime_hours |
integer | default 168, at least 1, at most 720 |
uses |
integer | How many computers can join with it; default 1, at least 1, at most 1000 |
send_email |
boolean | Mail the link to email; default false |
201: Created (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
success |
true |
yes | |
invite |
Invite | yes | |
code |
string | yes | The code, without separators |
display_code |
string | The code as people read it | |
link |
string | The join page, /join/<code> | |
deep_link |
string | The link that opens the client | |
mailed |
boolean | ||
mail_error |
string | smtp_not_configured or mail_failed; only when send_email failed |
| Error | When |
|---|---|
| 400 | invalid_body, invalid_name, invalid_email, invalid_folder, invalid_lifetime or invalid_uses |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | folder_forbidden: the folder is not open to the account, or the permission is missing |
| 409 | too_many_codes: too many open codes |
| 500 | server_error |
| 502 | server_error: the code could not be made |
Show an invite and the computers that joined with it.
Also once the joins used it up, until it would have expired. Poll it to follow a join; nothing is pushed. refused is the last computer the invite refused, null for none.
Needs enrollment.approve. neodesk invites show calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The invite ID (see invites list): 16 lower-case hex digits |
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
success |
true |
yes | |
invite |
Invite | yes | |
devices |
array of object | yes | |
devices[].id |
string | ||
devices[].name |
string | ||
devices[].hostname |
string | ||
devices[].platform |
string | ||
devices[].folder_id |
integer or null | ||
devices[].folder_name |
string | ||
devices[].online |
boolean | ||
devices[].joined_at |
string (date-time) | ||
devices[].device_type |
string | neodesk-support for NeoDesk Companion, neodesk for NeoDesk Desktop, empty until it says | |
refused |
object or null | yes | |
refused.device_id |
string | ||
refused.reason |
string | Why, such as key_changed | |
refused.at |
string (date-time) | ||
refused.key_request |
boolean | Whether the computer's new key waits for approval (see onboard devices approve-key) |
| 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 | not_found |
| 500 | server_error |
Revoke an invite.
Needs enrollment.approve. neodesk invites revoke calls it. It cannot be undone.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The invite ID (see invites list): 16 lower-case hex digits |
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 | not_found |
| 500 | server_error |
Mail an invite.
The server keeps only a hash of the code, so give the code the answer of invites create had. The mail goes out in lang, else in the sender's console language; replies go to the sender.
Needs enrollment.approve. neodesk invites mail calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The invite ID (see invites list): 16 lower-case hex digits |
Request body, application/json:
| Field | Type | Required | What it is |
|---|---|---|---|
code |
string | yes | The invite's code; write only |
to |
string (email) | yes | One plain address; at most 254 characters |
lang |
string | A language of the console, such as de |
200: Done (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
sent |
true |
yes |
| Error | When |
|---|---|
| 400 | invalid_body or invalid_email |
| 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 | The code is not this invite's, or can't be used any more |
| 409 | smtp_not_configured |
| 500 | server_error |
| 502 | mail_failed |
Show what invites use here: the address in their links, whether mail can be sent, and the client release.
console.base is the address the links point to: another computer must reach it, so set the console's public address when it is localhost. mail says whether invites can be mailed. release is the client release the join page offers for download.
Needs enrollment.approve or device.connect. neodesk invites status calls it.
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
success |
true |
yes | |
console |
object | yes | |
console.base |
string | The console address invite links use: the public address setting, else the address the request came to | |
console.https |
boolean | ||
mail |
boolean | yes | Whether mail can be sent (SMTP is set up) |
release |
object | yes | The client release the invite downloads come from |
release.source |
string | ||
release.tag |
string | ||
release.verified |
boolean | ||
release.packages |
integer | How many client packages the release has | |
release.error |
string |
| 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 |