curl --request POST \
--url https://api.emailr.dev/v1/broadcasts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Newsletter - January 2024",
"subject": "Your monthly update",
"template_id": "123e4567-e89b-12d3-a456-426614174000",
"from_email": "[email protected]",
"from_name": "Acme Newsletter",
"reply_to": "[email protected]",
"preview_text": "Check out our latest updates...",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"topic_id": "123e4567-e89b-12d3-a456-426614174000",
"scheduled_at": "2023-11-07T05:31:56Z",
"inbox_id": "123e4567-e89b-12d3-a456-426614174000",
"inbox_ids": [
"123e4567-e89b-12d3-a456-426614174000",
"223e4567-e89b-12d3-a456-426614174001"
],
"sending_speed": "auto",
"tags": [
"newsletter",
"vip"
]
}
'import requests
url = "https://api.emailr.dev/v1/broadcasts"
payload = {
"name": "Newsletter - January 2024",
"subject": "Your monthly update",
"template_id": "123e4567-e89b-12d3-a456-426614174000",
"from_email": "[email protected]",
"from_name": "Acme Newsletter",
"reply_to": "[email protected]",
"preview_text": "Check out our latest updates...",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"topic_id": "123e4567-e89b-12d3-a456-426614174000",
"scheduled_at": "2023-11-07T05:31:56Z",
"inbox_id": "123e4567-e89b-12d3-a456-426614174000",
"inbox_ids": ["123e4567-e89b-12d3-a456-426614174000", "223e4567-e89b-12d3-a456-426614174001"],
"sending_speed": "auto",
"tags": ["newsletter", "vip"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Newsletter - January 2024',
subject: 'Your monthly update',
template_id: '123e4567-e89b-12d3-a456-426614174000',
from_email: '[email protected]',
from_name: 'Acme Newsletter',
reply_to: '[email protected]',
preview_text: 'Check out our latest updates...',
segment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
topic_id: '123e4567-e89b-12d3-a456-426614174000',
scheduled_at: '2023-11-07T05:31:56Z',
inbox_id: '123e4567-e89b-12d3-a456-426614174000',
inbox_ids: ['123e4567-e89b-12d3-a456-426614174000', '223e4567-e89b-12d3-a456-426614174001'],
sending_speed: 'auto',
tags: ['newsletter', 'vip']
})
};
fetch('https://api.emailr.dev/v1/broadcasts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.emailr.dev/v1/broadcasts",
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([
'name' => 'Newsletter - January 2024',
'subject' => 'Your monthly update',
'template_id' => '123e4567-e89b-12d3-a456-426614174000',
'from_email' => '[email protected]',
'from_name' => 'Acme Newsletter',
'reply_to' => '[email protected]',
'preview_text' => 'Check out our latest updates...',
'segment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'topic_id' => '123e4567-e89b-12d3-a456-426614174000',
'scheduled_at' => '2023-11-07T05:31:56Z',
'inbox_id' => '123e4567-e89b-12d3-a456-426614174000',
'inbox_ids' => [
'123e4567-e89b-12d3-a456-426614174000',
'223e4567-e89b-12d3-a456-426614174001'
],
'sending_speed' => 'auto',
'tags' => [
'newsletter',
'vip'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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 := "https://api.emailr.dev/v1/broadcasts"
payload := strings.NewReader("{\n \"name\": \"Newsletter - January 2024\",\n \"subject\": \"Your monthly update\",\n \"template_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"from_email\": \"[email protected]\",\n \"from_name\": \"Acme Newsletter\",\n \"reply_to\": \"[email protected]\",\n \"preview_text\": \"Check out our latest updates...\",\n \"segment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"topic_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"inbox_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"inbox_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\",\n \"223e4567-e89b-12d3-a456-426614174001\"\n ],\n \"sending_speed\": \"auto\",\n \"tags\": [\n \"newsletter\",\n \"vip\"\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))
}HttpResponse<String> response = Unirest.post("https://api.emailr.dev/v1/broadcasts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Newsletter - January 2024\",\n \"subject\": \"Your monthly update\",\n \"template_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"from_email\": \"[email protected]\",\n \"from_name\": \"Acme Newsletter\",\n \"reply_to\": \"[email protected]\",\n \"preview_text\": \"Check out our latest updates...\",\n \"segment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"topic_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"inbox_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"inbox_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\",\n \"223e4567-e89b-12d3-a456-426614174001\"\n ],\n \"sending_speed\": \"auto\",\n \"tags\": [\n \"newsletter\",\n \"vip\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emailr.dev/v1/broadcasts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Newsletter - January 2024\",\n \"subject\": \"Your monthly update\",\n \"template_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"from_email\": \"[email protected]\",\n \"from_name\": \"Acme Newsletter\",\n \"reply_to\": \"[email protected]\",\n \"preview_text\": \"Check out our latest updates...\",\n \"segment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"topic_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"inbox_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"inbox_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\",\n \"223e4567-e89b-12d3-a456-426614174001\"\n ],\n \"sending_speed\": \"auto\",\n \"tags\": [\n \"newsletter\",\n \"vip\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"subject": "<string>",
"from_email": "[email protected]",
"from_name": "<string>",
"reply_to": "<string>",
"preview_text": "<string>",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"topic_id": "123e4567-e89b-12d3-a456-426614174000",
"inbox_id": "123e4567-e89b-12d3-a456-426614174000",
"inbox_ids": [
"<string>"
],
"sending_speed": "auto",
"status": "draft",
"total_recipients": 123,
"sent_count": 123,
"delivered_count": 123,
"opened_count": 123,
"clicked_count": 123,
"bounced_count": 123,
"scheduled_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"tags": [
"newsletter",
"vip"
],
"sequence_mode": "sales",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"sequence_exit_conditions": {}
}{
"error": "An error occurred",
"code": "VALIDATION_ERROR",
"details": "<unknown>"
}Create broadcast
Create a new email broadcast campaign
curl --request POST \
--url https://api.emailr.dev/v1/broadcasts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Newsletter - January 2024",
"subject": "Your monthly update",
"template_id": "123e4567-e89b-12d3-a456-426614174000",
"from_email": "[email protected]",
"from_name": "Acme Newsletter",
"reply_to": "[email protected]",
"preview_text": "Check out our latest updates...",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"topic_id": "123e4567-e89b-12d3-a456-426614174000",
"scheduled_at": "2023-11-07T05:31:56Z",
"inbox_id": "123e4567-e89b-12d3-a456-426614174000",
"inbox_ids": [
"123e4567-e89b-12d3-a456-426614174000",
"223e4567-e89b-12d3-a456-426614174001"
],
"sending_speed": "auto",
"tags": [
"newsletter",
"vip"
]
}
'import requests
url = "https://api.emailr.dev/v1/broadcasts"
payload = {
"name": "Newsletter - January 2024",
"subject": "Your monthly update",
"template_id": "123e4567-e89b-12d3-a456-426614174000",
"from_email": "[email protected]",
"from_name": "Acme Newsletter",
"reply_to": "[email protected]",
"preview_text": "Check out our latest updates...",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"topic_id": "123e4567-e89b-12d3-a456-426614174000",
"scheduled_at": "2023-11-07T05:31:56Z",
"inbox_id": "123e4567-e89b-12d3-a456-426614174000",
"inbox_ids": ["123e4567-e89b-12d3-a456-426614174000", "223e4567-e89b-12d3-a456-426614174001"],
"sending_speed": "auto",
"tags": ["newsletter", "vip"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Newsletter - January 2024',
subject: 'Your monthly update',
template_id: '123e4567-e89b-12d3-a456-426614174000',
from_email: '[email protected]',
from_name: 'Acme Newsletter',
reply_to: '[email protected]',
preview_text: 'Check out our latest updates...',
segment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
topic_id: '123e4567-e89b-12d3-a456-426614174000',
scheduled_at: '2023-11-07T05:31:56Z',
inbox_id: '123e4567-e89b-12d3-a456-426614174000',
inbox_ids: ['123e4567-e89b-12d3-a456-426614174000', '223e4567-e89b-12d3-a456-426614174001'],
sending_speed: 'auto',
tags: ['newsletter', 'vip']
})
};
fetch('https://api.emailr.dev/v1/broadcasts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.emailr.dev/v1/broadcasts",
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([
'name' => 'Newsletter - January 2024',
'subject' => 'Your monthly update',
'template_id' => '123e4567-e89b-12d3-a456-426614174000',
'from_email' => '[email protected]',
'from_name' => 'Acme Newsletter',
'reply_to' => '[email protected]',
'preview_text' => 'Check out our latest updates...',
'segment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'topic_id' => '123e4567-e89b-12d3-a456-426614174000',
'scheduled_at' => '2023-11-07T05:31:56Z',
'inbox_id' => '123e4567-e89b-12d3-a456-426614174000',
'inbox_ids' => [
'123e4567-e89b-12d3-a456-426614174000',
'223e4567-e89b-12d3-a456-426614174001'
],
'sending_speed' => 'auto',
'tags' => [
'newsletter',
'vip'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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 := "https://api.emailr.dev/v1/broadcasts"
payload := strings.NewReader("{\n \"name\": \"Newsletter - January 2024\",\n \"subject\": \"Your monthly update\",\n \"template_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"from_email\": \"[email protected]\",\n \"from_name\": \"Acme Newsletter\",\n \"reply_to\": \"[email protected]\",\n \"preview_text\": \"Check out our latest updates...\",\n \"segment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"topic_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"inbox_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"inbox_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\",\n \"223e4567-e89b-12d3-a456-426614174001\"\n ],\n \"sending_speed\": \"auto\",\n \"tags\": [\n \"newsletter\",\n \"vip\"\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))
}HttpResponse<String> response = Unirest.post("https://api.emailr.dev/v1/broadcasts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Newsletter - January 2024\",\n \"subject\": \"Your monthly update\",\n \"template_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"from_email\": \"[email protected]\",\n \"from_name\": \"Acme Newsletter\",\n \"reply_to\": \"[email protected]\",\n \"preview_text\": \"Check out our latest updates...\",\n \"segment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"topic_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"inbox_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"inbox_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\",\n \"223e4567-e89b-12d3-a456-426614174001\"\n ],\n \"sending_speed\": \"auto\",\n \"tags\": [\n \"newsletter\",\n \"vip\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emailr.dev/v1/broadcasts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Newsletter - January 2024\",\n \"subject\": \"Your monthly update\",\n \"template_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"from_email\": \"[email protected]\",\n \"from_name\": \"Acme Newsletter\",\n \"reply_to\": \"[email protected]\",\n \"preview_text\": \"Check out our latest updates...\",\n \"segment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"topic_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"inbox_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"inbox_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\",\n \"223e4567-e89b-12d3-a456-426614174001\"\n ],\n \"sending_speed\": \"auto\",\n \"tags\": [\n \"newsletter\",\n \"vip\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"subject": "<string>",
"from_email": "[email protected]",
"from_name": "<string>",
"reply_to": "<string>",
"preview_text": "<string>",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"topic_id": "123e4567-e89b-12d3-a456-426614174000",
"inbox_id": "123e4567-e89b-12d3-a456-426614174000",
"inbox_ids": [
"<string>"
],
"sending_speed": "auto",
"status": "draft",
"total_recipients": 123,
"sent_count": 123,
"delivered_count": 123,
"opened_count": 123,
"clicked_count": 123,
"bounced_count": 123,
"scheduled_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"tags": [
"newsletter",
"vip"
],
"sequence_mode": "sales",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"sequence_exit_conditions": {}
}{
"error": "An error occurred",
"code": "VALIDATION_ERROR",
"details": "<unknown>"
}Authorizations
API key authentication. Use your API key as the bearer token.
Body
1"Newsletter - January 2024"
1"Your monthly update"
Template ID to use for the broadcast email content. Required.
"123e4567-e89b-12d3-a456-426614174000"
Sender email address. Required unless inbox_id or inbox_ids is provided.
Display name for the sender. Combined with from_email as 'Name ' when sending.
"Acme Newsletter"
Reply-To email address for broadcast emails.
Preview text (preheader) shown in email clients.
500"Check out our latest updates..."
Optional topic ID to categorize the broadcast for unsubscription management
"123e4567-e89b-12d3-a456-426614174000"
Optional inbox ID. When provided, the inbox's name, from address, and reply-to address are used as defaults unless explicit values are given. Mutually exclusive with inbox_ids.
"123e4567-e89b-12d3-a456-426614174000"
Optional array of inbox IDs for inbox rotation. When set, emails are round-robin distributed across these inboxes, each using its own sender identity. Mutually exclusive with inbox_id.
[
"123e4567-e89b-12d3-a456-426614174000",
"223e4567-e89b-12d3-a456-426614174001"
]
Controls how fast emails are sent. 'auto' scales with recipient count (recommended), 'warmup' ~100/day, 'very_slow' ~100/hr, 'slow' ~1000/hr, 'normal' ~2000/hr, 'instant' sends as fast as possible.
auto, warmup, very_slow, slow, normal, instant "auto"
Tags for categorization. Lowercase, max 50 chars each, max 20 tags.
["newsletter", "vip"]
Response
Broadcast created
"123e4567-e89b-12d3-a456-426614174000"
Topic ID for categorizing the broadcast
"123e4567-e89b-12d3-a456-426614174000"
Associated inbox ID for sender identity defaults
"123e4567-e89b-12d3-a456-426614174000"
Inbox IDs used for inbox rotation
Sending speed setting for the broadcast
"auto"
"draft"
Tags for categorization.
["newsletter", "vip"]
Whether follow-ups are sent as threaded replies (sales) or fresh standalone emails (marketing).
sales, marketing "sales"
Configurable exit rules evaluated by the sequence dispatcher before each follow-up. Supported keys: exit_if_in_segment_ids (string[]), exit_if_not_in_segment_ids (string[]).
Show child attributes
Show child attributes