Create a broadcast
curl --request POST \
--url https://{notifuseDomain}/api/broadcasts.create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_id": "ws_1234567890",
"name": "Spring Newsletter 2024",
"audience": {
"list": "newsletter",
"segments": [
"premium_users"
],
"exclude_unsubscribed": true
},
"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": {}
}
'{
"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>"
}
}Broadcasts
Create a broadcast
Creates a new broadcast campaign in draft status.
Important: Creating a broadcast does not schedule or send it. After creating the broadcast,
you must call the /api/broadcasts.schedule endpoint to schedule or send it immediately.
POST
/
api
/
broadcasts.create
Create a broadcast
curl --request POST \
--url https://{notifuseDomain}/api/broadcasts.create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_id": "ws_1234567890",
"name": "Spring Newsletter 2024",
"audience": {
"list": "newsletter",
"segments": [
"premium_users"
],
"exclude_unsubscribed": true
},
"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": {}
}
'{
"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>"
}
}Authorizations
API token for authentication
Body
application/json
The ID of the workspace
Example:
"ws_1234567890"
Name of the broadcast
Maximum string length:
255Example:
"Spring Newsletter 2024"
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 created successfully
Show child attributes
Show child attributes
⌘I
