Get Git SSH public key
Returns the public SSH key of the hosting account.
Returns the public SSH key of the hosting account. Deploy website Git repository uses this key to
clone and pull over SSH, so a private repository works once the key is added to it as a deploy key
on the Git host. public_key is null when the account has no key yet.
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
500
Error response
application/json
get/api/hosting/v1/accounts/{username}/git/ssh-key
GET /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?