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

# Create image

> Create image from template

## Request

#### Template

<ParamField body="templateId" type="string" required>
  Unique template identifier (for example `tpl_xxxxxxxxx`).
</ParamField>

#### Options

<ParamField body="modifications" type="Modification[]" required>
  Layer overrides that Bannerify applies before rendering. Each modification must reference the layer `name` defined in the editor. See the [modification reference](/docs/api-reference/modification) for supported properties (text, images, tables, charts, etc.).
</ParamField>

<ParamField body="format" type="'png' | 'jpeg' | 'webp'">
  Output format. Defaults to `png`.
</ParamField>

<ParamField body="nocache" type="boolean">
  Set to `true` when you need a fresh render that bypasses the CDN cache.
</ParamField>

<RequestExample>
  ```ts theme={null}
  import { writeFile } from "node:fs/promises"

  const { result, error } = await bannerify.createImage("tpl_catalog", {
    modifications: [
      { name: "headline", text: "Launch promo" },
      { name: "price", text: "$29" },
    ],
    format: "png",
  })

  if (error) {
    console.error(error.message)
    return
  }

  await writeFile("launch-promo.png", Buffer.from(result))
  ```
</RequestExample>

## Response

<ResponseExample>
  ```ts theme={null}
  type CreateImageResult =
    | { result: ArrayBuffer; error?: never }
    | { result?: never; error: { code: string; message: string; docs: string; requestId: string } }
  ```
</ResponseExample>

Use `generateImageSignedUrl` or `createStoredImage` when you prefer a ready-to-share URL instead of handling binary data directly.
