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

NameTypeRequiredNotes
Idempotency-KeystringYesAt most 128 characters.

Request body

NameTypeRequiredNotes
audienceIdstringYesThe ID of an audience.
namestringYesA name you choose. At most 200 characters.
fromstringYesSender address, optionally with a display name: Acme <hello@acme.com>. Email address. At most 320 characters.
replyTostring or nullNoThe address replies go to, when it is not the sender.
templateIdstringYesThe ID of a saved template.
localizedTemplatesobjectNoTemplate 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.
valuesobjectNoTemplate variables, such as { "first_name": "Ada" }.
segmentobject or nullNoNarrows the audience to contacts whose attributes match. Leave it out for every confirmed contact.
abTestobject or nullNoAn A/B test of 2 to 4 variants. Leave it out to send one version.
maxRecipientsintegerYesThe 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

NameTypeRequiredNotes
cursorstringNo
limitintegerNoFrom 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

NameTypeRequiredNotes
broadcastIdstringYes
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

NameTypeRequiredNotes
broadcastIdstringYes

Request body

NameTypeRequiredNotes
audienceIdstringNoThe ID of an audience.
namestringNoA name you choose. At most 200 characters.
fromstringNoSender address, optionally with a display name: Acme <hello@acme.com>. Email address. At most 320 characters.
replyTostring or nullNoThe address replies go to, when it is not the sender.
templateIdstringNoThe ID of a saved template.
localizedTemplatesobjectNoTemplate 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.
valuesobjectNoTemplate variables, such as { "first_name": "Ada" }.
segmentobject or nullNoNarrows the audience to contacts whose attributes match. Leave it out for every confirmed contact.
abTestobject or nullNoAn A/B test of 2 to 4 variants. Leave it out to send one version.
maxRecipientsintegerNoThe 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

NameTypeRequiredNotes
broadcastIdstringYes

Headers

NameTypeRequiredNotes
Idempotency-KeystringYesAt most 128 characters.

Request body

NameTypeRequiredNotes
scheduledAtstringNoWhen 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

NameTypeRequiredNotes
broadcastIdstringYes

Request body

NameTypeRequiredNotes
contactIdstringNoThe ID of a contact.
localestringNoBCP 47 language tag such as en, sk or en-GB. At most 16 characters.
variantstringNoThe 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

NameTypeRequiredNotes
broadcastIdstringYes

Headers

NameTypeRequiredNotes
Idempotency-KeystringYesAt most 128 characters.

Request body

NameTypeRequiredNotes
tostring[]YesRecipient addresses. At most 5 items.
localestringNoBCP 47 language tag such as en, sk or en-GB. At most 16 characters.
variantstringNoThe 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

NameTypeRequiredNotes
broadcastIdstringYes
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

NameTypeRequiredNotes
broadcastIdstringYes
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

NameTypeRequiredNotes
broadcastIdstringYes
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

NameTypeRequiredNotes
broadcastIdstringYes
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

NameTypeRequiredNotes
broadcastIdstringYes

Query parameters

NameTypeRequiredNotes
cursorstringNo
limitintegerNoFrom 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

NameTypeRequiredNotes
broadcastIdstringYes
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

NameTypeRequiredNotes
broadcastIdstringYes
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

NameTypeRequiredNotes
broadcastIdstringYes

Request body

NameTypeRequiredNotes
variantstringNoThe 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"
  }'