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

Update Git auto-deployment settings

Creates or replaces the Git auto-deployment settings of the website: repository, branch, the directory under the document root to deploy into, and isenabled.

Update Git auto-deployment settings

put

Creates or replaces the Git auto-deployment settings of the website: repository, branch, the directory under the document root to deploy into, and is_enabled. Send the full set; is_enabled defaults to true and directory to the document root. installation_uuid must be an installation from List Git installations that belongs to the same customer as the website.

For PHP and static websites, saving with is_enabled true deploys the branch right away and every later push to that branch deploys again. For Node.js and Website Builder websites saving does not clone anything. On a Node.js website start the first deploy with Start Node.js build using source_type git; pushes then trigger new builds with the build settings stored for the website.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
usernamestringRequiredExample: u123456789
domainstringRequired

Domain name

Example: mydomain.tld
Body
installation_uuidstringRequired

Active Git installation from List Git installations

Example: 018f5e2a-1234-7890-abcd-1234567890ab
ownerstring · min: 1 · max: 200Required

Repository owner login, as returned by List Git installation repositories. GitLab group paths use slashes.

Example: octocatPattern: ^[a-zA-Z0-9_]([a-zA-Z0-9_.-]{0,198}[a-zA-Z0-9_])?(\/[a-zA-Z0-9_]([a-zA-Z0-9_.-]{0,198}[a-zA-Z0-9_])?)*$
repositorystring · min: 1 · max: 100Required

Repository name without the .git suffix

Example: my-sitePattern: ^[a-zA-Z0-9_-]([a-zA-Z0-9._-]{0,98}[a-zA-Z0-9_-])?$
branchstring · min: 1 · max: 200Required

Branch to deploy

Example: mainPattern: ^[a-zA-Z0-9._-]([a-zA-Z0-9\/._-]{0,198}[a-zA-Z0-9._-])?$
directorystring · max: 255 · nullableOptional

Subdirectory under the website document root to deploy into. Empty, null or omitted means the document root.

Default: ""Example: my-api
is_enabledbooleanOptional

Whether pushes to the branch deploy automatically

Default: trueExample: true
Responses
200

Success empty response

application/json
messagestringOptionalExample: Request accepted
put/api/hosting/v1/accounts/{username}/websites/{domain}/git/auto-deployments/settings
PUT /api/hosting/v1/accounts/{username}/websites/{domain}/git/auto-deployments/settings HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 156

{
  "installation_uuid": "018f5e2a-1234-7890-abcd-1234567890ab",
  "owner": "octocat",
  "repository": "my-site",
  "branch": "main",
  "directory": "my-api",
  "is_enabled": true
}
{
  "message": "Request accepted"
}

Last updated

Was this helpful?