These endpoints allow you to create, update and delete templates directly through the API, instead of using the Template Editor.
POST Create template
https://get.renderform.io/api/v2/my-templates
Creates a new, empty template with the given name, size and editor.
Sample request
curl --request POST \
--url https://get.renderform.io/api/v2/my-templates \
--header 'X-API-KEY: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Instagram post",
"width": 1080,
"height": 1080,
"editor": "html-editor",
"tags": ["marketing", "instagram"]
}'
Request body
name(required) - name of the templatewidth(required) - width of the template in pixelsheight(required) - height of the template in pixelseditor(required) -html-editor,canvas-editororcanvas-htmltags(optional) - tags assigned to the template, created automatically if they don't exist yetoutputFormat(optional) - output format of the template:jpeg(default),png,webp,pdf,mp4orwebm. Video formats are available only for thecanvas-htmleditorrecordDuration(optional) - video templates only, length of the video timeline in milliseconds (1000-30000, default5000)fps(optional) - video templates only, frames per second:24,25or30(default30)
PATCH Update template metadata
https://get.renderform.io/api/v2/my-templates/:templateId
Updates the name, size, output format and/or tags of a template. Only the fields provided in the request body are changed.
Sample request
curl --request PATCH \
--url https://get.renderform.io/api/v2/my-templates/<TEMPLATE_ID> \
--header 'X-API-KEY: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Instagram post v2",
"outputFormat": "png",
"tags": ["marketing", "instagram"]
}'
Request body
name(optional) - new name of the templatewidth(optional) - new width of the template in pixelsheight(optional) - new height of the template in pixelsoutputFormat(optional) - new output format of the template:jpeg,png,pdftags(optional) - replaces the full set of tags currently assigned to the template
DELETE Delete template
https://get.renderform.io/api/v2/my-templates/:templateId
Sample request
curl --request DELETE \
--url https://get.renderform.io/api/v2/my-templates/<TEMPLATE_ID> \
--header 'X-API-KEY: <API_KEY>'
Get / update template content
These endpoints let you read and overwrite a template's raw content directly. Currently, they only work for
templates using the html-editor.
GET Endpoint
https://get.renderform.io/api/v2/my-templates/:templateId/html-editor
curl --request GET \
--url https://get.renderform.io/api/v2/my-templates/<TEMPLATE_ID>/html-editor \
--header 'X-API-KEY: <API_KEY>'
Sample response
{
"html": "<div class=\"center-me\">\n <h1>{{title}}</h1>\n</div>",
"css": "body {\n font-family: 'Helvetica';\n}\n",
"sampleData": {
"title": "My HTML Template",
"pills": ["Design", "Automate", "Scale"]
}
}
html- HTML markup of the templatecss- CSS styles of the templatesampleData- sample values (as a JSON object) used to preview merge fields in the editor
PUT Endpoint
https://get.renderform.io/api/v2/my-templates/:templateId/html-editor
curl --request PUT \
--url https://get.renderform.io/api/v2/my-templates/<TEMPLATE_ID>/html-editor \
--header 'X-API-KEY: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"html": "<div class=\"center-me\">\n <h1>{{title}}</h1>\n</div>",
"css": "body {\n font-family: '\''Helvetica'\'';\n}\n",
"sampleData": {
"title": "My HTML Template",
"pills": ["Design", "Automate", "Scale"]
}
}'
Request body
html(required) - HTML markup to store for the templatecss(optional) - CSS styles to store for the templatesampleData(optional) - sample values (as a JSON object) used to preview merge fields
The response has the same shape as the GET endpoint and reflects what was actually persisted.