Create a template
Saves a Handlebars template. Use its id as template_id on a notification subscription, as wrapper_template_id on another template, or with POST /notifications. Secret and trusted tokens may call it; a limited token may not (403).
AuthorizationBearer <token>A secret, trusted or limited token. See Authentication.
application/json- body
The fields you can set on a template. On create, body is required. On update, send only the fields to change.
body*stringThe Handlebars source, at most 128 kB (UTF-8).
default_subject?|The subject a notification subscription uses when it sets none. It is saved but not returned when you read the template.
wrapper_template_id?|The id of a template to place this one inside. It must be in your account, and templates may not wrap or embed each other in a loop (400).
expand?|Comma-separated child objects of the data to expand.
show?|Comma-separated fields of the data to keep.
hide?|Comma-separated fields of the data to leave out.
comments?|Your own notes.
length <= 256template_type?|email (the default) or pdf. A PDF template cannot be changed back (400).
"email""pdf"nullpdf_type?|For a PDF template, what it renders, such as invoice or order.
page_format?|For a PDF template, the page size, such as A4 or Letter.
orientation?|For a PDF template, portrait or landscape.
margin_top?|For a PDF template, the top margin.
margin_bottom?|For a PDF template, the bottom margin.
margin_left?|For a PDF template, the left margin.
margin_right?|For a PDF template, the right margin.
The new template.
application/json- response
A Handlebars template that builds the body of an email (or a PDF). Use one on a notification subscription, wrap it in another with wrapper_template, or render it yourself with the build endpoint.
object?"template"Always template.
"template"url?stringThe URL of this template in the API.
uritemplate_id?stringThe template id.
date_created?stringWhen the template was created.
date-timedate_modified?stringWhen the template last changed.
date-timetest?booleantrue for a test mode template.
account_id?stringThe account it belongs to.
expand?|Comma-separated child objects of the data to expand before the template is filled.
show?|Comma-separated fields of the data to keep.
hide?|Comma-separated fields of the data to leave out.
wrapper_template?||The template this one is placed inside (a shared header and footer, for example): its URL, the full object with expand=wrapper_template, or null.
comments?|Your own notes, at most 256 characters.
template_type?|email (or null, the same) or pdf. A PDF template cannot be changed back.
"email""pdf"nullpdf_type?|For a PDF template, what it renders, such as invoice or order.
page_format?|For a PDF template, the page size, such as A4 or Letter.
orientation?|For a PDF template, portrait or landscape.
margin_top?|For a PDF template, the top margin.
margin_bottom?|For a PDF template, the bottom margin.
margin_left?|For a PDF template, the left margin.
margin_right?|For a PDF template, the right margin.
body?|The Handlebars source, at most 128 kB. In a list this holds a short note instead; get the template by id to read the body.
formatted?Dates as display text. Only returned with formatted=true.
curl -X POST 'https://api.comecero.com/api/v1/templates' \ -H 'Content-Type: application/json' \ -d '{ "body": "<p>Thanks for your order, {{customer.first_name}}.</p>"}'{ "object": "template", "url": "https://api.comecero.com/api/v1/templates/1102500900112TEm5Jc3Rw", "template_id": "1102500900112TEm5Jc3Rw", "date_created": "2026-10-01T09:05:00Z", "date_modified": "2026-10-01T09:05:00Z", "test": true, "account_id": "AB1234", "expand": null, "show": null, "hide": null, "wrapper_template": null, "comments": "Download email", "template_type": null, "pdf_type": null, "page_format": null, "orientation": null, "margin_top": null, "margin_bottom": null, "margin_left": null, "margin_right": null, "body": "<p>Hi {{customer.first_name}}, your download is ready: {{download_url}}</p>"}List templates GET
Lists the templates in your account, email and PDF. In the list, `body` is left out; get one template to read it. The list is offset-based. Secret and trusted tokens may call it; a limited token may not (`403`).
Get a template GET
Gets one template with its `body`. Secret and trusted tokens may call it; a limited token may not (`403`).