Check a promotion without making it
const url = 'https://example.com/v1/deployments/example/promotions/check';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"toProjectId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/deployments/example/promotions/check \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "toProjectId": "example" }'Runs every check a promotion makes and writes nothing: what would move, the next environment, and each value with a problem in the target (where a promotion refuses with promotion-values-not-ready). Refused as the promotion is for every other check. Needs read on the deployment’s project and admin on the target.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The deployment to promote: one serving an environment of an order.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The next environment of the deployment’s order.
Examplegenerated
{ "toProjectId": "example"}Responses
Section titled “Responses”What a promotion would move, and the values not ready in the target.
object
object
object
Carried with the build: an edit of a version it ships. Absent for one it ships.
object
Carried with the build: an edit of a version it ships. Absent for one it ships.
object
Absent for guardrails, which have no version.
object
Absent for guardrails, which have no version.
Each value with a problem in the target; empty when every one is ready.
object
The secret’s or env value’s name; for a model key, the key’s secret name, or any provider when none is registered.
secret, env, model-key or pack-env; a later runtime may add kinds, so treat an unknown one as a value not yet named.
object
tool, agent, provider or pack; a later runtime may add kinds, so treat an unknown one as a need not yet named.
Where a run finds it, when it is set: the project, else its org, else the tenant.
Why it isn’t ready; absent when it is. One of a fixed list; a later runtime may add problems, so treat an unknown one as a reason not yet named. missing: set nowhere a run looks. secret-not-yet: a pack env name set only as a secret, which isn’t given into a pack service’s environment yet. ambiguous: a pack env name set both as a secret and as a plain value. revoked: a tool’s secret revoked where it’s recorded, or a model key revoked where a run looks first (a run refuses rather than read a wider one). no-provider: an agent that runs on any provider (it names none, or names one that isn’t registered), with no provider registered in the tenant, so a run has none to call.
object
Its place in the order, from 0 (the first, which takes builds).
The env this runtime serves, which a run in the target reads its values under: a value is set there (--env=<envName> with --scope=project:<id>). Absent when the runtime names none, and each value is then listed unread.
Edits of the build’s agents and flows that would stay behind; absent when none.
object
agent or flow; a later runtime may add kinds, so treat an unknown one as an item not yet named.
The version its chain of edits starts from.
Example
{ "moves": { "agents": [ { "carried": true } ], "flows": [ { "carried": true } ] }, "values": [ { "foundAt": "project" } ]}Malformed body (bad-input). Or signature-invalid: the deployment’s signature doesn’t verify over the fields it keeps.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No admin on the target project. Or key-project-mismatch: the API key or session is limited to a project, which a promotion’s check is refused as the promotion is. Or signer-not-trusted: the key that signed the build is no longer trusted.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}deployment-not-found: no deployment with that id in this tenant, or one in a project you don’t read.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}promotion-not-next-environment, deployment-superseded, or a suspension of the source or the target, as on the promotion.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Server error (unmapped domain code or framework crash).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}See also
GET /v1/deployments/{deploymentId}: Fetch a signed deployment recordGET /v1/deployments/{deploymentId}/pack-env: Show where each name a deployment's pack declares is setPOST /v1/deployments/{deploymentId}/secrets: Sync secrets against a deploymentGET /v1/deployments/{deploymentId}/values: List the values a deployment needs in a project- Error code
bad-input - Error code
deployment-not-found - Error code
deployment-superseded - Error code
key-project-mismatch - Error code
promotion-not-next-environment - Error code
request-too-large - Error code
signature-invalid - Error code
signer-not-trusted - Every error code