Docs
SSH ›

List ssh keys

GET/v1/sandboxes/{id}/ssh/keys

The keys that may log in to the sandbox as root: what its machine's authorized keys file holds, whoever put it there, through this API or from inside. The sandbox has to be running, since the machine is what is asked.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
  4. const keys = await sandbox.ssh.keys();
Answer200 OK
  1. {
  2. "keys": [{
  3. "id": string,
  4. "fingerprint": string,
  5. "type": string,
  6. "comment": string | null,
  7. }],
  8. }

The keys, in the order they stand in the file.

Path

idrequired
string
e.g. "sbx_0123456789abcdef"

Headers

Authorizationrequired
Bearer key
An API key that may make this call.

Returns

200 The keys, in the order they stand in the file.

JSON1 field
keys
SshKey[]4 fields
id
string
What the key is named by when it is removed: the SHA-256 of the key, written so that it can stand in a path.
fingerprint
string
The same, as ssh-keygen -l prints it.
type
string
comment
stringnull
What follows the key on its line.
More Null when nothing does.

Errors and other answers

404 Not found.
409 sandbox_not_running.
501ssh_endpoint_not_configured sandboxes here are not logged in to over SSH. GET /v1/policy says so as ssh.

Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.