API referenceBroadcasts

Validate and send (or schedule) a draft broadcast

POST
/v1/broadcasts/{id}/send

Only callable from draft (else 409 not_draft). Requires a non-empty subject, a non-empty body_html or body_text, a target that still resolves, and a verified from_domain_id. Computes a best-effort total_recipients snapshot, then sets status = scheduled (if scheduled_at is in the future) or status = sending (the fan-out cron picks it up on its next per-minute tick — this call does not enqueue anything itself).

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key sent as Authorization: Bearer <key>. Looked up by SHA-256 hash (email_core::sha256_hex) against api_keys.hash; revoked keys and keys belonging to a suspended tenant are rejected. See the top-level Authentication section for permission levels.

Path Parameters

id*string

Request Body

application/json
  1. body
scheduled_at?integer

Epoch milliseconds. Omitted or in the past → send now.

Formatint64

Response Body

Transitioned to scheduled or sending.

application/json
  1. response
id?string
name?string
subject?string
from_domain_id?string|null
body_html?string|null
body_text?string|null
target_kind?|
Value in"audience""segment"null
target_id?string|null
status?string
Value in"draft""scheduled""sending""paused""sent""cancelled"
scheduled_at?|
Formatint64
total_recipients?integer

A best-effort snapshot computed at send time (audience member count, or a segment's live match count).

sent_count?integer

Advanced by the fan-out cron as recipients are enqueued.

created_at?integer
Formatint64
updated_at?integer
Formatint64
sent_at?|
Formatint64
curl -X POST "https://example.com/v1/broadcasts/string/send" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "name": "string",  "subject": "string",  "from_domain_id": "string",  "body_html": "string",  "body_text": "string",  "target_kind": "audience",  "target_id": "string",  "status": "draft",  "scheduled_at": 0,  "total_recipients": 0,  "sent_count": 0,  "created_at": 0,  "updated_at": 0,  "sent_at": 0}