Skip to guide

An image generation API for your own designs.

Create a reusable visual template, send new text or images as JSON, and generate the next variant. Start with one PNG, then connect the same request to your application or automation.

Start with a template you can reuse.

A blog cover, a course certificate or a product banner can keep its layout while the content changes. Pikstrapi renders the template with the values you send; this guide starts with a single-slide image.

  1. Save a template in the visual editor. Name the text layer title so the request below can address it.
  2. Open the API section in your account. Select your template and copy its real ID and the endpoint shown there.
  3. Create an API key for the account that owns the template. Keep it in a server environment variable or your automation tool’s credential store.

Open the API playground in your account

Send JSON. Receive a PNG file.

Use POST with x-api-key authentication and a JSON body. Save this example as render.json, replace YOUR_TEMPLATE_ID with your template’s UUID and set PIKSTRAPI_API_KEY in your shell.

{
  "templateId": "YOUR_TEMPLATE_ID",
  "exportFormat": "png",
  "mode": "immediate",
  "layers": {
    "title": {
      "text": "A new article. The same design."
    }
  }
}
curl --fail-with-body --request POST "https://api.pikstrapi.com/api/v1/templates/generate-image" \
  --header "x-api-key: $PIKSTRAPI_API_KEY" \
  --header "Content-Type: application/json" \
  --data @render.json \
  --output render.png

The command uses POSIX shell syntax. Use curl.exe and adapt variable syntax on Windows, or use the playground’s generated example. YOUR_API_BASE_URL means the base URL including /api/v1 shown in your account; replace it if present.

A successful immediate request returns HTTP 200 and the file bytes. It does not return a JSON image URL. The command writes those bytes to render.png; inspect the HTTP error if generation fails.

Update the layers that change.

The layers object uses the saved layer names. Give each layer a unique name: if names are repeated, only the first match changes. For example, title changes text and cover replaces an image. Add these overrides to the complete request with templateId and exportFormat; replace the image placeholder with a URL the renderer can access.

{
  "layers": {
    "title": {
      "text": "Your next launch",
      "color": "#B74C17"
    },
    "cover": {
      "image_url": "YOUR_PUBLIC_IMAGE_URL"
    }
  }
}

You can also use objects: an array of { id, props } overrides using the saved object IDs. If you send both, named layers are applied after objects. Use the playground to obtain IDs and names from your actual template.

Image exports accept png, jpeg and webp. The same endpoint supports svg and pdf. For JPEG use jpeg, not jpg. Select one slide for this first test; multiple image slides produce a ZIP rather than one PNG.

Choose how the result arrives.

Immediate: the file in the response

Use mode: "immediate" when your client will wait for the file. It is also the default when you omit mode. In an automation tool, configure the response as a file rather than JSON.

Deferred: a job you can track

Set mode: "deferred" to queue generation. The endpoint returns HTTP 200 with jobId, status, progress and fileId. This example illustrates the response fields; real IDs and status come from your request.

{
  "jobId": "YOUR_JOB_ID",
  "status": "queued",
  "progress": 0,
  "fileId": null
}

GET /api/v1/render-jobs/{jobId}, with the same API key, lets you check the job. An accepted job is not a completed image. To receive completion or failure, pass a publicly reachable HTTP(S) webhookUrl and handle render.completed or render.failed.

Follow the n8n HTTP Request guide

Test the data your design will really receive.

  • Use a long title, accented characters and a different image shape. Check the exported file at its intended size.
  • If a layer does not change, check its exact name or object ID. The layer must exist in the saved template.
  • For an authentication error, check the API key and its account. For a request error, check exportFormat, mode and the JSON structure.
  • Confirm the template belongs to that account and enough credits remain. Review an uncertain timeout before retrying: submitting again can create another render.

One request. Your next workflow.

Connect a published article, a completed course or a new data row to your template. Keep the first integration small and verify its output before expanding to a batch.

Try your template in the API playground

Product guide by Pikstrapi. Request and response contract reviewed on 9 October 2026. Examples require your own template, credentials and data.