Update a broadcast
curl --request POST \
--url https://{notifuseDomain}/api/broadcasts.update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_id": "ws_1234567890",
"id": "broadcast_12345",
"name": "Spring Newsletter 2024",
"audience": {
"list": "newsletter",
"segments": [
"premium_users"
],
"exclude_unsubscribed": true
},
"schedule": {
"is_scheduled": false,
"scheduled_date": "2024-03-15",
"scheduled_time": "10:30",
"timezone": "America/New_York",
"use_recipient_timezone": false
},
"test_settings": {
"enabled": true,
"sample_percentage": 20,
"auto_send_winner": true,
"auto_send_winner_metric": "open_rate",
"test_duration_hours": 24,
"variations": [
{
"template_id": "template_variant_a",
"variation_name": "Variation A",
"metrics": {
"recipients": 123,
"delivered": 123,
"opens": 123,
"clicks": 123,
"bounced": 123,
"complained": 123,
"unsubscribed": 123
},
"template": {}
}
]
},
"tracking_enabled": true,
"utm_parameters": {
"source": "newsletter",
"medium": "email",
"campaign": "spring_2024",
"term": "<string>",
"content": "<string>"
},
"data_feed": {
"global_feed": {
"enabled": true,
"url": "https://api.example.com/broadcast-data",
"headers": [
{
"name": "Authorization",
"value": "Bearer token123"
}
]
},
"global_feed_data": {},
"global_feed_fetched_at": "2023-11-07T05:31:56Z",
"recipient_feed": {
"enabled": true,
"url": "https://api.example.com/recipient-data",
"headers": [
{
"name": "Authorization",
"value": "Bearer token123"
}
]
}
},
"metadata": {}
}
'import requests
url = "https://{notifuseDomain}/api/broadcasts.update"
payload = {
"workspace_id": "ws_1234567890",
"id": "broadcast_12345",
"name": "Spring Newsletter 2024",
"audience": {
"list": "newsletter",
"segments": ["premium_users"],
"exclude_unsubscribed": True
},
"schedule": {
"is_scheduled": False,
"scheduled_date": "2024-03-15",
"scheduled_time": "10:30",
"timezone": "America/New_York",
"use_recipient_timezone": False
},
"test_settings": {
"enabled": True,
"sample_percentage": 20,
"auto_send_winner": True,
"auto_send_winner_metric": "open_rate",
"test_duration_hours": 24,
"variations": [
{
"template_id": "template_variant_a",
"variation_name": "Variation A",
"metrics": {
"recipients": 123,
"delivered": 123,
"opens": 123,
"clicks": 123,
"bounced": 123,
"complained": 123,
"unsubscribed": 123
},
"template": {}
}
]
},
"tracking_enabled": True,
"utm_parameters": {
"source": "newsletter",
"medium": "email",
"campaign": "spring_2024",
"term": "<string>",
"content": "<string>"
},
"data_feed": {
"global_feed": {
"enabled": True,
"url": "https://api.example.com/broadcast-data",
"headers": [
{
"name": "Authorization",
"value": "Bearer token123"
}
]
},
"global_feed_data": {},
"global_feed_fetched_at": "2023-11-07T05:31:56Z",
"recipient_feed": {
"enabled": True,
"url": "https://api.example.com/recipient-data",
"headers": [
{
"name": "Authorization",
"value": "Bearer token123"
}
]
}
},
"metadata": {}
}
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({
workspace_id: 'ws_1234567890',
id: 'broadcast_12345',
name: 'Spring Newsletter 2024',
audience: {list: 'newsletter', segments: ['premium_users'], exclude_unsubscribed: true},
schedule: {
is_scheduled: false,
scheduled_date: '2024-03-15',
scheduled_time: '10:30',
timezone: 'America/New_York',
use_recipient_timezone: false
},
test_settings: {
enabled: true,
sample_percentage: 20,
auto_send_winner: true,
auto_send_winner_metric: 'open_rate',
test_duration_hours: 24,
variations: [
{
template_id: 'template_variant_a',
variation_name: 'Variation A',
metrics: {
recipients: 123,
delivered: 123,
opens: 123,
clicks: 123,
bounced: 123,
complained: 123,
unsubscribed: 123
},
template: {}
}
]
},
tracking_enabled: true,
utm_parameters: {
source: 'newsletter',
medium: 'email',
campaign: 'spring_2024',
term: '<string>',
content: '<string>'
},
data_feed: {
global_feed: {
enabled: true,
url: 'https://api.example.com/broadcast-data',
headers: [{name: 'Authorization', value: 'Bearer token123'}]
},
global_feed_data: {},
global_feed_fetched_at: '2023-11-07T05:31:56Z',
recipient_feed: {
enabled: true,
url: 'https://api.example.com/recipient-data',
headers: [{name: 'Authorization', value: 'Bearer token123'}]
}
},
metadata: {}
})
};
fetch('https://{notifuseDomain}/api/broadcasts.update', 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://{notifuseDomain}/api/broadcasts.update",
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([
'workspace_id' => 'ws_1234567890',
'id' => 'broadcast_12345',
'name' => 'Spring Newsletter 2024',
'audience' => [
'list' => 'newsletter',
'segments' => [
'premium_users'
],
'exclude_unsubscribed' => true
],
'schedule' => [
'is_scheduled' => false,
'scheduled_date' => '2024-03-15',
'scheduled_time' => '10:30',
'timezone' => 'America/New_York',
'use_recipient_timezone' => false
],
'test_settings' => [
'enabled' => true,
'sample_percentage' => 20,
'auto_send_winner' => true,
'auto_send_winner_metric' => 'open_rate',
'test_duration_hours' => 24,
'variations' => [
[
'template_id' => 'template_variant_a',
'variation_name' => 'Variation A',
'metrics' => [
'recipients' => 123,
'delivered' => 123,
'opens' => 123,
'clicks' => 123,
'bounced' => 123,
'complained' => 123,
'unsubscribed' => 123
],
'template' => [
]
]
]
],
'tracking_enabled' => true,
'utm_parameters' => [
'source' => 'newsletter',
'medium' => 'email',
'campaign' => 'spring_2024',
'term' => '<string>',
'content' => '<string>'
],
'data_feed' => [
'global_feed' => [
'enabled' => true,
'url' => 'https://api.example.com/broadcast-data',
'headers' => [
[
'name' => 'Authorization',
'value' => 'Bearer token123'
]
]
],
'global_feed_data' => [
],
'global_feed_fetched_at' => '2023-11-07T05:31:56Z',
'recipient_feed' => [
'enabled' => true,
'url' => 'https://api.example.com/recipient-data',
'headers' => [
[
'name' => 'Authorization',
'value' => 'Bearer token123'
]
]
]
],
'metadata' => [
]
]),
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://{notifuseDomain}/api/broadcasts.update"
payload := strings.NewReader("{\n \"workspace_id\": \"ws_1234567890\",\n \"id\": \"broadcast_12345\",\n \"name\": \"Spring Newsletter 2024\",\n \"audience\": {\n \"list\": \"newsletter\",\n \"segments\": [\n \"premium_users\"\n ],\n \"exclude_unsubscribed\": true\n },\n \"schedule\": {\n \"is_scheduled\": false,\n \"scheduled_date\": \"2024-03-15\",\n \"scheduled_time\": \"10:30\",\n \"timezone\": \"America/New_York\",\n \"use_recipient_timezone\": false\n },\n \"test_settings\": {\n \"enabled\": true,\n \"sample_percentage\": 20,\n \"auto_send_winner\": true,\n \"auto_send_winner_metric\": \"open_rate\",\n \"test_duration_hours\": 24,\n \"variations\": [\n {\n \"template_id\": \"template_variant_a\",\n \"variation_name\": \"Variation A\",\n \"metrics\": {\n \"recipients\": 123,\n \"delivered\": 123,\n \"opens\": 123,\n \"clicks\": 123,\n \"bounced\": 123,\n \"complained\": 123,\n \"unsubscribed\": 123\n },\n \"template\": {}\n }\n ]\n },\n \"tracking_enabled\": true,\n \"utm_parameters\": {\n \"source\": \"newsletter\",\n \"medium\": \"email\",\n \"campaign\": \"spring_2024\",\n \"term\": \"<string>\",\n \"content\": \"<string>\"\n },\n \"data_feed\": {\n \"global_feed\": {\n \"enabled\": true,\n \"url\": \"https://api.example.com/broadcast-data\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer token123\"\n }\n ]\n },\n \"global_feed_data\": {},\n \"global_feed_fetched_at\": \"2023-11-07T05:31:56Z\",\n \"recipient_feed\": {\n \"enabled\": true,\n \"url\": \"https://api.example.com/recipient-data\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer token123\"\n }\n ]\n }\n },\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))
}HttpResponse<String> response = Unirest.post("https://{notifuseDomain}/api/broadcasts.update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": \"ws_1234567890\",\n \"id\": \"broadcast_12345\",\n \"name\": \"Spring Newsletter 2024\",\n \"audience\": {\n \"list\": \"newsletter\",\n \"segments\": [\n \"premium_users\"\n ],\n \"exclude_unsubscribed\": true\n },\n \"schedule\": {\n \"is_scheduled\": false,\n \"scheduled_date\": \"2024-03-15\",\n \"scheduled_time\": \"10:30\",\n \"timezone\": \"America/New_York\",\n \"use_recipient_timezone\": false\n },\n \"test_settings\": {\n \"enabled\": true,\n \"sample_percentage\": 20,\n \"auto_send_winner\": true,\n \"auto_send_winner_metric\": \"open_rate\",\n \"test_duration_hours\": 24,\n \"variations\": [\n {\n \"template_id\": \"template_variant_a\",\n \"variation_name\": \"Variation A\",\n \"metrics\": {\n \"recipients\": 123,\n \"delivered\": 123,\n \"opens\": 123,\n \"clicks\": 123,\n \"bounced\": 123,\n \"complained\": 123,\n \"unsubscribed\": 123\n },\n \"template\": {}\n }\n ]\n },\n \"tracking_enabled\": true,\n \"utm_parameters\": {\n \"source\": \"newsletter\",\n \"medium\": \"email\",\n \"campaign\": \"spring_2024\",\n \"term\": \"<string>\",\n \"content\": \"<string>\"\n },\n \"data_feed\": {\n \"global_feed\": {\n \"enabled\": true,\n \"url\": \"https://api.example.com/broadcast-data\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer token123\"\n }\n ]\n },\n \"global_feed_data\": {},\n \"global_feed_fetched_at\": \"2023-11-07T05:31:56Z\",\n \"recipient_feed\": {\n \"enabled\": true,\n \"url\": \"https://api.example.com/recipient-data\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer token123\"\n }\n ]\n }\n },\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/broadcasts.update")
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 \"workspace_id\": \"ws_1234567890\",\n \"id\": \"broadcast_12345\",\n \"name\": \"Spring Newsletter 2024\",\n \"audience\": {\n \"list\": \"newsletter\",\n \"segments\": [\n \"premium_users\"\n ],\n \"exclude_unsubscribed\": true\n },\n \"schedule\": {\n \"is_scheduled\": false,\n \"scheduled_date\": \"2024-03-15\",\n \"scheduled_time\": \"10:30\",\n \"timezone\": \"America/New_York\",\n \"use_recipient_timezone\": false\n },\n \"test_settings\": {\n \"enabled\": true,\n \"sample_percentage\": 20,\n \"auto_send_winner\": true,\n \"auto_send_winner_metric\": \"open_rate\",\n \"test_duration_hours\": 24,\n \"variations\": [\n {\n \"template_id\": \"template_variant_a\",\n \"variation_name\": \"Variation A\",\n \"metrics\": {\n \"recipients\": 123,\n \"delivered\": 123,\n \"opens\": 123,\n \"clicks\": 123,\n \"bounced\": 123,\n \"complained\": 123,\n \"unsubscribed\": 123\n },\n \"template\": {}\n }\n ]\n },\n \"tracking_enabled\": true,\n \"utm_parameters\": {\n \"source\": \"newsletter\",\n \"medium\": \"email\",\n \"campaign\": \"spring_2024\",\n \"term\": \"<string>\",\n \"content\": \"<string>\"\n },\n \"data_feed\": {\n \"global_feed\": {\n \"enabled\": true,\n \"url\": \"https://api.example.com/broadcast-data\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer token123\"\n }\n ]\n },\n \"global_feed_data\": {},\n \"global_feed_fetched_at\": \"2023-11-07T05:31:56Z\",\n \"recipient_feed\": {\n \"enabled\": true,\n \"url\": \"https://api.example.com/recipient-data\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer token123\"\n }\n ]\n }\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"broadcast": {
"id": "broadcast_12345",
"workspace_id": "ws_1234567890",
"name": "Spring Newsletter 2024",
"channel_type": "email",
"status": "draft",
"audience": {
"list": "newsletter",
"segments": [
"premium_users"
],
"exclude_unsubscribed": true
},
"schedule": {
"is_scheduled": false,
"scheduled_date": "2024-03-15",
"scheduled_time": "10:30",
"timezone": "America/New_York",
"use_recipient_timezone": false
},
"test_settings": {
"enabled": true,
"sample_percentage": 20,
"auto_send_winner": true,
"auto_send_winner_metric": "open_rate",
"test_duration_hours": 24,
"variations": [
{
"template_id": "template_variant_a",
"variation_name": "Variation A",
"metrics": {
"recipients": 123,
"delivered": 123,
"opens": 123,
"clicks": 123,
"bounced": 123,
"complained": 123,
"unsubscribed": 123
},
"template": {}
}
]
},
"utm_parameters": {
"source": "newsletter",
"medium": "email",
"campaign": "spring_2024",
"term": "<string>",
"content": "<string>"
},
"data_feed": {
"global_feed": {
"enabled": true,
"url": "https://api.example.com/broadcast-data",
"headers": [
{
"name": "Authorization",
"value": "Bearer token123"
}
]
},
"global_feed_data": {},
"global_feed_fetched_at": "2023-11-07T05:31:56Z",
"recipient_feed": {
"enabled": true,
"url": "https://api.example.com/recipient-data",
"headers": [
{
"name": "Authorization",
"value": "Bearer token123"
}
]
}
},
"metadata": {},
"winning_template": "template_winner",
"test_sent_at": "2023-11-07T05:31:56Z",
"winner_sent_at": "2023-11-07T05:31:56Z",
"enqueued_count": 1000,
"test_phase_recipient_count": 123,
"winner_phase_recipient_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"paused_at": "2023-11-07T05:31:56Z",
"pause_reason": "<string>"
}
}{
"error": "cannot update broadcast with status: sending"
}{
"error": "<string>"
}{
"error": "Broadcast not found"
}{
"error": "<string>"
}Broadcasts
Update a broadcast
Updates an existing broadcast. Only broadcasts in draft, scheduled, or paused status can be updated.
POST
/
api
/
broadcasts.update
Update a broadcast
curl --request POST \
--url https://{notifuseDomain}/api/broadcasts.update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_id": "ws_1234567890",
"id": "broadcast_12345",
"name": "Spring Newsletter 2024",
"audience": {
"list": "newsletter",
"segments": [
"premium_users"
],
"exclude_unsubscribed": true
},
"schedule": {
"is_scheduled": false,
"scheduled_date": "2024-03-15",
"scheduled_time": "10:30",
"timezone": "America/New_York",
"use_recipient_timezone": false
},
"test_settings": {
"enabled": true,
"sample_percentage": 20,
"auto_send_winner": true,
"auto_send_winner_metric": "open_rate",
"test_duration_hours": 24,
"variations": [
{
"template_id": "template_variant_a",
"variation_name": "Variation A",
"metrics": {
"recipients": 123,
"delivered": 123,
"opens": 123,
"clicks": 123,
"bounced": 123,
"complained": 123,
"unsubscribed": 123
},
"template": {}
}
]
},
"tracking_enabled": true,
"utm_parameters": {
"source": "newsletter",
"medium": "email",
"campaign": "spring_2024",
"term": "<string>",
"content": "<string>"
},
"data_feed": {
"global_feed": {
"enabled": true,
"url": "https://api.example.com/broadcast-data",
"headers": [
{
"name": "Authorization",
"value": "Bearer token123"
}
]
},
"global_feed_data": {},
"global_feed_fetched_at": "2023-11-07T05:31:56Z",
"recipient_feed": {
"enabled": true,
"url": "https://api.example.com/recipient-data",
"headers": [
{
"name": "Authorization",
"value": "Bearer token123"
}
]
}
},
"metadata": {}
}
'import requests
url = "https://{notifuseDomain}/api/broadcasts.update"
payload = {
"workspace_id": "ws_1234567890",
"id": "broadcast_12345",
"name": "Spring Newsletter 2024",
"audience": {
"list": "newsletter",
"segments": ["premium_users"],
"exclude_unsubscribed": True
},
"schedule": {
"is_scheduled": False,
"scheduled_date": "2024-03-15",
"scheduled_time": "10:30",
"timezone": "America/New_York",
"use_recipient_timezone": False
},
"test_settings": {
"enabled": True,
"sample_percentage": 20,
"auto_send_winner": True,
"auto_send_winner_metric": "open_rate",
"test_duration_hours": 24,
"variations": [
{
"template_id": "template_variant_a",
"variation_name": "Variation A",
"metrics": {
"recipients": 123,
"delivered": 123,
"opens": 123,
"clicks": 123,
"bounced": 123,
"complained": 123,
"unsubscribed": 123
},
"template": {}
}
]
},
"tracking_enabled": True,
"utm_parameters": {
"source": "newsletter",
"medium": "email",
"campaign": "spring_2024",
"term": "<string>",
"content": "<string>"
},
"data_feed": {
"global_feed": {
"enabled": True,
"url": "https://api.example.com/broadcast-data",
"headers": [
{
"name": "Authorization",
"value": "Bearer token123"
}
]
},
"global_feed_data": {},
"global_feed_fetched_at": "2023-11-07T05:31:56Z",
"recipient_feed": {
"enabled": True,
"url": "https://api.example.com/recipient-data",
"headers": [
{
"name": "Authorization",
"value": "Bearer token123"
}
]
}
},
"metadata": {}
}
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({
workspace_id: 'ws_1234567890',
id: 'broadcast_12345',
name: 'Spring Newsletter 2024',
audience: {list: 'newsletter', segments: ['premium_users'], exclude_unsubscribed: true},
schedule: {
is_scheduled: false,
scheduled_date: '2024-03-15',
scheduled_time: '10:30',
timezone: 'America/New_York',
use_recipient_timezone: false
},
test_settings: {
enabled: true,
sample_percentage: 20,
auto_send_winner: true,
auto_send_winner_metric: 'open_rate',
test_duration_hours: 24,
variations: [
{
template_id: 'template_variant_a',
variation_name: 'Variation A',
metrics: {
recipients: 123,
delivered: 123,
opens: 123,
clicks: 123,
bounced: 123,
complained: 123,
unsubscribed: 123
},
template: {}
}
]
},
tracking_enabled: true,
utm_parameters: {
source: 'newsletter',
medium: 'email',
campaign: 'spring_2024',
term: '<string>',
content: '<string>'
},
data_feed: {
global_feed: {
enabled: true,
url: 'https://api.example.com/broadcast-data',
headers: [{name: 'Authorization', value: 'Bearer token123'}]
},
global_feed_data: {},
global_feed_fetched_at: '2023-11-07T05:31:56Z',
recipient_feed: {
enabled: true,
url: 'https://api.example.com/recipient-data',
headers: [{name: 'Authorization', value: 'Bearer token123'}]
}
},
metadata: {}
})
};
fetch('https://{notifuseDomain}/api/broadcasts.update', 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://{notifuseDomain}/api/broadcasts.update",
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([
'workspace_id' => 'ws_1234567890',
'id' => 'broadcast_12345',
'name' => 'Spring Newsletter 2024',
'audience' => [
'list' => 'newsletter',
'segments' => [
'premium_users'
],
'exclude_unsubscribed' => true
],
'schedule' => [
'is_scheduled' => false,
'scheduled_date' => '2024-03-15',
'scheduled_time' => '10:30',
'timezone' => 'America/New_York',
'use_recipient_timezone' => false
],
'test_settings' => [
'enabled' => true,
'sample_percentage' => 20,
'auto_send_winner' => true,
'auto_send_winner_metric' => 'open_rate',
'test_duration_hours' => 24,
'variations' => [
[
'template_id' => 'template_variant_a',
'variation_name' => 'Variation A',
'metrics' => [
'recipients' => 123,
'delivered' => 123,
'opens' => 123,
'clicks' => 123,
'bounced' => 123,
'complained' => 123,
'unsubscribed' => 123
],
'template' => [
]
]
]
],
'tracking_enabled' => true,
'utm_parameters' => [
'source' => 'newsletter',
'medium' => 'email',
'campaign' => 'spring_2024',
'term' => '<string>',
'content' => '<string>'
],
'data_feed' => [
'global_feed' => [
'enabled' => true,
'url' => 'https://api.example.com/broadcast-data',
'headers' => [
[
'name' => 'Authorization',
'value' => 'Bearer token123'
]
]
],
'global_feed_data' => [
],
'global_feed_fetched_at' => '2023-11-07T05:31:56Z',
'recipient_feed' => [
'enabled' => true,
'url' => 'https://api.example.com/recipient-data',
'headers' => [
[
'name' => 'Authorization',
'value' => 'Bearer token123'
]
]
]
],
'metadata' => [
]
]),
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://{notifuseDomain}/api/broadcasts.update"
payload := strings.NewReader("{\n \"workspace_id\": \"ws_1234567890\",\n \"id\": \"broadcast_12345\",\n \"name\": \"Spring Newsletter 2024\",\n \"audience\": {\n \"list\": \"newsletter\",\n \"segments\": [\n \"premium_users\"\n ],\n \"exclude_unsubscribed\": true\n },\n \"schedule\": {\n \"is_scheduled\": false,\n \"scheduled_date\": \"2024-03-15\",\n \"scheduled_time\": \"10:30\",\n \"timezone\": \"America/New_York\",\n \"use_recipient_timezone\": false\n },\n \"test_settings\": {\n \"enabled\": true,\n \"sample_percentage\": 20,\n \"auto_send_winner\": true,\n \"auto_send_winner_metric\": \"open_rate\",\n \"test_duration_hours\": 24,\n \"variations\": [\n {\n \"template_id\": \"template_variant_a\",\n \"variation_name\": \"Variation A\",\n \"metrics\": {\n \"recipients\": 123,\n \"delivered\": 123,\n \"opens\": 123,\n \"clicks\": 123,\n \"bounced\": 123,\n \"complained\": 123,\n \"unsubscribed\": 123\n },\n \"template\": {}\n }\n ]\n },\n \"tracking_enabled\": true,\n \"utm_parameters\": {\n \"source\": \"newsletter\",\n \"medium\": \"email\",\n \"campaign\": \"spring_2024\",\n \"term\": \"<string>\",\n \"content\": \"<string>\"\n },\n \"data_feed\": {\n \"global_feed\": {\n \"enabled\": true,\n \"url\": \"https://api.example.com/broadcast-data\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer token123\"\n }\n ]\n },\n \"global_feed_data\": {},\n \"global_feed_fetched_at\": \"2023-11-07T05:31:56Z\",\n \"recipient_feed\": {\n \"enabled\": true,\n \"url\": \"https://api.example.com/recipient-data\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer token123\"\n }\n ]\n }\n },\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))
}HttpResponse<String> response = Unirest.post("https://{notifuseDomain}/api/broadcasts.update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": \"ws_1234567890\",\n \"id\": \"broadcast_12345\",\n \"name\": \"Spring Newsletter 2024\",\n \"audience\": {\n \"list\": \"newsletter\",\n \"segments\": [\n \"premium_users\"\n ],\n \"exclude_unsubscribed\": true\n },\n \"schedule\": {\n \"is_scheduled\": false,\n \"scheduled_date\": \"2024-03-15\",\n \"scheduled_time\": \"10:30\",\n \"timezone\": \"America/New_York\",\n \"use_recipient_timezone\": false\n },\n \"test_settings\": {\n \"enabled\": true,\n \"sample_percentage\": 20,\n \"auto_send_winner\": true,\n \"auto_send_winner_metric\": \"open_rate\",\n \"test_duration_hours\": 24,\n \"variations\": [\n {\n \"template_id\": \"template_variant_a\",\n \"variation_name\": \"Variation A\",\n \"metrics\": {\n \"recipients\": 123,\n \"delivered\": 123,\n \"opens\": 123,\n \"clicks\": 123,\n \"bounced\": 123,\n \"complained\": 123,\n \"unsubscribed\": 123\n },\n \"template\": {}\n }\n ]\n },\n \"tracking_enabled\": true,\n \"utm_parameters\": {\n \"source\": \"newsletter\",\n \"medium\": \"email\",\n \"campaign\": \"spring_2024\",\n \"term\": \"<string>\",\n \"content\": \"<string>\"\n },\n \"data_feed\": {\n \"global_feed\": {\n \"enabled\": true,\n \"url\": \"https://api.example.com/broadcast-data\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer token123\"\n }\n ]\n },\n \"global_feed_data\": {},\n \"global_feed_fetched_at\": \"2023-11-07T05:31:56Z\",\n \"recipient_feed\": {\n \"enabled\": true,\n \"url\": \"https://api.example.com/recipient-data\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer token123\"\n }\n ]\n }\n },\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/broadcasts.update")
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 \"workspace_id\": \"ws_1234567890\",\n \"id\": \"broadcast_12345\",\n \"name\": \"Spring Newsletter 2024\",\n \"audience\": {\n \"list\": \"newsletter\",\n \"segments\": [\n \"premium_users\"\n ],\n \"exclude_unsubscribed\": true\n },\n \"schedule\": {\n \"is_scheduled\": false,\n \"scheduled_date\": \"2024-03-15\",\n \"scheduled_time\": \"10:30\",\n \"timezone\": \"America/New_York\",\n \"use_recipient_timezone\": false\n },\n \"test_settings\": {\n \"enabled\": true,\n \"sample_percentage\": 20,\n \"auto_send_winner\": true,\n \"auto_send_winner_metric\": \"open_rate\",\n \"test_duration_hours\": 24,\n \"variations\": [\n {\n \"template_id\": \"template_variant_a\",\n \"variation_name\": \"Variation A\",\n \"metrics\": {\n \"recipients\": 123,\n \"delivered\": 123,\n \"opens\": 123,\n \"clicks\": 123,\n \"bounced\": 123,\n \"complained\": 123,\n \"unsubscribed\": 123\n },\n \"template\": {}\n }\n ]\n },\n \"tracking_enabled\": true,\n \"utm_parameters\": {\n \"source\": \"newsletter\",\n \"medium\": \"email\",\n \"campaign\": \"spring_2024\",\n \"term\": \"<string>\",\n \"content\": \"<string>\"\n },\n \"data_feed\": {\n \"global_feed\": {\n \"enabled\": true,\n \"url\": \"https://api.example.com/broadcast-data\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer token123\"\n }\n ]\n },\n \"global_feed_data\": {},\n \"global_feed_fetched_at\": \"2023-11-07T05:31:56Z\",\n \"recipient_feed\": {\n \"enabled\": true,\n \"url\": \"https://api.example.com/recipient-data\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer token123\"\n }\n ]\n }\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"broadcast": {
"id": "broadcast_12345",
"workspace_id": "ws_1234567890",
"name": "Spring Newsletter 2024",
"channel_type": "email",
"status": "draft",
"audience": {
"list": "newsletter",
"segments": [
"premium_users"
],
"exclude_unsubscribed": true
},
"schedule": {
"is_scheduled": false,
"scheduled_date": "2024-03-15",
"scheduled_time": "10:30",
"timezone": "America/New_York",
"use_recipient_timezone": false
},
"test_settings": {
"enabled": true,
"sample_percentage": 20,
"auto_send_winner": true,
"auto_send_winner_metric": "open_rate",
"test_duration_hours": 24,
"variations": [
{
"template_id": "template_variant_a",
"variation_name": "Variation A",
"metrics": {
"recipients": 123,
"delivered": 123,
"opens": 123,
"clicks": 123,
"bounced": 123,
"complained": 123,
"unsubscribed": 123
},
"template": {}
}
]
},
"utm_parameters": {
"source": "newsletter",
"medium": "email",
"campaign": "spring_2024",
"term": "<string>",
"content": "<string>"
},
"data_feed": {
"global_feed": {
"enabled": true,
"url": "https://api.example.com/broadcast-data",
"headers": [
{
"name": "Authorization",
"value": "Bearer token123"
}
]
},
"global_feed_data": {},
"global_feed_fetched_at": "2023-11-07T05:31:56Z",
"recipient_feed": {
"enabled": true,
"url": "https://api.example.com/recipient-data",
"headers": [
{
"name": "Authorization",
"value": "Bearer token123"
}
]
}
},
"metadata": {},
"winning_template": "template_winner",
"test_sent_at": "2023-11-07T05:31:56Z",
"winner_sent_at": "2023-11-07T05:31:56Z",
"enqueued_count": 1000,
"test_phase_recipient_count": 123,
"winner_phase_recipient_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"paused_at": "2023-11-07T05:31:56Z",
"pause_reason": "<string>"
}
}{
"error": "cannot update broadcast with status: sending"
}{
"error": "<string>"
}{
"error": "Broadcast not found"
}{
"error": "<string>"
}Authorizations
API token for authentication
Body
application/json
The ID of the workspace
Example:
"ws_1234567890"
ID of the broadcast to update
Example:
"broadcast_12345"
Name of the broadcast
Maximum string length:
255Example:
"Spring Newsletter 2024"
Show child attributes
Show child attributes
Schedule settings for a broadcast. Note: When a broadcast is first created, these fields are empty/false. Use the /api/broadcasts.schedule endpoint to configure scheduling.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Enable click and open tracking
Example:
true
Show child attributes
Show child attributes
Configuration for external data feeds
Show child attributes
Show child attributes
Custom metadata for the broadcast
Response
Broadcast updated successfully
Show child attributes
Show child attributes
⌘I
