Render an HTML template to an image with dynamic layer updates
Changed onRender an HTML template to an image. Upload an HTML file and specify layer updates using dot notation. Layers are targeted by HTML element ID attribute. Supports text content updates (layers.{id}.content), CSS style updates (layers.{id}.{css-property}), and image updates (src, background-image). CSS property names must use kebab-case (e.g. background-color, font-size). Example: layers.header_text.content="Hello" or layers.logo.src=(file upload).
Request
- Base URLhttps://api.jasper.ai
- URLhttps://api.jasper.ai/beta/image-template/render
- Auth
- API key in header X-API-Key
- or OAuth 2Authorization code: https://api.jasper.ai/oauth2/authorizeToken URL: https://api.jasper.ai/oauth2/token scopes: user
Request body multipart/form-data
Example request
{
"html_file": "<binary HTML file>",
"scale": 1,
"format": "png",
"width": 1200,
"height": 630,
"layers.header_text.content": "New Header",
"layers.header_text.color": "#FF0000",
"layers.logo.src": "<binary image file>",
"layers.bg.background-image": "<binary image file>"
}Response
The image was successfully rendered from HTML template.
Changes
- breaking
added the new required request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
removed the non-success response with the status
- breaking