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

# Validate In-App HTML

> Check a custom HTML in-app message before you put it on a sequence step

Checks a document for a [custom HTML in-app message](https://docs.sequenzy.com/concepts/in-app-html-messages.md) without saving anything: its size against the 100 KB limit, the Braze Liquid personalization Sequenzy converts (for example `{{${email_address}}}` to `{{email}}`), the hosts it loads scripts from, whether it closes itself, and anything that would block saving. Run it on a Survicate or Braze custom HTML message before using it as an `in_app` step with `format: "html"`. Requires the `sequences:read` scope.

## Body

**html** `string` *required*

The document: HTML, CSS and JavaScript. Documents up to 400 KB are checked, so an oversized one gets a clear error instead of a rejected request.

```bash theme={null}
curl "https://api.sequenzy.com/api/v1/in-app/html/validate" \
  --request POST \
  --header "Authorization: Bearer $SEQUENZY_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{ "html": "<p>Hi {{${first_name}}}</p><button onclick=\"brazeBridge.closeMessage()\">Close</button>" }'
```

## Response

**valid** `boolean`

True when the document can be saved on an in-app step.

**bytes** `number`

Size in UTF-8 bytes after Braze Liquid is converted.

**maxBytes** `number`

The size limit, 102,400 bytes.

**conversions** `array`

Braze Liquid converted to Sequenzy merge tags: `{ from, to, count }`.

**scriptHosts** `array`

Hosts the document loads scripts from. Websites with a Content Security Policy must allow them.

**closesItself** `boolean`

True when the document calls `sequenzy.close()` or `brazeBridge.closeMessage()`, so the step can turn its close button off.

**warnings** `array`

`{ code, message }` items: `no_close`, `external_scripts`, `braze_converted` and `unsupported_bridge_method`. Warnings don't block saving.

**errors** `array`

Problems that block saving, such as an empty or oversized document or Braze Liquid with no Sequenzy equivalent.

```json 200 theme={null}
{
  "success": true,
  "valid": true,
  "bytes": 92,
  "maxBytes": 102400,
  "conversions": [
    { "from": "{{${first_name}}}", "to": "{{firstName}}", "count": 1 }
  ],
  "scriptHosts": [],
  "closesItself": true,
  "warnings": [
    {
      "code": "braze_converted",
      "message": "Converted Braze Liquid: {{${first_name}}} → {{firstName}}"
    }
  ],
  "errors": []
}
```

```json 200 Not valid theme={null}
{
  "success": true,
  "valid": false,
  "bytes": 16,
  "maxBytes": 102400,
  "conversions": [],
  "scriptHosts": [],
  "closesItself": false,
  "warnings": [
    {
      "code": "no_close",
      "message": "This HTML never calls sequenzy.close() or brazeBridge.closeMessage(). Keep the close button on so people can dismiss it."
    }
  ],
  "errors": [
    "Replace Braze Liquid that has no Sequenzy equivalent: {{${country}}}"
  ]
}
```

```json 401 theme={null}
{
  "error": "Invalid API key"
}
```

```json 403 theme={null}
{
  "error": "API key is missing required scope: sequences:read"
}
```

```json 422 theme={null}
{
  "type": "validation",
  "on": "body",
  "property": "/html",
  "message": "Expected string"
}
```


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