SSH

Add an SSH key

Registers a public key to you. Accepted: Ed25519, ECDSA (P-256, P-384, P-521), the FIDO security-key forms sk-ssh-ed25519@openssh.com and sk-ecdsa-sha2-nistp256@openssh.com, and RSA of at least 3072 bits. Refused with a 400: DSA, shorter RSA, certificates, a line with authorized_keys options in front of the key, and anything that is not one key on one line.

A key can belong to one person only; registering one that is already registered is a 409. Each person may hold eight; the ninth is a 409.

The key is bound to the account this API key (or connected app) acts on, and to the credential itself: it is written into every computer with SSH on, on that account only, within moments, and it is removed when the credential is revoked. A key added from the dashboard instead reaches every account where you are an owner or member. The answer does not wait for the computers.

An API key confined to a workspace cannot add or remove SSH keys (403): an SSH key reaches further than that workspace.

Requires the member role or higher.

post/ssh-keys

Request

  • Base URL: https://app.mandala.computer/api/v1
  • URL: https://app.mandala.computer/api/v1/ssh-keys
  • Auth: HTTP bearer

Request body

public_keystring required

One line from a .pub file: <type> <base64> [comment], at most 8192 characters. The comment is dropped. The file read whole is fine: one trailing line ending (\n or \r\n) is ignored and not counted, but a second line is a 400.

namestring

A label, up to 60 characters after trimming. Left out or null, it is the comment on the line, with any control characters removed and cut to 60 characters, or key if there is none; an empty or blank name is key too.

Response

The key as registered.

idstring required

sshk- and sixteen hex characters.

namestring required

Your label for it. Defaults to the comment that followed the key when you added it.

public_keystring required

The key as <type> <base64>, re-encoded from what you sent: no options and no comment. This is the line the platform writes into the computer.

fingerprintstring required

SHA256: and 43 characters, exactly as ssh-keygen -l -f <file> prints it.

key_typestring required

One of ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, sk-ssh-ed25519@openssh.com, sk-ecdsa-sha2-nistp256@openssh.com or ssh-rsa.

created_atstring required

RFC 3339 timestamp.

last_used_atstring nullable required

When this key last opened a connection to a computer. null until it has.

reach'everywhere' | 'this_account' | 'another_account' required

Where this key can connect, from the account this request acts on. everywhere: it was added from the dashboard and works on every account where you are an owner or member. this_account: it was added through an API key or connected app on this account and works here only. another_account: it was added through an API key or connected app on a different account and does not work here; which account is not said. A key is registered once, so adding it again is a 409: to use one key on every account, remove it and add it from the dashboard; otherwise use a separate key here.

Changes

No recorded changes to this operation across all 1 revision of this API.