Doku durchsuchen
Menü
Geändert am Auf GitHub bearbeiten

Server-API: client api

Als Markdown kopieren

Diese 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 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.

GET /api/ab

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

POST /api/ab

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

GET /api/ab/personal

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)

ClientAddressBookAnswer.

Error When
401 No signed-in account

POST /api/ab/personal

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

GET /api/ab/tags

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

POST /api/ab/settings

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

POST /api/ab/shared/profiles

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

POST /api/ab/peers

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

POST /api/ab/tags/{guid}

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

POST /api/ab/peer/add/{guid}

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

PUT /api/ab/peer/update/{guid}

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

DELETE /api/ab/peer/{guid}

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

POST /api/ab/tag/add/{guid}

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

PUT /api/ab/tag/rename/{guid}

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

PUT /api/ab/tag/update/{guid}

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

DELETE /api/ab/tag/{guid}

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

GET /api/currentUser

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)

ClientUser.

Error When
401 No signed-in account

POST /api/currentUser

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)

ClientUser.

Error When
401 No signed-in account

GET /api/device-group

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

POST /api/device-group

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

GET /api/device-group/accessible

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

POST /api/device-password/answer

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}

GET /api/group

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

GET /api/group/get

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

POST /api/group/get

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

POST /api/login

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

GET /api/login-options

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.

POST /api/logout

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"

GET /api/peer-key/{id}

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

Durchsucht Seiten, Abschnitte, Befehle und Einstellungen.