---
title: "Get deployment build status"
method: POST
path: "/websiteSourceCode/deployment/status"
tags: ["Publishing"]
---

# Get deployment build status

`POST /websiteSourceCode/deployment/status`

## Request

- Base URL: `https://api.cactal.ai/v1`
- URL: `https://api.cactal.ai/v1/websiteSourceCode/deployment/status`
- Auth: HTTP bearer

Returns the preview revision, available page routes, publish availability, and build state for the selected head or published source version. Fails with 404 when `target=published` is requested for a never-published website.

## Request body

- object
  - `websiteId` string, required
  - `target` 'head' | 'published', required

## Response `200`

Deployment state for the resolved source version.

- object
  - `websiteId` string, required: Id of the website.
  - `sourceVersion` integer, required: Source version resolved from `target`.
  - `previewRevision` string, required: Opaque value that changes when the preview should be refreshed.
  - `hasPages` boolean, required: Whether the resolved source version contains at least one page.
  - `pages` object[], required: Statically extractable page routes in the resolved source version.
    - `pageId` string, required
    - `route` string, required
    - `draftOnly` boolean, required: Whether the page is served only on the draft preview and returns 404 on published hosts.
  - `canPublish` boolean, required: Whether this preview is ready and has not already been published.
  - `deployment` object, nullable, required: The deployment for the resolved source version, or `null` when none has been built.
    - `id` string, required: Unique id of the deployment.
    - `status` 'building' | 'ready' | 'failed', required: Build state of the deployment.
    - `failureMessage` string, nullable: Human-readable build failure summary. `null` unless `status` is `failed`.
    - `failureKind` 'transient' | 'permanent' | 'unknown', nullable: Failure category. `null` unless `status` is `failed`.

## Other responses

- `400`: Validation failed. The response `message` names the first invalid field.
- `401`: Missing, invalid, expired, or revoked API key.
- `403`: The authenticated principal lacks the required capability.
- `404`: The resource does not exist or is outside the principal’s access scope.
- `429`: Rate limit exceeded. Retry after the number of seconds in the `Retry-After` header.

---

[API](https://skmtc.dev/cactal/apis/cactal-api.md) · [All operations](https://skmtc.dev/cactal/apis/cactal-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cactal/apis/cactal-api/revisions/9cd0fb5eacdd?raw)
