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
/v1/workspaces/{wid}/sshSearch workspace SSH keysLists SSH keys belonging to a workspace with pagination.
Path parameters
| Name | Type | Description |
|---|---|---|
wid | string | Workspace ID |
Query parameters
| Name | Type | Description |
|---|---|---|
q | string | Quick search by name or ID |
id | string[] | Filter to specific key IDs |
name | string | Filter by name |
owner | string[] | 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.
curl "https://api.galaxygate.net/v1/workspaces/42/ssh" \
-H "Authorization: Bearer $GALAXYGATE_TOKEN" \
-A 'curl/8.5'Upload an SSH key
/v1/workspaces/{wid}/sshUpload an SSH keyUploads 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
| Name | Type | Description |
|---|---|---|
wid | string | Workspace ID |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Display name for the key, 4-32 characters |
public_key | string | yes | Full public key string, for example ssh-ed25519 AAAA... user@host |
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
/v1/ssh/{kid}Fetch an SSH keyPath parameters
| Name | Type | Description |
|---|---|---|
kid | string | SSH key ID |
Returns 200 OK with the full SSH key object.
Delete an SSH key
/v1/ssh/{kid}Delete an SSH keyDeletes 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
| Name | Type | Description |
|---|---|---|
kid | string | SSH key ID |
Returns 202 Accepted with an empty body.
SSH key list object
| Field | Type | Description |
|---|---|---|
id | string | SSH key ID |
name | string | Display name |
public_key | string | The full public key value |
user | object | User who uploaded the key (id and name) |
owner | object | Workspace 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:
| Field | Type | Description |
|---|---|---|
user | object | Uploader with id, name, email, flags, and optional nullable whmcs_id |
owner | object | Workspace with id, name, flags, and its owner user object |
All object IDs are strings. All listed fields are required except whmcs_id.