ssh_public_keys
Creates, updates, deletes, gets or lists a ssh_public_keys resource.
Overview​
| Name | ssh_public_keys |
| Type | Resource |
| Id | railway.account.ssh_public_keys |
Fields​
The following fields are returned by SELECT queries:
- list
One row per SshPublicKey.
| Name | Datatype | Description |
|---|---|---|
id | string | |
name | string | |
user_id | string | |
workspace_id | string | |
created_at | string (date-time) | |
fingerprint | string | |
public_key | string | |
updated_at | string (date-time) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | workspace_id | Gets SSH public keys. If workspaceId is provided, returns the keys owned by that workspace (requires workspace MEMBER access). Under a workspace-scoped API token, workspaceId defaults to the token's workspace when omitted; otherwise returns the authenticated user's personal keys. Backed by the Railway GraphQL query sshPublicKeys. | |
create | insert | name, public_key | Creates a new SSH public key. When workspaceId is provided (or omitted under a workspace-scoped API token, in which case it defaults to the token's workspace), the key is owned by the workspace and can be used by anyone authenticating as that workspace via native SSH; requires workspace ADMIN access. Otherwise the key is owned by the authenticated user. Backed by the Railway GraphQL mutation sshPublicKeyCreate. | |
delete | delete | id | Deletes an SSH public key. Backed by the Railway GraphQL mutation sshPublicKeyDelete. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
workspace_id | string | |
id | string | |
name | string | |
public_key | string |
SELECT examples​
- list
Gets SSH public keys. If workspaceId is provided, returns the keys owned by that workspace (requires workspace MEMBER access). Under a workspace-scoped API token, workspaceId defaults to the token's workspace when omitted; otherwise returns the authenticated user's personal keys. Backed by the Railway GraphQL query sshPublicKeys.
SELECT
id,
name,
user_id,
workspace_id,
created_at,
fingerprint,
public_key,
updated_at
FROM railway.account.ssh_public_keys
WHERE workspace_id = '{{ workspace_id }}'
;
INSERT examples​
- create
- Manifest
Creates a new SSH public key. When workspaceId is provided (or omitted under a workspace-scoped API token, in which case it defaults to the token's workspace), the key is owned by the workspace and can be used by anyone authenticating as that workspace via native SSH; requires workspace ADMIN access. Otherwise the key is owned by the authenticated user. Backed by the Railway GraphQL mutation sshPublicKeyCreate.
INSERT INTO railway.account.ssh_public_keys (
name,
public_key,
workspace_id
)
SELECT
'{{ name }}' /* required */,
'{{ public_key }}' /* required */,
'{{ workspace_id }}'
RETURNING
id,
name,
user_id,
workspace_id,
created_at,
fingerprint,
public_key,
updated_at
;
# Description fields are for documentation purposes
- name: ssh_public_keys
props:
- name: name
value: "{{ name }}"
- name: public_key
value: "{{ public_key }}"
- name: workspace_id
value: "{{ workspace_id }}"
DELETE examples​
- delete
Deletes an SSH public key. Backed by the Railway GraphQL mutation sshPublicKeyDelete.
DELETE FROM railway.account.ssh_public_keys
WHERE
id = '{{ id }}' --required
;