sms.template.set
curl --request POST \
--url https://platform.trylath.com/sms/template/set \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"text": "<string>",
"locale": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', text: '<string>', locale: '<string>'})
};
fetch('https://platform.trylath.com/sms/template/set', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://platform.trylath.com/sms/template/set"
payload = {
"name": "<string>",
"text": "<string>",
"locale": "<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/sms/template/set"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"text\": \"<string>\",\n \"locale\": \"<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>",
"segments": 0,
"encoding": "<string>",
"units": 0,
"reserved": true
}
}sms.template.set
Saves a new draft version of a named SMS template: one body 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. Reports the segment count the body will cost, since that is what a message is billed by and it is decided by the wording — and a translation is very often the one that crosses into a second segment. Nothing is sent from a draft until sms.template.publish.
POST
/
sms
/
template
/
set
sms.template.set
curl --request POST \
--url https://platform.trylath.com/sms/template/set \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"text": "<string>",
"locale": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', text: '<string>', locale: '<string>'})
};
fetch('https://platform.trylath.com/sms/template/set', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://platform.trylath.com/sms/template/set"
payload = {
"name": "<string>",
"text": "<string>",
"locale": "<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/sms/template/set"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"text\": \"<string>\",\n \"locale\": \"<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>",
"segments": 0,
"encoding": "<string>",
"units": 0,
"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. The reserved name auth.signin.sms overrides the built-in sign-in text.
Required string length:
1 - 120Pattern:
^[a-z][a-z0-9_-]*(\.[a-z][a-z0-9_-]*)*$The message body; may reference {{variables}}
Required string length:
1 - 1600Language variant, e.g. 'fr' or 'pt-BR'. Omit for the default variant used when nothing more specific fits the recipient.
Maximum string length:
20Last modified on September 13, 2026
Was this page helpful?

