Koo Docs
View as Markdown

Deployments

Deploy a service

POST/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/deploy
Rolesreadereditoradminowner
Parameters
namestringpathrequired

Service name within the environment.

environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Request body
imagestring

Optionally pins an exact image ref; omit to deploy the service's configured source image ref.

Returns
202 · DeploymentDto422 · ErrorEnvelopeDto
idstringread-only

Unique identifier of this deployment.

serviceIdstringread-only

Identifier of the service this deployment belongs to.

versionintegerread-only

Monotonic version number of the deployment within its service.

imagestring

Resolved container image reference deployed by this release.

buildIdstringread-only

Identifier of the build that produced this image, when built from source.

branchstringread-only

Git branch this release was built from, when built from a git source.

commitstringread-only

Resolved commit SHA this release was built from, when built from a git source.

archiveRefstringread-only

The uploaded build-context archive this release was built from (`koo up`).

status"queued" | "building" | "built" | "applied" | "failed" | "superseded"read-only

Pipeline state, a fixed linear sequence: `queued` = accepted, waiting; `building` = the image builder is running (source builds only); `built` = image built and pushed, awaiting apply; `applied` = the release is applied to the platform — the pipeline is DONE (this is not a health verdict: the service may still be starting or unhealthy — see the service status); `failed` = the build or apply failed (see `errors`); `superseded` = a newer deployment replaced this one before it applied. Image deploys skip the build phases (queued → applied).

buildStagestringread-only

Live builder stage caption while `building` (e.g. "cloning", "building") — best-effort display detail; the authoritative build state is `status` + the timestamps.

errorsobject[]read-only

Fatal pipeline failures (populated when `status` is `failed`).

warningsobject[]read-only

Non-fatal pipeline notes.

createdAtstring <date-time>read-only

When the deployment was created (= entered `queued`).

buildStartedAtstring <date-time>read-only

When the image build started (source builds only).

builtAtstring <date-time>read-only

When the image finished building and was pushed (source builds only).

appliedAtstring <date-time>read-only

When the release was applied to the platform.

healthyAtstring <date-time>read-only

When the applied release was first observed running (runtime healthy). Absent while the rollout is still in progress — and for releases that never reached healthy.

finishedAtstring <date-time>read-only

When the deployment terminally failed or was superseded.

cURL
POST /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/deploy
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/services/:name/deploy \  -X POST \  -H "Authorization: Bearer kc_your_api_token" \  -H "Content-Type: application/json" \  -d '{}'
Response
json
{  "id": "dep_01example0000000000000000x",  "serviceId": "svc_01example0000000000000000x",  "version": 3,  "image": "example",  "buildId": "bld_01example0000000000000000x",  "branch": "example",  "commit": "example",  "archiveRef": "example",  "status": "queued",  "buildStage": "example",  "errors": [    {      "message": "example",      "at": "2026-01-01T00:00:00.000Z",      "stage": "build"    }  ],  "warnings": [    {      "message": "example",      "at": "2026-01-01T00:00:00.000Z",      "stage": "build"    }  ],  "createdAt": "2026-01-01T00:00:00.000Z",  "buildStartedAt": "2026-01-01T00:00:00.000Z",  "builtAt": "2026-01-01T00:00:00.000Z",  "appliedAt": "2026-01-01T00:00:00.000Z",  "healthyAt": "2026-01-01T00:00:00.000Z",  "finishedAt": "2026-01-01T00:00:00.000Z"}

Request a presigned upload URL for a build-context archive

POST/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/uploads
Rolesreadereditoradminowner

Step 1 of `koo up`: returns a short-lived presigned PUT URL to upload a gzipped tarball of the working directory to, plus the `archiveRef` to pass to deploy-from-archive. The upload is namespaced to this service.

Parameters
namestringpathrequired

Service name within the environment.

environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Request body
sizeBytesinteger

Size of the gzipped archive in bytes (advisory; the server may cap uploads).

Returns
200 · UploadTargetDto422 · ErrorEnvelopeDto
uploadUrlstring <uri>read-only

Presigned URL to PUT the gzipped build-context tarball to.

archiveRefstringread-only

Opaque reference to the uploaded archive; pass it to deploy-from-archive.

method"PUT"read-only

HTTP method to use for the upload.

contentTypestringread-only

Exact Content-Type header the upload must send (signed into the URL).

expiresInSecondsintegerread-only

Lifetime of the presigned URL in seconds.

cURL
POST /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/uploads
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/services/:name/uploads \  -X POST \  -H "Authorization: Bearer kc_your_api_token" \  -H "Content-Type: application/json" \  -d '{}'
Response
json
{  "uploadUrl": "https://example.com",  "archiveRef": "example",  "method": "PUT",  "contentType": "example",  "expiresInSeconds": 0}

Deploy a previously-uploaded build-context archive

POST/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/deploy-from-archive
Rolesreadereditoradminowner

Step 2 of `koo up`: builds an image from the uploaded archive (`archiveRef` from the uploads endpoint) and ships it as a new deployment. The builder fetches + extracts the archive as the build context — no git clone.

Parameters
namestringpathrequired

Service name within the environment.

environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Request body
archiveRefstringrequired

The archive reference returned by POST …/uploads.

Returns
202 · DeploymentDto412 · ErrorEnvelopeDto422 · ErrorEnvelopeDto
idstringread-only

Unique identifier of this deployment.

serviceIdstringread-only

Identifier of the service this deployment belongs to.

versionintegerread-only

Monotonic version number of the deployment within its service.

imagestring

Resolved container image reference deployed by this release.

buildIdstringread-only

Identifier of the build that produced this image, when built from source.

branchstringread-only

Git branch this release was built from, when built from a git source.

commitstringread-only

Resolved commit SHA this release was built from, when built from a git source.

archiveRefstringread-only

The uploaded build-context archive this release was built from (`koo up`).

status"queued" | "building" | "built" | "applied" | "failed" | "superseded"read-only

Pipeline state, a fixed linear sequence: `queued` = accepted, waiting; `building` = the image builder is running (source builds only); `built` = image built and pushed, awaiting apply; `applied` = the release is applied to the platform — the pipeline is DONE (this is not a health verdict: the service may still be starting or unhealthy — see the service status); `failed` = the build or apply failed (see `errors`); `superseded` = a newer deployment replaced this one before it applied. Image deploys skip the build phases (queued → applied).

buildStagestringread-only

Live builder stage caption while `building` (e.g. "cloning", "building") — best-effort display detail; the authoritative build state is `status` + the timestamps.

errorsobject[]read-only

Fatal pipeline failures (populated when `status` is `failed`).

warningsobject[]read-only

Non-fatal pipeline notes.

createdAtstring <date-time>read-only

When the deployment was created (= entered `queued`).

buildStartedAtstring <date-time>read-only

When the image build started (source builds only).

builtAtstring <date-time>read-only

When the image finished building and was pushed (source builds only).

appliedAtstring <date-time>read-only

When the release was applied to the platform.

healthyAtstring <date-time>read-only

When the applied release was first observed running (runtime healthy). Absent while the rollout is still in progress — and for releases that never reached healthy.

finishedAtstring <date-time>read-only

When the deployment terminally failed or was superseded.

cURL
POST /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/deploy-from-archive
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/services/:name/deploy-from-archive \  -X POST \  -H "Authorization: Bearer kc_your_api_token" \  -H "Content-Type: application/json" \  -d '{      "archiveRef": "example"    }'
Response
json
{  "id": "dep_01example0000000000000000x",  "serviceId": "svc_01example0000000000000000x",  "version": 3,  "image": "example",  "buildId": "bld_01example0000000000000000x",  "branch": "example",  "commit": "example",  "archiveRef": "example",  "status": "queued",  "buildStage": "example",  "errors": [    {      "message": "example",      "at": "2026-01-01T00:00:00.000Z",      "stage": "build"    }  ],  "warnings": [    {      "message": "example",      "at": "2026-01-01T00:00:00.000Z",      "stage": "build"    }  ],  "createdAt": "2026-01-01T00:00:00.000Z",  "buildStartedAt": "2026-01-01T00:00:00.000Z",  "builtAt": "2026-01-01T00:00:00.000Z",  "appliedAt": "2026-01-01T00:00:00.000Z",  "healthyAt": "2026-01-01T00:00:00.000Z",  "finishedAt": "2026-01-01T00:00:00.000Z"}

Roll back a service to a prior deployment version

POST/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/rollback
Rolesreadereditoradminowner

Redeploys a prior retained version — its image and the service configuration captured with it — as a NEW deployment. History stays immutable. Bounded by your plan’s deployment history depth.

Parameters
namestringpathrequired

Service name within the environment.

environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Request body
versionintegerrequired

The prior deployment version to roll back to (must be within your plan’s history depth).

Returns
202 · DeploymentDto403 · ErrorEnvelopeDto404 · ErrorEnvelopeDto409 · ErrorEnvelopeDto422 · ErrorEnvelopeDto
idstringread-only

Unique identifier of this deployment.

serviceIdstringread-only

Identifier of the service this deployment belongs to.

versionintegerread-only

Monotonic version number of the deployment within its service.

imagestring

Resolved container image reference deployed by this release.

buildIdstringread-only

Identifier of the build that produced this image, when built from source.

branchstringread-only

Git branch this release was built from, when built from a git source.

commitstringread-only

Resolved commit SHA this release was built from, when built from a git source.

archiveRefstringread-only

The uploaded build-context archive this release was built from (`koo up`).

status"queued" | "building" | "built" | "applied" | "failed" | "superseded"read-only

Pipeline state, a fixed linear sequence: `queued` = accepted, waiting; `building` = the image builder is running (source builds only); `built` = image built and pushed, awaiting apply; `applied` = the release is applied to the platform — the pipeline is DONE (this is not a health verdict: the service may still be starting or unhealthy — see the service status); `failed` = the build or apply failed (see `errors`); `superseded` = a newer deployment replaced this one before it applied. Image deploys skip the build phases (queued → applied).

buildStagestringread-only

Live builder stage caption while `building` (e.g. "cloning", "building") — best-effort display detail; the authoritative build state is `status` + the timestamps.

errorsobject[]read-only

Fatal pipeline failures (populated when `status` is `failed`).

warningsobject[]read-only

Non-fatal pipeline notes.

createdAtstring <date-time>read-only

When the deployment was created (= entered `queued`).

buildStartedAtstring <date-time>read-only

When the image build started (source builds only).

builtAtstring <date-time>read-only

When the image finished building and was pushed (source builds only).

appliedAtstring <date-time>read-only

When the release was applied to the platform.

healthyAtstring <date-time>read-only

When the applied release was first observed running (runtime healthy). Absent while the rollout is still in progress — and for releases that never reached healthy.

finishedAtstring <date-time>read-only

When the deployment terminally failed or was superseded.

cURL
POST /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/rollback
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/services/:name/rollback \  -X POST \  -H "Authorization: Bearer kc_your_api_token" \  -H "Content-Type: application/json" \  -d '{      "version": 3    }'
Response
json
{  "id": "dep_01example0000000000000000x",  "serviceId": "svc_01example0000000000000000x",  "version": 3,  "image": "example",  "buildId": "bld_01example0000000000000000x",  "branch": "example",  "commit": "example",  "archiveRef": "example",  "status": "queued",  "buildStage": "example",  "errors": [    {      "message": "example",      "at": "2026-01-01T00:00:00.000Z",      "stage": "build"    }  ],  "warnings": [    {      "message": "example",      "at": "2026-01-01T00:00:00.000Z",      "stage": "build"    }  ],  "createdAt": "2026-01-01T00:00:00.000Z",  "buildStartedAt": "2026-01-01T00:00:00.000Z",  "builtAt": "2026-01-01T00:00:00.000Z",  "appliedAt": "2026-01-01T00:00:00.000Z",  "healthyAt": "2026-01-01T00:00:00.000Z",  "finishedAt": "2026-01-01T00:00:00.000Z"}

Build logs for one deployment (from-source deploys)

GET/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/deployments/{version}/build-logs
Rolesreadereditoradminowner

The builder output for a from-source deployment: the persisted snapshot after the build finishes, or a live tail while it runs (`live: true` — poll again). Image deploys have no build and 404. Runtime logs are a separate endpoint (`…/services/:name/logs`).

Parameters
versionnumberpathrequired

Deployment version within the service.

namestringpathrequired

Service name within the environment.

environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Returns
200 · BuildLogsResponseDto404 · ErrorEnvelopeDto
versionintegerread-only

The deployment version these logs belong to.

logsstringread-only

The build output text. Empty when the build has not produced output yet.

truncatedbooleanread-only

True when the log was tail-capped (the most recent output is kept).

livebooleanread-only

True when the text was proxied from the still-running builder (it may grow — poll again); false when it is the persisted terminal snapshot.

retrievedAtstring <date-time>read-only

When this text was read.

cURL
GET /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/deployments/{version}/build-logs
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/services/:name/deployments/:version/build-logs \  -H "Authorization: Bearer kc_your_api_token"
Response
json
{  "version": 3,  "logs": "example",  "truncated": true,  "live": true,  "retrievedAt": "2026-01-01T00:00:00.000Z"}

Deployment history, newest first

GET/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/deployments
Rolesreadereditoradminowner
Parameters
cursorstringquery

Opaque cursor (page.nextCursor).

limitnumberquery

Page size (1–100, default 20).

namestringpathrequired

Service name within the environment.

environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Returns
200 · DeploymentsPageDto
dataobject[]read-only
pageobjectread-only
cURL
GET /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/deployments
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/services/:name/deployments \  -H "Authorization: Bearer kc_your_api_token"
Response
json
{  "data": [    {      "id": "acct_01example0000000000000000x",      "serviceId": "svc_01example0000000000000000x",      "version": 3,      "image": "example",      "buildId": "bld_01example0000000000000000x",      "branch": "example",      "commit": "example",      "archiveRef": "example",      "status": "queued",      "buildStage": "example",      "errors": [        {          "message": "example",          "at": "2026-01-01T00:00:00.000Z",          "stage": "build"        }      ],      "warnings": [        {          "message": "example",          "at": "2026-01-01T00:00:00.000Z",          "stage": "build"        }      ],      "createdAt": "2026-01-01T00:00:00.000Z",      "buildStartedAt": "2026-01-01T00:00:00.000Z",      "builtAt": "2026-01-01T00:00:00.000Z",      "appliedAt": "2026-01-01T00:00:00.000Z",      "healthyAt": "2026-01-01T00:00:00.000Z",      "finishedAt": "2026-01-01T00:00:00.000Z"    }  ],  "page": {    "nextCursor": "example",    "hasMore": true  }}