---
title: "Validate the head source"
method: POST
path: "/websiteSourceCode/head/check"
tags: ["Publishing"]
---

# Validate the head source

`POST /websiteSourceCode/head/check`

## Request

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

Runs the publish-time framework quality gate without changing source: format, typecheck, lint, build, and a server-render of every page using placeholder content synthesized from the CMS schema. Failures return `ok: false` with diagnostics, and pages that compiled but threw while rendering in `renderFailures`. No lease is required and no CMS content is read, so the outcome depends only on source and schema.

## Request body

- object
  - `websiteId` string, required

## Response `200`

The quality-gate outcome for the checked head version.

- object
  - `version` integer, required: Source version that was checked.
  - `ok` boolean, required: Whether the source passed validation and compiled.
  - `message` string: Failure summary. Present only when `ok` is `false`.
  - `details` object: Framework diagnostics such as per-page errors. Present only for failures that carry details.
  - `notes` string[]: Non-blocking observations about the draft, such as a form that emails nobody. Present only when there are any.
  - `renderFailures` object[]: Pages that compiled but threw while server-rendering. Present only when rendering is what failed.
    - `pageId` string, required: Id of the page that failed.
    - `route` string, required: Route the failing page serves.
    - `message` string, required: Error thrown while server-rendering the page.

## 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)
