Skip to main content

Create the Client

Get an API key from brew.new/settings/api. Each key is bound to one brand at creation. Pick the brand you want this client to act on before generating.

1. Upsert a Contact

created: false means the contact already existed and was updated. Both outcomes are successful.

2. Browse Public Templates (Optional)

Templates are public reference emails. Pass any one as referenceEmailId to email generation when you want to anchor the output on its layout. Your own brand design context is automatic: every API key is bound to one brand at creation, and brew.emails.generate grounds itself in that brand without you ever passing a brandId.

3. Generate an Email

4. Edit a Saved Email (Optional)

brew.emails.edit runs the agent against an existing email’s current latest version and persists a new version: "latest" row on the same emailId, demoting the previous head to a numeric historical version.
The brand is resolved from the API key. The emailId is a path parameter, so neither brandId nor emailId may appear in the body.

4b. Import an Existing Email (Optional)

Already have HTML or react-email JSX? brew.emails.import ingests it into an editable Brew design, and external images are re-hosted on the CDN. It is usage-metered.

5. List Verified Domains

6. Send an Email

brew.emails.send(...) delivers a design to a target (a saved brand-owned audienceId, an inline to list of up to 50 addresses, or a single address) via a verified domain. It is not campaign-specific: send the same design as many times as you like. For per-recipient event-driven delivery (welcome flows, drip campaigns, transactional fires) chain brew.automations.triggers.fire(...) against a published automation graph instead (see the cookbook). Audience send example:
Scheduled send example (pin to a specific email version with emailVersionId):
QA a design before the blast with the same send method. Pass test: true and a single to address. It delivers synchronously from the Brew sender (no verified domain or audience needed) and returns { status: 'sent', recipient }:

Handle Errors

Next Steps

Resource Surface

See the current TypeScript SDK resources and methods.

API Reference

See the raw HTTP contract behind the SDK.

Need help?

Our team is ready to support you at every step of your journey with Brew. Choose the option that works best for you:

Search Documentation

Type in the “Ask any question” search bar at the top left to instantly find relevant documentation pages.

ChatGPT/Claude Integration

Click “Open in ChatGPT” at the top right of any page to analyze documentation with ChatGPT or Claude for deeper insights.