Localize an email template over the API
An email template is HTML prose with template syntax inside. Send the body to the API, run a workflow across your languages, and read the same HTML back per language, with the placeholders protected the whole way, ready to paste into your ESP.
On this page
How do I send a template in?
POST /documents with content_type: "html" and your target languages. The HTML goes in verbatim; formatting, links, and template placeholders all survive translation.
Then estimate and run exactly as in Automate Transept with the API: the estimate is free, and the run fans across every language version in one call.
# BASE="https://app.transept.ai/api/public/v1"; KEY from Settings → Developer
curl -s -X POST $BASE/documents \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"title": "Trial welcome", "content_type": "html", "source_language": "en",
"target_languages": ["de", "fr"],
"content": "<h1>Welcome, {{ first_name | default:\"friend\" }}!</h1><p>Your trial starts today.</p>"}'
# → { document_id, language_group: [ {id, target_language}, … ] }What happens to the placeholders?
{{ first_name | … }} is masked before the model sees the text and restored verbatim after; the reply is counted against the source, so a lost or garbled token is repaired rather than shipped. One deliberate exception: fallback text inside a tag (the friend in default:"friend") is what recipients without a name on file actually read, so it is translated while the tag around it is not. The full token-protection rules are in strings files.
How do I get each language back?
GET /documents/{id}/content?format=html on each language version returns the same HTML shape with translated copy, ready to paste into the ESP's language variant.
curl -s "$BASE/documents/<de-version-id>/content?format=html" \
-H "Authorization: Bearer $KEY"
# → the same HTML with German copy, Liquid intactCan the whole loop run without me?
Yes. A webhook trigger set to “the request body is the content” takes the template straight from your ESP or a Zapier/n8n step, runs the workflow on arrival, and an outgoing webhook pushes a signed event when the translations are ready, so your automation can pull the HTML back without polling. Nobody uploads anything by hand.
Do Liquid, Handlebars, or merge tags survive translation?
Yes. Template tokens are masked before the model sees the text and restored verbatim after, and every reply is checked against the source so a lost placeholder is repaired rather than shipped. The one deliberate exception is fallback text inside a tag, which recipients actually read, so it is translated while the tag around it is not.
Can my email platform push templates in without any code?
Yes. Set a workflow trigger's target to "the request body is the content" and point the platform, or a Zapier/n8n step, at the trigger URL. Each delivery becomes a document and the workflow runs on arrival. See webhook triggers.
What about templates localized through Braze or Mailchimp tags?
Templates whose localization lives in translation tags or language conditionals have their own import path that reads and fills those tags directly. See email templates from Braze and Mailchimp.
Still stuck? Ask Literess in the app, or write to [email protected].