Brew’s REST API lets you manage contacts, trigger automations, and send transactional emails
Brew’s REST API gives you secure, programmatic access to core email marketing features. Use the API to:
The API is designed for easy integration with your backend, CRM, or internal tools. All API endpoints are secured with HTTPS and use Bearer token authentication.
Get up and running in under 5 minutes:
Get your API key
In Brew, go to Settings → API and click Generate Key. Give it a descriptive name like “Production App”. All API requests require authentication using your API key as a Bearer token:
Keep your API key secure. Never share it publicly or use it in client-side code. Store it in environment variables and never commit API keys to version control.
Test your connection
Start building
Explore the API endpoints and build your integration. Send your first transactional email, create contacts, or trigger automations.
Base URL: https://api.getbrew.ai/v1
All requests must include an Authorization
header with your API key:
Brew’s API follows REST conventions using standard HTTP methods:
All requests must be made over HTTPS. We do not support HTTP.
Working with email addresses in URLs: When using email addresses in URL paths (like when deleting or updating contacts), remember to URI-encode them. Replace @
with %40
. For example: [email protected]
becomes user%40example.com
.
Send password resets, order confirmations, and other triggered emails:
Response:
Send password resets, order confirmations, and other triggered emails:
Response:
Send events to trigger automations and update contact data:
Response:
Add contacts to your audience with custom properties:
Response:
Remove contacts from your audience:
Response:
Brew supports custom contact properties to store additional data for segmentation and personalization. Add custom properties as top-level fields in your contact requests.
For detailed information about creating and managing custom properties, including supported data types and examples, see our Custom Properties documentation.
Brew enforces 10 requests per second per account. Every response includes rate limit headers:
x-ratelimit-limit
: Max requests per secondx-ratelimit-remaining
: Requests left in current windowx-ratelimit-reset
: When your limit resets (Unix timestamp)Example response headers:
If you exceed the limit (429 response), implement retries with exponential backoff.
Brew uses standard HTTP status codes with consistent error responses:
Status | Description |
---|---|
200 | Success |
400 | Bad request |
401 | Invalid API key |
404 | Resource not found |
409 | Conflict (duplicate) |
429 | Rate limit exceeded |
500 | Server error |
Error response format:
When you receive errors, we recommend implementing appropriate retry logic with exponential backoff for server errors (5xx) and rate limiting (429).
Common Error Solutions
401 Unauthorized:
Bearer YOUR_API_KEY
format400 Bad Request:
429 Rate Limited:
Request Body Too Large:
CORS and Client-Side Issues
Brew’s API does not support cross-origin requests from browsers. Always make API calls from your backend server.
If you see CORS errors, move your API requests to a server-side environment.
Idempotency ensures that operations (like sending emails) are only performed once, even if you make the same API request multiple times. This is particularly useful for:
For POST requests, include an Idempotency-Key
header with a unique value:
welcome-email/user-123
)If you send a different request body with a previously used idempotency key, you’ll receive an error. Each key must be associated with exactly one set of request parameters.
Get started quickly with the Brew API using our OpenAPI documents. Import these into API clients like Postman or Insomnia to explore all endpoints with example requests and responses.
OpenAPI 3.1 specification in YAML format
OpenAPI 3.1 specification in JSON format
Our team is ready to support you at every step of your journey with Brew. Choose the option that works best for you:
Type in the “Ask any question” search bar at the top left to instantly find relevant documentation pages.
Click the sparkle ✨ icon next to the “Ask any question” search bar in the top left to chat with our AI assistant that’s been trained on our entire documentation.
Click “Open in ChatGPT” at the top right of any page to analyze documentation with ChatGPT or Claude for deeper insights.
Type in the “Ask any question” search bar at the top left to instantly find relevant documentation pages.
Click the sparkle ✨ icon next to the “Ask any question” search bar in the top left to chat with our AI assistant that’s been trained on our entire documentation.
Click “Open in ChatGPT” at the top right of any page to analyze documentation with ChatGPT or Claude for deeper insights.
Book time with our founders for personalized guidance on strategy, best practices, or complex implementation questions.
Need immediate assistance? Reach us at +1-(332)-203-2145 for urgent issues or time-sensitive questions.
Our preferred support channel. You’ll receive an invite after signup for direct founder support and fast responses.
Contact us at [email protected] for detailed inquiries or if you prefer not to use Slack.