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
- import { Agental } from "agental-sdk";
- const agental = new Agental();
- const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
- 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
idrequiredstring | e.g. "sbx_0123456789abcdef" |
keyIdrequiredstring | The key's id, as the list gives it. e.g. "nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8" |
Headers
AuthorizationrequiredBearer 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. |
| 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.