---
title: "Validate Design Code"
method: POST
path: "/blogs/design-code/validate"
tags: ["Design Code"]
---

# Validate Design Code

`POST /blogs/design-code/validate`

Validate a design code field without saving it. Handlebars template fields (custom_banner_code, custom_layout_code) are compiled against the registered helper set; syntax errors and unknown helpers are reported with line numbers. The CSS, header, and footer fields always pass. Validation is compile-level only — partials and helper calls without arguments can still fail at render time, so check the rendered blog page after saving. Requires editor permission or higher on the blog.

## Request body

- DesignCodeValidateRequest
  - `field` 'custom_banner_code' | 'custom_layout_code' | 'custom_css_code' | 'custom_header_code' | 'custom_footer_code', required — Design code field the code is intended for
  - `code` string, required — Design code to validate

## Response `200`

Validation completed. Check `data.valid` for the result.

- DesignCodeValidateResponse
  - `data` object, required — Validation result. Compile-level only — partials and helper calls without arguments can still fail at render time.
    - `valid` boolean, required — Whether the code compiled successfully
    - `errors` object[], required — Compile errors. Empty when the code is valid.
      - `line` integer, nullable — 1-based line number of the error, when known
      - `message` string, required — Error message from the Handlebars compiler

## Other responses

- `400` — Bad request
- `401` — Authentication failed
- `403` — Insufficient permissions
- `500` — 서버 내부 오류

---

[API](https://skmtc.dev/inblog/apis/inblog-api.md) · [All operations](https://skmtc.dev/inblog/apis/inblog-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/inblog/inblog-api/revisions/445daf773d30/schema)
