Update Template Modifications

Update text and image content in template layers


Update the content of text and image layers in a studio template. This endpoint allows you to modify parameterized elements directly without re-saving the entire template structure. Supports updating multiple parameters across multiple pages in a single request.

For detailed information about the template data structure, see Anatomy of a Template.

Endpoint#

https://api.orshot.com/v1/studio/templates/:templateId/update-modifications

Query Parameters#

ParameterTypeRequiredDefaultDescription
includeThumbnailsBooleanNofalseWhen true, thumbnails are regenerated for the pages that had modifications applied, and the response waits for all renders to complete. When false or absent, thumbnails regenerate asynchronously after the response.

Request Examples#

// Update text and image on a single page
await fetch("https://api.orshot.com/v1/studio/templates/12345/update-modifications", {
  method: "PATCH",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <ORSHOT_API_KEY>",
  },
  body: JSON.stringify({
    data: [
      {
        page: 1,
        modifications: {
          headline: "Flash Sale: 24 Hours Only!",
          subtitle: "Don't miss out on amazing deals",
          product_image: "https://cdn.example.com/sale-banner.png",
          price: "$49.99"
        }
      }
    ],
    embed_user_id: "your-external-user-id" // Optional
  }),
});

Rate Limits#

LimitValue
Requests per minute30
Max modifications per request50

URL Parameters#

ParameterTypeRequiredDescription
templateIdIntegerYesThe ID of the template to update

Request Body Structure#

The request body uses a data array format, where each item specifies the page number and modifications to apply:

{
  "data": [
    {
      "page": 1,
      "modifications": {
        "headline": "New Headline Text",
        "product_image": "https://cdn.example.com/new-image.png",
        "price": "$99.99"
      }
    }
  ]
}

Request Body Parameters#

ParameterTypeRequiredDescription
dataArrayYesArray of page modification objects
embed_user_idStringNoAssign or update the template's embed user. Accepts either an external user ID (resolved using your workspace's embed configuration) or an Orshot internal ID (prefixed with eui_).

Data Object Structure#

Each object in the data array should include:

FieldTypeRequiredDescription
pageIntegerYesPage number (1-indexed) to apply modifications to
modificationsObjectYesKey-value pairs of parameterId to new value

Supported Modification Types#

Text Content#

Update text element content by its parameterId:

{
  "page": 1,
  "modifications": {
    "headline": "Summer Sale 2026!",
    "subtitle": "Up to 50% off all items",
    "cta_text": "Shop Now"
  }
}

Image URLs#

Update image sources by providing a URL:

{
  "page": 1,
  "modifications": {
    "product_image": "https://cdn.example.com/product.png",
    "logo": "https://cdn.example.com/logo.svg",
    "background": "https://cdn.example.com/bg.jpg"
  }
}

Style Properties#

Update style properties using dot notation:

{
  "page": 1,
  "modifications": {
    "headline.fontSize": 48,
    "headline.color": "#ff0000",
    "cta_button.backgroundColor": "#007bff",
    "subtitle.fontFamily": "Inter"
  }
}

Response Fields#

FieldTypeDescription
successBooleanWhether the operation completed
template_idIntegerID of the updated template
appliedArrayList of successfully applied modifications
failedArrayList of failed modifications (only if any failed)
thumbnailsObjectOnly present when ?includeThumbnails=true. See Thumbnails Object Structure below

Which array a key lands in#

ArrayPresent whenMeaning
appliedalwaysThe value was written to the template
failedonly when non-emptyThe key did not land and you need to change something: unknown parameter, rejected value, ambiguous key
skippedonly when non-emptyThe key is valid for a render but has nothing to store on a template, so there is nothing to fix

failed and skipped are omitted from the response when they are empty, so a clean patch returns applied only. Check data.failed before treating a patch as fully successful.

Applied/Failed Object Structure#

FieldTypeDescription
pageIntegerPage number where the modification was applied/failed. A pageN@ key is reported against the page it addressed, not the page of the enclosing item
page_idStringStable UUID of the page where the modification was applied/failed. null if the requested page number does not exist on the template
keyStringThe parameter ID or style path
typeStringType of modification: text, image, video, shape, container, canvas, element, or style
propStringThe property that was written, for style items (fontSize, x, width, alt, …). Absent for content items
contentStringThe applied value (only for applied items)
errorStringError message (only for failed items)
reasonStringStable machine-readable code for the failure, for per-key failures (see below). Absent on item-level failures

Keys you need to act on come back in failed with a reason code:

ReasonMeaning
param_not_foundNo element on the template carries that parameter ID
param_not_parameterizableThe element exists but its parameter is switched off
invalid_content_valueValue rejected by validation (error carries the specific message)
non_string_value / invalid_value / invalid_crop_valueThe value type does not fit the parameter or property
render_only_inlineInline text parameters (headline:name) apply per render; send the whole headline value instead
bare_content_multi_pageAmbiguous key on a multi-page template; prefix it with pageN@
page_not_foundThe pageN@ prefix names a page the template does not have
unsupported_key / unsupported_type / unsupported_element_typeThe key or the element type has no stored home for that kind of value
sanitized_placeholderThe value is a log stand-in for uploaded bytes ([base64 ...]), not real content

Keys that are legitimate for a render but have no home on a stored template come back in skipped with a reason and a human-readable message. They are informational: send them to a render call instead.

ReasonMeaning
overridden_by_page_keyA pageN@ key for the same parameter was also sent and won for that page
render_only_promptAI prompt keys (photo.prompt, .promptMode, .promptReferences)
render_only_transitionTransition dynamics (.showAt, .hideAt, .enter*, .exit*)
render_only_videoVideo dynamics on a video element (.trimStart, .muted, .loop)
not_persisted_href / not_persisted_contentType.href and .contentType are read per render, never stored

Thumbnails Object Structure#

When ?includeThumbnails=true is passed, a PNG thumbnail is regenerated for only the pages that had modifications applied (not all pages). The thumbnails object in the response has this shape:

FieldTypeDescription
successBooleantrue if at least one page rendered successfully
pages[].pageInteger1-based page number
pages[].page_idStringStable UUID of the page
pages[].thumbnail_urlString|nullPublic URL of the new thumbnail PNG. null if this page failed
pages[].errorString|nullError message if this page failed. null on success

When ?includeThumbnails is not passed, thumbnails regenerate in the background for the modified pages and appear on the template shortly after the response.

Supported Style Properties#

When using dot notation for style updates, the following properties are commonly supported:

PropertyTypeDescription
fontSizeNumberFont size in pixels
fontFamilyStringFont family name
colorStringText color (hex, rgb, rgba)
backgroundColorStringBackground color
opacityNumberOpacity (0-1)
fontWeightString/NumberFont weight (normal, bold, 100-900)
textAlignStringText alignment (left, center, right)
letterSpacingNumberLetter spacing in pixels
lineHeightNumberLine height multiplier

Error Responses#

Status CodeErrorDescription
400data requiredRequest body missing data array
400data array emptyEmpty data array
400Maximum 50 total modifications per requestToo many modifications in one request
403Access ForbiddenInvalid API key or template not in workspace
404Template not foundTemplate ID doesn't exist
429Rate limit exceededToo many requests (max 30/min)

Invalid per-item input (a non-positive page, or modifications that isn't an object) does not fail the request: the item is reported in the failed array and the response still returns 200. | 500 | Internal server error | Server-side error |

Cache Invalidation#

When modifications are applied:

  1. Template render cache is automatically invalidated
  2. Dynamic URL cache for the template is cleared
  3. Subsequent render requests will use the updated content

Best Practices#

  1. Use Parameter IDs: Ensure your template has parameterId set on elements you want to update
  2. Batch Updates: Combine multiple page modifications in a single request to reduce API calls
  3. Validate URLs: Ensure image URLs are accessible and return valid images
  4. Error Handling: Always check the failed array in responses for partial failures. It is omitted when every key landed, so test data.failed before reading its length. Keys in skipped need no action
  5. Style Consistency: When updating styles, ensure values are compatible with the element type

Ready to automate?

Start rendering images, PDFs and videos from your templates in under 2 minutes. Free plan, no credit card.

Get your API key
  • Image, PDF and video generation via API
  • Visual editor with AI and smart layouts
  • Zapier, Make, MCP and 50+ integrations
  • White-label embed for your own app
  • 30 free credits — no credit card required