> For the complete documentation index, see [llms.txt](https://help.pixfizz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.pixfizz.com/api-and-integrations/pixfizz-restful-api/dynamic-design-previews.md). Agents can also search and read this documentation through its [MCP server](https://help.pixfizz.com/~gitbook/mcp).

# Dynamic Design Previews

The Pixfizz platform exposes an API endpoint that makes it possible to preview pages from a design without creating a project. Only relevant when integrating Pixfizz with a 3rd-party CMS.

## Formats

The previews are available in JPG, WebP, and SVG variants. SVG previews are recommended because they offer better performance and often look more crisp at small sizes.

SVG previews reference external images and therefore cannot be used in a `src` attribute of an `<img>` element. Use an `<object>` element instead. Example:

```
<object type="image/svg+xml" data="/v1/themes/1/preview/preview.svg?width=800"></object>
```

## URL Parameters

Design preview URLs have the following form:

```
/v1/themes/<theme-id>/preview/<page-name>.<extension>?<query-params>
```

`theme-id` is the numeric ID of the design, `page-name` is the name of the page as given in the pixfizz admin, and `extension` is one of `jpg`, `webp`, or `svg`.

`query-params` allow you to request a different size of the image (default is 100px) and toggle element substitutions on the page through variant and template options.

The supported query parameters are:

* `width`
* `height`
* `variants[<variant-code>]`
* `template_options[<option-code>]`

Variants and template options of type `text` accept the input text and multiple choice variants/template options expect the code of the selected option.

## Examples

This simple example returns a 800px wide preview image:

```
https://staging.pixfizz.com/v1/themes/132496/preview/card.jpg?width=800
```

{% embed url="<https://staging.pixfizz.com/v1/themes/132496/preview/card.jpg?width=800>" %}

This example returns the same 800px wide page preview, but toggles some template options to trigger element substitutions:

```
https://staging.pixfizz.com/v1/themes/132496/preview/card.jpg?width=800&template_options[name]=Kramer&template_options[text-colour]=fog&template_options[base-colour]=espresso
```

{% embed url="<https://staging.pixfizz.com/v1/themes/132496/preview/card.jpg?template_options[base-colour]=espresso&template_options[name]=Kramer&template_options[text-colour]=fog&width=800>" %}
