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/v1/templates
Creates a new, empty template with the given name, size and editor.
Sample request
curl --request POST \
--url https://get.renderform.io/api/v1/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 yet
PATCH Update template metadata
https://get.renderform.io/api/v2/my-templates/:templateId
Updates the name, size 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",
"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 pixelstags(optional) - replaces the full set of tags currently assigned to the template
DELETE Delete template
https://get.renderform.io/api/v2/my-templates/:templateId
Soft-deletes a template. The template is no longer returned by List templates or usable for rendering.
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 — calling them on a canvas-editor or canvas-html template returns a
400 error.
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.