Skip to main content

Overview

Brew Public API v1 gives you programmatic access to the same core flows that power the product. Use it to:
  • Manage contacts and contact fields.
  • List saved audiences.
  • Create and list brands.
  • List verified sending domains.
  • Generate and list emails.
  • List public templates.
  • Start send jobs for saved emails.
The full endpoint reference in this docs site is generated from Brew’s OpenAPI source of truth. That means the human-written overview on this page explains the flow. The generated endpoint pages explain the exact request and response contract.

Base URL

https://brew.new/api
All current public endpoints are under the /v1 prefix.

Authentication

Every request needs a Brew API key. You can send it in either header:
Authorization: Bearer brew_your_api_key
X-API-Key: brew_your_api_key
Keep API keys on your server only. Do not put them in browser code.

Quick Start

1

Get an API key

In Brew, go to Settings → API and create a key.
2

Check that auth works

Use a simple read endpoint like domains:
curl -H "Authorization: Bearer brew_your_api_key" \
  https://brew.new/api/v1/domains
3

Generate an email

Create a saved email with a prompt:
curl -X POST "https://brew.new/api/v1/emails" \
  -H "Authorization: Bearer brew_your_api_key" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: email-generate-001" \
  -d '{
    "prompt": "Create a welcome email for new subscribers"
  }'
4

Send it

Use the returned emailId and one verified domainId:
curl -X POST "https://brew.new/api/v1/sends" \
  -H "Authorization: Bearer brew_your_api_key" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: send-001" \
  -d '{
    "emailId": "email_123",
    "domainId": "domain_123",
    "subject": "Welcome to Brew",
    "emails": ["user@example.com"]
  }'

How The API Fits Together

Think about the API in four parts.

Recipient Data

  • GET /v1/contacts
  • POST /v1/contacts
  • PATCH /v1/contacts
  • DELETE /v1/contacts
  • GET /v1/fields
  • POST /v1/fields
  • DELETE /v1/fields
  • GET /v1/audiences
Use these endpoints to manage contacts, custom contact fields, and saved audience groups.

Brand And Sender Identity

  • GET /v1/brands
  • POST /v1/brands
  • GET /v1/domains
Brands give the email generator design context. Domains give sends a verified sender identity.

Email Creation

  • GET /v1/emails
  • POST /v1/emails
  • GET /v1/templates
Templates are public reference emails. Emails are your org’s saved generated emails.

Delivery

  • POST /v1/sends
Sends are asynchronous. The API accepts the send job and returns a queued or scheduled result with a runId.

Current Public v1 Surface

MethodEndpointPurpose
GET/v1/contactsList contacts, count contacts, or look up one contact by email
POST/v1/contactsUpsert one or many contacts
PATCH/v1/contactsPatch a contact
DELETE/v1/contactsDelete one or many contacts
GET/v1/fieldsList contact fields
POST/v1/fieldsCreate a contact field
DELETE/v1/fieldsDelete a contact field
GET/v1/audiencesList saved audiences
GET/v1/brandsList completed brands
POST/v1/brandsCreate or reuse a brand from a URL
GET/v1/domainsList verified sending domains
GET/v1/emailsList latest saved emails
POST/v1/emailsGenerate a new email
GET/v1/templatesList public templates
POST/v1/sendsStart a send job

Idempotency

POST endpoints support idempotency with the Idempotency-Key header. Use it on:
  • POST /v1/contacts
  • POST /v1/fields
  • POST /v1/brands
  • POST /v1/emails
  • POST /v1/sends
If you retry the same request with the same key and the same body, Brew returns the original response instead of doing the work twice.

Rate Limits And Debugging Headers

Successful responses include helpful headers:
  • x-request-id
  • X-RateLimit-Limit
  • X-RateLimit-Remaining
  • X-RateLimit-Reset
When you contact support, always include the x-request-id.

TypeScript SDK

If you prefer typed wrappers over raw HTTP, Brew also ships an official TypeScript SDK.

TypeScript SDK

Use @brew.new/sdk for typed requests, retries, idempotency, and a resource-oriented client surface.

Public API v1 Reference

Browse the generated endpoint pages from the current OpenAPI spec.

Public API v1

Browse every generated endpoint page from the current OpenAPI spec.

SDK Overview

Start with the official TypeScript 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.