Skip to content

SSH keys ​

SSH keys are workspace-scoped. Once uploaded, a key can be injected into any new instance in that workspace at provision time. Uploading and deleting keys requires at least the WRITE permission on the INSTANCE resource kind. Reading keys requires at least READ.

Each workspace has a maximum number of SSH keys set by its quota.

All path parameters are required strings.

Search workspace SSH keys ​

GET/v1/workspaces/{wid}/sshSearch workspace SSH keys

Lists SSH keys belonging to a workspace with pagination.

Path parameters

NameTypeDescription
widstringWorkspace ID

Query parameters

NameTypeDescription
qstringQuick search by name or ID
idstring[]Filter to specific key IDs
namestringFilter by name
ownerstring[]Filter by workspace IDs within this workspace

All query parameters are optional. Plus the shared pagination parameters. Returns 200 OK with a paged list of SSH key list objects.

bash
curl "https://api.galaxygate.net/v1/workspaces/42/ssh" \
  -H "Authorization: Bearer $GALAXYGATE_TOKEN" \
  -A 'curl/8.5'

Upload an SSH key ​

POST/v1/workspaces/{wid}/sshUpload an SSH key

Uploads an SSH public key to a workspace. The key is validated as a well-formed public key before it is stored. The name must be between 4 and 32 characters. Returns an error if the workspace has reached its SSH key quota.

Path parameters

NameTypeDescription
widstringWorkspace ID

Request body

FieldTypeRequiredDescription
namestringyesDisplay name for the key, 4-32 characters
public_keystringyesFull public key string, for example ssh-ed25519 AAAA... user@host
bash
curl -X POST https://api.galaxygate.net/v1/workspaces/42/ssh \
  -H "Authorization: Bearer $GALAXYGATE_TOKEN" \
  -H "Content-Type: application/json" \
  -A 'curl/8.5' \
  -d '{
    "name": "laptop",
    "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPg0ih3sVYhcP7A4xlw6CTlc4D2Dzsy/DJDG2sw5dcbW user@host"
  }'

Returns 200 OK with the full SSH key object.

Fetch an SSH key ​

GET/v1/ssh/{kid}Fetch an SSH key

Path parameters

NameTypeDescription
kidstringSSH key ID

Returns 200 OK with the full SSH key object.

Delete an SSH key ​

DELETE/v1/ssh/{kid}Delete an SSH key

Deletes an SSH key. The key is removed from the workspace immediately. Deleting the workspace record does not remove an installed key from an instance.

Path parameters

NameTypeDescription
kidstringSSH key ID

Returns 202 Accepted with an empty body.


SSH key list object ​

FieldTypeDescription
idstringSSH key ID
namestringDisplay name
public_keystringThe full public key value
userobjectUser who uploaded the key (id and name)
ownerobjectWorkspace that owns the key (id and name)

Full SSH key object ​

Upload and fetch return the same id, name, and public_key fields as the list object. Their related objects contain these fields:

FieldTypeDescription
userobjectUploader with id, name, email, flags, and optional nullable whmcs_id
ownerobjectWorkspace with id, name, flags, and its owner user object

All object IDs are strings. All listed fields are required except whmcs_id.