SSH ›
List ssh keys
GET
/v1/sandboxes/{id}/ssh/keysThe 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
- import { Agental } from "agental-sdk";
- const agental = new Agental();
- const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
- const keys = await sandbox.ssh.keys();
Answer200 OK
- {
- "keys": [{
- "id": string,
- "fingerprint": string,
- "type": string,
- "comment": string | null,
- }],
- }
The keys, in the order they stand in the file.
Path
idrequiredstring | e.g. "sbx_0123456789abcdef" |
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Returns
200 The keys, in the order they stand in the file.
JSON1 field
keysSshKey[]4 fields
idstring
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.
fingerprintstring
The same, as ssh-keygen -l prints it.
typestring
commentstringnull
What follows the key on its line.
More
Null when nothing does.Errors and other answers
| 404 | Not found. |
| 409 | sandbox_not_running. |
| 501 | ssh_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.