Generate Git SSH key
Creates the SSH key pair of the hosting account and returns the public key.
Creates the SSH key pair of the hosting account and returns the public key. When the account already has a key, returns that key unchanged. One key serves every website of the account; add the public key to a private repository as a deploy key before deploying it.
Authorizations
AuthorizationstringRequired
API Token authentication
Path parameters
usernamestringRequiredExample:
u123456789Responses
200
Success response
application/json
Public SSH key the hosting account uses to clone and pull Git repositories
public_keystring · nullableRequiredExample:
Public key to add as a deploy key on the Git host. Null when the account has no key yet.
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7 u123456789@example-server401
Unauthenticated response
application/json
422
Validation error response
application/json
500
Error response
application/json
post/api/hosting/v1/accounts/{username}/git/ssh-key
POST /api/hosting/v1/accounts/{username}/git/ssh-key HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7 u123456789@example-server"
}Last updated
Was this helpful?