Sends a newsletter through Sparkpost immediately. Stamps date_sent + sent=true on the persisted document. Seamless flow: call with just `id` once the draft has subject, recipients, viewport_data, and reply_to_email set. The server pulls those fields from the persisted doc and renders viewport_data → HTML server-side if no body is already rendered. Only pass subject/senderName/replyToEmail/recipients/html/attachments when you explicitly need to override the persisted values for this one send. The Sparkpost API must be configured server-side; calls return 503 when SPARKPOST_API_KEY is unset.
AuthorizationRequiredBearer <token>API key as Bearer token
In: header
application/jsonRequiredhtmlstringPre-rendered HTML body. Usually omitted — the server renders viewport_data automatically if no body is persisted. Supply only when you need to override the persisted body for this one send.
subjectstringOverride the persisted subject for this send. Newlines are stripped server-side.
senderNamestringOverride the persisted display_name on the From line.
replyToEmailstringOverride the persisted reply_to_email.
recipientsarray<string>Override the persisted recipient list. Typo-domain addresses are stripped server-side.
attachmentsarray<object>Override the persisted attachments. URLs are downloaded and base64-encoded before transmission to Sparkpost.
idRequiredstringNewsletter id, discoverable via list_newsletters
Delete Newsletter
Permanently deletes a newsletter. No soft-delete; the row is removed.
Schedule Newsletter
Schedules a newsletter for future delivery. Stamps sent=true, date_sent=<sendAt>, and a server-rendered body on the newsletter, then enqueues a Firestore trigger row that fires the actual Sparkpost transmission at sendAt. Does NOT call Sparkpost itself — that happens at fire time. Preconditions checked before scheduling: - Newsletter exists and is owned by the caller's workspace - sendAt is strictly in the future - Newsletter has a non-empty subject - Newsletter has at least one recipient - Newsletter has viewport_data (or a previously-rendered body) — the server renders viewport_data to HTML and persists it as body for the trigger to consume. For immediate transmission, use send_newsletter instead.