Skip to main content
Brew is the first AI-native ESP. The product is built so any AI agent that can call an HTTP API can drive Brew end-to-end, extracting brands, generating emails, creating automations, sending, and tracking results. This works today with any agent platform that supports HTTP tool-calling, including:
  • 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.)
From there, the agent can:
CapabilityHow
Define a custom event triggerPOST /v1/triggers (no provider field — server hardcodes brew_api)
Generate an email bodyPOST /v1/emails with a prompt + required emailType (campaign | automation | transactional)
Create or update contactsPOST /v1/contacts (single OR batch — up to 1000 rows per request)
Author + publish an automation graphPOST /v1/automationsPATCH /v1/automations { automationId, published: true }
Fire an automation run on a real eventPOST /v1/automation/runs with { triggerEventId, payload, idempotencyKey }
Inspect a run + per-node logsGET /v1/automation/runs?automationRunId=…&include=logs
Send a one-shot audience campaignPOST /v1/sends (audienceId is required — campaign-only)
Discover saved audiences / verified domainsGET /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 of POST /v1/automation/runs auto-upserts the contact derived from the trigger payload, so most agent use cases don’t need to call POST /v1/contacts separately.
See the API Reference for the full contract, the agentic cookbook for end-to-end recipes, and 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:
  1. Define each Brew endpoint as a tool in your agent’s tool registry
  2. Provide auth headers using your Brew API key
  3. Let the agent call the right tool, generating an email, sending it, building an automation, based on conversation
Your agent’s user can now say “Send a welcome email to the new signups from yesterday” and the agent figures out: pull the contacts, generate the email, send.

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_signup event in Brew
  • Customer abandons cart → trigger cart_abandoned
  • Payment fails → trigger payment_failed
The agent doesn’t have to be in the loop for every send. It just sets up the automations once, and Brew fires them automatically.

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:
  1. User connects their brand in the Brew dashboard (one-time setup that produces an API key bound to that brand)
  2. Agent generates transactional and welcome emails (POST /v1/emails { prompt, emailType: 'transactional' })
  3. Agent assembles an automation graph (POST /v1/automations { name, triggerEventId, nodes, connections }) and publishes it (PATCH /v1/automations { automationId, published: true })
  4. Agent wires the user’s app backend to fire the trigger from the real event: POST /v1/automation/runs { triggerEventId, payload, idempotencyKey }
The user gets fully on-brand email behavior in their app without ever opening Brew directly.

Authentication

Every API request needs an API key in the header:
X-API-Key: brew_YOUR_API_KEY
Or:
Authorization: Bearer brew_YOUR_API_KEY
Create keys under Settings → API in Brew. Each key is scoped to a brand.

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:

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.