API referenceBroadcasts

Edit a draft broadcast

PATCH
/v1/broadcasts/{id}

Only allowed while status = draft (else 409 not_editable) — editing a scheduled/sending/finished broadcast out from under the fan-out cron would be unsafe. Fields omitted from the body keep their current value; target_kind/target_id are re-validated only when this request touches either of them.

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
name?string
subject?string
from_domain_id?string
body_html?string
body_text?string
target_kind?string
Value in"audience""segment"
target_id?string

Response Body

Updated.

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 PATCH "https://example.com/v1/broadcasts/string" \  -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}