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

Generate Git SSH key

Creates the SSH key pair of the hosting account and returns the public key.

Generate Git SSH key

post

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: 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
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?