Broadcasts API

The Broadcasts resource is the public control plane for one-off messages. This guide explains draft management, test sends, and live-send safety.

7 min read

Manage Broadcast Drafts

Broadcasts are one-off messages sent to Subscribers. The public Broadcasts API lets integrations create drafts, inspect existing Broadcasts, update their details, send test emails, and start a live send only when the Broadcast is ready.

Creating or updating a Broadcast does not send it. The broadcasts:write resource permission covers draft, test, schedule, send, stop, and delete operations. Limit the tools available to an agent when its task should use only part of that lifecycle.

Use the API to prepare Broadcasts and call the send operation only when the requested task includes contacting real Subscribers.

  1. Create the broadcast as a draft.
  2. Set the subject, preview text, body, and any required Broadcast metadata.
  3. Select or store the segment or filter rules that choose the intended subscribers, then ask a user to review the subscribers in Broadcasts before live sending.
  4. Send a test email with the test endpoint.
  5. If your integration manages approvals, record the reviewer and approval state in your own system.
  6. Call the live send endpoint only after the subscribers, content, sender, and send timing are approved.
  7. After sending, read the broadcast results from Mailrith. Do not assume the send completed instantly.
  • Create Broadcasts as drafts when you migrate messages or prepare Broadcast content.
  • Use test sends before live sends so reviewers can inspect the rendered email.
  • Use live send endpoints only after your workflow confirms the subscribers, subject, content, and compliance requirements.
  • Store the returned Broadcast ID if another system must link its records to the Mailrith Broadcast.

Endpoint Overview

Collection and item endpoints manage broadcast records. Use these endpoints to list, create, inspect, update, and delete broadcasts.

POST /v1/broadcasts/{broadcast_id}/test sends a test email to a reviewer. Use this endpoint in review workflows, but do not send test emails to large or uncontrolled lists.

GET /v1/broadcasts/{broadcast_id}/preflight checks the current Subscriber estimate, provider capacity, sender setup, and blocking issues.

POST /v1/broadcasts/{broadcast_id}/send accepts the live send asynchronously and returns 202 Accepted with a run ID. In internal tools and agent workflows, require explicit approval before calling this endpoint.

GET /v1/broadcasts/{broadcast_id}/progress returns bounded progress. GET /v1/broadcasts/{broadcast_id}/delivery-errors returns cursor-paginated permanent failures and unknown results.

POST /v1/broadcasts/{broadcast_id}/cancel requests cancellation for work that has not reached the provider. It cannot recall provider-accepted email.

GET /v1/broadcasts

List broadcasts

Returns broadcast drafts, scheduled sends, active sends, and completed sends.

View Schema
POST /v1/broadcasts

Create a broadcast

Creates a broadcast draft in the authenticated workspace.

View Schema
GET /v1/broadcasts/{broadcast_id}

Get a broadcast

Returns a broadcast draft, scheduled send, active send, or completed send.

View Schema
PUT /v1/broadcasts/{broadcast_id}

Update a broadcast

Updates an existing Broadcast draft. Scheduled, running, completed, and failed Broadcasts cannot be changed here. Before changing a scheduled Broadcast, read it by ID and retain its scheduled_at in the current task only. If the saved time is no longer safely in the future, ask the user for a new time before unscheduling. Otherwise unschedule it, apply the update, reschedule it for the same time, and verify both status and scheduled_at. If the update fails after unscheduling, restore the unchanged Broadcast to the same future time when possible. If the schedule cannot be restored, leave it as a Draft and immediately report that it will not send; never choose a replacement time without the user.

View Schema
DELETE /v1/broadcasts/{broadcast_id}

Delete a broadcast

Deletes a draft, scheduled, or failed broadcast from the authenticated workspace. Broadcasts cannot be deleted after they start sending.

View Schema
POST /v1/broadcasts/{broadcast_id}/cancel

Cancel a broadcast send

Requests cancellation for delivery work that has not reached the provider. Provider-accepted emails cannot be recalled. Repeat the same request with the same idempotency key when the response is lost.

View Schema
GET /v1/broadcasts/{broadcast_id}/delivery-errors

List broadcast delivery errors

Returns a cursor-paginated page of permanent failures and unknown delivery results.

View Schema
GET /v1/broadcasts/{broadcast_id}/preflight

Inspect broadcast readiness

Optionally checks the current Subscriber estimate, provider capacity, sender setup, event tracking, and blocking issues. This diagnostic is not required before starting a durable send.

View Schema
GET /v1/broadcasts/{broadcast_id}/progress

Get broadcast send progress

Returns bounded delivery progress, current rates, timing, outcome counts, and pause state. Poll until terminal is true; use 5 to 10 second intervals while progress changes and back off to 30 seconds when unchanged.

View Schema
PUT /v1/broadcasts/{broadcast_id}/schedule

Schedule or reschedule a broadcast

Schedules a draft for future delivery, or changes the delivery time of an existing scheduled Broadcast. This uses Mailrith's durable scheduled-send path and does not start delivery immediately.

View Schema
DELETE /v1/broadcasts/{broadcast_id}/schedule

Unschedule a broadcast

Returns a scheduled Broadcast to draft state before delivery starts.

View Schema
POST /v1/broadcasts/{broadcast_id}/send

Send a broadcast now

Immediately creates durable preparation for a broadcast draft or scheduled send. Mailrith calculates the exact Subscriber total and checks provider readiness in the background before delivery. A 202 response means the durable send was accepted, not that provider delivery is complete. Reuse the same idempotency key if the response is lost.

View Schema
POST /v1/broadcasts/{broadcast_id}/test

Send a broadcast test email

Sends a test message from an existing Broadcast that has a sender. Provide a saved Subscriber ID for personalization; use subscribers_list to find one when needed. The recipient may be any test inbox and does not have to match the saved Subscriber.

View Schema
Send A Broadcast Test Email
curl -X POST https://api.mailrith.com/v1/broadcasts/broadcast_123/test \
  -H "Authorization: Bearer mrk_example_secret_key" \
  -H "Idempotency-Key: broadcast-123-test-1" \
  -H "Content-Type: application/json" \
  -d '{
    "recipient_email": "reviewer@example.com"
  }'

Start And Poll An Asynchronous Send

A 202 Accepted response means Mailrith saved the send request and queued durable preparation. It does not mean every email was delivered or accepted by the provider. Store run_id, then poll the progress endpoint until terminal is true.

Use an Idempotency-Key on send and cancellation requests. If your connection drops before you receive the response, repeat the same method, path, body, and key. Do not create a new key for an uncertain retry.

You can call the preflight endpoint when you want a readiness diagnostic before sending. A successful check returns a short-lived send_proof, which you may pass unchanged as preflight_proof. Preflight is optional: without a valid proof, Mailrith still creates the durable run immediately, then calculates the exact Subscriber total and checks provider readiness in the background before delivery.

Poll once after 5 seconds, then use 10-second intervals while the send is changing. After several unchanged responses, increase the interval to 30 seconds. Stop when terminal is true. Always honor Retry-After after a 429 response.

Cancellation returns 202 Accepted. A status of canceling means remaining work is stopping. A status of canceled means cancellation already finished. changed says whether this request changed durable state. If recovery_pending is true, the request is saved and recovery will continue it even though the immediate Queue wake could not be sent.

  • phase describes preparing, sending, paused, canceling, sent, sent with errors, canceled, or failed work.
  • materialized is the number of prepared Subscriber deliveries. accepted is the number accepted by the provider.
  • retrying is work waiting for a safe retry. permanent_failed will not be retried automatically.
  • unknown means Mailrith cannot prove whether the provider accepted the email. Do not automatically retry unknown results.
  • provider identifies the selected email service. estimated_completion_basis is provider-quota when known quota windows are included and current-rate when the estimate uses only the current sending speed.
  • percent_complete, effective_rate, estimated_completion, pause_reason, and next_retry_at can change as provider capacity changes.
  • The compatible Broadcast status remains running while active and completed after terminal processing. Use progress phase and outcome counts for the detailed result.
  • Cancellation returns broadcast_send_not_found when no durable send exists, broadcast_cancel_finalization_started or broadcast_cancel_already_finished when the run can no longer be canceled, and broadcast_cancel_concurrent_update when another control action won the state change. Read the latest progress before deciding what to do next.
Start A Broadcast
curl -X POST https://api.mailrith.com/v1/broadcasts/broadcast_123/send \
  -H "Authorization: Bearer mrk_example_secret_key" \
  -H "Idempotency-Key: broadcast-123-send-1" \
  -H "Content-Type: application/json" \
  -d '{}'
Read Progress And Delivery Errors
curl https://api.mailrith.com/v1/broadcasts/broadcast_123/progress \
  -H "Authorization: Bearer mrk_example_secret_key"

curl "https://api.mailrith.com/v1/broadcasts/broadcast_123/delivery-errors?limit=100" \
  -H "Authorization: Bearer mrk_example_secret_key"
Request Cancellation Safely
curl -X POST https://api.mailrith.com/v1/broadcasts/broadcast_123/cancel \
  -H "Authorization: Bearer mrk_example_secret_key" \
  -H "Idempotency-Key: broadcast-123-cancel-1"

Handle Preflight, Rate, And Quota Problems

Read every blocking_issues item before starting. Each item includes a stable code, a plain-language message, and a resolution. Run preflight again after correcting the sending address or domain setup because Subscriber counts and provider capacity can change.

A send can return a conflict when the Broadcast changed after preflight. Fetch a new preflight instead of resubmitting stale proof data.

  • broadcast_provider_quota_unavailable: sending capacity could not be checked. Contact Mailrith support if retrying preflight does not resolve it.
  • broadcast_provider_production_access_required: a legacy provider account lacks production access. This is a legacy-connection code; contact support if it appears after migration to Mailrith sending.
  • broadcast_connection_unavailable: sending is unavailable for the selected address. Review Workspaces → Edit Workspace → Sending Domain, or choose an available identity from /v1/sender-identities.
  • broadcast_connection_unhealthy: Mailrith could not reach the sending service. Retry preflight later or contact support; do not submit another send.
  • broadcast_sender_unverified: the sending address or custom domain is not verified. Review the records in the Workspace’s Sending Domain section.
  • broadcast_no_recipients: no active Subscribers match the saved selection.
  • broadcast_not_sendable: the Broadcast is no longer in a state that can start a send.
  • A provider pause or quota wait during delivery appears in pause_reason and next_retry_at. Continue polling; do not create another Broadcast send.
  • A 429 response is an API request-rate limit. Wait for Retry-After; it is separate from the provider's email send rate.

Sending Safety

A Broadcast send can contact real Subscribers. Give the Broadcasts Work Profile only to workflows that need to manage the complete Broadcast lifecycle.

For a preparation-only AI workflow, restrict the client to draft and preflight tools. A credential with broadcasts:write can send without a second Mailrith approval, so the agent should confirm the selected Subscribers and run a test before it starts delivery.

When a send fails, keep the error code, Broadcast ID, and run ID in your logs. Do not retry live sends blindly. Reuse the same idempotency key when a response is lost, and never automatically retry an unknown delivery outcome.

  • Confirm that the workspace key points to the intended workspace before creating or sending Broadcasts.
  • Confirm that the subscribers or segment are correct before calling the live send endpoint.
  • Send a test to a controlled reviewer address.
  • Use a stable idempotency key for the send request, then follow the returned run until it reaches a final state.

Need Help Shipping an Integration?

Reach the Mailrith team if you need help planning a sync, validating a webhook flow, or troubleshooting a request.

Contact Mailrith

On this page

Jump to the section you need.