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.
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.
API Token authentication
u123456789Domain name
mydomain.tldActive Git installation from List Git installations
018f5e2a-1234-7890-abcd-1234567890abRepository owner login, as returned by List Git installation repositories. GitLab group
paths use slashes.
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_])?)*$Repository name without the .git suffix
my-sitePattern: ^[a-zA-Z0-9_-]([a-zA-Z0-9._-]{0,98}[a-zA-Z0-9_-])?$Branch to deploy
mainPattern: ^[a-zA-Z0-9._-]([a-zA-Z0-9\/._-]{0,198}[a-zA-Z0-9._-])?$Subdirectory under the website document root to deploy into. Empty, null or omitted means the document root.
""Example: my-apiWhether pushes to the branch deploy automatically
trueExample: trueSuccess empty response
Request acceptedUnauthenticated response
Validation error response
Error response
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?