For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get Git SSH public key

Returns the public SSH key of the hosting account.

Get Git SSH public key

get

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: u123456789
Responses
200

Success response

application/json

Public SSH key the hosting account uses to clone and pull Git repositories

public_keystring · nullableRequired

Public key to add as a deploy key on the Git host. Null when the account has no key yet.

Example: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7 u123456789@example-server
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?