curl --request POST \
--url https://platform.trylath.com/sms/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"template": "<string>",
"locale": "<string>",
"body": "<string>",
"variables": {},
"sendAfter": "2023-11-07T05:31:56Z",
"topic": "<string>",
"metadata": {}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
template: '<string>',
locale: '<string>',
body: JSON.stringify('<string>'),
variables: {},
sendAfter: '2023-11-07T05:31:56Z',
topic: '<string>',
metadata: {}
})
};
fetch('https://platform.trylath.com/sms/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://platform.trylath.com/sms/send"
payload = {
"to": "<string>",
"template": "<string>",
"locale": "<string>",
"body": "<string>",
"variables": {},
"sendAfter": "2023-11-07T05:31:56Z",
"topic": "<string>",
"metadata": {}
}
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/send"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"template\": \"<string>\",\n \"locale\": \"<string>\",\n \"body\": \"<string>\",\n \"variables\": {},\n \"sendAfter\": \"2023-11-07T05:31:56Z\",\n \"topic\": \"<string>\",\n \"metadata\": {}\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": {
"messageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"to": "<string>",
"segments": 0,
"encoding": "<string>",
"template": "<string>",
"templateVersion": 0,
"templateLocale": "<string>",
"sendAfter": "2023-11-07T05:31:56Z",
"suppressed": {
"reason": "<string>",
"detail": "<string>"
},
"blocked": {
"reason": "<string>",
"fix": "<string>"
}
}
}sms.send
Sends one SMS to one number in E.164 form, from the environment’s configured sender. The body may carry . Asks the audience policy first: a number that has replied STOP is recorded as suppressed, not sent. Billing counts segments, not messages — a body outside the GSM alphabet costs more than twice as much per character, and the reply says how many segments were counted. If the environment cannot text anyone yet (no active carrier registration, or no number to send from) the message is still stored and the reply carries blocked saying why — do not wait on a status that cannot change until that clears.
curl --request POST \
--url https://platform.trylath.com/sms/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"template": "<string>",
"locale": "<string>",
"body": "<string>",
"variables": {},
"sendAfter": "2023-11-07T05:31:56Z",
"topic": "<string>",
"metadata": {}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
template: '<string>',
locale: '<string>',
body: JSON.stringify('<string>'),
variables: {},
sendAfter: '2023-11-07T05:31:56Z',
topic: '<string>',
metadata: {}
})
};
fetch('https://platform.trylath.com/sms/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://platform.trylath.com/sms/send"
payload = {
"to": "<string>",
"template": "<string>",
"locale": "<string>",
"body": "<string>",
"variables": {},
"sendAfter": "2023-11-07T05:31:56Z",
"topic": "<string>",
"metadata": {}
}
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/send"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"template\": \"<string>\",\n \"locale\": \"<string>\",\n \"body\": \"<string>\",\n \"variables\": {},\n \"sendAfter\": \"2023-11-07T05:31:56Z\",\n \"topic\": \"<string>\",\n \"metadata\": {}\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": {
"messageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"to": "<string>",
"segments": 0,
"encoding": "<string>",
"template": "<string>",
"templateVersion": 0,
"templateLocale": "<string>",
"sendAfter": "2023-11-07T05:31:56Z",
"suppressed": {
"reason": "<string>",
"detail": "<string>"
},
"blocked": {
"reason": "<string>",
"fix": "<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.
Headers
Replays the stored response for the same key and input; refuses different input.
Body
One recipient, E.164, e.g. +14155550100
^\+[1-9]\d{6,14}$An SMS template name; provide variables with it. Use instead of body, not with it.
1 - 120Send the template's variant for this language, falling back to the broader language and then the default. Omit to use the recipient's own locale if one is recorded.
20Inline send: the message; may reference {{variables}}
1 - 1600Show child attributes
Show child attributes
Hold the message until this moment; omit to send now. Until it is sent it can be stopped with sms.message.cancel.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$A consent topic for marketing; omit for transactional, which only a suppression stops
1 - 64Up to 20 key/values echoed on every webhook about this message
Show child attributes
Show child attributes
Was this page helpful?

