Create public key
Add a new public key to your account. Use this endpoint to register SSH keys for VPS authentication.
Add a new public key to your account.
Use this endpoint to register SSH keys for VPS authentication.
Authorizations
AuthorizationstringRequired
API Token authentication
Body
namestringRequiredExample:
My Public KeykeystringRequiredExample:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD...Responses
200
Success response
application/json
idintegerOptionalExample:
Public key ID
325namestringOptionalExample:
Public key name
My public keykeystringOptionalExample:
Public key content
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD...401
Unauthenticated response
application/json
422
Validation error response
application/json
500
Error response
application/json
post/api/vps/v1/public-keys
POST /api/vps/v1/public-keys HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 75
{
"name": "My Public Key",
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD..."
}{
"id": 325,
"name": "My public key",
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD..."
}Last updated
Was this helpful?