Update broadcast
curl --request PUT \
--url https://api.emailr.dev/v1/broadcasts/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"subject": "<string>",
"from_email": "jsmith@example.com",
"from_name": "<string>",
"reply_to": "jsmith@example.com",
"preview_text": "<string>",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"topic_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scheduled_at": "2023-11-07T05:31:56Z",
"inbox_id": "123e4567-e89b-12d3-a456-426614174000",
"inbox_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"sequence_exit_conditions": {
"exit_if_in_segment_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"exit_if_not_in_segment_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"tags": [
"newsletter",
"vip"
]
}
'import requests
url = "https://api.emailr.dev/v1/broadcasts/{id}"
payload = {
"name": "<string>",
"subject": "<string>",
"from_email": "jsmith@example.com",
"from_name": "<string>",
"reply_to": "jsmith@example.com",
"preview_text": "<string>",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"topic_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scheduled_at": "2023-11-07T05:31:56Z",
"inbox_id": "123e4567-e89b-12d3-a456-426614174000",
"inbox_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"sequence_exit_conditions": {
"exit_if_in_segment_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"exit_if_not_in_segment_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
},
"tags": ["newsletter", "vip"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
subject: '<string>',
from_email: 'jsmith@example.com',
from_name: '<string>',
reply_to: 'jsmith@example.com',
preview_text: '<string>',
template_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
segment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
topic_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
scheduled_at: '2023-11-07T05:31:56Z',
inbox_id: '123e4567-e89b-12d3-a456-426614174000',
inbox_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
sequence_exit_conditions: {
exit_if_in_segment_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
exit_if_not_in_segment_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
},
tags: ['newsletter', 'vip']
})
};
fetch('https://api.emailr.dev/v1/broadcasts/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'subject' => '<string>',
'from_email' => 'jsmith@example.com',
'from_name' => '<string>',
'reply_to' => 'jsmith@example.com',
'preview_text' => '<string>',
'template_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'segment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'topic_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'scheduled_at' => '2023-11-07T05:31:56Z',
'inbox_id' => '123e4567-e89b-12d3-a456-426614174000',
'inbox_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'sequence_exit_conditions' => [
'exit_if_in_segment_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'exit_if_not_in_segment_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'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/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"from_email\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"reply_to\": \"jsmith@example.com\",\n \"preview_text\": \"<string>\",\n \"template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"segment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"topic_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"inbox_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"inbox_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"sequence_exit_conditions\": {\n \"exit_if_in_segment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"exit_if_not_in_segment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"tags\": [\n \"newsletter\",\n \"vip\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.emailr.dev/v1/broadcasts/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"from_email\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"reply_to\": \"jsmith@example.com\",\n \"preview_text\": \"<string>\",\n \"template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"segment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"topic_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"inbox_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"inbox_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"sequence_exit_conditions\": {\n \"exit_if_in_segment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"exit_if_not_in_segment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"tags\": [\n \"newsletter\",\n \"vip\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emailr.dev/v1/broadcasts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"from_email\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"reply_to\": \"jsmith@example.com\",\n \"preview_text\": \"<string>\",\n \"template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"segment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"topic_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"inbox_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"inbox_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"sequence_exit_conditions\": {\n \"exit_if_in_segment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"exit_if_not_in_segment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\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": "jsmith@example.com",
"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>"
}{
"error": "An error occurred",
"code": "VALIDATION_ERROR",
"details": "<unknown>"
}broadcasts
Update broadcast
Update a broadcast that has not been sent yet (draft or scheduled status only)
PUT
/
v1
/
broadcasts
/
{id}
Update broadcast
curl --request PUT \
--url https://api.emailr.dev/v1/broadcasts/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"subject": "<string>",
"from_email": "jsmith@example.com",
"from_name": "<string>",
"reply_to": "jsmith@example.com",
"preview_text": "<string>",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"topic_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scheduled_at": "2023-11-07T05:31:56Z",
"inbox_id": "123e4567-e89b-12d3-a456-426614174000",
"inbox_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"sequence_exit_conditions": {
"exit_if_in_segment_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"exit_if_not_in_segment_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"tags": [
"newsletter",
"vip"
]
}
'import requests
url = "https://api.emailr.dev/v1/broadcasts/{id}"
payload = {
"name": "<string>",
"subject": "<string>",
"from_email": "jsmith@example.com",
"from_name": "<string>",
"reply_to": "jsmith@example.com",
"preview_text": "<string>",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"topic_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scheduled_at": "2023-11-07T05:31:56Z",
"inbox_id": "123e4567-e89b-12d3-a456-426614174000",
"inbox_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"sequence_exit_conditions": {
"exit_if_in_segment_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"exit_if_not_in_segment_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
},
"tags": ["newsletter", "vip"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
subject: '<string>',
from_email: 'jsmith@example.com',
from_name: '<string>',
reply_to: 'jsmith@example.com',
preview_text: '<string>',
template_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
segment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
topic_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
scheduled_at: '2023-11-07T05:31:56Z',
inbox_id: '123e4567-e89b-12d3-a456-426614174000',
inbox_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
sequence_exit_conditions: {
exit_if_in_segment_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
exit_if_not_in_segment_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
},
tags: ['newsletter', 'vip']
})
};
fetch('https://api.emailr.dev/v1/broadcasts/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'subject' => '<string>',
'from_email' => 'jsmith@example.com',
'from_name' => '<string>',
'reply_to' => 'jsmith@example.com',
'preview_text' => '<string>',
'template_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'segment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'topic_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'scheduled_at' => '2023-11-07T05:31:56Z',
'inbox_id' => '123e4567-e89b-12d3-a456-426614174000',
'inbox_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'sequence_exit_conditions' => [
'exit_if_in_segment_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'exit_if_not_in_segment_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'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/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"from_email\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"reply_to\": \"jsmith@example.com\",\n \"preview_text\": \"<string>\",\n \"template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"segment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"topic_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"inbox_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"inbox_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"sequence_exit_conditions\": {\n \"exit_if_in_segment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"exit_if_not_in_segment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"tags\": [\n \"newsletter\",\n \"vip\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.emailr.dev/v1/broadcasts/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"from_email\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"reply_to\": \"jsmith@example.com\",\n \"preview_text\": \"<string>\",\n \"template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"segment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"topic_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"inbox_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"inbox_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"sequence_exit_conditions\": {\n \"exit_if_in_segment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"exit_if_not_in_segment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"tags\": [\n \"newsletter\",\n \"vip\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emailr.dev/v1/broadcasts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"from_email\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"reply_to\": \"jsmith@example.com\",\n \"preview_text\": \"<string>\",\n \"template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"segment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"topic_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"inbox_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"inbox_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"sequence_exit_conditions\": {\n \"exit_if_in_segment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"exit_if_not_in_segment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\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": "jsmith@example.com",
"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>"
}{
"error": "An error occurred",
"code": "VALIDATION_ERROR",
"details": "<unknown>"
}Authorizations
Body
application/json
Response
Broadcast updated