{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/jamframe-com/json-schema/jamframe-com-render-request-schema.json",
  "title": "RenderRequest",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/jamframe-com-openapi.yml#/components/schemas/RenderRequest",
  "type": "object",
  "required": [
    "templateId"
  ],
  "properties": {
    "templateId": {
      "type": "string",
      "maxLength": 64,
      "description": "Id of a design in the API key's workspace or of a template-library\ntemplate. A library template can also be named by its slug\n(`tool-quote-card-paper`).\n"
    },
    "modifications": {
      "type": "object",
      "description": "Values to fill in, keyed by modification key: `key`,\n`pageN@key`, `key.property` or `pageN@key.property` (see\n\"Modification keys\" in the introduction). Keys are at most 200\ncharacters.\n",
      "propertyNames": {
        "minLength": 1,
        "maxLength": 200
      },
      "additionalProperties": {
        "$ref": "#/$defs/ModificationValue"
      }
    },
    "response": {
      "$ref": "#/$defs/RenderOptions"
    },
    "async": {
      "type": "boolean",
      "default": false,
      "description": "Run as a render job and answer `202` with its `jobId` at once\n(see `GET /render-jobs/{id}`). MP4 renders are always jobs; this\nmakes the request return without waiting.\n"
    },
    "webhookUrl": {
      "type": "string",
      "format": "uri",
      "maxLength": 2048,
      "description": "Render jobs only (`\"async\": true` or an MP4): JamFrame POSTs\n`{ \"event\": \"render.completed\" | \"render.failed\", \"job\": … }`\nhere when the job ends (see the `renderJobCallback` webhook).\nMust be `https://` in production and must not point to a\nprivate or loopback address. Sending it with a synchronous\nimage or PDF render is a `400`.\n"
    },
    "expiresIn": {
      "type": "integer",
      "minimum": 1,
      "maximum": 604800,
      "default": 300,
      "description": "How long the file links in the answer work, in seconds: 5\nminutes by default, at most 7 days (`expiresAt` says until\nwhen). A render job keeps it: each `GET /render-jobs/{id}`, and\neach webhook, carries fresh links that work this long. Files are\ndeleted 8 days after the render. For a permanent image link, use\na Dynamic URL. Not with `response.type: \"base64\"`.\n"
    },
    "translate": {
      "type": "boolean",
      "default": false,
      "description": "Translate every text layer's final text (after `modifications`\nand AI layers) into `lang` with AI, in one call per render.\n`{{placeholders}}`, links, e-mail addresses, @handles, #hashtags\nand numbers are kept as they are. Cached per text and language:\na repeat costs no AI credits. Needs `lang`.\n"
    },
    "lang": {
      "type": "string",
      "minLength": 2,
      "maxLength": 35,
      "description": "The language to translate into with `translate`, a BCP 47 tag such as `es`, `fr`, `pt-BR` or `zh-Hant`."
    },
    "ai": {
      "type": "object",
      "additionalProperties": false,
      "description": "How the render's AI layers and translation behave.",
      "properties": {
        "onError": {
          "type": "string",
          "enum": [
            "fail",
            "fallback"
          ],
          "default": "fail",
          "description": "`fail`: an AI failure fails the render with its `AI_*` code.\n`fallback`: AI layers render their saved text and image (a\ncached result is still used) and the text stays\nuntranslated, with a warning; no AI credits are charged.\n"
        }
      }
    }
  },
  "$defs": {
    "ModificationValue": {
      "description": "A value for one modification key. Strings are used as-is (up to\n20,000 characters; `subtitles` up to 500,000, a whole SRT or WebVTT\nfile); numbers and booleans are accepted for numeric and boolean\nstyle properties; `null` clears the value. `subtitles` also takes\nan array of cues.\n",
      "oneOf": [
        {
          "type": "string",
          "maxLength": 500000
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "maxItems": 5000,
          "description": "`subtitles` only: the cues, in seconds on the video's timeline.",
          "items": {
            "$ref": "#/$defs/SubtitleCue"
          }
        }
      ]
    },
    "RenderOptions": {
      "type": "object",
      "description": "How to render and how to return the result. Every field is optional.",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "url",
            "base64"
          ],
          "default": "url",
          "description": "`url` stores each file and returns a link to it that works for\n`expiresIn` seconds. `base64` returns the file bytes inline and\nstores nothing.\n"
        },
        "format": {
          "type": "string",
          "enum": [
            "png",
            "jpeg",
            "jpg",
            "webp",
            "pdf",
            "mp4"
          ],
          "default": "png",
          "description": "Output format. `jpg` is an alias of `jpeg`. `mp4` renders a\nvideo (H.264, 30 fps, AAC audio when the template has a track,\nsubtitles burned in) as a render job.\n"
        },
        "scale": {
          "type": "integer",
          "minimum": 1,
          "maximum": 3,
          "default": 1,
          "description": "Pixel density for images (2 = twice the canvas size). Ignored for PDF and MP4 (videos are the canvas size)."
        },
        "quality": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "description": "Compression quality for `jpeg` and `webp`. Ignored for `png`, `pdf` and `mp4`."
        },
        "includePages": {
          "type": "array",
          "maxItems": 50,
          "items": {
            "type": "integer",
            "minimum": 1
          },
          "description": "Pages to render (from 1). All pages when omitted. A page the\ntemplate doesn't have is a `400 VALIDATION_ERROR`; at most 20\npages are rendered per request.\n"
        },
        "size": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64,
          "description": "Smart Resize: render every page at this size. A size saved on\nthe template (its id from `GET /designs/{id}` `sizes`, with its\nmanual adjustments), a size name (`story`, `reel`, `square`,\n`portrait`, `landscape`, `widescreen`, `thumbnail`, `pin`, or a\npreset id like `instagram-story`, `og-image`,\n`youtube-thumbnail`), `\"WIDTHxHEIGHT\"` (16–10000 px; a saved\nsize of those dimensions is used when there is one), or\n`original`. Works with every format, MP4 included.\n"
        },
        "sizes": {
          "type": "array",
          "minItems": 1,
          "maxItems": 10,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "description": "Smart Resize: render each of these sizes (same values as\n`size`) in one synchronous call; `content` is then one entry per\nsize (`SizedContent`). Not with `size`, `mp4`, `async` or\n`base64`. Credits: 1 per page per size. Two values that name the\nsame output (`story` and `1080x1920`) are a `400`, and so is a\ncall that would render more than 30 pages in all (pages ×\nsizes): ask for fewer, or send one request per size.\n"
        },
        "subtitles": {
          "type": "string",
          "enum": [
            "srt",
            "vtt"
          ],
          "description": "MP4 only: also store the video's subtitles as an `.srt` or\n`.vtt` file next to the MP4 and return its URL as\n`data.subtitles`. Free. Without subtitles the file has no cues\n(and a warning says so).\n"
        },
        "cmyk": {
          "description": "**Experimental.** PDF only (`\"format\": \"pdf\"`); off by default.\nConverts the PDF's colours to CMYK for print with an ICC\nprofile: text and shapes stay vector, greys and black text print\nwith black ink only, and the file gets the profile as its output\nintent and is labelled PDF/X-4 when it qualifies. `true` uses\n`fogra39`. Semi-transparent areas blend in CMYK, as PDF/X-4\nrequires, so overlaps can look slightly different from the\nscreen. The options and the output may still change.\n",
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "profile": {
                  "type": "string",
                  "enum": [
                    "fogra39",
                    "fogra51",
                    "fogra52",
                    "fogra47",
                    "fogra29",
                    "fogra40",
                    "fogra45",
                    "ifra26",
                    "gracol2013",
                    "gracol2013-uncoated",
                    "swop2013",
                    "japan2011",
                    "gracol2006"
                  ],
                  "default": "fogra39",
                  "description": "The printing condition. `fogra39` (offset, coated paper,\nEurope), `fogra51` / `fogra52` (PSO Coated / Uncoated v3,\nEurope), `fogra47` and `fogra29` (uncoated, Europe),\n`fogra40` and `fogra45` (magazine paper), `ifra26`\n(newspapers), `gracol2013`, `gracol2013-uncoated` and\n`gracol2006` (sheet-fed, USA), `swop2013` (publication,\nUSA), `japan2011` (Japan Color 2011 Coated). Ask your\nprint shop which one to use.\n"
                }
              }
            }
          ]
        },
        "compress": {
          "description": "**Experimental.** PDF only (`\"format\": \"pdf\"`); off by default.\nMakes the PDF smaller, like Ghostscript's PDF settings: images\ndrawn at more than the preset's resolution are downsampled\n(measured where each image is drawn), photos may be stored as\nJPEG, and the file structure is compressed. Text and shapes are\nnot changed. `true` uses the `ebook` preset. With `cmyk`, the CMYK\nfile is compressed. The options and the output may still change.\n",
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "preset": {
                  "type": "string",
                  "enum": [
                    "ebook",
                    "screen",
                    "printer",
                    "prepress"
                  ],
                  "default": "ebook",
                  "description": "`screen`: 72 dpi, JPEG quality 60 (smallest). `ebook`:\n150 dpi, quality 75 (sharing and email). `printer`: 300\ndpi, quality 90. `prepress`: 300 dpi, quality 95 (print\nshops).\n"
                },
                "dpi": {
                  "type": "integer",
                  "minimum": 36,
                  "maximum": 1200,
                  "description": "Image resolution in pixels per inch, instead of the\npreset's. An image is downsampled only when it is above\n1.5 times this.\n"
                }
              }
            }
          ]
        }
      }
    },
    "SubtitleCue": {
      "type": "object",
      "required": [
        "start",
        "end",
        "text"
      ],
      "properties": {
        "start": {
          "type": "number",
          "minimum": 0,
          "description": "Seconds on the video's timeline when the cue appears."
        },
        "end": {
          "type": "number",
          "description": "Seconds when it goes (after `start`)."
        },
        "text": {
          "type": "string",
          "maxLength": 1000,
          "description": "Plain text; a newline starts a new line. Styling tags are stripped."
        }
      }
    }
  }
}