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.

The official Brew SDK is TypeScript-first (@brew.new/sdk). For every other language — Python, Go, Ruby, Java, PHP, Swift, Kotlin, .NET, Rust, Elixir — generate your own client from the canonical OpenAPI 3.1 spec. The same spec powers Brew’s TypeScript SDK and the generated API reference pages, so the contract is guaranteed in sync.

The OpenAPI spec

URLUse when
https://brew.new/openapi/public-api-v1.yamlPulling from the API host (recommended — always matches the live deploy).
https://docs.brew.new/api-reference/openapi-public-v1.yamlPulling from the docs site (Mintlify CDN).
Both URLs serve the same bytes — the docs URL is a mirror. The spec covers every public v1 endpoint (triggers, automations, automation runs, emails, sends, contacts, fields, audiences, domains, templates) with request schemas, response schemas, error envelopes, rate-limit + idempotency headers, and per-route examples. The OpenAPI ecosystem has several mature generators. We don’t endorse a single one — pick what fits your stack.
The reference open-source generator. Supports ~50 client targets.
# One-time install (Java is required)
brew install openapi-generator

# Python
openapi-generator generate \
  -i https://brew.new/openapi/public-api-v1.yaml \
  -g python \
  -o ./brew-python-sdk \
  --additional-properties=packageName=brew_sdk

# Go
openapi-generator generate \
  -i https://brew.new/openapi/public-api-v1.yaml \
  -g go \
  -o ./brew-go-sdk \
  --additional-properties=packageName=brew

# Ruby
openapi-generator generate \
  -i https://brew.new/openapi/public-api-v1.yaml \
  -g ruby \
  -o ./brew-ruby-sdk \
  --additional-properties=gemName=brew_sdk
Every other supported language — Java, PHP, C#, Swift, Kotlin, Rust, Elixir, Dart — uses the same shape: change the -g target.

Auth + headers in generated clients

Every generator emits a configurable client. Wire the API key into the Authorization header. Most generators have a one-call helper:
GeneratorAuth setup (Python example)
openapi-generatorconfiguration = brew_sdk.Configuration(access_token=os.environ['BREW_API_KEY'])
Speakeasyclient = Brew(security=brew.Security(bearer_auth=os.environ['BREW_API_KEY']))
Fernclient = BrewClient(token=os.environ['BREW_API_KEY'])
The spec declares two security schemes — bearerAuth (preferred) and apiKeyAuth (the X-API-Key form). Pick whichever your generator surfaces more cleanly.

What to wire up in your generated client

Beyond the call shape, a production-ready Brew client should:
  • Honor X-RateLimit-Remaining and Retry-After — see Rate limits for the cookbook.
  • Set Idempotency-Key on retried POSTs — see Idempotency.
  • Surface x-request-id on every error so customers can include it in support tickets — see Response headers.
  • Branch error logic on error.code (stable) not error.message (human-readable) — see Errors.
  • Use the BrewApiError envelope — every non-2xx response carries { error: { code, type, message, suggestion, docs, retryAfter?, param?, details? } }.
The TypeScript SDK does all of this automatically — port the patterns over.

Pinning to a spec version

The OpenAPI spec is versioned via the v1 prefix on every path (/v1/...). When we break compatibility, we’ll mint /v2/... paths AND publish a new spec at public-api-v2.yaml; the v1 spec will stay at the same URL. For a more reproducible build, pin to a copy of the spec checked into your repo:
curl -fsSL https://brew.new/openapi/public-api-v1.yaml > vendor/brew-openapi-v1.yaml
# then point your generator at vendor/brew-openapi-v1.yaml
Re-pull periodically (e.g. via CI) to pick up new endpoints + new examples.

Contributing back

If you publish a generator config / template that produces an idiomatic Brew client in $YOUR_LANGUAGE, link it from the changelog or open an issue — we’ll happily mention it as a community SDK.

See also

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.