Deploys — NuPaaS Docs
API reference

Deploys

Deployment endpoints live under /deployments on the v1 API. A deployment is one attempt to build and run a project at a specific commit or container image.

The deployment resource

ParameterTypeDescription
idstringDeployment identifier.
project_idstringThe project this deployment belongs to.
statusstringCurrent lifecycle status — see Polling to completion below.
commit_shastringCommit built, for a source build. Empty string for an image deployment.
branchstringBranch built, for a source build. Empty string for an image deployment.
triggered_bystringWhat started the deployment. Deployments created through this API report api.
created_atstringCreation timestamp, ISO 8601.

List deployments

GET /deployments returns deployments across your organization, newest first. Requires a valid credential; no additional scope.

GET /deployments
curl "https://platform.nupaas.com/api/v1/deployments?project_id=prj_REPLACE&limit=25" \
  -H "Authorization: Bearer plat_REPLACE_WITH_YOUR_KEY"
ParameterTypeDescription
project_idquery stringOptional. Restrict to one project. Omit to list every project's deployments.
limitquery stringPage size. Sent as a string. Defaults to "25".
cursorquery stringOpaque cursor from a previous page's next_cursor. Defaults to empty.
Response
{
  "data": [
    {
      "id": "dep_REPLACE",
      "project_id": "prj_REPLACE",
      "status": "active",
      "commit_sha": "9f21c0a4b8e15d3f7c62a09e4d1b8577fa30cc12",
      "branch": "main",
      "triggered_by": "api",
      "created_at": "2026-02-03T11:07:44Z"
    }
  ],
  "pagination": { "next_cursor": null, "has_more": false }
}

Note the filter is project_id with an underscore, not projectId, and that it is optional — so a request that names it wrongly is not obviously broken, it just returns every project's deployments. Assert that the results are narrowed rather than assuming the filter applied.

Create a deployment

POST /deployments. Requires the write scope. There are two shapes: build from a branch, or run an existing image.

Deploy a branch
curl -X POST https://platform.nupaas.com/api/v1/deployments \
  -H "Authorization: Bearer plat_REPLACE_WITH_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"project_id":"prj_REPLACE","branch":"main"}'
Deploy an image
curl -X POST https://platform.nupaas.com/api/v1/deployments \
  -H "Authorization: Bearer plat_REPLACE_WITH_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"project_id":"prj_REPLACE","image_ref":"nginx:alpine","port":8080}'
ParameterTypeDescription
project_idstringRequired. The project to deploy.
branchstringOptional. Branch to build from. Defaults to an empty string, meaning not a source build.
image_refstringOptional. Container image to run instead of building. Defaults to an empty string.
service_idstringOptional. Target a specific service within the project.
portnumberOptional. Container port to route traffic to. Defaults to 8080.
health_check_pathstringOptional. Readiness path. Defaults to /health.
envobjectAccepted by the schema but not supported. A non-empty value is rejected with 400.

The response returns the new deployment under data. The call is asynchronous: a success response means the deployment was accepted, not that it is running. Use polling to wait for the outcome.

Get a deployment

GET /deployments/{id}. Requires a valid credential; no additional scope. This is the endpoint you poll.

GET /deployments/{id}
curl https://platform.nupaas.com/api/v1/deployments/dep_REPLACE \
  -H "Authorization: Bearer plat_REPLACE_WITH_YOUR_KEY"

An identifier outside your organization returns 404.

Roll back

POST /deployments/{id}/rollback. Requires the write scope. The identifier in the path is the deployment you are rolling back from.

POST /deployments/{id}/rollback
curl -X POST https://platform.nupaas.com/api/v1/deployments/dep_REPLACE/rollback \
  -H "Authorization: Bearer plat_REPLACE_WITH_YOUR_KEY"

There is no request body. The response is a deployment resource, and it is a new deployment with a new identifier — a rollback is deployed like any other change rather than mutating history. Poll the returned identifier to know when the rollback has landed.

Build logs

GET /deployments/{id}/logs. Requires a valid credential; no additional scope.

GET /deployments/{id}/logs
curl https://platform.nupaas.com/api/v1/deployments/dep_REPLACE/logs \
  -H "Authorization: Bearer plat_REPLACE_WITH_YOUR_KEY"
Response
{
  "data": [
    { "timestamp": "2026-02-03T11:07:46Z", "line": "Resolving build strategy" },
    { "timestamp": "2026-02-03T11:07:52Z", "line": "Building image" }
  ]
}
ParameterTypeDescription
timestampstringWhen the line was emitted, ISO 8601.
linestringA single log line.

Polling to completion

Creating a deployment is asynchronous. To find out whether it worked, poll GET /deployments/{id} until status reaches a terminal value.

ParameterTypeDescription
activeterminalThe deployment succeeded and is serving traffic.
failedterminalThe build or rollout failed. Read the logs.
crashedterminalThe workload started and then died.
rolled_backterminalThe deployment was rolled back.
supersededterminalA newer deployment replaced this one before it settled.

Treat any status not on this list as still in progress and keep polling. Three seconds between polls, with an overall timeout, matches what the CLI does and stays well inside the rate limit. Only active is success: treat the other four as failures in a deployment pipeline, or a rollback will look like a green build.