---
title: "Deploy"
description: "The `Deploy` entity."
section: "Reference"
group: "Types"
order: 62
---

## Definition

```ts
interface Deploy {
  id: string;
  workspaceId: string;
  entityId: string;
  sequenceNumber: number;
  buildId: string | null;
  status: "pending" | "failed" | "running" | "completed" | "cancelled";
  trigger: "manual" | "auto" | "rollback";
  sourceEventId: string | null;
  productionUrl: string | null;
  previewUrl: string | null;
  error: string | null;
  metadata: Record<string, unknown> | null;
  createdBy: string | null;
  startedAt: string | null;
  completedAt: string | null;
  createdAt: string;
}
```

## Fields

| Field            | Type                                                               | Notes                                                                                         |
| ---------------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- |
| `id`             | `string`                                                           | `readonly` `required`                                                                         |
| `workspaceId`    | `string`                                                           | `required` — Workspace that owns this deploy.                                                 |
| `entityId`       | `string`                                                           | `required` — Prefixed ID of the entity being deployed (app, function, element version, etc.). |
| `sequenceNumber` | `number`                                                           | `required` — Monotonically-increasing deploy number for the target entity.                    |
| `buildId`        | `string \| null`                                                   | `required` — Build whose artifacts this deploy is shipping, if any.                           |
| `status`         | `"pending" \| "failed" \| "running" \| "completed" \| "cancelled"` | `required` — Deploy lifecycle (queued, running, succeeded, failed, cancelled).                |
| `trigger`        | `"manual" \| "auto" \| "rollback"`                                 | `required` — What initiated the deploy (user action, automatic build completion, etc.).       |
| `sourceEventId`  | `string \| null`                                                   | `required` — ID of the event that triggered the deploy, when applicable.                      |
| `productionUrl`  | `string \| null`                                                   | `required` — Canonical production URL for this deploy, if it went live.                       |
| `previewUrl`     | `string \| null`                                                   | `required` — Immutable per-deploy preview URL, if one was generated.                          |
| `error`          | `string \| null`                                                   | `required` — Error message when the deploy failed, otherwise null.                            |
| `metadata`       | `Record<string, unknown> \| null`                                  | `required` — Free-form deploy metadata.                                                       |
| `createdBy`      | `string \| null`                                                   | `required` — User who started the deploy; null for system-triggered deploys.                  |
| `startedAt`      | `string \| null`                                                   | `required` — ISO-8601 timestamp when the deploy began executing.                              |
| `completedAt`    | `string \| null`                                                   | `required` — ISO-8601 timestamp when the deploy finished.                                     |
| `createdAt`      | `string`                                                           | `readonly` `required` — ISO-8601 timestamp of creation.                                       |
