Email templates
These endpoints manage your email templates from code. To send one, go to Sending emails.
An email template is a subject and an HTML body with gaps for your data. The Emails page explains them, and Variables and preview shows the Twig syntax the subject and body are written in.
The endpoints that create and change templates are for when your own system owns the wording.
Before you start
Section titled “Before you start”The overview explains sending requests and lists, and the errors page the errors every endpoint can answer. Each list below names the fields it accepts. Authentication explains how keys work.
Key permissions
Section titled “Key permissions”A key with update_email_template still can’t send, because each endpoint needs its own permission. Every permission lists them with the labels you tick when you create the key.
How the body and the design relate
Section titled “How the body and the design relate”A template holds two things, and only one of them is sent.
htmlBodyis what recipients get. Doxtly never builds it for you: whatever you store here is the message.designJsonis the block layout the visual designer reopens. Changing a block doesn’t change the email, and only the logo and tracking settings have any effect on sending.
So when you create templates from your own code, the simplest route is to send htmlBody and leave designJson out. The designer then opens the template in its source view, as HTML written by hand.
When a template is saved, its body is cleaned. Doxtly removes these rather than refusing them, so read back what you stored if a part of your HTML seems to be missing:
- The tags
script,iframe,object,embed,form,input,textarea,select,button,applet,base,svg,math,video,audio,sourceandtrack, with their content. - Event handler attributes such as
onclick,javascript:andvbscript:addresses, and the style valuesexpression(),behavior:,-moz-binding:andurl(data:...). - Link addresses other than
http,https,mailto,#,/paths or Twig, and image sources other thanhttp,https,data:image/,/paths, Twig or the template’s own pictures. Each becomes#.
Twig syntax is left alone, and it is checked on saving, in the subject and the body of every version: something left open, a tag, filter or function the template language doesn’t have, such as Twig’s date, or something else written wrongly answers 422 on contents[0].subject or contents[0].htmlBody, for example “date” cannot be used in the message body: it is not a function of the template language. Write a date with formatdate and a count with len. What saving can’t know is your data: a value missing at sending prints nothing.
Pictures
Section titled “Pictures”A picture in htmlBody written as <img src="data:image/png;base64,..."> is taken out of the body on saving and stored as a file of the template. The stored body points at it with a content id, cid:image-<key>@doxtly, and the message carries the picture as an attachment shown inline. Each picture has a key:
| Key | Picture |
|---|---|
logo |
The design’s own logo, or the organization’s logo when the design uses it. |
block-<blockId> |
The picture of an image block. |
inline-<digest> |
A picture written directly into the body. |
Pictures must be PNG, JPEG, GIF or WebP, at most 10 MB each. A template can’t be larger than 25 MB, the most an email can carry. That’s measured on the body and on the design’s pictures as base64, which is about a third larger than the picture files. Your mailbox may take less: Outlook takes at most 4 MB per message.
Your own HTML can show the organization’s logo with <img src="cid:image-logo@doxtly">, as long as the design has settings with useOrganizationLogo on. A design with no settings has no logo picture.
The template object
Section titled “The template object”GET, POST and PUT on a single template answer with this object.
| Field | Type | Meaning |
|---|---|---|
id |
string | The template’s id. |
name |
string | Its name. |
defaultLanguage |
string | ar, de, en, es, fr, hi, it, ja, pl, pt, th, tr, uk or zh: the version that goes out when nothing else decides. |
contents |
array | One version per language, the default first: language, subject, htmlBody and designJson. |
purpose |
string or null | What it is written for, when it is for an occasion. |
isSystemDefault |
boolean | Whether it is one of your default messages: always active, never deleted. |
isPurposeDefault |
boolean | Whether you chose it to go out for its occasion. |
status |
string | draft, active or archived. Only active templates can be sent. |
organizationLogo |
object or null | Your organization’s logo: fileId, filename, content (a data URI) and size. |
createdAt |
string | When it was created. |
updatedAt |
string | When it last changed. |
lastUsedAt |
string or null | When it last sent an email. |
Because pictures come inline, this object can be several megabytes for a picture-heavy template. The list doesn’t include them.
The design object
Section titled “The design object”| Field | Type | Meaning |
|---|---|---|
blocks |
array | The blocks, top to bottom. An entry of an unknown type is dropped without an error. |
settings |
object or null | Global settings, below. |
manualHtml |
boolean or null | True when the body was written by hand in the source view. |
settings field |
Type | Default | Meaning |
|---|---|---|---|
useOrganizationLogo |
boolean | true |
Show the organization’s logo rather than one of the template’s own. This one affects sending too: it decides what the logo picture is. |
logoAsset |
object or null | null |
The template’s own logo, as a picture object. When there is one, it wins over the organization’s. |
logoWidth |
integer | 150 |
Logo width in pixels. |
backgroundColor |
string | #f4f4f4 |
The colour around the message. |
contentBackgroundColor |
string | #ffffff |
The colour behind the content. |
contentWidth |
integer | 600 |
Content width in pixels. |
fontFamily |
string | Arial, Helvetica, sans-serif |
The font. |
footerText |
string | empty | Footer text. |
footerColor |
string | #999999 |
Footer colour. |
trackOpens |
boolean | true |
Whether opens are tracked. This one does affect sending. A template with no settings is tracked too. |
A settings value of the wrong type, or an empty text, is replaced by its default without an error.
Every block has a string id and a type. Fields you leave out take the defaults below. Blocks describes what each one does.
type |
Fields, with defaults |
|---|---|
header |
content (empty), level (1, 2 or 3, default 1), align (left), color (#333333) |
text |
content (empty), align (left), fontSize (14), color (#555555) |
image |
imageAsset (null), alt (empty), width (600), align (center) |
button |
text (empty), url (empty), backgroundColor (#2563eb), textColor (#ffffff), align (center), borderRadius (4) |
divider |
color (#e0e0e0), thickness (1), style (solid, dashed or dotted) |
spacer |
height (20) |
columns |
columns (a list of block lists), ratio (50-50, 33-67, 67-33 or 33-33-33) |
conditional |
condition (empty), hasElse (false), ifBlocks, elseBlocks |
loop |
collectionVariable, itemVariable (item), blocks |
align is left, center or right. Only conditions and loops are checked on saving: a conditional whose condition can’t be read, and a loop without a collectionVariable that is a variable, such as order.items, or a variable through functions, such as products | slice(0, 3), and an itemVariable of one word in letters, digits and underscores, not starting with a digit, answer 422. For everything else, stay with the values above, which are the ones the designer offers.
A picture object (logoAsset, imageAsset) has these fields:
| Field | Type | Meaning |
|---|---|---|
filename |
string | Required. |
fileId |
string | The stored file. Empty or left out for a new picture. |
content |
string or null | The picture as a data URI or plain base64. Send it for a new picture. |
size |
integer or null | Its size in bytes, in responses. |
url |
string or null | Always null for email templates. |
To keep a stored picture when you update a template, send back its fileId and filename, or the whole object as you received it. An object with neither fileId nor content removes the picture.
List email templates
Section titled “List email templates”GET/v1/email_templates
Returns one page of your templates, without their bodies and designs. Use it to find a template’s id, or to check which ones are active before you offer them in your own app.
Key permission: get_email_templates
Headers: X-Api-Key, X-Api-Secret
| Query parameter | Default | Rules |
|---|---|---|
page |
1 |
The page, from 1. |
perPage |
20 |
From 1 to 1000. -1 asks for up to 1000. |
sort |
none | Comma-separated fields, with - for descending: -updatedAt,name. You can sort by name, subject, status, createdAt, updatedAt and lastUsedAt. |
filter[field][operator] |
none | Such as filter[status][eq]=active. Operators: eq, neq, gt, gte, lt, lte, like, in, notIn, isNull, isNotNull, between. in and notIn take comma-separated values, between takes two. like is for text fields, with % as the wildcard. |
search[field] |
none | Such as search[name]=welcome. Every word must appear, ignoring case. Give several fields and a word may appear in any of them. Text fields only. |
| Response field | Type | Meaning |
|---|---|---|
items |
array | Each with id, name, subject, status, createdAt, updatedAt, lastUsedAt, purpose, isSystemDefault, isPurposeDefault and languages (the languages it is written in). |
meta.total |
integer | Templates across all pages. |
meta.page |
integer | This page. |
meta.perPage |
integer | Items per page. |
meta.totalPages |
integer | How many pages there are. |
meta.hasMore |
boolean | Whether a later page exists. |
meta.hasPrevious |
boolean | Whether an earlier page exists. |
Without sort the order isn’t meaningful, though it stays stable between pages. Sort explicitly if you show the list to anyone.
| Status | When |
|---|---|
400 |
A page, sort field, filter field, operator or value isn’t valid, for example sort=htmlBody or perPage=0. |
The errors every endpoint can answer apply here too.
Example
Section titled “Example”curl -G 'https://api.doxtly.com/v1/email_templates' \ -H "X-Api-Key: $DOXTLY_API_KEY" \ -H "X-Api-Secret: $DOXTLY_API_SECRET" \ --data-urlencode 'filter[status][eq]=active' \ --data-urlencode 'search[name]=certificate' \ --data-urlencode 'sort=-updatedAt' \ --data-urlencode 'perPage=10'Response 200:
{ "items": [ { "id": "01a1ab62-7cf2-7049-86a7-9ccda6920024", "name": "Your certificate", "subject": "Your certificate for {{ trainee.display.course }}", "status": "active", "createdAt": "2026-11-05T12:05:20+01:00", "updatedAt": "2026-11-05T14:27:08+01:00", "lastUsedAt": "2026-11-05T14:27:08+01:00", "purpose": null, "isSystemDefault": false, "isPurposeDefault": false, "languages": ["en"] }, { "id": "01a1ab6e-31d9-7376-9e0a-d38f60c8725c", "name": "Course certificate ready", "subject": "Your results for {{ course.title }}", "status": "active", "createdAt": "2026-11-05T12:18:08+01:00", "updatedAt": "2026-11-05T12:18:10+01:00", "lastUsedAt": "2026-11-05T12:18:10+01:00", "purpose": null, "isSystemDefault": false, "isPurposeDefault": false, "languages": ["en"] }, { "id": "01a1aafd-3e18-7e39-8f15-ea9e816bda75", "name": "Certificate ready", "subject": "Your certificate for {{ course.title }}", "status": "active", "createdAt": "2026-07-31T10:00:00+02:00", "updatedAt": "2026-11-05T10:43:33+01:00", "lastUsedAt": "2026-11-05T10:43:33+01:00", "purpose": null, "isSystemDefault": false, "isPurposeDefault": false, "languages": ["en"] } ], "meta": { "total": 3, "page": 1, "perPage": 10, "totalPages": 1, "hasMore": false, "hasPrevious": false }}Create an email template
Section titled “Create an email template”POST/v1/email_templates
Creates a template. New templates are drafts unless you say otherwise, and only active ones can be sent.
Key permission: create_email_template
Headers: X-Api-Key, X-Api-Secret, Content-Type: application/json
| Body field | Type | Required | Rules |
|---|---|---|---|
name |
string | Yes | Not blank, at most 128 characters. |
defaultLanguage |
string | Yes | ar, de, en, es, fr, hi, it, ja, pl, pt, th, tr, uk or zh. |
contents |
array | Yes | At least one version, with one in defaultLanguage. |
contents[].language |
string | Yes | ar, de, en, es, fr, hi, it, ja, pl, pt, th, tr, uk or zh, once each. |
contents[].subject |
string | Yes | Not blank, at most 255 characters. Twig is allowed. |
contents[].htmlBody |
string | Yes | Not blank. The HTML that is sent. See how the body is cleaned. |
contents[].designJson |
object | No | The design. Leave it out for hand-written HTML. |
purpose |
string | No | The occasion it is written for. A template for an occasion must keep what that occasion delivers. |
status |
string | No | draft, active or archived. Default draft. |
The response is 201 with the template and a Location header pointing at it.
| Status | When |
|---|---|
400 |
A picture isn’t valid base64, is over 10 MB, or isn’t PNG, JPEG, GIF or WebP. |
403 |
Your plan’s limit on email templates is reached, or your plan doesn’t include them. See Plans and limits. |
413 |
The body or the design’s pictures take more than 25 MB. |
422 |
A field fails the rules above, or a loop block is invalid. |
The errors every endpoint can answer apply here too.
Example
Section titled “Example”curl -X POST 'https://api.doxtly.com/v1/email_templates' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET" \ -H 'Content-Type: application/json' \ -d '{"name":"Course certificate","defaultLanguage":"en","contents":[{"language":"en","subject":"Your certificate for {{ course.title }}","htmlBody":"<p>Dear {{ trainee.firstName | default(\"participant\") }},</p><p>Congratulations on completing {{ course.title }}. Your certificate is attached.</p>"}],"status":"active"}'Response 201:
{ "id": "01a1cea3-182e-70a5-adf4-185defb78b1f", "name": "Course certificate", "status": "active", "defaultLanguage": "en", "contents": [ { "language": "en", "subject": "Your certificate for {{ course.title }}", "htmlBody": "<p>Dear {{ trainee.firstName | default(\"participant\") }},</p><p>Congratulations on completing {{ course.title }}. Your certificate is attached.</p>", "designJson": { "blocks": [], "settings": null, "manualHtml": null } } ], "organizationLogo": { "fileId": "01a1aafc-b792-738b-9a61-fbbafd92f7b3", "filename": "northbridge-logo.svg", "content": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0…", "size": 433 }, "createdAt": "2026-11-12T08:22:37+01:00", "updatedAt": "2026-11-12T08:22:37+01:00", "lastUsedAt": null, "purpose": null, "isSystemDefault": false, "isPurposeDefault": false}Shortened: organizationLogo.content holds the whole picture.
Get an email template
Section titled “Get an email template”GET/v1/email_templates/{id}
Returns one template with its body and design, pictures included.
Key permission: read_email_template. No query parameters.
Headers: X-Api-Key, X-Api-Secret
Path parameters: id, the email template’s identifier.
The response is 200 with the template.
| Status | When |
|---|---|
404 |
No template has this id in your organization. A malformed id answers the same. |
The errors every endpoint can answer apply here too.
Example
Section titled “Example”curl 'https://api.doxtly.com/v1/email_templates/01a1cea3-182e-70a5-adf4-185defb78b1f' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET"Response 200:
{ "id": "01a1cea3-182e-70a5-adf4-185defb78b1f", "name": "Course certificate", "status": "active", "defaultLanguage": "en", "contents": [ { "language": "en", "subject": "Your certificate for {{ course.title }}", "htmlBody": "<p>Dear {{ trainee.firstName | default(\"participant\") }},</p><p>Congratulations on completing {{ course.title }}. Your certificate is attached.</p>", "designJson": { "blocks": [], "settings": null, "manualHtml": null } } ], "organizationLogo": { "fileId": "01a1aafc-b792-738b-9a61-fbbafd92f7b3", "filename": "northbridge-logo.svg", "content": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0…", "size": 433 }, "createdAt": "2026-11-12T08:22:37+01:00", "updatedAt": "2026-11-12T08:22:37+01:00", "lastUsedAt": null, "purpose": null, "isSystemDefault": false, "isPurposeDefault": false}Shortened: organizationLogo.content holds the whole picture.
Update an email template
Section titled “Update an email template”PUT/v1/email_templates/{id}
Replaces a template. Send the whole thing, as with create: this is not a partial update.
Key permission: update_email_template
Headers: X-Api-Key, X-Api-Secret, Content-Type: application/json
Path parameters: id, the email template’s identifier.
The body has the same fields and rules as create. The response is 200 with the template.
| Status | When |
|---|---|
400 |
A picture isn’t valid base64, is over 10 MB, or isn’t PNG, JPEG, GIF or WebP. |
404 |
No template has this id in your organization. |
413 |
The body or the design’s pictures take more than 25 MB. |
422 |
A field fails the rules, or a loop block is invalid. |
The response has the same shape as create, with a newer updatedAt.
The errors every endpoint can answer apply here too.
Example
Section titled “Example”curl -X PUT 'https://api.doxtly.com/v1/email_templates/01a1cea3-182e-70a5-adf4-185defb78b1f' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET" \ -H 'Content-Type: application/json' \ -d '{"name":"Course certificate 2026","defaultLanguage":"en","contents":[{"language":"en","subject":"Your {{ course.title }} certificate","htmlBody":"<p>Dear {{ trainee.firstName }},</p><p>Your certificate is attached.</p>"}],"status":"active"}'Response 200:
{ "id": "01a1cea3-182e-70a5-adf4-185defb78b1f", "name": "Course certificate 2026", "status": "active", "defaultLanguage": "en", "contents": [ { "language": "en", "subject": "Your {{ course.title }} certificate", "htmlBody": "<p>Dear {{ trainee.firstName }},</p><p>Your certificate is attached.</p>", "designJson": { "blocks": [], "settings": null, "manualHtml": null } } ], "organizationLogo": { "fileId": "01a1aafc-b792-738b-9a61-fbbafd92f7b3", "filename": "northbridge-logo.svg", "content": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0…", "size": 433 }, "createdAt": "2026-11-12T08:22:37+01:00", "updatedAt": "2026-11-12T08:22:37+01:00", "lastUsedAt": null, "purpose": null, "isSystemDefault": false, "isPurposeDefault": false}Shortened: organizationLogo.content holds the whole picture.
Delete an email template
Section titled “Delete an email template”DELETE/v1/email_templates/{id}
Deletes a template and its pictures. The record of every email sent from it goes too, so its rows disappear from Sent emails. A workflow’s Send email step that names the template isn’t changed, and it fails with a “not found” error the next time it runs. If you only want to stop using a template and keep that history, set its status to archived instead. Nothing can be sent from an archived template either, so check your workflows in both cases.
Key permission: delete_email_template
Headers: X-Api-Key, X-Api-Secret
Path parameters: id, the email template’s identifier.
The response is 204 with no body.
| Status | When |
|---|---|
404 |
No template has this id in your organization. |
409 |
Workflows still use it (code used_by_workflows, with workflows: their id and name). Change them first. |
The errors every endpoint can answer apply here too.
Example
Section titled “Example”curl -X DELETE 'https://api.doxtly.com/v1/email_templates/01a1cea3-182e-70a5-adf4-185defb78b1f' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET"The response is 204 with no body.
Duplicate an email template
Section titled “Duplicate an email template”POST/v1/email_templates/{id}/duplicate
Makes a new template from a saved one, for a second campaign or another team’s wording. The copy has every language version of the original, with its subject, design, hand-written body and purpose, and its pictures stored again as its own files, so deleting either template leaves the other’s pictures in place. It’s a draft, never the default for its purpose, and counts towards your plan’s email template limit. It takes the name you send in title; without one, the original’s with the word for a copy at the end, in the language of the answers: “ (copy)” for Accept-Language: en, “ (kopia)” when you send none. See Duplicating a template.
Key permission: duplicate_email_template (Duplicate email template)
Headers: X-Api-Key, X-Api-Secret
Path parameters: id, the email template’s identifier.
Body: optional.
| Field | Type | Description |
|---|---|---|
title |
string | The copy’s name, up to 255 characters. Spaces around it are removed, and the name keeps its first 128 characters, the most a template’s name holds. Leave it out for the original’s name with the word for a copy after it. |
Response: 201, with the copy as the template, and its path in the Location header.
| Status | When |
|---|---|
403 |
Your plan’s limit of email templates is reached. Nothing is created. |
404 |
No template has this id in your organization. |
422 |
title is blank or longer than 255 characters. |
The errors every endpoint can answer apply here too.
Example
Section titled “Example”curl -X POST 'https://api.doxtly.com/v1/email_templates/01a1cea3-182e-70a5-adf4-185defb78b1f/duplicate' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET" \ -H 'Content-Type: application/json' \ -d '{"title": "Course certificate, advanced course"}'Response 201:
{ "id": "01a2059c-3b1e-7d44-9f0a-6c2e8b51d7a3", "name": "Course certificate, advanced course", "status": "draft", "defaultLanguage": "en", "contents": [ { "language": "en", "subject": "Your certificate for {{ course.title }}", "htmlBody": "<p>Dear {{ trainee.firstName | default(\"participant\") }},</p><p>Congratulations on completing {{ course.title }}. Your certificate is attached.</p>", "designJson": { "blocks": [], "settings": null, "manualHtml": null } } ], "organizationLogo": null, "createdAt": "2026-11-22T18:40:12+01:00", "updatedAt": "2026-11-22T18:40:12+01:00", "lastUsedAt": null, "purpose": null, "isSystemDefault": false, "isPurposeDefault": false}Export an email template
Section titled “Export an email template”GET/v1/email_templates/{id}/export
The template as it was last saved, as a portable file to import into this organization or another (Import and export). It holds the name, the default language and every language version with its subject, design and hand-written body (sourceHtml, null where the body comes from the blocks). Pictures are inside the file, with no file of your organization named. The status isn’t included. It’s the same file as the designer’s Export template without unsaved changes.
Key permission: export_email_template (Export email templates). No query parameters.
Headers: X-Api-Key, X-Api-Secret
Path parameters: id, the email template’s identifier.
The response is 200 with the portable file: format doxtly.email, version, title, requirements (always empty: an email template names nothing else of your organization) and content.
| Status | When |
|---|---|
404 |
No template has this id in your organization. |
The errors every endpoint can answer apply here too.
Example
Section titled “Example”curl 'https://api.doxtly.com/v1/email_templates/01a1cea3-182e-70a5-adf4-185defb78b1f/export' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET"Response 200:
{ "format": "doxtly.email", "version": 1, "title": "Course certificate", "requirements": [], "content": { "name": "Course certificate", "defaultLanguage": "en", "versions": [ { "language": "en", "subject": "Your certificate for {{ course.title }}", "design": { "blocks": [], "settings": null }, "sourceHtml": "<p>Dear {{ trainee.firstName | default(\"participant\") }},</p><p>Congratulations on completing {{ course.title }}. Your certificate is attached.</p>" } ] }}Read a template’s data structure
Section titled “Read a template’s data structure”GET/v1/email_templates/{id}/data_structure
Lists what a template reads from the data you send, worked out from its stored subject and body. Use it to see exactly which values your CRM has to supply. It’s the API form of the Data structure dialog.
Key permission: read_email_template. No query parameters.
Headers: X-Api-Key, X-Api-Secret
Path parameters: id, the email template’s identifier.
| Response field | Type | Meaning |
|---|---|---|
type |
string | Always email. |
variables |
array | What the template reads. |
variables[].path |
string | The variable, with dots for nesting: trainee.firstName. For a list, courses is the list and courses.title a field of each item. |
variables[].kind |
string | value (printed), list (looped over) or flag (only tested in a condition). |
variables[].required |
boolean | True when leaving it out leaves a gap in the message. The email still goes out. |
A part of the template that doesn’t compile reads as nothing here, with no error, so an empty list doesn’t prove the template works.
| Status | When |
|---|---|
404 |
No template has this id in your organization. |
The errors every endpoint can answer apply here too.
Example
Section titled “Example”curl 'https://api.doxtly.com/v1/email_templates/01a1cea3-182e-70a5-adf4-185defb78b1f/data_structure' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET"Response 200:
{ "type": "email", "variables": [ { "path": "course.title", "kind": "value", "required": true, "conditions": [], "default": null, "position": 0, "children": [] }, { "path": "trainee.firstName", "kind": "value", "required": true, "conditions": [], "default": null, "position": 1, "children": [] } ]}Get a template’s picture
Section titled “Get a template’s picture”GET/v1/email_templates/{id}/pictures/{key}
Returns one picture of a template as an image. A stored body shows pictures by content ids, which browsers can’t load, so call this when you render a body outside an email client.
Key permission: read_email_template
Headers: X-Api-Key, X-Api-Secret
| Path parameter | Rules |
|---|---|
id |
The template’s id. |
key |
The picture’s key, the part between cid:image- and @doxtly. From 1 to 128 letters, digits, dots, underscores or hyphens. |
The response is the image itself, with Content-Type set to its format, and it may be cached privately for 5 minutes.
| Status | When |
|---|---|
404 |
No template has this id, the template shows no picture under this key, or the key has characters it can’t contain. |
The errors every endpoint can answer apply here too.
Example
Section titled “Example”curl 'https://api.doxtly.com/v1/email_templates/01a1abe5-c184-7d89-a9e8-584aac78992e/pictures/inline-946a6f7f169daacc90e9' \ -H "X-Api-Key: $DOXTLY_API_KEY" \ -H "X-Api-Secret: $DOXTLY_API_SECRET" \ -o banner.pngThe response is the file itself. Its headers:
HTTP/2 200content-type: image/pngcontent-disposition: inline; filename=inline-946a6f7f169daacc90e9.pngcontent-length: 73List sent emails
Section titled “List sent emails”GET/v1/email_submissions
Returns the emails your organization sent from templates, by hand, through the API or from workflows, and what became of each. Poll it to catch emails that failed.
Key permission: get_email_submissions
Headers: X-Api-Key, X-Api-Secret
Query parameters
Section titled “Query parameters”The shared list parameters apply. Pass sort=-sentAt to get the newest first.
| Parameter | Values | What it does |
|---|---|---|
filter[status][eq] |
success, failed or queued |
Emails in that state. |
filter[since][gte] |
A time with its offset, such as 2026-11-03T00:00:00+01:00 |
Emails sent from that moment on. A date alone, or a time with no offset, answers 400. |
filter[search][eq] |
Text | Finds the text in the subject or the template’s name, ignoring letter case. |
sort |
sentAt, status, emailTemplate.name |
The order. Add a - for descending. |
Response
Section titled “Response”200 OK with items and meta. Each item carries id, emailTemplateName, subject, status, recipients, cc, sentAt, openTracking (whether opens were tracked), openedAt and prefetchedAt (when a mail service fetched the message ahead of the reader, which is not an open).
Example
Section titled “Example”curl 'https://api.doxtly.com/v1/email_submissions?filter[status][eq]=failed&sort=-sentAt&perPage=1' \ -H "X-Api-Key: $DOXTLY_API_KEY" \ -H "X-Api-Secret: $DOXTLY_API_SECRET"{ "items": [ { "id": "0195f0c8-12de-7a5b-b3c7-4e8f1a2d6b90", "emailTemplateName": "Contract to sign", "subject": "Your contract with Northbridge Advisory", "status": "failed", "recipients": ["grace.holt@example.com"], "cc": [], "sentAt": "2026-11-12T10:02:44+01:00", "openTracking": false, "openedAt": null, "prefetchedAt": null } ], "meta": { "total": 1, "page": 1, "perPage": 1, "totalPages": 1, "hasMore": false, "hasPrevious": false }}Errors
Section titled “Errors”| Status | When |
|---|---|
400 |
A filter, sort field or page can’t be used. |
401 |
The key or secret is missing or wrong, or the key is switched off or expired. |
403 |
The key wasn’t given get_email_submissions. |
Get a sent email
Section titled “Get a sent email”GET/v1/email_submissions/{id}
Returns one sent email with its body, the variables it was written with, its attachments and who opened it.
Key permission: read_email_submission
Headers: X-Api-Key, X-Api-Secret
| Path parameter | Type | Meaning |
|---|---|---|
id |
UUID | The sent email’s identifier. |
Response
Section titled “Response”200 OK with the fields of a list item, plus emailTemplateId, htmlContent (the body as sent; empty when it is no longer stored), variables, attachments (each with filename, filesize and mimetype), errorMessage (why it failed, or null), recipientOpens (each recipient’s email, openedAt, lastOpenedAt, openCount and prefetchedAt) and language (the language of the template version it was written in, or null).
Example
Section titled “Example”curl https://api.doxtly.com/v1/email_submissions/0195f0c8-12de-7a5b-b3c7-4e8f1a2d6b90 \ -H "X-Api-Key: $DOXTLY_API_KEY" \ -H "X-Api-Secret: $DOXTLY_API_SECRET"Errors
Section titled “Errors”| Status | When |
|---|---|
401 |
The key or secret is missing or wrong, or the key is switched off or expired. |
403 |
The key wasn’t given read_email_submission. |
404 |
Your organization has no sent email with this id. |
Use a template for its occasion
Section titled “Use a template for its occasion”POST/v1/email_templates/{id}/purpose_default
Key permission: update_email_template
Makes this template the one that goes out for its occasion, instead of the one chosen before; a default message takes that place back when you choose it. Takes no body and returns 200 OK with the template. A template written for no occasion answers 409, and so does one that is not active: The template that goes out by default must be active.
curl -X POST 'https://api.doxtly.com/v1/email_templates/01a1cd21-667b-7425-b303-93e6268507b5/purpose_default' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET"{ "id": "01a1cd21-667b-7425-b303-93e6268507b5", "name": "Client form invitation", "status": "active", "defaultLanguage": "pl", "contents": [ { "language": "pl", "subject": "{{ organizationName }} prosi o wypełnienie formularza: {{ formName }}", "htmlBody": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.or…", "designJson": { "blocks": [ { "type": "header", "content": "Formularz do wypełnienia", "level": 1, "align": "left", "color": "#1C1917", "id": "form_link-1" }, { "type": "text", "content": "Dzień dobry,", "align": "left", "fontSize": 16, "color": "#44403C", "id": "form_link-2" } ], "settings": { "useOrganizationLogo": true, "logoAsset": null, "logoWidth": 150, "backgroundColor": "#FFFFFF", "contentBackgroundColor": "#ffffff", "contentWidth": 600, "fontFamily": "Arial, Helvetica, sans-serif", "footerText": "Wysłane przez {{ organizationName }} za pośrednictwem Doxtly", "footerColor": "#78716C", "trackOpens": false, "accentStripe": true }, "manualHtml": false } }, { "language": "en", "subject": "{{ organizationName }} asks you to fill in a form: {{ formName }}", "htmlBody": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.or…", "designJson": { "blocks": [ { "type": "header", "content": "A form to fill in", "level": 1, "align": "left", "color": "#1C1917", "id": "form_link-1" }, { "type": "text", "content": "Hello{% if recipientName %} {{ recipientName }}{% endif %},", "align": "left", "fontSize": 16, "color": "#44403C", "id": "form_link-2" } ], "settings": { "useOrganizationLogo": true, "logoAsset": null, "logoWidth": 150, "backgroundColor": "#FFFFFF", "contentBackgroundColor": "#ffffff", "contentWidth": 600, "fontFamily": "Arial, Helvetica, sans-serif", "footerText": "Sent by {{ organizationName }} via Doxtly", "footerColor": "#78716C", "trackOpens": false, "accentStripe": true }, "manualHtml": false } } ], "organizationLogo": { "fileId": "01a1aafc-b792-738b-9a61-fbbafd92f7b3", "filename": "northbridge-logo.svg", "content": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0…", "size": 433 }, "createdAt": "2026-11-12T01:21:20+01:00", "updatedAt": "2026-11-12T08:10:38+01:00", "lastUsedAt": null, "purpose": "form_link", "isSystemDefault": false, "isPurposeDefault": true}Shortened: each list shows its first items, and htmlBody its beginning.
Restore a default message
Section titled “Restore a default message”POST/v1/email_templates/{id}/restore
Key permission: update_email_template
Puts the words of a default message back in one language. Takes {"language": "pl"}, any language the template can be written in, and returns 200 OK with the template. Any other template answers 409.
curl -X POST 'https://api.doxtly.com/v1/email_templates/01a1beb3-10c6-7259-9bb4-b067cbdae5dc/restore' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET" \ -H 'Content-Type: application/json' \ -d '{"language":"it"}'{ "id": "01a1beb3-10c6-7259-9bb4-b067cbdae5dc", "name": "Package cancelled", "status": "active", "defaultLanguage": "en", "contents": [ { "language": "en", "subject": "Signing cancelled: {{ packageTitle }}", "htmlBody": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.or…", "designJson": { "blocks": [ { "type": "header", "content": "Signing cancelled", "level": 1, "align": "left", "color": "#1C1917", "id": "package_voided-1" } ], "settings": { "useOrganizationLogo": true, "logoAsset": null, "logoWidth": 150, "backgroundColor": "#FFFFFF", "contentBackgroundColor": "#ffffff", "contentWidth": 600, "fontFamily": "Arial, Helvetica, sans-serif", "footerText": "Sent by {{ organizationName }} via Doxtly", "footerColor": "#78716C", "trackOpens": false, "accentStripe": true }, "manualHtml": false } } ], "organizationLogo": { "fileId": "01a1aafc-b792-738b-9a61-fbbafd92f7b3", "filename": "northbridge-logo.svg", "content": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0…", "size": 433 }, "createdAt": "2026-11-09T06:06:08+01:00", "updatedAt": "2026-11-12T06:21:41+01:00", "lastUsedAt": "2026-11-12T06:21:41+01:00", "purpose": "package_voided", "isSystemDefault": true, "isPurposeDefault": false}Shortened: each list shows its first items, and htmlBody its beginning.
Read the notifications
Section titled “Read the notifications”GET/v1/standard_messages
Returns the six messages Doxtly sends by itself to people outside your organization about a package, as the Notifications tab shows them: whether each goes out, and by which channel, template and language.
Key permission: get_email_templates. No query parameters.
Headers: X-Api-Key, X-Api-Secret
The response is 200 with three fields:
| Field | Type | Meaning |
|---|---|---|
messages |
array | One item per message, always all six, in the tab’s order: purpose, enabled and delivery. |
availableChannels |
array | The channels your organization can send by now: email, plus doxtly_email, sms and whatsapp when it has them. |
doxtlyMail |
object or null |
For Doxtly’s mailbox: limit and used (the plan’s messages this period) and suspended. null where the mailbox isn’t offered. |
purpose is one of signature_request, approval_request, signature_reminder, signing_completed (everyone signed), package_voided and package_declined (package refused). delivery is {channel, templateId, language}: templateId is null for the default message, and language is null for the recipient’s language. A message left at email while your organization has no mailbox of its own shows doxtly_email, because that is how it goes.
Example
Section titled “Example”curl 'https://api.doxtly.com/v1/standard_messages' \ -H "X-Api-Key: $DOXTLY_API_KEY" \ -H "X-Api-Secret: $DOXTLY_API_SECRET"Response 200, with four of the six messages left out:
{ "messages": [ { "purpose": "signature_request", "enabled": true, "delivery": { "channel": "email", "templateId": null, "language": null } }, { "purpose": "approval_request", "enabled": true, "delivery": { "channel": "email", "templateId": null, "language": null } } ], "availableChannels": ["email", "doxtly_email", "sms", "whatsapp"], "doxtlyMail": { "limit": 1000, "used": 2, "suspended": false }}Change a notification
Section titled “Change a notification”PUT/v1/standard_messages/{purpose}
Switches one of these messages on or off and sets how it goes out, as the row’s switch and its dialog on the Notifications tab do.
Key permission: update_email_template
Headers: X-Api-Key, X-Api-Secret, Content-Type: application/json
Path parameters: purpose, one of the six above.
The body replaces both settings of the message, so send both:
| Field | Type | Required | Rules |
|---|---|---|---|
enabled |
boolean | No | Whether the message goes out. true when left out. |
delivery |
object | No | channel: email, doxtly_email, sms or whatsapp. templateId: a template of yours written for this occasion, an email template for email and an SMS or WhatsApp template for those; null or left out for the default message. language: {"mode": "recipient"}, {"mode": "organization"} or {"mode": "fixed", "code": "de"}; null or left out for the recipient’s. Left out as a whole, the message goes by email with the default message in the recipient’s language. |
A message sent from Doxtly’s mailbox uses Doxtly’s own words, so a template chosen with doxtly_email has no effect. The response is 200 with the same three fields as reading the notifications.
| Status | When |
|---|---|
404 |
purpose is not one of the six messages. |
409 |
The message is switched on with a channel your organization has no integration for. |
422 |
templateId is no template of your organization’s, or one not written for this occasion. |
The errors every endpoint can answer apply here too.
Example
Section titled “Example”Send reminders by SMS in German:
curl -X PUT 'https://api.doxtly.com/v1/standard_messages/signature_reminder' \ -H "X-Api-Key: $DOXTLY_API_KEY" \ -H "X-Api-Secret: $DOXTLY_API_SECRET" \ -H 'Content-Type: application/json' \ -d '{"enabled": true, "delivery": {"channel": "sms", "language": {"mode": "fixed", "code": "de"}}}'Response 200, showing only the message that changed:
{ "messages": [ { "purpose": "signature_reminder", "enabled": true, "delivery": { "channel": "sms", "templateId": null, "language": { "mode": "fixed", "code": "de" } } } ], "availableChannels": ["email", "doxtly_email", "sms", "whatsapp"], "doxtlyMail": { "limit": 1000, "used": 2, "suspended": false }}