Skip to main content

Add Ssh Key

POST /v1/ssh-keys

Register an OpenSSH public key (a line such as the contents of id_ed25519.pub) on your account. The InstaVM SSH gateway recognises you by your active keys. Adding a key you removed earlier reactivates it, and adding one that is already active returns it unchanged. A key can belong to only one account.

Authentication​

Requires authentication via: OAuth2PasswordBearer.

Parameters​

NameInTypeRequiredDescriptionConstraints
X-API-Keyheaderstring | nullNonullable

Request Body​

Required: Yes

application/json​

Resolved schema:

{
"properties": {
"public_key": {
"type": "string",
"title": "Public Key",
"description": "OpenSSH public key string"
}
},
"type": "object",
"required": [
"public_key"
],
"title": "SSHKeyCreateRequest"
}

Field details:

FieldTypeRequiredDescriptionConstraints
public_keystringYesOpenSSH public key string

Responses​

200​

Successful Response

application/json​

Resolved schema:

{}

400​

The text is not a valid OpenSSH public key line.

No response body.

401​

No credentials, or the Bearer token / X-API-Key is invalid.

No response body.

403​

The account is disabled, or a guest token was used.

No response body.

409​

This key is registered to another account.

No response body.

422​

Validation Error

application/json​

Resolved schema:

{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}

Field details:

FieldTypeRequiredDescriptionConstraints
detailarray<object>No
detail[]objectNo
detail[].locarray<string | integer>No
detail[].loc[]string | integerNo
detail[].msgstringNo
detail[].typestringNo