# Deployment

A single versioned release of a service — its image, pipeline status, and per-phase timestamps (the deploy timeline).

**Attributes** (`DeploymentDto`)

- `id` · `string` · read-only — Unique identifier of this deployment.
- `serviceId` · `string` · read-only — Identifier of the service this deployment belongs to.
- `version` · `integer` · read-only — Monotonic version number of the deployment within its service.
- `image` · `string` · optional — Resolved container image reference deployed by this release.
- `buildId` · `string` · read-only — Identifier of the build that produced this image, when built from source.
- `branch` · `string` · read-only — Git branch this release was built from, when built from a git source.
- `commit` · `string` · read-only — Resolved commit SHA this release was built from, when built from a git source.
- `archiveRef` · `string` · read-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).
- `buildStage` · `string` · read-only — Live builder stage caption while `building` (e.g. "cloning", "building") — best-effort display detail; the authoritative build state is `status` + the timestamps.
- `errors` · `object[]` · read-only — Fatal pipeline failures (populated when `status` is `failed`).
  - `message` · `string` · read-only — The real failure detail, verbatim — never fabricated.
  - `at` · `string <date-time>` · read-only — When this was recorded.
  - `stage` · `"build" | "apply"` · read-only — Which pipeline stage produced it: the image build, or applying to the platform.
- `warnings` · `object[]` · read-only — Non-fatal pipeline notes.
  - `message` · `string` · read-only — The real failure detail, verbatim — never fabricated.
  - `at` · `string <date-time>` · read-only — When this was recorded.
  - `stage` · `"build" | "apply"` · read-only — Which pipeline stage produced it: the image build, or applying to the platform.
- `createdAt` · `string <date-time>` · read-only — When the deployment was created (= entered `queued`).
- `buildStartedAt` · `string <date-time>` · read-only — When the image build started (source builds only).
- `builtAt` · `string <date-time>` · read-only — When the image finished building and was pushed (source builds only).
- `appliedAt` · `string <date-time>` · read-only — When the release was applied to the platform.
- `healthyAt` · `string <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.
- `finishedAt` · `string <date-time>` · read-only — When the deployment terminally failed or was superseded.

**Example `DeploymentDto`**

```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"
}
```
