Batch send emails
curl --request POST \
--url http://localhost:3001/api/v1/emails/batch \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"items": [
{
"idempotencyKey": "<string>",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateKey": "<string>",
"profileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"subscriptionGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to": {
"email": "jsmith@example.com",
"externalId": "<string>"
},
"cc": "<string>",
"bcc": "<string>",
"data": {},
"tracking": {
"clicks": true
}
}
],
"defaults": {
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateKey": "<string>",
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"subscriptionGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tracking": {
"clicks": true
}
}
}
'import requests
url = "http://localhost:3001/api/v1/emails/batch"
payload = {
"items": [
{
"idempotencyKey": "<string>",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateKey": "<string>",
"profileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"subscriptionGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to": {
"email": "jsmith@example.com",
"externalId": "<string>"
},
"cc": "<string>",
"bcc": "<string>",
"data": {},
"tracking": { "clicks": True }
}
],
"defaults": {
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateKey": "<string>",
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"subscriptionGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tracking": { "clicks": True }
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
idempotencyKey: '<string>',
templateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
templateKey: '<string>',
profileId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
senderProfileId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
from: '<string>',
replyTo: '<string>',
subject: '<string>',
subscriptionGroupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
to: {email: 'jsmith@example.com', externalId: '<string>'},
cc: '<string>',
bcc: '<string>',
data: {},
tracking: {clicks: true}
}
],
defaults: {
templateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
templateKey: '<string>',
senderProfileId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
from: '<string>',
replyTo: '<string>',
subject: '<string>',
subscriptionGroupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tracking: {clicks: true}
}
})
};
fetch('http://localhost:3001/api/v1/emails/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/v1/emails/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'idempotencyKey' => '<string>',
'templateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'templateKey' => '<string>',
'profileId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'senderProfileId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'from' => '<string>',
'replyTo' => '<string>',
'subject' => '<string>',
'subscriptionGroupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'to' => [
'email' => 'jsmith@example.com',
'externalId' => '<string>'
],
'cc' => '<string>',
'bcc' => '<string>',
'data' => [
],
'tracking' => [
'clicks' => true
]
]
],
'defaults' => [
'templateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'templateKey' => '<string>',
'senderProfileId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'from' => '<string>',
'replyTo' => '<string>',
'subject' => '<string>',
'subscriptionGroupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tracking' => [
'clicks' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3001/api/v1/emails/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"idempotencyKey\": \"<string>\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateKey\": \"<string>\",\n \"profileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"subscriptionGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"to\": {\n \"email\": \"jsmith@example.com\",\n \"externalId\": \"<string>\"\n },\n \"cc\": \"<string>\",\n \"bcc\": \"<string>\",\n \"data\": {},\n \"tracking\": {\n \"clicks\": true\n }\n }\n ],\n \"defaults\": {\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateKey\": \"<string>\",\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"subscriptionGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tracking\": {\n \"clicks\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("http://localhost:3001/api/v1/emails/batch")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"idempotencyKey\": \"<string>\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateKey\": \"<string>\",\n \"profileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"subscriptionGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"to\": {\n \"email\": \"jsmith@example.com\",\n \"externalId\": \"<string>\"\n },\n \"cc\": \"<string>\",\n \"bcc\": \"<string>\",\n \"data\": {},\n \"tracking\": {\n \"clicks\": true\n }\n }\n ],\n \"defaults\": {\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateKey\": \"<string>\",\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"subscriptionGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tracking\": {\n \"clicks\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/v1/emails/batch")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"idempotencyKey\": \"<string>\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateKey\": \"<string>\",\n \"profileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"subscriptionGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"to\": {\n \"email\": \"jsmith@example.com\",\n \"externalId\": \"<string>\"\n },\n \"cc\": \"<string>\",\n \"bcc\": \"<string>\",\n \"data\": {},\n \"tracking\": {\n \"clicks\": true\n }\n }\n ],\n \"defaults\": {\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateKey\": \"<string>\",\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"subscriptionGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tracking\": {\n \"clicks\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"total": 4503599627370495,
"accepted": 4503599627370495,
"rejected": 4503599627370495,
"items": [
{
"index": 4503599627370495,
"idempotencyKey": "<string>",
"status": "Accepted",
"send": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": {
"type": "template",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"frozenEmailInstanceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from": {
"email": "jsmith@example.com",
"name": "<string>"
},
"replyTo": {
"email": "jsmith@example.com",
"name": "<string>"
},
"subject": "<string>",
"subscriptionGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"profileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to": {
"email": "jsmith@example.com"
},
"cc": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"messageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"failureMessage": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
]
}{
"errorCode": "TEMPLATE_NAME_EXISTS",
"message": "Template name 'Hello' already exists in this organization.",
"details": {
"issues": [
{
"path": "name",
"code": "duplicate",
"message": "Template name already exists in this organization."
}
]
}
}{
"errorCode": "TEMPLATE_NAME_EXISTS",
"message": "Template name 'Hello' already exists in this organization.",
"details": {
"issues": [
{
"path": "name",
"code": "duplicate",
"message": "Template name already exists in this organization."
}
]
}
}{
"errorCode": "TEMPLATE_NAME_EXISTS",
"message": "Template name 'Hello' already exists in this organization.",
"details": {
"issues": [
{
"path": "name",
"code": "duplicate",
"message": "Template name already exists in this organization."
}
]
}
}{
"errorCode": "TEMPLATE_NAME_EXISTS",
"message": "Template name 'Hello' already exists in this organization.",
"details": {
"issues": [
{
"path": "name",
"code": "duplicate",
"message": "Template name already exists in this organization."
}
]
}
}Emails
Batch send emails
Create or replay many independent EmailSend records. Each item has its own recipient identity, one-send data, idempotency key, and result; this is not a Broadcast, Bulk Operation, Carrier, or NewsletterIssue.
POST
/
api
/
v1
/
emails
/
batch
Batch send emails
curl --request POST \
--url http://localhost:3001/api/v1/emails/batch \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"items": [
{
"idempotencyKey": "<string>",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateKey": "<string>",
"profileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"subscriptionGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to": {
"email": "jsmith@example.com",
"externalId": "<string>"
},
"cc": "<string>",
"bcc": "<string>",
"data": {},
"tracking": {
"clicks": true
}
}
],
"defaults": {
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateKey": "<string>",
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"subscriptionGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tracking": {
"clicks": true
}
}
}
'import requests
url = "http://localhost:3001/api/v1/emails/batch"
payload = {
"items": [
{
"idempotencyKey": "<string>",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateKey": "<string>",
"profileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"subscriptionGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to": {
"email": "jsmith@example.com",
"externalId": "<string>"
},
"cc": "<string>",
"bcc": "<string>",
"data": {},
"tracking": { "clicks": True }
}
],
"defaults": {
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateKey": "<string>",
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"subscriptionGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tracking": { "clicks": True }
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
idempotencyKey: '<string>',
templateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
templateKey: '<string>',
profileId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
senderProfileId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
from: '<string>',
replyTo: '<string>',
subject: '<string>',
subscriptionGroupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
to: {email: 'jsmith@example.com', externalId: '<string>'},
cc: '<string>',
bcc: '<string>',
data: {},
tracking: {clicks: true}
}
],
defaults: {
templateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
templateKey: '<string>',
senderProfileId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
from: '<string>',
replyTo: '<string>',
subject: '<string>',
subscriptionGroupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tracking: {clicks: true}
}
})
};
fetch('http://localhost:3001/api/v1/emails/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/v1/emails/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'idempotencyKey' => '<string>',
'templateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'templateKey' => '<string>',
'profileId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'senderProfileId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'from' => '<string>',
'replyTo' => '<string>',
'subject' => '<string>',
'subscriptionGroupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'to' => [
'email' => 'jsmith@example.com',
'externalId' => '<string>'
],
'cc' => '<string>',
'bcc' => '<string>',
'data' => [
],
'tracking' => [
'clicks' => true
]
]
],
'defaults' => [
'templateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'templateKey' => '<string>',
'senderProfileId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'from' => '<string>',
'replyTo' => '<string>',
'subject' => '<string>',
'subscriptionGroupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tracking' => [
'clicks' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3001/api/v1/emails/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"idempotencyKey\": \"<string>\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateKey\": \"<string>\",\n \"profileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"subscriptionGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"to\": {\n \"email\": \"jsmith@example.com\",\n \"externalId\": \"<string>\"\n },\n \"cc\": \"<string>\",\n \"bcc\": \"<string>\",\n \"data\": {},\n \"tracking\": {\n \"clicks\": true\n }\n }\n ],\n \"defaults\": {\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateKey\": \"<string>\",\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"subscriptionGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tracking\": {\n \"clicks\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("http://localhost:3001/api/v1/emails/batch")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"idempotencyKey\": \"<string>\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateKey\": \"<string>\",\n \"profileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"subscriptionGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"to\": {\n \"email\": \"jsmith@example.com\",\n \"externalId\": \"<string>\"\n },\n \"cc\": \"<string>\",\n \"bcc\": \"<string>\",\n \"data\": {},\n \"tracking\": {\n \"clicks\": true\n }\n }\n ],\n \"defaults\": {\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateKey\": \"<string>\",\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"subscriptionGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tracking\": {\n \"clicks\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/v1/emails/batch")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"idempotencyKey\": \"<string>\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateKey\": \"<string>\",\n \"profileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"subscriptionGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"to\": {\n \"email\": \"jsmith@example.com\",\n \"externalId\": \"<string>\"\n },\n \"cc\": \"<string>\",\n \"bcc\": \"<string>\",\n \"data\": {},\n \"tracking\": {\n \"clicks\": true\n }\n }\n ],\n \"defaults\": {\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateKey\": \"<string>\",\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"from\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"subscriptionGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tracking\": {\n \"clicks\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"total": 4503599627370495,
"accepted": 4503599627370495,
"rejected": 4503599627370495,
"items": [
{
"index": 4503599627370495,
"idempotencyKey": "<string>",
"status": "Accepted",
"send": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": {
"type": "template",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"frozenEmailInstanceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from": {
"email": "jsmith@example.com",
"name": "<string>"
},
"replyTo": {
"email": "jsmith@example.com",
"name": "<string>"
},
"subject": "<string>",
"subscriptionGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"profileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to": {
"email": "jsmith@example.com"
},
"cc": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"messageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"failureMessage": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
]
}{
"errorCode": "TEMPLATE_NAME_EXISTS",
"message": "Template name 'Hello' already exists in this organization.",
"details": {
"issues": [
{
"path": "name",
"code": "duplicate",
"message": "Template name already exists in this organization."
}
]
}
}{
"errorCode": "TEMPLATE_NAME_EXISTS",
"message": "Template name 'Hello' already exists in this organization.",
"details": {
"issues": [
{
"path": "name",
"code": "duplicate",
"message": "Template name already exists in this organization."
}
]
}
}{
"errorCode": "TEMPLATE_NAME_EXISTS",
"message": "Template name 'Hello' already exists in this organization.",
"details": {
"issues": [
{
"path": "name",
"code": "duplicate",
"message": "Template name already exists in this organization."
}
]
}
}{
"errorCode": "TEMPLATE_NAME_EXISTS",
"message": "Template name 'Hello' already exists in this organization.",
"details": {
"issues": [
{
"path": "name",
"code": "duplicate",
"message": "Template name already exists in this organization."
}
]
}
}Authorizations
Unified API key for server-side SDK and API integrations
Body
application/json
Independent email sends. Items are processed in order and each item has its own idempotency key and result.
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
Shared batch defaults applied to each item before item validation. Recipient, data, cc, and bcc fields are not allowed here.
Show child attributes
Show child attributes
Response
Default Response
Total items submitted.
Required range:
0 <= x <= 9007199254740991Items that created or replayed an EmailSend.
Required range:
0 <= x <= 9007199254740991Items rejected before creating an EmailSend.
Required range:
0 <= x <= 9007199254740991Ordered per-item results.
- EmailBatchSendAcceptedItem
- EmailBatchSendRejectedItem
Show child attributes
Show child attributes
⌘I

