Schema6 min read•Audience: Developers
Template JSON Schema Specification
Formal schema definition for the PostBrix template document format, block tree relationships, and email settings.
Key Takeaways
- Document structure: an array of root-level Section blocks and optional EmailSettings.
- Strict validation rules enforced by the AST normalizer before MJML compilation.
- TypeScript interface specifications for full programmatic compatibility.
JSON Schema Definition#
code
json
AST Validation in CI/CD#
You can validate template AST files before submitting them to the PostBrix API:
- Validate with standard JSON schema validators (such as
ajvin Node.js orjsonschemain Python). - Confirms that required block IDs and types are present and attribute types match schema definitions.
Frequently Asked Questions
Are block IDs required to follow a specific format?
Block IDs must be unique strings within the document (e.g. "sec_1a2b", "col_3c4d", "btn_5e6f"). We recommend alphanumeric strings with prefixes.
Can I include custom metadata in the template document?
Yes. The root settings object accepts arbitrary metadata keys (like { "settings": { "tags": ["transactional", "billing"] } }).