SSH Keys
Get all SSH keys for a project
Authorizations
Query parameters
projectstringRequiredExample:
proj_abc123456Responses
200
Successful Response
application/json
422
Validation Error
application/json
get
/v2/ssh-keysGET /v2/ssh-keys?project=proj_abc123456 HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
{
"fid": "sshkey_abc123456",
"name": "text",
"project": "proj_abc123456",
"public_key": "text",
"created_at": "2024-01-01T00:00:00Z",
"required": true
}
]Create a new SSH key. If public_key is not provided, this endpoint will generate a new RSA key pair and return both the private and public keys.
Authorizations
Body
projectstringRequiredExample:
proj_abc123456namestringRequired
public_keyany ofOptional
stringOptional
nullOptional
requiredbooleanOptionalDefault:
falseResponses
201
Successful Response
application/json
422
Validation Error
application/json
post
/v2/ssh-keysPOST /v2/ssh-keys HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 79
{
"project": "proj_abc123456",
"name": "text",
"public_key": "text",
"required": false
}{
"fid": "sshkey_abc123456",
"name": "text",
"project": "proj_abc123456",
"public_key": "text",
"created_at": "2024-01-01T00:00:00Z",
"required": true,
"private_key": "-----BEGIN RSA PRIVATE KEY-----..."
}Delete an SSH key. Note that SSH keys used in active bids/reservations cannot be deleted.
Authorizations
Path parameters
ssh_key_fidstringRequiredExample:
sshkey_abc123456Responses
204
Successful Response
No content
422
Validation Error
application/json
delete
/v2/ssh-keys/{ssh_key_fid}DELETE /v2/ssh-keys/{ssh_key_fid} HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Update an SSH key to set it as required. Only admins can set a key as required.
Authorizations
Path parameters
ssh_key_fidstringRequiredExample:
sshkey_abc123456Body
requiredbooleanRequired
Responses
200
Successful Response
application/json
422
Validation Error
application/json
patch
/v2/ssh-keys/{ssh_key_fid}PATCH /v2/ssh-keys/{ssh_key_fid} HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 17
{
"required": true
}{
"fid": "sshkey_abc123456",
"name": "text",
"project": "proj_abc123456",
"public_key": "text",
"created_at": "2024-01-01T00:00:00Z",
"required": true
}