Image APIs
API reference › Templates

The fields a template asks for: its placeholders and each layer's main property

GET/v1/templates/{id}/fields

GET/v1/templates/{id}/fields

The fields a template asks for: its placeholders and each layer's main property

A form for the template, for no-code tools and your own UI. variable fields are the template's {{placeholders}} (send them in variables); modification fields are each layer's main property that no placeholder fills: a text layer's text, an image's src, a QR code's data, a chart's values, a bar or rating's value, a rectangle's fill (send them in modifications). type says what a value is (text, image_url, color, number, numbers) and default is what the template has now.

PARAMETERS
idpath · stringREQUIRED
The template id
e.g. tpl_4nq8vzk2hdyw7bxme3rc
In the full reference
REQUEST
curl "https://api.imageapis.com/v1/templates/tpl_4nq8vzk2hdyw7bxme3rc/fields" \
  -H "X-API-Key: YOUR_KEY"
RESPONSE
200OK
{
  "template": {
    "id": "tpl_4nq8vzk2hdyw7bxme3rc",
    "name": "Blog post card",
    "engine": "layers",
    "width": 1200,
    "height": 630,
    "animated": false
  },
  "fields": [
    {
      "key": "title",
      "kind": "variable",
      "label": "Title",
      "type": "text"
    },
    {
      "key": "site.text",
      "kind": "modification",
      "label": "Site (text)",
      "type": "text",
      "layer": "site",
      "property": "text",
      "default": "apidirectory.com"
    },
    {
      "key": "accent.fill",
      "kind": "modification",
      "label": "Accent (colour)",
      "type": "color",
      "layer": "accent",
      "property": "fill",
      "default": "#6366f1",
      "help": "A CSS colour: #ff5733, rgb(…) or a name."
    }
  ],
  "example": {
    "template": "tpl_4nq8vzk2hdyw7bxme3rc",
    "variables": {
      "title": "Title"
    }
  }
}
401Missing or invalid API key (from the gateway)
404No such template or record on this account
{
  "error": "string",
  "message": "string",
  "param": "string"
}
Try it — sign in first
Runs on a sandbox key: 200 requests a month. Your real key is for production.