Reference
Broadcasts API
Create, preview, test, send, schedule, pause, and report on broadcasts.
On this page
Every request needs Authorization: Bearer with an API key. Errors use the shapes and codes in Errors and retry decisions. The OpenAPI document has the full schemas.
Create broadcast
POST /v1/broadcasts (createBroadcast)
Creates a draft newsletter email to an audience from a saved template, optionally narrowed by a segment, with a template per locale or an A/B test. A draft sends nothing: preview it, send a test copy, then call sendBroadcast.
Needs an API key with the broadcasts:write scope. Test keys are refused.
Headers
| Name | Type | Required | Notes |
|---|---|---|---|
Idempotency-Key | string | Yes | At most 128 characters. |
Request body
| Name | Type | Required | Notes |
|---|---|---|---|
audienceId | string | Yes | The ID of an audience. |
name | string | Yes | A name you choose. At most 200 characters. |
from | string | Yes | Sender address, optionally with a display name: Acme <hello@acme.com>. Email address. At most 320 characters. |
replyTo | string or null | No | The address replies go to, when it is not the sender. |
templateId | string | Yes | The ID of a saved template. |
localizedTemplates | object | No | Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId. |
values | object | No | Template variables, such as { "first_name": "Ada" }. |
segment | object or null | No | Narrows the audience to contacts whose attributes match. Leave it out for every confirmed contact. |
abTest | object or null | No | An A/B test of 2 to 4 variants. Leave it out to send one version. |
maxRecipients | integer | Yes | The most contacts this broadcast may send to. It stops sending at this number. From 1 to 100000. |
curl --request POST "https://ternwire.com/v1/broadcasts" \
--header "Authorization: Bearer $TERNWIRE_API_KEY" \
--header "Idempotency-Key: createBroadcast-001" \
--header "Content-Type: application/json" \
--data '{
"audienceId": "audience_8f3c2a1b9d0e",
"name": "string",
"from": "ada@example.com",
"templateId": "template_8f3c2a1b9d0e",
"maxRecipients": 1
}'List broadcasts
GET /v1/broadcasts (listBroadcasts)
Lists broadcasts, newest first, with their state and progress.
Needs an API key with the broadcasts:read scope.
Query parameters
| Name | Type | Required | Notes |
|---|---|---|---|
cursor | string | No | |
limit | integer | No | From 1 to 100. Default 25. |
curl --request GET "https://ternwire.com/v1/broadcasts" \
--header "Authorization: Bearer $TERNWIRE_API_KEY"Get broadcast
GET /v1/broadcasts/{broadcastId} (getBroadcast)
Progress counts each accepted copy once by its current outcome. Submitted means the provider took the copy, not that it was delivered.
Needs an API key with the broadcasts:read scope.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
broadcastId | string | Yes |
curl --request GET "https://ternwire.com/v1/broadcasts/{broadcastId}" \
--header "Authorization: Bearer $TERNWIRE_API_KEY"Update broadcast
PATCH /v1/broadcasts/{broadcastId} (updateBroadcast)
Only a draft can change.
Needs an API key with the broadcasts:write scope. Test keys are refused.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
broadcastId | string | Yes |
Request body
| Name | Type | Required | Notes |
|---|---|---|---|
audienceId | string | No | The ID of an audience. |
name | string | No | A name you choose. At most 200 characters. |
from | string | No | Sender address, optionally with a display name: Acme <hello@acme.com>. Email address. At most 320 characters. |
replyTo | string or null | No | The address replies go to, when it is not the sender. |
templateId | string | No | The ID of a saved template. |
localizedTemplates | object | No | Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId. |
values | object | No | Template variables, such as { "first_name": "Ada" }. |
segment | object or null | No | Narrows the audience to contacts whose attributes match. Leave it out for every confirmed contact. |
abTest | object or null | No | An A/B test of 2 to 4 variants. Leave it out to send one version. |
maxRecipients | integer | No | The most contacts this broadcast may send to. It stops sending at this number. From 1 to 100000. |
curl --request PATCH "https://ternwire.com/v1/broadcasts/{broadcastId}" \
--header "Authorization: Bearer $TERNWIRE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"audienceId": "audience_8f3c2a1b9d0e",
"name": "string",
"from": "ada@example.com"
}'Send broadcast
POST /v1/broadcasts/{broadcastId}/send (sendBroadcast)
Freezes the template and schedules the broadcast, or starts it now without scheduledAt. A schedule needs an explicit offset and a time from now to at most 30 days ahead. A time more than a minute in the past returns schedule_out_of_range.
Needs an API key with the broadcasts:write scope. Test keys are refused.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
broadcastId | string | Yes |
Headers
| Name | Type | Required | Notes |
|---|---|---|---|
Idempotency-Key | string | Yes | At most 128 characters. |
Request body
| Name | Type | Required | Notes |
|---|---|---|---|
scheduledAt | string | No | When it is scheduled to start, in ISO 8601 with an offset. ISO 8601 date and time. |
curl --request POST "https://ternwire.com/v1/broadcasts/{broadcastId}/send" \
--header "Authorization: Bearer $TERNWIRE_API_KEY" \
--header "Idempotency-Key: sendBroadcast-001" \
--header "Content-Type: application/json" \
--data '{
"scheduledAt": "2026-11-08T12:00:00.000Z"
}'Preview broadcast
POST /v1/broadcasts/{broadcastId}/preview (previewBroadcast)
Renders the broadcast for a sample contact without sending anything, and estimates how many contacts it would reach. Check that estimatedRecipients is within recipientLimit before sending.
Needs an API key with the broadcasts:read scope.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
broadcastId | string | Yes |
Request body
| Name | Type | Required | Notes |
|---|---|---|---|
contactId | string | No | The ID of a contact. |
locale | string | No | BCP 47 language tag such as en, sk or en-GB. At most 16 characters. |
variant | string | No | The A/B test variant, or null. At most 50 characters. |
curl --request POST "https://ternwire.com/v1/broadcasts/{broadcastId}/preview" \
--header "Authorization: Bearer $TERNWIRE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"contactId": "contact_8f3c2a1b9d0e",
"locale": "string",
"variant": "string"
}'Send broadcast test
POST /v1/broadcasts/{broadcastId}/test (sendBroadcastTest)
Sends a real, billed copy to each address. Every address must belong to a verified member of the organization.
Needs an API key with the broadcasts:write scope. Test keys are refused.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
broadcastId | string | Yes |
Headers
| Name | Type | Required | Notes |
|---|---|---|---|
Idempotency-Key | string | Yes | At most 128 characters. |
Request body
| Name | Type | Required | Notes |
|---|---|---|---|
to | string[] | Yes | Recipient addresses. At most 5 items. |
locale | string | No | BCP 47 language tag such as en, sk or en-GB. At most 16 characters. |
variant | string | No | The A/B test variant, or null. At most 50 characters. |
curl --request POST "https://ternwire.com/v1/broadcasts/{broadcastId}/test" \
--header "Authorization: Bearer $TERNWIRE_API_KEY" \
--header "Idempotency-Key: sendBroadcastTest-001" \
--header "Content-Type: application/json" \
--data '{
"to": [
"ada@example.com"
]
}'Unschedule broadcast
POST /v1/broadcasts/{broadcastId}/unschedule (unscheduleBroadcast)
Turns a scheduled broadcast back into a draft before it starts.
Needs an API key with the broadcasts:write scope. Test keys are refused.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
broadcastId | string | Yes |
curl --request POST "https://ternwire.com/v1/broadcasts/{broadcastId}/unschedule" \
--header "Authorization: Bearer $TERNWIRE_API_KEY"Pause broadcast
POST /v1/broadcasts/{broadcastId}/pause (pauseBroadcast)
Stops sending further copies of a running broadcast. Copies already accepted are still delivered. Resume it later or cancel it.
Needs an API key with the broadcasts:write scope. Test keys are refused.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
broadcastId | string | Yes |
curl --request POST "https://ternwire.com/v1/broadcasts/{broadcastId}/pause" \
--header "Authorization: Bearer $TERNWIRE_API_KEY"Resume broadcast
POST /v1/broadcasts/{broadcastId}/resume (resumeBroadcast)
Continues sending a paused broadcast to the contacts it has not reached yet.
Needs an API key with the broadcasts:write scope. Test keys are refused.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
broadcastId | string | Yes |
curl --request POST "https://ternwire.com/v1/broadcasts/{broadcastId}/resume" \
--header "Authorization: Bearer $TERNWIRE_API_KEY"Cancel broadcast
POST /v1/broadcasts/{broadcastId}/cancel (cancelBroadcast)
Ends a scheduled, running or paused broadcast for good. Copies already accepted are still delivered.
Needs an API key with the broadcasts:write scope. Test keys are refused.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
broadcastId | string | Yes |
curl --request POST "https://ternwire.com/v1/broadcasts/{broadcastId}/cancel" \
--header "Authorization: Bearer $TERNWIRE_API_KEY"List broadcast recipients
GET /v1/broadcasts/{broadcastId}/recipients (listBroadcastRecipients)
Lists the contacts a broadcast was sent to, with each copy's delivery state, one page at a time.
Needs an API key with the broadcasts:read scope.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
broadcastId | string | Yes |
Query parameters
| Name | Type | Required | Notes |
|---|---|---|---|
cursor | string | No | |
limit | integer | No | From 1 to 100. Default 25. |
curl --request GET "https://ternwire.com/v1/broadcasts/{broadcastId}/recipients" \
--header "Authorization: Bearer $TERNWIRE_API_KEY"Get broadcast engagement
GET /v1/broadcasts/{broadcastId}/engagement (getBroadcastEngagement)
Opens and clicks for a broadcast sent with tracking on. Unique counts are recipients and totals are raw events. Opens are an estimate: Apple Mail Privacy Protection and security scanners load the image or follow links without a person, and clients that block images never report an open.
Needs an API key with the broadcasts:read scope.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
broadcastId | string | Yes |
curl --request GET "https://ternwire.com/v1/broadcasts/{broadcastId}/engagement" \
--header "Authorization: Bearer $TERNWIRE_API_KEY"Get broadcastab test
GET /v1/broadcasts/{broadcastId}/ab-test (getBroadcastAbTest)
Per-variant results of an A/B test's test group and the winner once chosen. A rate is unique opens or clicks divided by accepted test copies. Opens are inflated by mail privacy proxies, so clicks are the default winner metric.
Needs an API key with the broadcasts:read scope.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
broadcastId | string | Yes |
curl --request GET "https://ternwire.com/v1/broadcasts/{broadcastId}/ab-test" \
--header "Authorization: Bearer $TERNWIRE_API_KEY"Pick broadcastab test winner
POST /v1/broadcasts/{broadcastId}/ab-test/winner (pickBroadcastAbTestWinner)
Chooses the winner while the test is running and sends it to the remainder. Name a variant to pick it, or omit variant to apply the winner metric to the results so far. Repeating the same choice returns the broadcast; a different variant after a winner is chosen is a conflict.
Needs an API key with the broadcasts:write scope. Test keys are refused.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
broadcastId | string | Yes |
Request body
| Name | Type | Required | Notes |
|---|---|---|---|
variant | string | No | The A/B test variant, or null. At most 50 characters. |
curl --request POST "https://ternwire.com/v1/broadcasts/{broadcastId}/ab-test/winner" \
--header "Authorization: Bearer $TERNWIRE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"variant": "string"
}'