---
title: "Dry-run a payload against a template schema"
method: POST
path: "/v1/templates/{ref}/validate"
tags: ["Templates"]
---

# Dry-run a payload against a template schema

`POST /v1/templates/{ref}/validate`

## Request

- Base URL: `https://api.galleyrender.com`
- URL: `https://api.galleyrender.com/v1/templates/{ref}/validate`
- Auth: HTTP bearer

Renders nothing and costs nothing. Returns the same field-level errors `POST /v1/render` would.

## Path parameters

- `ref` string, required

## Request body

- object
  - `data` unknown, required

## Response `200`

Whether the payload is valid, and why not.

- object
  - `object` 'validation', required
  - `template` string, required
  - `valid` boolean, required
  - `errors` FieldError[], required
    - `path` string, required: Dotted path into the submitted data.
    - `message` string, required
    - `expected` string, required: The type or constraint the field must satisfy.
    - `received` string: What arrived, described briefly.
    - `example` unknown
  - `warnings` Warning[], required: Fields the template would not use, possibly empty. The same array `POST /v1/render` returns.
    - union: Something about the request that did not stop it. Paths and schema key names only, never a value; at most 20 per response. Discriminated by `type`.
      - object
        - `type` 'unknown_field', required
        - `path` string, required: Where the field is, e.g. `data.deposit`.
        - `message` string, required
        - `did_you_mean` string: The path of the field the template does have, when one is close or a known alias.
      - object
        - `type` 'unsupported_language', required
        - `path` string, required
        - `message` string, required
        - `supported` string[], required: The languages this template has translated text for.
      - object: Language support is switched off on this service, so `data.lang` and `data.labels` were not applied: the fixed text is English, dates and money are formatted for en-US and the paper size is the template's own. Send the same request again later for the document in your language.
        - `type` 'i18n_disabled', required
        - `path` string, required: `data.lang`, or `data.labels` when only labels were sent.
        - `message` string, required
      - object: A PNG made with the Satori engine whose data holds characters outside the Latin fonts the template embeds. Satori has no fallback face, so they render as empty boxes; render with `format: "pdf"` to have them drawn with system fonts.
        - `type` 'font_coverage', required
        - `path` string, required: The first field that holds such text. The text itself is never quoted.
        - `message` string, required
  - `example` unknown

## Other responses

- `401`: `authentication_error`.
- `404`: `not_found`.

---

[API](https://skmtc.dev/galleyrender/apis/galley-render-api.md) · [All operations](https://skmtc.dev/galleyrender/apis/galley-render-api/llms.txt) · [OpenAPI document](https://skmtc.dev/galleyrender/apis/galley-render-api/revisions/a85d68468cd2?raw)
