Start Node.js build
Changed onStart a Node.js build process using files already present on the website's file storage.
WARNING: on success this overwrites the website's existing contents and cannot be undone — verify this is intended before calling this endpoint.
With source_type archive, source_options.archive_path must point to an existing archive file on the server (relative to the website document root). Use the Generate Upload URL endpoint to obtain credentials and upload the archive first. To auto-detect build settings from an archive before starting, first call the Get Node.js Build Settings from Archive endpoint.
With source_type git, source_options carries owner, repository, branch and installation_uuid. Take the installation from List Git installations and the owner and repository from List Git installation repositories; the branch is cloned at its current head. The installation must belong to the same customer as the website.
The returned build uuid can be used to poll progress and retrieve logs via the Get Node.js Build Logs endpoint.
Request
- Base URL: https://developers.hostinger.com
- URL: https://developers.hostinger.com/api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds
- Auth: HTTP bearer
Path parameters
Domain name
Request body
Example request
{
"node_version": 20,
"app_type": "vite",
"root_directory": "webapp",
"output_directory": "dist",
"build_script": "build",
"entry_file": "server.js",
"package_manager": "npm",
"source_type": "archive",
"source_options": {
"archive_path": "example.zip",
"owner": "octocat",
"repository": "my-site",
"branch": "main",
"installation_uuid": "018f5e2a-1234-7890-abcd-1234567890ab"
}
}Response
Success response
Example response
{
"uuid": "69f07fe2-197a-4fb3-9dae-606f965ad13d",
"state": "pending",
"options": {
"node_version": 24,
"app_type": "vite",
"root_directory": "src",
"output_directory": "dist",
"build_script": "build",
"entry_file": "server.js",
"package_manager": "npm",
"source_type": "archive",
"source_options": {
"archive_path": "archive.zip",
"owner": "octocat",
"repository": "my-site",
"branch": "main",
"installation_uuid": "018f5e2a-1234-7890-abcd-1234567890ab",
"commit": {
"hash": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
"message": "Initial commit",
"author": {
"name": "Jane Doe",
"avatar_url": "https://avatars.githubusercontent.com/u/583231"
}
}
}
},
"created_at": "2024-05-29T05:49:49.067239Z",
"updated_at": "2024-05-29T05:49:49.067239Z"
}Changes
- warning
added the new
gitenum value to the/////response property for the response status - info
added the new optional request property
/ - info
added the new optional request property
/ - info
added the new optional request property
/ - info
added the new optional request property
/ - info
added the new
gitenum value to the request property - info
added the required property
//////////to the response with the status - info
added the required property
//////////to the response with the status - info
added the required property
//////////to the response with the status - info
added the required property
//////////to the response with the status - info
added the required property
//////////to the response with the status
- warning
- info
endpoint added
- info