templates

Validate a design against the Unlayer schema.

Validate a design JSON against the Unlayer design schema. Returns { success: true, data: { valid: true } } when the payload conforms; otherwise data is { valid: false, errors: [...] } with descriptive issues. Every checked design gets HTTP 200 — data.valid is the source of truth, not the status code. Only malformed requests (e.g. a missing design field or an unknown displayMode) fail request validation with 400 VALIDATION_ERROR.

post/v3/templates/validate

Request

  • Base URL: https://api.unlayer.com
  • URL: https://api.unlayer.com/v3/templates/validate
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Request body

designobject required

The design JSON to validate.

schema'full' | 'simple'

Which form of the schema to validate against. Defaults to "full".

displayMode'email' | 'web' | 'popup' | 'document'

Display mode for the design (email, web, document, popup). Some validation rules differ per mode. Defaults to "email" — without a default, options from every mode would apply at once, the strictest possible check, and real editor-saved designs could be reported invalid.

migrateboolean

When true (default), a full-form design with an older schemaVersion is upgraded to the current schema before validating — matching how the editor and the convert endpoints treat stored designs. Designs without a schemaVersion predate versioning and are fully migrated the same way. Set to false to check strict conformance with the current schema version. Designs with a newer schemaVersion than this API knows are validated as-if-current.

Response

Default Response

successtrue required

Changes

No recorded changes to this operation across all 2 revisions of this API.