- OpenClaw
- Claude (via tools/function calling, computer use, or MCP)
- Replit agents
- Lovable (worked example)
- Viktor
- Custom agents built on OpenAI, Anthropic, Google, or open-source LLMs
How it works
Agents talk to Brew through Brew’s REST API. The same endpoints that power the Brew app are available to your agent, there’s no separate “agent API.” Your agent gets:- An API key from Brew (Settings → API)
- The OpenAPI spec from the API Reference tab
- The right scopes for what it needs (read contacts, create automations, send emails, etc.)
| Capability | How |
|---|---|
| Define a custom event trigger | POST /v1/triggers (no provider field — server hardcodes brew_api) |
| Generate an email body | POST /v1/emails with a prompt + required emailType (campaign | automation | transactional) |
| Create or update contacts | POST /v1/contacts (single OR batch — up to 1000 rows per request) |
| Author + publish an automation graph | POST /v1/automations → PATCH /v1/automations { automationId, published: true } |
| Fire an automation run on a real event | POST /v1/automation/runs with { triggerEventId, payload, idempotencyKey } |
| Inspect a run + per-node logs | GET /v1/automation/runs?automationRunId=…&include=logs |
| Send a one-shot audience campaign | POST /v1/sends (audienceId is required — campaign-only) |
| Discover saved audiences / verified domains | GET /v1/audiences, GET /v1/domains |
Brand creation and analytics queries are not part of the public v1 API. Brands are managed in the dashboard (one brand per API key); analytics live on the dashboard at brew.new/analytics. The fire branch ofSee the API Reference for the full contract, the agentic cookbook for end-to-end recipes, andPOST /v1/automation/runsauto-upserts the contact derived from the trigger payload, so most agent use cases don’t need to callPOST /v1/contactsseparately.
https://brew.new/api/v1/llms.txt for
the machine-discoverable agent operations guide.
Pattern: function-calling agent
Most modern agents support tool/function calling. Wire Brew’s API into your agent’s tool definitions and the agent picks the right call based on the user’s request. A typical setup:- Define each Brew endpoint as a tool in your agent’s tool registry
- Provide auth headers using your Brew API key
- Let the agent call the right tool, generating an email, sending it, building an automation, based on conversation
Pattern: backend trigger
If your agent runs on a backend (Replit, Lovable’s Edge Functions, your own API), wire it to call Brew’s trigger endpoints when events happen in your app:- New user signs up → trigger your
user_signupevent in Brew - Customer abandons cart → trigger
cart_abandoned - Payment fails → trigger
payment_failed
Pattern: chat-driven brand and email creation
Some agents (Lovable, Viktor) generate full apps and need to ship email as part of the build. Brew handles this too:- User connects their brand in the Brew dashboard (one-time setup that produces an API key bound to that brand)
- Agent generates transactional and welcome emails (
POST /v1/emails { prompt, emailType: 'transactional' }) - Agent assembles an automation graph (
POST /v1/automations { name, triggerEventId, nodes, connections }) and publishes it (PATCH /v1/automations { automationId, published: true }) - Agent wires the user’s app backend to fire the trigger from the real event:
POST /v1/automation/runs { triggerEventId, payload, idempotencyKey }
Authentication
Every API request needs an API key in the header:What to read next
API Reference
Full endpoint reference, authentication, and code examples.
Lovable
Worked example using Brew API from a Lovable app via Supabase Edge Functions.
Automations
Build flows and configure the trigger events your agent will fire.
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:- Self-Service Tools
- Talk to Our Team
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.