Skip to content

Deployments API

Deployments and releases.

13 operations. Every call needs a session cookie or an Authorization: Bearer nct_… token unless marked Public. Conventions, errors and scopes

GET/deployments/{deploymentId}

Get a deployment

waitingFor is set while the deployment waits for an offline server.

ParameterInTypeDescription
deploymentIdrequiredpathstring
Response 200 · OK · application/json
DeploymentView
  • actorLabelstringrequired
  • actorTypestringrequired
  • BuildInforequired
  • buildServerIdstringrequired
  • buildServerNamestring
  • cancelRequestedAtstring (date-time) | nullrequired
  • cancelRequestedBystringrequired
  • canceledAtStepstringrequired
  • CommitViewrequired
  • createdAtstring (date-time)required
  • finishedAtstring (date-time) | nullrequired
  • generationinteger (int64)required
  • idstringrequired
  • messagestring | nullrequired
  • noCacheboolean
  • ReleaseViewrequired
  • releaseIdstringrequired
  • rolledBackFromstringrequired
  • serverIdstringrequired
  • serviceIdstringrequired
  • startedAtstring (date-time) | nullrequired
  • statusstringrequired
  • statusMessagestringrequired
  • strategyenum: rolling | recreate | route_onlyrequired
  • triggerenum: manual | redeploy | rollback | staged | reconcile | drain | git_push | preview | cron | deploy_hookrequired
  • WaitingForrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

POST/deployments/{deploymentId}/cancel

Cancel a deployment at any step

Before the agent acknowledged the deployment's command the deployment ends as canceled at once. Once the agent runs it, a cancel request is sent to the agent (cancelRequestedAt is set) and the deployment ends as canceled when the agent reports back, with the step it reached in canceledAtStep: a pull or build is stopped (a build's work directory is removed), containers of the new release are removed and the current release keeps serving, during verification the previous routes are restored first, and a recreate deploy that already stopped the previous release starts it again. If the previous release cannot be restored the result is rollback_failed with manual recovery steps. Once the new release is live it is too late: the deployment finishes (a still-running post-deploy command is stopped). An offline server receives the request when it reconnects. A finished deployment is 409 cannot_cancel.

ParameterInTypeDescription
Idempotency-KeyheaderstringClient-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours.
deploymentIdrequiredpathstring
Response 200 · OK · application/json
DeploymentView
  • actorLabelstringrequired
  • actorTypestringrequired
  • BuildInforequired
  • buildServerIdstringrequired
  • buildServerNamestring
  • cancelRequestedAtstring (date-time) | nullrequired
  • cancelRequestedBystringrequired
  • canceledAtStepstringrequired
  • CommitViewrequired
  • createdAtstring (date-time)required
  • finishedAtstring (date-time) | nullrequired
  • generationinteger (int64)required
  • idstringrequired
  • messagestring | nullrequired
  • noCacheboolean
  • ReleaseViewrequired
  • releaseIdstringrequired
  • rolledBackFromstringrequired
  • serverIdstringrequired
  • serviceIdstringrequired
  • startedAtstring (date-time) | nullrequired
  • statusstringrequired
  • statusMessagestringrequired
  • strategyenum: rolling | recreate | route_onlyrequired
  • triggerenum: manual | redeploy | rollback | staged | reconcile | drain | git_push | preview | cron | deploy_hookrequired
  • WaitingForrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflictcannot_cancel
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

GET/deployments/{deploymentId}/commands

A deployment's agent commands, redacted

Every command the control plane sent for the deployment (deploy, build_image, cancel_deploy, …): kind, server, delivery state, enqueue/ack/finish times, outcome and error, with the payload and result as persisted. Variable values, tokens, credentials and file contents never appear: those fields are masked. Needs the same access as the deployment's logs.

ParameterInTypeDescription
deploymentIdrequiredpathstring
Response 200 · OK · application/json
CommandsOutputBody
  • CommandView[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

GET/deployments/{deploymentId}/events

A deployment's step timeline

ParameterInTypeDescription
deploymentIdrequiredpathstring
Response 200 · OK · application/json
EventsOutputBody
  • EventView[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

GET/deployments/{deploymentId}/release

The release a deployment shipped, for debugging

The release id and generation, the resolved source (image ref and digest, or git commit), how it was built and where it ran, the configuration snapshot with secrets and file contents masked, and the keys of its variables with which are secret, references or provided by the platform. Never a variable value. 404 when the deployment has no release yet.

ParameterInTypeDescription
deploymentIdrequiredpathstring
Response 200 · OK · application/json
ReleaseDetailView
  • BuildInforequired
  • configanyrequired
  • createdAtstring (date-time)required
  • deploymentIdstringrequired
  • generationinteger (int64)required
  • idstringrequired
  • imageRefstringrequired
  • ReleasePlacementrequired
  • serviceIdstringrequired
  • ReleaseSourcerequired
  • ReleaseVariableView[] | nullrequired
  • variablesPrunedbooleanrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

POST/deployments/{deploymentId}/rollback

Roll back to the release of a successful deployment

Application image and configuration only. Databases, volumes and external services are not rolled back. Creates a new deployment of the old release (rolledBackFrom is the deployment that was running). A git release whose built image was pruned returns 409 image_pruned with commitSha in the details: rebuild the commit instead.

ParameterInTypeDescription
Idempotency-KeyheaderstringClient-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours.
deploymentIdrequiredpathstring
Response 202 · Accepted · application/json
RollbackView
  • actorLabelstringrequired
  • actorTypestringrequired
  • BuildInforequired
  • buildServerIdstringrequired
  • buildServerNamestring
  • cancelRequestedAtstring (date-time) | nullrequired
  • cancelRequestedBystringrequired
  • canceledAtStepstringrequired
  • CommitViewrequired
  • createdAtstring (date-time)required
  • disclaimerstringrequired
  • finishedAtstring (date-time) | nullrequired
  • generationinteger (int64)required
  • idstringrequired
  • messagestring | nullrequired
  • noCacheboolean
  • ReleaseViewrequired
  • releaseIdstringrequired
  • rolledBackFromstringrequired
  • serverIdstringrequired
  • serviceIdstringrequired
  • startedAtstring (date-time) | nullrequired
  • statusstringrequired
  • statusMessagestringrequired
  • strategyenum: rolling | recreate | route_onlyrequired
  • triggerenum: manual | redeploy | rollback | staged | reconcile | drain | git_push | preview | cron | deploy_hookrequired
  • WaitingForrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflictimage_pruned
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

POST/environments/{environmentId}/deploy-staged

Deploy every service with staged changes

Services start in reference order: providers of ${{service.KEY}} references first (otherwise databases first; a reference cycle keeps the input order). A consumer's deployment waits until the providers of the same batch finished (at most 10 minutes). order lists the service ids in the order they were started. Services that cannot deploy are skipped unless named in serviceIds.

ParameterInTypeDescription
Idempotency-KeyheaderstringClient-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours.
environmentIdrequiredpathstring
Request body · application/json · required
DeployStagedInputBody
  • messagestring
    Optional note shown with every deployment of the batch
  • noCacheboolean
    Build every git service of the batch without cache (--no-cache --pull) for this batch only; other services deploy as usual
  • serviceIdsstring[] | null
    Limit to these services (default: every service with staged changes)
Response 202 · Accepted · application/json
StagedResult
  • DeploymentView[] | nullrequired
  • orderstring[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

GET/environments/{environmentId}/deployments

List the deployments of every service of an environment (newest first)

Filter by status (comma-separated) and serviceId.

ParameterInTypeDescription
environmentIdrequiredpathstring
statusquerystringComma-separated statuses, e.g. failed,succeeded
serviceIdquerystring (uuid)Only deployments of this service
cursorquerystringOpaque cursor from a previous page's nextCursor
limitqueryinteger (int64)Page size (default 50, max 200)
Response 200 · OK · application/json
PageEnvDeploymentView
  • EnvDeploymentView[] | nullrequired
  • nextCursorstring
    Present when more items exist
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

GET/environments/{environmentId}/deployments/daily

Deployment outcomes per UTC day for an environment

One entry per day, oldest first, ending today (days 1..90, default 30); days without deployments are zeros. failed counts failed and rollback_failed, other counts canceled, rolled_back and in-flight deployments.

ParameterInTypeDescription
environmentIdrequiredpathstring
daysqueryinteger (int64)Window length in UTC days, ending today
Response 200 · OK · application/json
DailyOutcomes
  • DailyOutcome[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

POST/services/{serviceId}/build-plan

Preview how a git service would be built

Asks the agent of the service's server to clone the branch head and report the build method (the repository's Dockerfile, Railpack or a generated starter Dockerfile), why it applies, and for Railpack the detected providers, packages, steps and start command. Nothing is built or deployed. The request waits for the agent (up to 150 s): 409 server_offline when the server is offline, 504 build_plan_timeout when it does not answer. Requires deployments:write because it makes the server clone the repository and run the planner.

ParameterInTypeDescription
serviceIdrequiredpathstring
Response 200 · OK · application/json
BuildPlanResult
  • commitShastring
  • dockerfileFoundbooleanrequired
  • dockerfilePathstringrequired
  • BuildInfo
  • messagestring
  • PlanLog[] | null
  • outcomestringrequired
  • requestedstringrequired
  • suggestedStarterstring
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflictserver_offline
  • 422Unprocessable Entity
  • 500Internal Server Error
  • 504Gateway Timeoutbuild_plan_timeout

Errors are RFC 9457 application/problem+json with a stable code field.

GET/services/{serviceId}/deployments

List a service's deployments (newest first)

ParameterInTypeDescription
serviceIdrequiredpathstring
cursorquerystringOpaque cursor from a previous page's nextCursor
limitqueryinteger (int64)Page size (default 50, max 200)
Response 200 · OK · application/json
PageDeploymentView
  • DeploymentView[] | nullrequired
  • nextCursorstring
    Present when more items exist
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

POST/services/{serviceId}/deployments

Deploy a service

Returns 202 with the deployment; it runs asynchronously. 409 deployment_in_progress while another deployment of the service is active; 422 for blocking problems (no server, revoked server, unresolved variable references).

ParameterInTypeDescription
Idempotency-KeyheaderstringClient-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours.
serviceIdrequiredpathstring
Request body · application/json
DeployInputBody1
  • commitShastring
    Git services only: build this full 40-character commit instead of the branch head ("Rebuild commit").
  • messagestring
    Optional note shown with the deployment
  • noCacheboolean
    Git services only: build this one deployment without any cache (--no-cache --pull, and no reuse of an image a build server already pushed). Later deployments build normally. 422 agent_too_old if the server's agent predates this option.
Response 202 · Accepted · application/json
DeploymentView
  • actorLabelstringrequired
  • actorTypestringrequired
  • BuildInforequired
  • buildServerIdstringrequired
  • buildServerNamestring
  • cancelRequestedAtstring (date-time) | nullrequired
  • cancelRequestedBystringrequired
  • canceledAtStepstringrequired
  • CommitViewrequired
  • createdAtstring (date-time)required
  • finishedAtstring (date-time) | nullrequired
  • generationinteger (int64)required
  • idstringrequired
  • messagestring | nullrequired
  • noCacheboolean
  • ReleaseViewrequired
  • releaseIdstringrequired
  • rolledBackFromstringrequired
  • serverIdstringrequired
  • serviceIdstringrequired
  • startedAtstring (date-time) | nullrequired
  • statusstringrequired
  • statusMessagestringrequired
  • strategyenum: rolling | recreate | route_onlyrequired
  • triggerenum: manual | redeploy | rollback | staged | reconcile | drain | git_push | preview | cron | deploy_hookrequired
  • WaitingForrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflictdeployment_in_progress
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

POST/services/{serviceId}/deployments/plan

Plan a deployment (dry run)

Reports the strategy (rolling or recreate, with reasons), warnings, the pending changes, the resolved source and blocking problems. Nothing is started.

ParameterInTypeDescription
serviceIdrequiredpathstring
Response 200 · OK · application/json
Plan
  • PlanBlocking[] | nullrequired
  • FieldChange[] | nullrequired
  • MeshPlanrequired
  • PlacementViewrequired
  • reasonsstring[] | nullrequired
  • ServerRefrequired
  • PlanSourcerequired
  • strategyenum: rolling | recreate | route_onlyrequired
  • warningsstring[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.