Prerequisites
Before you begin, make sure you have:Initialize the Client
Synchronous Client
Create a new client instance for synchronous operations:Async Client
For async applications, useAsyncBrewSDK:
BREW_SDK_API_KEY environment variable for authentication.
Import Contacts
Import contacts into your Brew audience:- Sync
- Async
Note that the import resource is accessed via
import_ (with underscore) because import is a reserved keyword in Python.Update a Contact
Update an existing contact’s information:- Sync
- Async
Send a Transactional Email
Send a transactional email using a published template:- Sync
- Async
Delete a Contact
Remove a contact from your audience:- Sync
- Async
Working with Types
The SDK uses Pydantic models for type-safe responses:Handling Responses
All SDK methods return Pydantic models with helper methods:Error Handling
Wrap API calls in try-except to handle errors:Complete Example
Here’s a complete example putting it all together:- Sync
- Async
Next Steps
Contacts
Learn more about managing contacts
Transactional Emails
Send transactional emails
Error Handling
Handle errors and configure retries
API Reference
View the full API documentation
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:- Self-Service Tools
- Talk to Our Team
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.