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

Start Node.js build

Start a Node.js build process using files already present on the website's file storage.

Start Node.js build

post

Start 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.

The source_type must be archive and 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.

The returned build uuid can be used to poll progress and retrieve logs via the Get Node.js Build Logs endpoint.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
usernamestringRequiredExample: u123456789
domainstringRequired

Domain name

Example: mydomain.tld
Body
node_versioninteger · enumRequired

Node.js version

Example: 20Possible values:
app_typestring · enum · nullableRequired

Node.js application type

Example: vitePossible values:
root_directorystring · min: 1 · max: 200 · nullableRequired

Application root directory (where package.json is located) relative to public_html

Example: webapp
output_directorystring · min: 1 · max: 200 · nullableRequired

Build output directory relative to the root directory

Example: dist
build_scriptstring · min: 1 · max: 64 · nullableRequired

Build script that will be ran to build the application

Example: build
entry_filestring · min: 1 · max: 200 · nullableOptional

The main entry point file for the application

Example: server.js
package_managerstring · enum · min: 1 · max: 20 · nullableOptional

Package manager

Example: npmPossible values:
source_typestring · enumRequired

The source type of the files

Example: archivePossible values:
Responses
200

Success response

application/json
uuidstringOptional

Build UUID

Example: 69f07fe2-197a-4fb3-9dae-606f965ad13d
statestring · enumOptional

Build state

Example: pendingPossible values:
optionsone of · nullableOptional

Build options

created_atstring · date-timeOptional

Creation timestamp

Example: 2024-05-29T05:49:49.067239Z
updated_atstring · date-timeOptional

Last update timestamp

Example: 2024-05-29T05:49:49.067239Z
post/api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds
POST /api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 233

{
  "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"
  }
}
{
  "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"
    }
  },
  "created_at": "2024-05-29T05:49:49.067239Z",
  "updated_at": "2024-05-29T05:49:49.067239Z"
}

Last updated

Was this helpful?