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.
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 | integer | Workspace ID |
Query parameters
| Name | Type | Description |
|---|---|---|
q | string | Quick search by name or ID |
id | integer[] | Filter to specific key IDs |
name | string | Filter by name |
Plus the shared pagination parameters. Returns a paged list of SSH key 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 | integer | 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 the full SSH key object.
Fetch an SSH key
/v1/ssh/{id}Fetch an SSH keyPath parameters
| Name | Type | Description |
|---|---|---|
id | integer | SSH key ID |
Returns the full SSH key object.
Delete an SSH key
/v1/ssh/{id}Delete an SSH keyDeletes an SSH key. The key is removed from the workspace immediately. Instances that were already provisioned with this key are not affected; the key has already been written to their authorized_keys.
Path parameters
| Name | Type | Description |
|---|---|---|
id | integer | SSH key ID |
Returns 202 Accepted with an empty body.
SSH key 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) |