Reference
View as MarkdownDeployments 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
/deployments/{deploymentId}Get a deployment
waitingFor is set while the deployment waits for an offline server.
| Parameter | In | Type | Description |
|---|---|---|---|
deploymentIdrequired | path | string |
Response 200 · OK · application/json
- 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
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/deployments/{deploymentId}/cancelCancel 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.
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Client-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours. |
deploymentIdrequired | path | string |
Response 200 · OK · application/json
- 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
401Unauthorized403Forbidden404Not Found409Conflictcannot_cancel422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/deployments/{deploymentId}/commandsA 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.
| Parameter | In | Type | Description |
|---|---|---|---|
deploymentIdrequired | path | string |
Response 200 · OK · application/json
- CommandView[] | nullrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/deployments/{deploymentId}/eventsA deployment's step timeline
| Parameter | In | Type | Description |
|---|---|---|---|
deploymentIdrequired | path | string |
Response 200 · OK · application/json
- EventView[] | nullrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/deployments/{deploymentId}/releaseThe 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.
| Parameter | In | Type | Description |
|---|---|---|---|
deploymentIdrequired | path | string |
Response 200 · OK · application/json
- BuildInforequired
- configanyrequired
- createdAtstring (date-time)required
- deploymentIdstringrequired
- generationinteger (int64)required
- idstringrequired
- imageRefstringrequired
- ReleasePlacementrequired
- serviceIdstringrequired
- ReleaseSourcerequired
- ReleaseVariableView[] | nullrequired
- variablesPrunedbooleanrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/deployments/{deploymentId}/rollbackRoll 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.
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Client-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours. |
deploymentIdrequired | path | string |
Response 202 · Accepted · application/json
- 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
401Unauthorized403Forbidden404Not Found409Conflictimage_pruned422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/environments/{environmentId}/deploy-stagedDeploy 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.
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Client-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours. |
environmentIdrequired | path | string |
Request body · application/json · required
- messagestringOptional note shown with every deployment of the batch
- noCachebooleanBuild every git service of the batch without cache (--no-cache --pull) for this batch only; other services deploy as usual
- serviceIdsstring[] | nullLimit to these services (default: every service with staged changes)
Response 202 · Accepted · application/json
- DeploymentView[] | nullrequired
- orderstring[] | nullrequired
401Unauthorized403Forbidden404Not Found409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/environments/{environmentId}/deploymentsList the deployments of every service of an environment (newest first)
Filter by status (comma-separated) and serviceId.
| Parameter | In | Type | Description |
|---|---|---|---|
environmentIdrequired | path | string | |
status | query | string | Comma-separated statuses, e.g. failed,succeeded |
serviceId | query | string (uuid) | Only deployments of this service |
cursor | query | string | Opaque cursor from a previous page's nextCursor |
limit | query | integer (int64) | Page size (default 50, max 200) |
Response 200 · OK · application/json
- EnvDeploymentView[] | nullrequired
- nextCursorstringPresent when more items exist
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/environments/{environmentId}/deployments/dailyDeployment 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.
| Parameter | In | Type | Description |
|---|---|---|---|
environmentIdrequired | path | string | |
days | query | integer (int64) | Window length in UTC days, ending today |
Response 200 · OK · application/json
- DailyOutcome[] | nullrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/build-planPreview 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.
| Parameter | In | Type | Description |
|---|---|---|---|
serviceIdrequired | path | string |
Response 200 · OK · application/json
- commitShastring
- dockerfileFoundbooleanrequired
- dockerfilePathstringrequired
- BuildInfo
- messagestring
- PlanLog[] | null
- outcomestringrequired
- requestedstringrequired
- suggestedStarterstring
401Unauthorized403Forbidden404Not Found409Conflictserver_offline422Unprocessable Entity500Internal Server Error504Gateway Timeoutbuild_plan_timeout
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/deploymentsList a service's deployments (newest first)
| Parameter | In | Type | Description |
|---|---|---|---|
serviceIdrequired | path | string | |
cursor | query | string | Opaque cursor from a previous page's nextCursor |
limit | query | integer (int64) | Page size (default 50, max 200) |
Response 200 · OK · application/json
- DeploymentView[] | nullrequired
- nextCursorstringPresent when more items exist
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/deploymentsDeploy 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).
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Client-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours. |
serviceIdrequired | path | string |
Request body · application/json
- commitShastringGit services only: build this full 40-character commit instead of the branch head ("Rebuild commit").
- messagestringOptional note shown with the deployment
- noCachebooleanGit 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
- 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
401Unauthorized403Forbidden404Not Found409Conflictdeployment_in_progress422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/services/{serviceId}/deployments/planPlan 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.
| Parameter | In | Type | Description |
|---|---|---|---|
serviceIdrequired | path | string |
Response 200 · OK · application/json
- PlanBlocking[] | nullrequired
- FieldChange[] | nullrequired
- MeshPlanrequired
- PlacementViewrequired
- reasonsstring[] | nullrequired
- ServerRefrequired
- PlanSourcerequired
- strategyenum: rolling | recreate | route_onlyrequired
- warningsstring[] | nullrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.