sms.template.preview
curl --request POST \
--url https://platform.trylath.com/sms/template/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"locale": "<string>",
"variables": {},
"draft": false
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', locale: '<string>', variables: {}, draft: false})
};
fetch('https://platform.trylath.com/sms/template/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://platform.trylath.com/sms/template/preview"
payload = {
"name": "<string>",
"locale": "<string>",
"variables": {},
"draft": False
}
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/preview"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"locale\": \"<string>\",\n \"variables\": {},\n \"draft\": false\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>",
"resolvedLocale": "<string>",
"origin": "<string>",
"version": 0,
"text": "<string>",
"missing": [
"<string>"
],
"segments": 0,
"encoding": "<string>",
"units": 0,
"locale": "<string>"
}
}sms.template.preview
Renders an SMS template with the variables given and returns the exact body that would be sent, its encoding and its segment count, without sending anything or spending anything. Names any variable the template needs and the call did not supply.
POST
/
sms
/
template
/
preview
sms.template.preview
curl --request POST \
--url https://platform.trylath.com/sms/template/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"locale": "<string>",
"variables": {},
"draft": false
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', locale: '<string>', variables: {}, draft: false})
};
fetch('https://platform.trylath.com/sms/template/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://platform.trylath.com/sms/template/preview"
payload = {
"name": "<string>",
"locale": "<string>",
"variables": {},
"draft": False
}
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/preview"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"locale\": \"<string>\",\n \"variables\": {},\n \"draft\": false\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>",
"resolvedLocale": "<string>",
"origin": "<string>",
"version": 0,
"text": "<string>",
"missing": [
"<string>"
],
"segments": 0,
"encoding": "<string>",
"units": 0,
"locale": "<string>"
}
}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.
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_-]*)*$Preview as a recipient in this language. Falls back the same way a real send does.
Maximum string length:
20Values for the template's variables
Show child attributes
Show child attributes
Preview the unpublished draft instead of the published version
Last modified on September 13, 2026
Was this page helpful?

