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

# Validate Layout

> Check a layout without saving it.

<Note>
  Artifacts are in preview. These endpoints are available only to organisations with the Visual Builder enabled; elsewhere they return `404` with an empty body.
</Note>

Runs the same checks as a create or update and stores nothing. The response is always `200`: read `valid`.

Each issue has a JSON-style `path` (for example `blocks[3].yAxisLabel`), a machine-readable `code` and a `message`. `errors` would make a write fail. `warnings` would not: `unknown_field` marks a key the server would drop, which is usually a misspelt field name.

`errors` and `warnings` each list at most 50 issues. `omitted_errors` and `omitted_warnings` count the issues found beyond that, so `0` means the list is complete.

`layout` is the normalised camelCase layout the server would store, or null when the layout could not be parsed at all.

## Body parameters

<ParamField body="layout" type="object" required>
  The BlockLayout to check, exactly as you would send it to create or update.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request POST 'https://api.wordsmith.ai/api/v1/artifacts/validate' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "layout": {
      "blocks": [
        {
          "type": "header",
          "title": "Summary",
          "subtitel": "Draft"
        }
      ]
    }
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.wordsmith.ai/api/v1/artifacts/validate", {
    method: "POST",
    headers: {
      Authorization: "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
    "layout": {
      "blocks": [
        {
          "type": "header",
          "title": "Summary",
          "subtitel": "Draft"
        }
      ]
    }
  }),
  });
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.wordsmith.ai/api/v1/artifacts/validate"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
  }
  payload = {
    "layout": {
      "blocks": [
        {
          "type": "header",
          "title": "Summary",
          "subtitel": "Draft"
        }
      ]
    }
  }

  response = requests.post(url, headers=headers, json=payload)
  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "valid": true,
    "errors": [],
    "warnings": [
      {
        "path": "blocks[0].subtitel",
        "code": "unknown_field",
        "message": "`subtitel` is not a field here, so it was ignored. Check its spelling against the schema."
      }
    ],
    "omitted_errors": 0,
    "omitted_warnings": 0,
    "layout": {
      "type": "dashboard",
      "blocks": [
        {
          "type": "header",
          "title": "Summary"
        }
      ],
      "version": "1"
    }
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.