curl --request POST \
--url https://platform.trylath.com/email/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "jsmith@example.com",
"template": "<string>",
"locale": "<string>",
"variables": {},
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"layout": "brand",
"from": "jsmith@example.com",
"replyTo": "jsmith@example.com",
"fromName": "<string>",
"sendAfter": "2023-11-07T05:31:56Z",
"metadata": {},
"attachments": [
{
"filename": "<string>",
"content": "aSDinaTvuI8gbWludGxpZnk=",
"contentType": "application/octet-stream"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: 'jsmith@example.com',
template: '<string>',
locale: '<string>',
variables: {},
subject: '<string>',
html: '<string>',
text: '<string>',
layout: 'brand',
from: 'jsmith@example.com',
replyTo: 'jsmith@example.com',
fromName: '<string>',
sendAfter: '2023-11-07T05:31:56Z',
metadata: {},
attachments: [
{
filename: '<string>',
content: 'aSDinaTvuI8gbWludGxpZnk=',
contentType: 'application/octet-stream'
}
]
})
};
fetch('https://platform.trylath.com/email/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://platform.trylath.com/email/send"
payload = {
"to": "jsmith@example.com",
"template": "<string>",
"locale": "<string>",
"variables": {},
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"layout": "brand",
"from": "jsmith@example.com",
"replyTo": "jsmith@example.com",
"fromName": "<string>",
"sendAfter": "2023-11-07T05:31:56Z",
"metadata": {},
"attachments": [
{
"filename": "<string>",
"content": "aSDinaTvuI8gbWludGxpZnk=",
"contentType": "application/octet-stream"
}
]
}
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/send"
payload := strings.NewReader("{\n \"to\": \"jsmith@example.com\",\n \"template\": \"<string>\",\n \"locale\": \"<string>\",\n \"variables\": {},\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"layout\": \"brand\",\n \"from\": \"jsmith@example.com\",\n \"replyTo\": \"jsmith@example.com\",\n \"fromName\": \"<string>\",\n \"sendAfter\": \"2023-11-07T05:31:56Z\",\n \"metadata\": {},\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"contentType\": \"application/octet-stream\"\n }\n ]\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",
"attachments": [
{
"filename": "<string>",
"contentType": "<string>",
"sizeBytes": 0
}
],
"to": "<string>",
"from": "<string>",
"fromName": "<string>",
"subject": "<string>",
"template": "<string>",
"templateVersion": 0,
"templateLocale": "<string>",
"sendAfter": "2023-11-07T05:31:56Z",
"suppressed": {
"reason": "<string>",
"detail": "<string>"
}
}
}email.send
Sends one transactional email to one recipient, from the project’s default sender, either from a named template with variables or from inline subject and body. Asks the audience policy first: a suppressed address is recorded as suppressed, not sent. Returns the message id and its status.
curl --request POST \
--url https://platform.trylath.com/email/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "jsmith@example.com",
"template": "<string>",
"locale": "<string>",
"variables": {},
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"layout": "brand",
"from": "jsmith@example.com",
"replyTo": "jsmith@example.com",
"fromName": "<string>",
"sendAfter": "2023-11-07T05:31:56Z",
"metadata": {},
"attachments": [
{
"filename": "<string>",
"content": "aSDinaTvuI8gbWludGxpZnk=",
"contentType": "application/octet-stream"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: 'jsmith@example.com',
template: '<string>',
locale: '<string>',
variables: {},
subject: '<string>',
html: '<string>',
text: '<string>',
layout: 'brand',
from: 'jsmith@example.com',
replyTo: 'jsmith@example.com',
fromName: '<string>',
sendAfter: '2023-11-07T05:31:56Z',
metadata: {},
attachments: [
{
filename: '<string>',
content: 'aSDinaTvuI8gbWludGxpZnk=',
contentType: 'application/octet-stream'
}
]
})
};
fetch('https://platform.trylath.com/email/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://platform.trylath.com/email/send"
payload = {
"to": "jsmith@example.com",
"template": "<string>",
"locale": "<string>",
"variables": {},
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"layout": "brand",
"from": "jsmith@example.com",
"replyTo": "jsmith@example.com",
"fromName": "<string>",
"sendAfter": "2023-11-07T05:31:56Z",
"metadata": {},
"attachments": [
{
"filename": "<string>",
"content": "aSDinaTvuI8gbWludGxpZnk=",
"contentType": "application/octet-stream"
}
]
}
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/send"
payload := strings.NewReader("{\n \"to\": \"jsmith@example.com\",\n \"template\": \"<string>\",\n \"locale\": \"<string>\",\n \"variables\": {},\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"layout\": \"brand\",\n \"from\": \"jsmith@example.com\",\n \"replyTo\": \"jsmith@example.com\",\n \"fromName\": \"<string>\",\n \"sendAfter\": \"2023-11-07T05:31:56Z\",\n \"metadata\": {},\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"contentType\": \"application/octet-stream\"\n }\n ]\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",
"attachments": [
{
"filename": "<string>",
"contentType": "<string>",
"sizeBytes": 0
}
],
"to": "<string>",
"from": "<string>",
"fromName": "<string>",
"subject": "<string>",
"template": "<string>",
"templateVersion": 0,
"templateLocale": "<string>",
"sendAfter": "2023-11-07T05:31:56Z",
"suppressed": {
"reason": "<string>",
"detail": "<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
^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$A template name; provide variables 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.
20Show child attributes
Show child attributes
Inline send: the subject (with template, overrides the template's subject)
1 - 998Inline send: the HTML body
200000Inline send: the plain-text body; derived from html when omitted
100000Inline send only: wrap the HTML in the project's themed frame
brand, none The project's default sender (omit) or any address on one of its verified domains
^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$The name shown in the inbox beside the address. Defaults to the project's name; pass an empty string to send the bare address.
120Hold the message until this moment; omit to send now. Until it is sent it can be stopped with email.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)))$Up to 20 key/values echoed on every webhook about this message
Show child attributes
Show child attributes
Files to attach. Base64 content, at most 10 MB across all of them.
10Show child attributes
Show child attributes
Was this page helpful?

