Skip to content

Check a promotion without making it

View as Markdown
POST
/v1/deployments/{deploymentId}/promotions/check
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, the plan limits’ among them; at its plan or past it, the answer has planWarning. Needs read on the deployment’s project and admin on the target.

deploymentId
required
string
>= 1 characters

The deployment to promote: one serving an environment of an order.

Media typeapplication/json
object
toProjectId
required

The next environment of the deployment’s order.

string
>= 1 characters
Examplegenerated
{
"toProjectId": "example"
}

What a promotion would move, and the values not ready in the target.

Media typeapplication/json
object
moves
required
object
packId
string
imageDigest
required
string
/^sha256:[0-9a-f]{64}$/
agents
required
Array<object>
object
id
required
string
version
string
carried

Carried with the build: an edit of a version it ships. Absent for one it ships.

boolean
flows
required
Array<object>
object
id
required
string
version
string
carried

Carried with the build: an edit of a version it ships. Absent for one it ships.

boolean
tools
required
Array<object>
object
id
required
string
version

Absent for guardrails, which have no version.

string
guardrails
required
Array<object>
object
id
required
string
version

Absent for guardrails, which have no version.

string
values
required

Each value with a problem in the target; empty when every one is ready.

Array<object>
object
name
required

The secret’s or env value’s name; for a model key, the key’s secret name, or any provider when none is registered.

string
kind
required

secret, env, model-key or pack-env; a later runtime may add kinds, so treat an unknown one as a value not yet named.

string
neededBy
required
object
type
required

tool, agent, provider or pack; a later runtime may add kinds, so treat an unknown one as a need not yet named.

string
id
required
string
version
string
foundAt

Where a run finds it, when it is set: the project, else its org, else the workspace (tenant).

string
Allowed values: project org tenant
problem

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 two ways, as two of a plain value, a secret and a cloud secret. 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 workspace, so a run has none to call.

string
nextEnvironment
required
object
projectId
required
string
position
required

Its place in the order, from 0 (the first, which takes builds).

integer
>= 1
envName

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.

string
leftBehind

Edits of the build’s agents and flows that would stay behind; absent when none.

Array<object>
object
kind
required

agent or flow; a later runtime may add kinds, so treat an unknown one as an item not yet named.

string
id
required
string
version
required
string
from
required

The version its chain of edits starts from.

string
planWarning

The plan limits’ counts that are at their plan or past it, with this write: flows and agents in production, against the license key’s plan or the workspace’s own limit. Past most, new ones are refused (plan-limit-reached); what runs keeps running.

object
>= 1 properties
flows
object
plan
required

The plan’s number: the license key’s, or the workspace’s own limit (TenantLimits).

integer
most
required

The most it runs: its plan and a margin. A write past this is refused.

integer
inUse
required

How many run in production, with this write.

integer
agents
object
plan
required

The plan’s number: the license key’s, or the workspace’s own limit (TenantLimits).

integer
most
required

The most it runs: its plan and a margin. A write past this is refused.

integer
inUse
required

How many run in production, with this write.

integer
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.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Missing / malformed / expired / revoked bearer token.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
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. Or, as the promotion answers it, plan-limit-reached: this adds flows or agents to production past the most this runtime’s license key runs, so none of them is added; what runs keeps running. details has projectId (on a reinstate, when its version records one); over, each count over (flows first) with its limit (flows or agents), the number it adds (adding), and the key’s plan, most and inUse when they count this workspace alone; the first of them again at the top (details.limit, …); newIds, the flows and agents it adds; and next, where a larger plan is, when the runtime names one.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

deployment-not-found: no deployment with that id in this workspace, one in a project you don’t read, or one whose project is deleted.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
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.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
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).

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}
Retry-After
integer
>= 1

Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.

Server error (unmapped domain code or framework crash).

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

The authorization store couldn’t be reached (authz-backend-unavailable), or the database was too busy for the authorization check (database-busy), so the request wasn’t run; Retry-After (whole seconds) says when to try again. Or tenant-state-unavailable (with Retry-After), on a runtime serving many workspaces: the workspace’s state couldn’t be read, so nothing was changed.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}
Retry-After
integer
>= 1

Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.

See also