curl -X PATCH 'https://api.nuntly.com/broadcasts/bc_01kabn43yqyxn2bx4ve84mczd3' \
-H 'Authorization: Bearer ntly_xxx' \
-H 'Content-Type: application/json' \
-d '{"name":"October newsletter"}'import { Nuntly } from '@nuntly/sdk';
const client = new Nuntly({
apiKey: process.env['NUNTLY_API_KEY'],
});
const response = await client.broadcasts.update('bc_01kabn43yqyxn2bx4ve84mczd3', {
name: 'October newsletter',
});import com.nuntly.sdk.Nuntly;
import com.nuntly.sdk.ClientOptions;
import com.nuntly.sdk.models.*;
var nuntly = Nuntly.create(ClientOptions.builder()
.apiKey(System.getenv("NUNTLY_API_KEY"))
.build());
var response = nuntly.broadcasts().update("bc_01kabn43yqyxn2bx4ve84mczd3", UpdateBroadcastRequest.builder()
.name("October newsletter")
.build());import requests
url = "https://api.nuntly.com/broadcasts/{broadcastId}"
payload = {
"templateId": "tpl_01kabn43yqyxn2bx4ve84mczd3",
"from": "Tomlinson AI <ray@info.tomlinson.ai>",
"name": "October newsletter",
"subject": "Verify your email address",
"replyTo": "support@company.com",
"topicId": "tpc_01kabn43yqyxn2bx4ve84mczd3",
"segmentId": "seg_01kabn43yqyxn2bx4ve84mczd3",
"variables": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nuntly.com/broadcasts/{broadcastId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'templateId' => 'tpl_01kabn43yqyxn2bx4ve84mczd3',
'from' => 'Tomlinson AI <ray@info.tomlinson.ai>',
'name' => 'October newsletter',
'subject' => 'Verify your email address',
'replyTo' => 'support@company.com',
'topicId' => 'tpc_01kabn43yqyxn2bx4ve84mczd3',
'segmentId' => 'seg_01kabn43yqyxn2bx4ve84mczd3',
'variables' => [
]
]),
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.nuntly.com/broadcasts/{broadcastId}"
payload := strings.NewReader("{\n \"templateId\": \"tpl_01kabn43yqyxn2bx4ve84mczd3\",\n \"from\": \"Tomlinson AI <ray@info.tomlinson.ai>\",\n \"name\": \"October newsletter\",\n \"subject\": \"Verify your email address\",\n \"replyTo\": \"support@company.com\",\n \"topicId\": \"tpc_01kabn43yqyxn2bx4ve84mczd3\",\n \"segmentId\": \"seg_01kabn43yqyxn2bx4ve84mczd3\",\n \"variables\": {}\n}")
req, _ := http.NewRequest("PATCH", 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))
}require 'uri'
require 'net/http'
url = URI("https://api.nuntly.com/broadcasts/{broadcastId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"templateId\": \"tpl_01kabn43yqyxn2bx4ve84mczd3\",\n \"from\": \"Tomlinson AI <ray@info.tomlinson.ai>\",\n \"name\": \"October newsletter\",\n \"subject\": \"Verify your email address\",\n \"replyTo\": \"support@company.com\",\n \"topicId\": \"tpc_01kabn43yqyxn2bx4ve84mczd3\",\n \"segmentId\": \"seg_01kabn43yqyxn2bx4ve84mczd3\",\n \"variables\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>"
}
}{
"error": {
"status": 123,
"code": "<string>",
"title": "<string>",
"details": {}
}
}Update Broadcast
Edit a draft or scheduled broadcast.
curl -X PATCH 'https://api.nuntly.com/broadcasts/bc_01kabn43yqyxn2bx4ve84mczd3' \
-H 'Authorization: Bearer ntly_xxx' \
-H 'Content-Type: application/json' \
-d '{"name":"October newsletter"}'import { Nuntly } from '@nuntly/sdk';
const client = new Nuntly({
apiKey: process.env['NUNTLY_API_KEY'],
});
const response = await client.broadcasts.update('bc_01kabn43yqyxn2bx4ve84mczd3', {
name: 'October newsletter',
});import com.nuntly.sdk.Nuntly;
import com.nuntly.sdk.ClientOptions;
import com.nuntly.sdk.models.*;
var nuntly = Nuntly.create(ClientOptions.builder()
.apiKey(System.getenv("NUNTLY_API_KEY"))
.build());
var response = nuntly.broadcasts().update("bc_01kabn43yqyxn2bx4ve84mczd3", UpdateBroadcastRequest.builder()
.name("October newsletter")
.build());import requests
url = "https://api.nuntly.com/broadcasts/{broadcastId}"
payload = {
"templateId": "tpl_01kabn43yqyxn2bx4ve84mczd3",
"from": "Tomlinson AI <ray@info.tomlinson.ai>",
"name": "October newsletter",
"subject": "Verify your email address",
"replyTo": "support@company.com",
"topicId": "tpc_01kabn43yqyxn2bx4ve84mczd3",
"segmentId": "seg_01kabn43yqyxn2bx4ve84mczd3",
"variables": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nuntly.com/broadcasts/{broadcastId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'templateId' => 'tpl_01kabn43yqyxn2bx4ve84mczd3',
'from' => 'Tomlinson AI <ray@info.tomlinson.ai>',
'name' => 'October newsletter',
'subject' => 'Verify your email address',
'replyTo' => 'support@company.com',
'topicId' => 'tpc_01kabn43yqyxn2bx4ve84mczd3',
'segmentId' => 'seg_01kabn43yqyxn2bx4ve84mczd3',
'variables' => [
]
]),
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.nuntly.com/broadcasts/{broadcastId}"
payload := strings.NewReader("{\n \"templateId\": \"tpl_01kabn43yqyxn2bx4ve84mczd3\",\n \"from\": \"Tomlinson AI <ray@info.tomlinson.ai>\",\n \"name\": \"October newsletter\",\n \"subject\": \"Verify your email address\",\n \"replyTo\": \"support@company.com\",\n \"topicId\": \"tpc_01kabn43yqyxn2bx4ve84mczd3\",\n \"segmentId\": \"seg_01kabn43yqyxn2bx4ve84mczd3\",\n \"variables\": {}\n}")
req, _ := http.NewRequest("PATCH", 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))
}require 'uri'
require 'net/http'
url = URI("https://api.nuntly.com/broadcasts/{broadcastId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"templateId\": \"tpl_01kabn43yqyxn2bx4ve84mczd3\",\n \"from\": \"Tomlinson AI <ray@info.tomlinson.ai>\",\n \"name\": \"October newsletter\",\n \"subject\": \"Verify your email address\",\n \"replyTo\": \"support@company.com\",\n \"topicId\": \"tpc_01kabn43yqyxn2bx4ve84mczd3\",\n \"segmentId\": \"seg_01kabn43yqyxn2bx4ve84mczd3\",\n \"variables\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>"
}
}{
"error": {
"status": 123,
"code": "<string>",
"title": "<string>",
"details": {}
}
}Authorizations
Use an API key from https://nuntly.com/api-keys. Required on every endpoint.
Path Parameters
Body
Set to null to detach the template.
"tpl_01kabn43yqyxn2bx4ve84mczd3"
The sender address, on a verified domain.
"Tomlinson AI <ray@info.tomlinson.ai>"
Set to null to remove the name.
"October newsletter"
Set to null to fall back to the template version’s subject.
"Verify your email address"
The email address where replies should be sent. If a recipient replies, the response will go to this address instead of the sender's email address
"support@company.com"
Set to null to remove the topic.
"tpc_01kabn43yqyxn2bx4ve84mczd3"
Set to null to remove the segment.
"seg_01kabn43yqyxn2bx4ve84mczd3"
Replaces the stored values. Send {} to clear them.
Show child attributes
Show child attributes
Only draft is accepted.
draft, scheduled, queued, sending, sent, paused, failed Response
Successful response.
Show child attributes
Show child attributes
