Send an email
Sends an email design. Polymorphic on test / transactionId:
test: true→ a synchronous one-off TEST delivery of the design’s current (or pinned) body to a single address, with a[TEST]subject prefix. Sends from the Brew default sender unless a verified org-owneddomainIdis supplied (fromEmail/senderNamecustomize it; an unverified/foreign domain is rejected, never downgraded). Optionalvariablessupply example values for{{ var | fallback }}merge tags — a value wins over the declared fallback. Targets onetoaddress and never creates aSendrow. Returns200{ status: "sent", recipient }.transactionId→ fire a reusable transactional email object. Domain and design are locked on the object;to(1–50) is required; optionalpayloadsupplies merge-tag values. Optional envelope overrides:replyTo,senderName,fromEmail,subject,previewText. Creates asendsrow withkind: transactional. Returns202{ sendId, runId }. Prefer this over leftover inlineemailId+domainId+toon a transactional domain.- default /
test: false→ a campaign send combining the design (emailId, optionally pinned toemailVersionId), a verifieddomainId, and a target — a savedaudienceIdOR inlineto(a single email or an array, max 50) — into one delivery event. The same design can be sent unlimited times; every call mints a new send. Returns202{ sendId, runId }— poll viaGET /v1/analytics/sends?sendId=.
Campaign target — provide EXACTLY ONE of audienceId or to. Inline recipients face the same unsubscribe/suppression gate and per-recipient quota as audience sends. For per-recipient event-driven delivery, publish an automation and fire its trigger (POST /v1/automations/triggers/{triggerEventId}/fire).
Brand scoping: resources (emailId, domainId, audienceId) living in a different brand surface as 404 so the API never confirms cross-brand existence.
Authorizations
Send your Brew API key as Authorization: Bearer brew_xxx.
Headers
Optional idempotency key for safe retries. Reusing the same key with the same request body returns the original response for 24 hours.
1 - 100The brand this request acts on. REQUIRED for organization-scoped credentials (otherwise 400 BRAND_ID_REQUIRED — there is no default brand); list ids with GET /v1/brands. Brand-scoped credentials may omit it, and sending a different brand returns 403 BRAND_SCOPE_MISMATCH. A brand outside your organization returns 404 BRAND_NOT_FOUND.
1 - 64Body
- Option 1
- Option 2
- Option 3
true 111Inbox preheader for this test send — overrides the design's JSX . Omit to deliver the design's own preview line.
200OPTIONAL verified sending domain for this test. Omit for the Brew default sender (hello@email.brew.new). Must be a verified domain owned by this org/brand — an unverified or foreign domain is rejected (404/422), never silently downgraded to the Brew default.
11 - 1281 - 64Example values for {{ var | fallback }} merge tags in the subject, previewText, and body. A supplied value wins over contact fields and the declared fallback; undefined variables render their fallback (or empty). Max 25 entries; keys must match the merge-tag grammar (letter/_/$ start, then word chars/dots/$, max 64 chars); values max 256 chars.
Nested JSON template data for Liquid-mode designs, exposed as trigger.* / payload.*. Flat variables still resolve legacy {{ tag | fallback }} merge tags; send both if a design mixes syntaxes. Live-fire parity on non-Liquid workspaces: scalar keys resolve merge tags (below variables) and nested values are rejected with a 400.