> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kodostatus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate Design Draft

> Validate current draft or a candidate payload against draft rules

## Path Parameters

<ParamField path="id" type="string" required>
  Status page ID.
</ParamField>

## Body Parameters

Body is optional:

* No body: validates current draft/base state.
* With body: validates merged candidate payload.

Body fields match `PUT /status-pages/{id}/design/draft`.

<Info>
  Send no body to validate the current draft. Sending `{}` is invalid because at least one field is required when a body is present.
</Info>

## Response

<ResponseField name="valid" type="boolean">
  `true` when no blocking errors were found.
</ResponseField>

<ResponseField name="errors" type="array">
  Blocking issues with `code`, `path`, `message`, `severity`.
</ResponseField>

<ResponseField name="warnings" type="array">
  Non-blocking issues with `code`, `path`, `message`, `severity`.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  # Validate current draft
  curl -X POST "https://kodostatus.com/api/v1/status-pages/<page-id>/design/draft/validate" \
    -H "X-API-Key: your_api_key"

  # Validate candidate payload
  curl -X POST "https://kodostatus.com/api/v1/status-pages/<page-id>/design/draft/validate" \
    -H "X-API-Key: your_api_key" \
    -H "Content-Type: application/json" \
    -d '{ "template_mode": "custom", "template": "<main>{{services}}</main>" }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "valid": true,
    "errors": [],
    "warnings": []
  }
  ```
</ResponseExample>

## Common Errors

| Status | Code             | Meaning                                                                  |
| ------ | ---------------- | ------------------------------------------------------------------------ |
| `400`  | `INVALID_SCHEMA` | Invalid JSON or schema. Response includes `details` from Zod validation. |
| `404`  | -                | Status page not found                                                    |

<Note>
  Plan-restricted features (e.g. `template_mode: custom` on Starter) return `PLAN_RESTRICTED` errors inside the `errors` array in a 200 response, not as a 403 status code.
</Note>
