Server API: client api
Copy as MarkdownThese 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 API the RustDesk and NeoDesk desktop clients call: sign-in, the signed-in account, the address book, groups and peer keys. Its answers have the shapes the clients expect.
Show the account's address book.
The legacy address book of the account, with the address books of its organizations merged in. Devices outside the account's scope are taken out. Except for pro accounts, the server adds the tags admins set on the devices and the server's tag list.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
200: The address book (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
data |
string | yes | The address book as JSON text; "{}" when empty |
licensed_devices |
integer | Always 0 |
| Error | When |
|---|---|
| 401 | No signed-in account |
Replace the account's address book.
Saves the legacy address book; an empty body saves {}. For an account with device.edit, the tags of its entries are copied onto the devices in its scope.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
Request body, application/json:
| Field | Type | What it is |
|---|---|---|
data |
string or object | The address book, as JSON text or as the object; at most 512 kB |
200: Saved (application/json)
Object.
| Error | When |
|---|---|
| 400 | The body is not valid JSON |
| 401 | No signed-in account |
| 413 | The address book is larger than 512 kB |
Show the account's personal address book.
Devices outside the account's scope are taken out. Except for pro accounts, the server adds the tags admins set on the devices.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
200: The address book (application/json)
| Error | When |
|---|---|
| 401 | No signed-in account |
Replace the account's personal address book.
An empty body, or one without data, answers the GUID of the account's own book for the entry by entry API (/ab/peers and the routes after it); it is the book GET and POST /ab read and write. For an account with device.edit, the tags of its entries are copied onto the devices in its scope.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
Request body, application/json:
| Field | Type | What it is |
|---|---|---|
data |
string or object | The address book, as JSON text or as the object; at most 512 kB |
200: Saved, or for an empty body the own book's GUID (application/json)
| Field | Type | What it is |
|---|---|---|
guid |
string | Only for an empty body |
| Error | When |
|---|---|
| 400 | The body is not valid JSON |
| 401 | No signed-in account |
| 413 | The address book is larger than 512 kB |
List the tags of the account's devices.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
200: The tags (application/json)
| Field | Type |
|---|---|
data |
array of string |
| Error | When |
|---|---|
| 401 | No signed-in account |
Read the address book limits.
The most entries of one book; 0 is no limit besides the size of 512 kB.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
200: The limits (application/json)
| Field | Type |
|---|---|
max_peer_one_ab |
integer |
| Error | When |
|---|---|
| 401 | No signed-in account |
List the shared address books the account uses.
The shared books the account owns (rule 3) or is a member of, with its rule: 1 read, 2 read/write, 3 full control.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
| Parameter | In | Type | What it is |
|---|---|---|---|
current |
query | integer | The page, from 1; default 1, at least 1 |
pageSize |
query | integer | Items per page, at most 1000; default 100, at least 1, at most 1000 |
200: The books (application/json)
| Field | Type |
|---|---|
total |
integer |
data |
array of object |
data[].guid |
string |
data[].name |
string |
data[].owner |
string |
data[].note |
string |
data[].rule |
integer, one of 1, 2, 3 |
| Error | When |
|---|---|
| 401 | No signed-in account |
List the entries of an address book.
A shared book's passwords are in the entries only for a caller that holds device.connect and sees the device; devices of this server outside the caller's scope are left out.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
ab |
query | string | yes | The book's GUID |
current |
query | integer | The page, from 1; default 1, at least 1 |
|
pageSize |
query | integer | Items per page, at most 1000; default 100, at least 1, at most 1000 |
200: The entries (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
total |
integer | ||
data |
array of object | ||
data[].id |
string | yes | The device's ID, at most 64 characters |
data[].alias |
string | ||
data[].note |
string | ||
data[].tags |
array of string | At most 20, each at most 50 characters | |
data[].password |
string | Shared books only: the password members with device.connect get; empty removes it | |
data[].hash |
string | Own book only: the hash of a password the computer remembers | |
data[].username |
string | ||
data[].hostname |
string | ||
data[].platform |
string |
| Error | When |
|---|---|
| 401 | No signed-in account |
| 404 | No such book, or the account is not its owner or a member |
List the tags of an address book.
The book's tags with their colours.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
guid |
path | string | yes | The book: a shared book's GUID or the account's own book's GUID from POST /ab/personal |
200: The tags (application/json)
An array of object; each item:
| Field | Type | What it is |
|---|---|---|
[].name |
string | |
[].color |
integer | ARGB colour |
| Error | When |
|---|---|
| 401 | No signed-in account |
| 404 | No such book, or the account is not its owner or a member |
Add an entry to an address book.
Needs read/write or full control on a shared book. 409 when the book has the ID already.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
guid |
path | string | yes | The book: a shared book's GUID or the account's own book's GUID from POST /ab/personal |
Request body, application/json:
| Field | Type | Required | What it is |
|---|---|---|---|
id |
string | yes | The device's ID, at most 64 characters |
alias |
string | ||
note |
string | ||
tags |
array of string | At most 20, each at most 50 characters | |
password |
string | Shared books only: the password members with device.connect get; empty removes it | |
hash |
string | Own book only: the hash of a password the computer remembers | |
username |
string | ||
hostname |
string | ||
platform |
string |
200: Changed; the body is empty
| Error | When |
|---|---|
| 400 | The body is not valid JSON or the entry or tag is invalid |
| 401 | No signed-in account |
| 403 | The account may only read this book |
| 404 | No such book, or the account is not its owner or a member |
| 409 | The book has this ID already |
| 413 | The book would be larger than 512 kB |
| 503 | A password was sent and the server has no key to seal it |
Change an entry of an address book.
Sets the fields sent on the entry with the ID. Needs read/write or full control on a shared book.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
guid |
path | string | yes | The book: a shared book's GUID or the account's own book's GUID from POST /ab/personal |
Request body, application/json:
| Field | Type | Required | What it is |
|---|---|---|---|
id |
string | yes | The device's ID, at most 64 characters |
alias |
string | ||
note |
string | ||
tags |
array of string | At most 20, each at most 50 characters | |
password |
string | Shared books only: the password members with device.connect get; empty removes it | |
hash |
string | Own book only: the hash of a password the computer remembers | |
username |
string | ||
hostname |
string | ||
platform |
string |
200: Changed; the body is empty
| Error | When |
|---|---|
| 400 | The body is not valid JSON or the entry or tag is invalid |
| 401 | No signed-in account |
| 403 | The account may only read this book |
| 404 | No such book, or the account is not its owner or a member |
| 413 | The book would be larger than 512 kB |
| 503 | A password was sent and the server has no key to seal it |
Remove entries from an address book.
The body lists the IDs to remove. Needs read/write or full control on a shared book.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
guid |
path | string | yes | The book: a shared book's GUID or the account's own book's GUID from POST /ab/personal |
Request body, application/json:
Array of string.
200: Changed; the body is empty
| Error | When |
|---|---|
| 400 | The body is not valid JSON or the entry or tag is invalid |
| 401 | No signed-in account |
| 403 | The account may only read this book |
| 404 | No such book, or the account is not its owner or a member |
Add a tag to an address book.
Needs read/write or full control on a shared book.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
guid |
path | string | yes | The book: a shared book's GUID or the account's own book's GUID from POST /ab/personal |
Request body, application/json:
| Field | Type | What it is |
|---|---|---|
name |
string | |
color |
integer | ARGB colour |
200: Changed; the body is empty
| Error | When |
|---|---|
| 400 | The body is not valid JSON or the entry or tag is invalid |
| 401 | No signed-in account |
| 403 | The account may only read this book |
| 404 | No such book, or the account is not its owner or a member |
| 409 | The book has this tag already |
Rename a tag of an address book.
Renames the tag on the entries too.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
guid |
path | string | yes | The book: a shared book's GUID or the account's own book's GUID from POST /ab/personal |
Request body, application/json:
| Field | Type |
|---|---|
old |
string |
new |
string |
200: Changed; the body is empty
| Error | When |
|---|---|
| 400 | The body is not valid JSON or the entry or tag is invalid |
| 401 | No signed-in account |
| 403 | The account may only read this book |
| 404 | No such book, or the account is not its owner or a member |
| 409 | The book has the new name already |
Change the colour of a tag.
Needs read/write or full control on a shared book.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
guid |
path | string | yes | The book: a shared book's GUID or the account's own book's GUID from POST /ab/personal |
Request body, application/json:
| Field | Type | What it is |
|---|---|---|
name |
string | |
color |
integer | ARGB colour |
200: Changed; the body is empty
| Error | When |
|---|---|
| 400 | The body is not valid JSON or the entry or tag is invalid |
| 401 | No signed-in account |
| 403 | The account may only read this book |
| 404 | No such book, or the account is not its owner or a member |
Remove tags from an address book.
The body lists the tags to remove; they are taken off the entries too.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
guid |
path | string | yes | The book: a shared book's GUID or the account's own book's GUID from POST /ab/personal |
Request body, application/json:
Array of string.
200: Changed; the body is empty
| Error | When |
|---|---|
| 400 | The body is not valid JSON or the entry or tag is invalid |
| 401 | No signed-in account |
| 403 | The account may only read this book |
| 404 | No such book, or the account is not its owner or a member |
Show the signed-in account.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
200: The account (application/json)
| Error | When |
|---|---|
| 401 | No signed-in account |
Show the signed-in account.
GET and POST answer the same; a body is not read.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
200: The account (application/json)
| Error | When |
|---|---|
| 401 | No signed-in account |
List the names of the device groups and folders the account sees.
Lists the device groups and folders of the console the account sees, in the envelope RustDesk clients expect. Each entry has the name, guid, note and position only.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
200: The groups (application/json)
| Field | Type |
|---|---|
total |
integer |
data |
array of object |
data[].guid |
string |
data[].name |
string |
data[].note |
string |
data[].sort |
integer |
msg |
"success" |
| Error | When |
|---|---|
| 401 | No signed-in account |
Make a device group.
Only super admins and global admins may.
On the server API, port 21114. Takes the token of a RustDesk client sign-in. Only for the role super_admin or admin or global_admin.
Request body, application/json:
| Field | Type | Required | What it is |
|---|---|---|---|
name |
string | yes | cut to 256 characters |
note |
string | cut to 1024 characters | |
team_id |
string | cut to 32 characters | |
source_type |
string | manual, or tag for a group of the devices with a tag | |
tag_filter |
string | the tag of a tag group; cut to 256 characters |
200: Made (application/json)
| Field | Type |
|---|---|
id |
integer |
guid |
string |
name |
string |
note |
string |
team_id |
string |
source_type |
string |
tag_filter |
string |
member_count |
integer |
created_at |
string (date-time) |
| Error | When |
|---|---|
| 400 | The body is not valid JSON, or name is missing |
| 401 | No credential, or one that is not valid |
| 403 | The account is not a super admin or global admin |
List the names of the device groups and folders the account sees.
Lists the device groups and folders of the console the account sees, in the envelope RustDesk clients expect. Each entry has the name, guid, note and position only.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
200: The groups (application/json)
| Field | Type |
|---|---|
total |
integer |
data |
array of object |
data[].guid |
string |
data[].name |
string |
data[].note |
string |
data[].sort |
integer |
msg |
"success" |
| Error | When |
|---|---|
| 401 | No signed-in account |
Answer a device's password question with the device password the console set, without handing out the password.
NeoDesk Desktop, signed in to the server, sends the salt and challenge the device asked while it connects and gets the answer to send back. Each answer is written to the console's audit log as a use of the device password. An account limited to an organization or to device groups gets 403 for a device outside them.
On the server API, port 21114. Takes the token of a RustDesk client sign-in. Needs device.connect and device.password_use.
Request body, application/json:
| Field | Type | Required | What it is |
|---|---|---|---|
id |
string | yes | The device ID |
salt |
string | yes | The salt of the device's question; at most 256 characters |
challenge |
string | yes | The challenge of the device's question; at most 256 characters |
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
password_set |
true |
yes | |
answer |
string | yes | The answer to the question, in base64 |
| Error | When |
|---|---|
| 400 | The body is not JSON (invalid_json), the device ID is not valid (invalid_id), or salt or challenge is missing or too long (salt_and_challenge_required) |
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
| 404 | The console set no password for this salt, or someone changed it at the device; the answer is {"password_set": false} |
List the device groups and folders the account sees, with their devices.
Lists the device groups and folders of the console the account sees, in the envelope RustDesk clients expect.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
200: The groups (application/json)
| Field | Type | What it is |
|---|---|---|
total |
integer | |
data |
array of object | |
data[].guid |
string | |
data[].name |
string | |
data[].note |
string | |
data[].team |
object | The devices of the group |
data[].team.peers |
array of object | |
data[].team.peers[].id |
string | |
data[].access_perm |
1 |
|
data[].created_at |
string or null (date-time) | Always null |
data[].sort |
integer | |
msg |
"success" |
| Error | When |
|---|---|
| 401 | No signed-in account |
List the device groups and folders the account sees, with their devices.
Lists the device groups and folders of the console the account sees, in the envelope RustDesk clients expect.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
200: The groups (application/json)
| Field | Type | What it is |
|---|---|---|
total |
integer | |
data |
array of object | |
data[].guid |
string | |
data[].name |
string | |
data[].note |
string | |
data[].team |
object | The devices of the group |
data[].team.peers |
array of object | |
data[].team.peers[].id |
string | |
data[].access_perm |
1 |
|
data[].created_at |
string or null (date-time) | Always null |
data[].sort |
integer | |
msg |
"success" |
| Error | When |
|---|---|
| 401 | No signed-in account |
List the device groups and folders the account sees, with their devices.
Lists the device groups and folders of the console the account sees, in the envelope RustDesk clients expect. A body is not read.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
200: The groups (application/json)
| Field | Type | What it is |
|---|---|---|
total |
integer | |
data |
array of object | |
data[].guid |
string | |
data[].name |
string | |
data[].note |
string | |
data[].team |
object | The devices of the group |
data[].team.peers |
array of object | |
data[].team.peers[].id |
string | |
data[].access_perm |
1 |
|
data[].created_at |
string or null (date-time) | Always null |
data[].sort |
integer | |
msg |
"success" |
| Error | When |
|---|---|
| 401 | No signed-in account |
Sign a desktop client in with a username and password.
Answers a client token valid for 7 days from its last use and at most 30 days, or, for an account with TOTP, type email_check with a secret for the second step, which lives 5 minutes. Accounts that sign in with single sign-on are refused. Rate limited by address and by username.
On the server API, port 21114.
Request body, application/json:
The first step sends username and password; for an account with a second factor, the second step sends the code with the secret.
| Field | Type | What it is |
|---|---|---|
username |
string | |
password |
string | |
id |
string | The device ID of the client |
uuid |
string | The device UUID of the client |
type |
string | account |
autoLogin |
boolean | |
verificationCode |
string | The second step: the 6-digit TOTP code |
tfaCode |
string | The same as verificationCode |
secret |
string | The second step: the secret the first step answered |
200: Signed in, or the second step is due (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
type |
string, one of access_token, email_check |
yes | access_token when signed in, email_check when the second step is due |
access_token |
string | The client token (with type access_token) | |
user |
ClientUser | ||
tfa_type |
"tfa_check" |
tfa_check (with type email_check) | |
secret |
string | The secret for the second step (with type email_check) |
| Error | When |
|---|---|
| 400 | The body is not valid JSON, or username or password is missing |
| 401 | The username or password is wrong, the account uses single sign-on, or the code or secret is wrong or expired |
| 403 | The account is disabled, or must set up a second factor or change its password first |
| 429 | Too many sign-in attempts |
| 504 | The directory did not answer in time |
List the sign-in methods a desktop client offers.
The first entry, "", stands for the password sign-in. The second is "common-oidc/" followed by a JSON list of the browser sign-ins: [{"name": "NeoDesk", "icon": "<svg ...>"}], then the identity provider when single sign-on is on.
On the server API, port 21114.
200: The methods (application/json)
Array of string.
Sign a desktop client out.
Ends the client token in the Authorization header, if there is one. Always answers ok.
On the server API, port 21114.
200: Signed out (application/json)
| Field | Type |
|---|---|
status |
"ok" |
Show a device's public key.
pk is the base64 public key the device registered with; empty for an unknown device and for pro accounts. The route asks no permission and does not check the device scope.
On the server API, port 21114. Takes the token of a RustDesk client sign-in.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The device ID |
200: The key (application/json)
| Field | Type |
|---|---|
id |
string |
pk |
string |
| Error | When |
|---|---|
| 401 | No credential, or one that is not valid |