Skip to content
pols.so docs
Esc
↑↓navigate↵open⌘Jpreview

Register an SSH public key for the org's sandboxes

The SSH gateway lets the holder of any registered key into every running sandbox of the org, as the sandbox user. A key can be registered once per org (409 otherwise).

POST/v1/ssh-keys
Authorization
AuthorizationBearer token · headerrequired

Org-scoped API key, pols_....

Request body
requiredapplication/json
public_keystringrequired

One public key in authorized_keys format (ssh-ed25519 AAAA... comment), for example the contents of ~/.ssh/id_ed25519.pub. Options before the key type, certificates and DSA keys are refused; RSA keys need at least 2048 bits.

min length 1 · max length 16384
namestring

A label. Default the key's comment, else its fingerprint.

max length 100
Responses
201

The registered key.

idstringrequired
namestringrequired
fingerprintstringrequired

SHA-256 fingerprint, as ssh-keygen -l prints it.

public_keystringrequired

The key in authorized_keys format, without its comment.

created_atstring<date-time>required
429

Rate limited (rate_limited): too many requests or failed authentications from this address, too many requests or lifecycle calls for this org, or too many of its exec, file, computer and CDP calls in progress at once. Retry after Retry-After seconds.

errorobjectrequired
Show properties
codestringrequired

Stable machine-readable code: bad_request (400), unauthorized (401), forbidden (403), quota_exceeded (403), not_found (404), conflict (409), rate_limited (429, see Retry-After), internal (500), runtime_error (502, the sandbox host failed), unavailable (503, the feature is not configured on this deployment), timeout (504, or 408 when a request body stalls).

messagestringrequired
default

Error.

errorobjectrequired
Show properties
codestringrequired

Stable machine-readable code: bad_request (400), unauthorized (401), forbidden (403), quota_exceeded (403), not_found (404), conflict (409), rate_limited (429, see Retry-After), internal (500), runtime_error (502, the sandbox host failed), unavailable (503, the feature is not configured on this deployment), timeout (504, or 408 when a request body stalls).

messagestringrequired
Request
curl -X POST 'https://api.pols.so/v1/ssh-keys' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "public_key": "string",
  "name": "string"
}'
Response
{
  "id": "ssh_4n8c2k7w1p0d",
  "name": "string",
  "fingerprint": "SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s",
  "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl",
  "created_at": "2019-08-24T14:15:22Z"
}