Skip to content

API Reference

Deployment API

Copy page

Deploy Node.js and Next.js apps to your own Hostino Node.js hosting via the API

All endpoints live on https://api.hostino.ai and use an OAuth (Bearer) token. The full flow and behaviour (build on the server, zero-downtime switch, automatic restore, dependency reuse) is described in AI Deploy.

EndpointScopeWhat it does
GET /v1/deploy/targetsdeploy:readServices that can run a Node.js app, and the apps on each
GET /v1/appsdeploy:readApps, domain/path, Node version and environment variable names
POST /v1/deploymentsdeploy:writeStart a deployment and get a single-use upload link
PUT /v1/uploads/:tokensingle-use tokenUpload the project’s tar.gz archive (up to 50 MB)
GET /v1/deployments/:iddeploy:readStatus
GET /v1/deployments/:id/logs?tail=deploy:readInstall/build and runtime logs
GET /v1/deployments/:id/analysisdeploy:readWhy a deploy failed: known causes with evidence from the logs and fixes
POST /v1/apps/:app/envdeploy:writeSet/remove environment variables (set, unset)
POST /v1/apps/:app/rollbackdeploy:writeSwitch back to an earlier successful deployment (deployment_id)
POST /v1/apps/:app/restartdeploy:writeRestart

Start a deployment

Terminal window
curl -s -X POST https://api.hostino.ai/v1/deployments -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"service_id":"389","app_name":"web","node_version":"20"}'

domain (one of the account’s domains or subdomains) and app_uri (a path, e.g. api) are optional. The response includes upload.url and upload.command:

Terminal window
tar --exclude=node_modules --exclude=.next --exclude=.git --exclude='.env*' -czf /tmp/hostino-deploy.tgz . \
&& curl -sS --fail-with-body -X PUT -H 'Content-Type: application/gzip' --data-binary @/tmp/hostino-deploy.tgz '<upload.url>'

Statuses

awaiting_upload → uploading → extracting → building → activating → live or failed (with error and error_detail). The previous deployment becomes replaced once the new one is live. If the backup copy had to be removed to make room, note says so, and dependencies_reused shows whether dependencies were reused instead of reinstalled.

Failed-deploy analysis

GET /v1/deployments/:id/analysis matches a deployment’s error and its build and runtime logs against known causes on Hostino Node.js hosting, and returns for each a cause, evidence from the log and a concrete fix (up to 5). The analysis runs on Hostino’s side; no log is sent anywhere. When a deployment is failed, GET /v1/deployments/:id also includes these findings as diagnosis.

{
"deployment_id": "web-k3x9", "status": "failed", "error": "build_failed",
"findings": [
{ "cause": "missing_module", "title": "Package \"axios\" is missing",
"fix": "Add it to \"dependencies\" (not devDependencies) in package.json — e.g. npm install axios — commit package.json and package-lock.json, then deploy again.",
"evidence": "Error: Cannot find module 'axios'" }
]
}

Recognized causes: a missing package or letter-case differences in an import path, conflicting package versions, the Node.js version, syntax and TypeScript errors, the memory and process limits of the hosting, a full disk, network errors while downloading npm packages, a missing build script or start file, a fixed port instead of process.env.PORT, an unset environment variable, Next.js starting without a build, and database connection errors. If nothing matches, findings is empty and note says to read the last log lines.

Errors

Error codes and their fixes are listed in AI Deploy → Errors and fixes.