Schedule a broadcast
curl --request POST \
--url https://{notifuseDomain}/api/broadcasts.schedule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_id": "ws_1234567890",
"id": "broadcast_12345",
"send_now": false,
"scheduled_date": "2024-03-15",
"scheduled_time": "10:30",
"timezone": "America/New_York",
"use_recipient_timezone": false
}
'import requests
url = "https://{notifuseDomain}/api/broadcasts.schedule"
payload = {
"workspace_id": "ws_1234567890",
"id": "broadcast_12345",
"send_now": False,
"scheduled_date": "2024-03-15",
"scheduled_time": "10:30",
"timezone": "America/New_York",
"use_recipient_timezone": False
}
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',
send_now: false,
scheduled_date: '2024-03-15',
scheduled_time: '10:30',
timezone: 'America/New_York',
use_recipient_timezone: false
})
};
fetch('https://{notifuseDomain}/api/broadcasts.schedule', 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.schedule",
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',
'send_now' => false,
'scheduled_date' => '2024-03-15',
'scheduled_time' => '10:30',
'timezone' => 'America/New_York',
'use_recipient_timezone' => false
]),
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.schedule"
payload := strings.NewReader("{\n \"workspace_id\": \"ws_1234567890\",\n \"id\": \"broadcast_12345\",\n \"send_now\": false,\n \"scheduled_date\": \"2024-03-15\",\n \"scheduled_time\": \"10:30\",\n \"timezone\": \"America/New_York\",\n \"use_recipient_timezone\": false\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.schedule")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": \"ws_1234567890\",\n \"id\": \"broadcast_12345\",\n \"send_now\": false,\n \"scheduled_date\": \"2024-03-15\",\n \"scheduled_time\": \"10:30\",\n \"timezone\": \"America/New_York\",\n \"use_recipient_timezone\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/broadcasts.schedule")
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 \"send_now\": false,\n \"scheduled_date\": \"2024-03-15\",\n \"scheduled_time\": \"10:30\",\n \"timezone\": \"America/New_York\",\n \"use_recipient_timezone\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"error": "scheduled_date and scheduled_time are required when not sending immediately"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Broadcasts
Schedule a broadcast
Schedules a broadcast for sending either immediately or at a specified time. This endpoint is restricted in demo mode.
POST
/
api
/
broadcasts.schedule
Schedule a broadcast
curl --request POST \
--url https://{notifuseDomain}/api/broadcasts.schedule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_id": "ws_1234567890",
"id": "broadcast_12345",
"send_now": false,
"scheduled_date": "2024-03-15",
"scheduled_time": "10:30",
"timezone": "America/New_York",
"use_recipient_timezone": false
}
'import requests
url = "https://{notifuseDomain}/api/broadcasts.schedule"
payload = {
"workspace_id": "ws_1234567890",
"id": "broadcast_12345",
"send_now": False,
"scheduled_date": "2024-03-15",
"scheduled_time": "10:30",
"timezone": "America/New_York",
"use_recipient_timezone": False
}
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',
send_now: false,
scheduled_date: '2024-03-15',
scheduled_time: '10:30',
timezone: 'America/New_York',
use_recipient_timezone: false
})
};
fetch('https://{notifuseDomain}/api/broadcasts.schedule', 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.schedule",
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',
'send_now' => false,
'scheduled_date' => '2024-03-15',
'scheduled_time' => '10:30',
'timezone' => 'America/New_York',
'use_recipient_timezone' => false
]),
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.schedule"
payload := strings.NewReader("{\n \"workspace_id\": \"ws_1234567890\",\n \"id\": \"broadcast_12345\",\n \"send_now\": false,\n \"scheduled_date\": \"2024-03-15\",\n \"scheduled_time\": \"10:30\",\n \"timezone\": \"America/New_York\",\n \"use_recipient_timezone\": false\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.schedule")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": \"ws_1234567890\",\n \"id\": \"broadcast_12345\",\n \"send_now\": false,\n \"scheduled_date\": \"2024-03-15\",\n \"scheduled_time\": \"10:30\",\n \"timezone\": \"America/New_York\",\n \"use_recipient_timezone\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/broadcasts.schedule")
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 \"send_now\": false,\n \"scheduled_date\": \"2024-03-15\",\n \"scheduled_time\": \"10:30\",\n \"timezone\": \"America/New_York\",\n \"use_recipient_timezone\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"error": "scheduled_date and scheduled_time are required when not sending immediately"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
API token for authentication
Body
application/json
The ID of the workspace
Example:
"ws_1234567890"
ID of the broadcast to schedule
Example:
"broadcast_12345"
Send immediately instead of scheduling
Example:
false
Scheduled date in YYYY-MM-DD format (required if send_now=false)
Pattern:
^\d{4}-\d{2}-\d{2}$Example:
"2024-03-15"
Scheduled time in HH:MM format (required if send_now=false)
Pattern:
^\d{2}:\d{2}$Example:
"10:30"
IANA timezone
Example:
"America/New_York"
Send at scheduled time in each recipient's timezone
Example:
false
Response
Broadcast scheduled successfully
Example:
true
⌘I
