Docs
SSH ›

Remove ssh key

DELETE/v1/sandboxes/{id}/ssh/keys/{keyId}

Lets a key log in to the sandbox no longer. Every line of the machine's authorized keys file that holds the key is taken out. Whoever is logged in with it stays so until they leave. The sandbox has to be running.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
  4. await sandbox.ssh.removeKey(key.id);
Answer204 No Content

No body: the status says it was done.

The key may log in no longer.

Path

idrequired
string
e.g. "sbx_0123456789abcdef"
keyIdrequired
string
The key's id, as the list gives it. e.g. "nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8"

Headers

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

Returns

204 The key may log in no longer.

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.