Preview template data as HTML

Expand source and a JSON data object through the bounded template engine. Optional schema validation uses the saved-template rules. This does not save a template, create a render, or spend credits. The response is untrusted customer HTML for an isolated preview. Browser sessions need the current CSRF token.

post/v1/templates/preview

Request

  • Base URL: https://thirds.ai
  • URL: https://thirds.ai/v1/templates/preview
  • Auth: HTTP bearer

Request body

brand_kit_idstring nullable

Select an owned active brand kit. This uses template evaluation with a 1 MiB source limit and a 3 MiB data limit, even when data is omitted. Overrides the source thirds-brand-kit meta default. Supplies reserved brand.name, brand.palette, brand.colours.primary/secondary/accent (the kit colour that fits each role of this design, so the design keeps its own pattern of dark, pale, and bright colours), brand.colours.dark/light (a dark and a light surface in the kit's hue, each readable on the other), brand.ink.primary/secondary/accent/dark/light (#ffffff, #111111, or #000000, the text colour on each role colour, at least 4.5:1), brand.logo, brand.logos, brand.logo_ground (the plate colour on which the first logo shows well), brand.logo_tile.primary/secondary/accent/dark/light (transparent when the logo shows well on that role colour, or else the plate colour), brand.logo_aspect (the logo width divided by its height), brand.fonts entries with family and src, and brand.heading_font and brand.body_font (the family of the first and second font). data.brand is refused when a kit is selected. A kit with no colours supplies no colour roles. Only present logos and fonts are supplied. With no kit, brand is an empty value that is false in a test, so brand.colours.primary | default('#000000') gives the default. Assets are captured before enqueue. Schemas validate customer data before brand is added.

sourcestring required
dataobject required

Template values, bounded to 3,145,728 encoded JSON bytes with the template depth and collection limits.

Response

The expanded HTML. This response uses Cache-Control: private, no-store.

htmlstring required

Changes

No recorded changes to this operation across all 1 revision of this API.