---
title: "Generate an image from a template (Image Automation API)"
method: POST
path: "/api/graphic/automation/v2"
tags: ["Image Automation"]
---

# Generate an image from a template (Image Automation API)

`POST /api/graphic/automation/v2`

Generate images such as social media visuals, banners and more from a saved Document template. You can change text, colors, images and other properties in one request.

## Request body

- AutomationRequest — JSON payload for the Image Automation API.
  - `document_uid` string — UID of the Document to use as template.
  - `template_name` string — Name of the Document to use as template.
  - `api_key` string, required — Your API key (same value as Authorization header).
  - `format` 'image' | 'json' | 'base64' | 'pdf' | 'html' — Expected output format.
  - `image_type` 'jpeg' | 'png' — Output image type.
  - `custom_field` string — Optional field returned in JSON response when format=json or html.
  - `modifications` AutomationModification[]
    - `element_name` string, required
    - `image_url` string, uri
    - `type` string — text | shape | icon | image
    - `color` string
    - `text` string
    - `background-color` string
    - `border-color` string
    - `border-size` string
    - `font-family` string
    - `font-size` string
    - `text-align` string
    - `width` string
    - `height` string
    - `visible` string — true | false
    - `shape` string

## Response `200`

Image generated successfully. Response format depends on the 'format' parameter.

- AutomationJsonResponse
  - `status` string
  - `created_at` string
  - `image_url` string, uri
  - `uid` string
  - `custom_field` string

## Other responses

- `400` — Bad request or invalid JSON payload
- `401` — Invalid or missing API key

---

[API](https://skmtc.dev/pixelixe/apis/pixelixe-api.md) · [All operations](https://skmtc.dev/pixelixe/apis/pixelixe-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pixelixe/pixelixe-api/revisions/294cd781ad49/schema)
