Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.brew.new/llms.txt

Use this file to discover all available pages before exploring further.

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
Extract a brandPOST /v1/brands with a domain
Generate an emailPOST /v1/emails with a prompt
Create or update contactsPOST /v1/contacts
Build an audiencePOST /v1/audiences
Trigger an automationPOST /v1/triggers/{eventId}/events
Send an emailPOST /v1/sends
Read analyticsGET /v1/analytics
See the API Reference for the full contract.

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. Agent extracts the user’s brand into Brew (POST /v1/brands)
  2. Agent generates transactional and welcome emails (POST /v1/emails)
  3. Agent wires the user’s app backend to trigger Brew sends
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.