email.template.set
curl --request POST \
--url https://platform.trylath.com/email/template/set \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"locale": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
locale: '<string>',
subject: '<string>',
html: '<string>',
text: '<string>'
})
};
fetch('https://platform.trylath.com/email/template/set', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://platform.trylath.com/email/template/set"
payload = {
"name": "<string>",
"locale": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform.trylath.com/email/template/set"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"locale\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"activityId": "<string>",
"result": {
"name": "<string>",
"draft": "<unknown>",
"reserved": true
}
}email.template.set
Saves a new draft version of a named email template: subject, HTML and text with {{variables}}, {{#if}} and {{#each}}. Give a `locale` to write that language's variant; each language has its own versions and publishes on its own. Refuses syntax errors with line numbers. Nothing is sent from a draft until email.template.publish.
POST
/
email
/
template
/
set
email.template.set
curl --request POST \
--url https://platform.trylath.com/email/template/set \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"locale": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
locale: '<string>',
subject: '<string>',
html: '<string>',
text: '<string>'
})
};
fetch('https://platform.trylath.com/email/template/set', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://platform.trylath.com/email/template/set"
payload = {
"name": "<string>",
"locale": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform.trylath.com/email/template/set"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"locale\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"activityId": "<string>",
"result": {
"name": "<string>",
"draft": "<unknown>",
"reserved": true
}
}Authorizations
A Lath API key: lath_live_sk… or lath_test_sk… on a server, lath_live_pk… or lath_test_pk… in a browser.
Headers
Replays the stored response for the same key and input; refuses different input.
Body
application/json
The template name. Reserved names (auth.signin.code, auth.signin.link) override the built-in sign-in messages.
Required string length:
1 - 120Pattern:
^[a-z][a-z0-9_-]*(\.[a-z][a-z0-9_-]*)*$Language variant, e.g. 'fr' or 'pt-BR'. Omit for the default variant used when nothing more specific fits the recipient.
Maximum string length:
20Required for a template that has never been published
Required string length:
1 - 998Maximum string length:
200000Plain-text part; derived from html when omitted
Maximum string length:
100000brand wraps the HTML in the project's themed frame (default); none sends the HTML as written
Available options:
brand, none Last modified on September 13, 2026
Was this page helpful?

