Register a signed deployment
const url = 'https://example.com/v1/deployments';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"imageRef":"example","artifactVersion":"example","indexHash":"example","signerKeyId":"example","signerPublicKey":"example","signature":"example","publishedAt":"2026-04-15T12:00:00Z","productionEntry":"promote-only","projectId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","source":{"repo":"example","path":"example","commit":"example","branch":"example","dirty":true},"replace":[{"blockId":"example","reason":"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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "imageRef": "example", "artifactVersion": "example", "indexHash": "example", "signerKeyId": "example", "signerPublicKey": "example", "signature": "example", "publishedAt": "2026-04-15T12:00:00Z", "productionEntry": "promote-only", "projectId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "source": { "repo": "example", "path": "example", "commit": "example", "branch": "example", "dirty": true }, "replace": [ { "blockId": "example", "reason": "example" } ] }'Atomic transaction: check the signing key against the workspace’s trust list (the signingKeyRegistry binding), verify the Ed25519 signature over the canonical envelope, read the image’s /app/index.json and verify it hashes to the signed indexHash and names the signed artifactVersion (ImageRegistryBinding), validate every tool / guardrail / agent / flow / data block it declares (the image’s index is what registers; the request carries none), upsert into the corresponding registries (in the body’s projectId, one project per client, else the workspace’s default project), then record the deployment. The pack’s data blocks (the index’s blocks) are published first, as POST /v1/blocks publishes a version: a version the runtime holds with the same content is kept, and the agents’ block ranges pin over the runtime’s versions and the pack’s, the newest in range. Its tools are checked the same way before anything is written: a tool version the runtime holds is kept only with the same definition (409 tool-already-registered). A runtime that does this lists deploy-publishes-pack-blocks in info["x-kindgi-capabilities"] of /v1/openapi.json. Where each tool’s secrets are read is recorded on its version (RecordedSecretScope); one set nowhere yet is read where this deployment’s secrets sync writes (POST /v1/deployments/{deploymentId}/secrets), the scope this route needs admin on. All-or-nothing rollback on any failure. Idempotency: same imageDigest re-submitted returns 200 with the existing record (no new version bump). Idempotency-Key also applies at the HTTP layer.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Responses
Section titled “Responses”Digest replay — same imageDigest already recorded; returns existing record, with no planWarning.
object
Example
{ "productionEntry": "promote-only", "endpoint": { "status": "pending", "waiting": true, "packEnvProblem": { "code": "pack-env-ambiguous" }, "keptFor": [ { "registered": true, "held": true } ] }, "contents": { "agents": [ { "reason": "pins-changed", "pinChanges": [ { "kind": "tool" } ] } ], "flows": [ { "reason": "pins-changed", "pinChanges": [ { "kind": "tool" } ] } ] }, "replaced": [ { "by": { "kind": "user" } } ]}Deployment registered.
object
Example
{ "productionEntry": "promote-only", "endpoint": { "status": "pending", "waiting": true, "packEnvProblem": { "code": "pack-env-ambiguous" }, "keptFor": [ { "registered": true, "held": true } ] }, "contents": { "agents": [ { "reason": "pins-changed", "pinChanges": [ { "kind": "tool" } ] } ], "flows": [ { "reason": "pins-changed", "pinChanges": [ { "kind": "tool" } ] } ] }, "replaced": [ { "by": { "kind": "user" } } ]}Signature invalid, image unverifiable, or deployment-validation-failed with per-primitive details[]. When image-unverifiable comes from a failed registry read, details.cause names why: image-not-found, image-file-not-found, image-registry-unreachable, image-registry-unauthorized, image-unreadable (a layer that isn’t a readable archive), or image-limit-exceeded, with the bound in details.limit (manifest, file, layer, read or unpack: the image’s own, so the same image is refused again). The workspace’s hour of image reads passes, so it answers 429. A tool that declares or sends a model provider’s key, or a secret under the reserved kindgi. prefix, is one such issue (path /secrets/<name>): a tool never gets a model provider’s key or one of Kindgi’s own secrets. An agent’s output.schema, or a flow’s loop, fanout branch or subgraph outputSchema or its output.schema, that doesn’t compile is one too (path where it sits, such as /output/schema or /nodes/<i>/branches/<k>/outputSchema), as defineAgent and the flow loader refuse it: every turn or run would. A tool whose metadata has a key under kindgi. (the runtime’s own) is a validation-failed detail at /metadata/<key>. Or reference-out-of-scope: an agent or flow names a tool, agent, flow, guardrail or data block that neither the deployment brings nor its project reaches (details.issues, at /agents/<i>/… or /flows/<i>/…); nothing is registered. Or connection-key-refused: a name the pack’s env declares is the account key of a texts connection app registration (details.secret, details.appId; the first such name, its required names before its optional ones and each list sorted by name), which only that registration names: use a key of its own, a new API key from the provider stored under its own name; nothing is registered. Or identity-provider-key-refused: a name the pack’s env declares is an identity provider’s secret (details.secret, details.identityProviderId; asked after the texts keys, in the same order), which only sign-in names: use a secret of its own, stored under its own name; nothing is registered.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Signer key not on the workspace’s trust list. Or, with projectId, no admin on that project (forbidden), or a key limited to another project (key-project-mismatch); without it, no admin on the workspace. Or 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. It counts the pack’s agents and flows in the project it deploys into. Without an authorization store, key-project-mismatch (details.keyProjectId): the API key or session is limited to a project, and this writes above it, to the workspace, an org or a team (with a store, that is permission-denied).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The body’s projectId names no project of this workspace, or a deleted one (project-not-found).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Idempotency-Key was reused with a different body, or resource-state conflict. Or, on a runtime serving many workspaces (KINDGI_TENANCY=multi), where each workspace deploys only its own images: image-not-allowed, the image is outside the workspace’s repository (details.imagePrefix, its own), or image-prefix-unset, the workspace has no repository set yet; both are checked before any registry read, and never on a runtime serving one tenant. Or tool-project-mismatch, agent-project-mismatch, flow-project-mismatch or block-project-mismatch: one of the image’s tools, agents, flows or data blocks belongs to another project (details.primitive, details.id; the message doesn’t name the project); nothing was deployed, even when it was unchanged. Or block-already-registered: the runtime holds one of the pack’s data block versions with other content, and a version never changes; or holds versions of the pack’s blocks unregistered, by hand or by the rollback of a deploy that failed after publishing them, and a deploy never reinstates one (details.primitive is block, details.id is <id>@<version>, the first such block); the message says to give it a new version, or names each unregistered one with the command that reinstates it; nothing was deployed. Or tool-already-registered: the runtime holds one of the pack’s tool versions, active or unregistered, with another definition, and a version never changes (details.primitive is tool, details.id is <id>@<version>, details.fields the fields of its definition that differ: the manifest’s top-level fields, and modulePath for where its code lives in the pack). A new image of the same tool isn’t another definition: its image and artifact version aren’t compared. The message says to give the tool a new version; nothing was deployed. Or tool-kind-mismatch: one of the image’s tools has the id of an MCP endpoint’s tool (details.endpointId; details.primitive, details.id), whose active versions are all the endpoint’s; nothing was deployed. Or project-suspended: the project the deploy goes into (the named one, or the default for a workspace-wide deploy) is suspended, and nothing deploys into it until it’s restored. Or environment-takes-promotions: the project the deploy goes into is a later environment of an environment order, which takes builds only by promotion from the one before it; deploy into the order’s first environment and promote the build from there (details.firstProjectId, when you can read that project; details.position, the project’s place from 0). Nothing is written. Or registry-read-only: this registry takes no writes (under kindgi dev, the pack’s files are the source); the message says what to do instead. Or deploy-would-put-back-older-blocks: a newer version of one of the pack’s data blocks than its files’ runs now in a project of one of its agents (a project’s own version, or a segment pin inside one), and the body’s replace doesn’t name it. details.blocks lists each (DeployCheckStop): the files’ version and the newest that runs, where, who made it run there and when, and the pull request opened for it; in a project the caller can’t read, the version only. Every project counts, whoever deploys. Nothing was deployed. A runtime that doesn’t read the agents’ pins and Latest doesn’t check. Or promote-only-build: the build is promote-only (the body’s productionEntry, or a signing key whose id starts with kindgi-promote-only: or that has the public key of one the workspace has trusted), and the project is in production, or its production can’t be read. It reaches production only by promotion: deploy it into a project before this one in its environment order, then promote it (details.signerKeyId, details.projectId). Nothing was deployed. Or env-not-served: this runtime keeps every value under the env it serves (whoami’s servedEnv, with refusesOtherEnvs), and a tool’s authorization.secretRef names another. Leave its envName out to read it under details.servedEnv. Nothing is stored. Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}rate-limit-exceeded with details.limit: "schema-compile-time", on a server with a compile budget (Kindgi Cloud): this workspace’s schemas spent details.budgetMs compiling in the last 60 seconds. Nothing was stored; Retry-After says when to send it again. Or details.limit: "tenant-unpack-hour", on a server that bounds each workspace’s image reads (Kindgi Cloud): this workspace’s image reads unpacked as much as they may in an hour. Nothing was deployed; Retry-After says when there’s room again. Or 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.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}plan-count-busy (with Retry-After): counting the flows and agents in production took too long, so none of them is added; a retry is safe. Or idempotency-store-unavailable (with Retry-After): the Idempotency-Key store couldn’t be read before the request ran, so nothing was changed. Or the authorization store couldn’t be reached (authz-backend-unavailable, with Retry-After), or the database was too busy for the authorization check (database-busy, with Retry-After), so the request wasn’t run. 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.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/deployments: List signed deployments- Plan limits
- Ship a pack from CI
- Kindgi 0.1.9
- Error code
agent-project-mismatch - Error code
authz-backend-unavailable - Error code
block-already-registered - Error code
block-project-mismatch - Error code
connection-key-refused - Error code
database-busy - Error code
deploy-would-put-back-older-blocks - Error code
env-not-served - Error code
environment-takes-promotions - Error code
flow-project-mismatch - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
identity-provider-key-refused - Error code
image-not-allowed - Error code
image-prefix-unset - Error code
image-unverifiable - Error code
key-project-mismatch - Error code
permission-denied - Error code
plan-count-busy - Error code
plan-limit-reached - Error code
project-not-found - Error code
project-suspended - Error code
promote-only-build - Error code
rate-limit-exceeded - Error code
reference-out-of-scope - Error code
registry-read-only - Error code
request-too-large - Error code
tenant-state-unavailable - Error code
tool-already-registered - Error code
tool-kind-mismatch - Error code
tool-project-mismatch - Error code
validation-failed - Every error code