# Templates

> How to point the API at a brand template saved in Paqshot: listing templates, their ids and using them in generation.

A template is your brand's saved image style: a scene and lighting description, a list of things to avoid, and reference images (key visuals). Instead of describing the style in `prompt` every time, you pass the template id and every image comes out in the same style.

## Template types

| Type | Id | Where it comes from |
|---|---|---|
| Your brand templates | UUID, e.g. `3f2b9c1e-…` | We prepare them with you and save them in your workspace. You only see your workspace's templates and shared ones. |
| Brand style from Reislo | `reislo:<brand slug>`, e.g. `reislo:squares` | Paqshot reads the brand's colours, style and guidance straight from Reislo on every use. No template to set up in Paqshot. |
| Infographic templates | `light-minimalistic`, `flat`, `illustrative-book`, `illustrative-editorial`, `clay`, `isometric`, `architectural-technical` | Built in, available to everyone. |

## List templates

```text
GET https://api-design.prosecaptain.com/api/templates
Authorization: Bearer YOUR_TOKEN
```

With a token it returns your workspace's templates, shared templates and the built-in infographics. Without a token, only shared templates.

```json
{
  "success": true,
  "count": 3,
  "templates": [
    { "id": "auto", "name": "Auto", "type": "auto" },
    { "id": "flat", "name": "Flat", "type": "infographic" },
    {
      "id": "3f2b9c1e-8a4d-4c2e-9b1f-5d6e7a8b9c0d",
      "name": "Autumn campaign",
      "description": "Warm light, wood, linen",
      "type": "photography",
      "previewUrl": "https://api.paqshot.com/assets/…"
    }
  ]
}
```

Pass the `id` field in the `template` parameter. `previewUrl` is a preview of the first reference image.

## Generate with a template

```json
{
  "productImage": { "data": "<base64>", "mimeType": "image/jpeg" },
  "sceneType": "product_packshot",
  "template": "3f2b9c1e-8a4d-4c2e-9b1f-5d6e7a8b9c0d",
  "prompt": "Product on a linen tablecloth",
  "aspectRatio": "4:5",
  "imageSize": "2K"
}
```

What comes from the template and what you set in the request:

| From the template | From the request |
|---|---|
| Style, lighting and scene description | Product photo |
| List of things to avoid | An extra `prompt`, added to the template description |
| Reference images, sent as a style reference | `aspectRatio`, `imageSize`, `location`, `people` |

The response has a `template` field with the name of the template used, so you can check it was applied.

## Template not found

When the template does not exist, is not published or belongs to another workspace, the API returns 400 and the image is not counted:

```json
{
  "success": false,
  "error": "Template 3f2b9c1e-… not found in Directus or not accessible for your workspace"
}
```

The values `auto`, `none`, or no `template` field at all mean generation without a template.