Authorizations
Include your Brew API key as a Bearer token in the Authorization header.
Example: Authorization: Bearer bw_api_your_key_here
Headers
Unique identifier to prevent duplicate emails. Use this to safely retry requests without sending duplicate emails. We recommend using UUIDs or another method with sufficient entropy to avoid collisions. Keys expire after 24 hours and should be up to 100 characters.
100
Body
Specify the recipient, email design to use, and any dynamic data. Optionally add the contact to your audience with basic contact information like names and subscription groups.
Contact Matching (when addToAudience is true): You can provide email, userId, or both to identify the contact. When both are provided, Brew searches for a contact matching either identifier. If a contact is found (for example, by email), the other identifier (userId) will be updated on that contact. If no existing contact matches either identifier, a new contact is created with both values.
Request body for sending a transactional email
Recipient's email address
"customer@example.com"
ID of the transactional email to send (from your published designs)
"te_password_reset"
Whether to create a contact in your audience if one doesn't exist
Contact's first name (used when addToAudience is true)
"John"
Contact's last name (used when addToAudience is true)
"Smith"
Unique external user ID (used when addToAudience is true)
"user_12345"
Custom source value (used when addToAudience is true, defaults to "API")
"Password reset"
Whether the contact is subscribed to marketing emails (used when addToAudience is true)
Subscription groups to add the contact to (used when addToAudience is true)
{
"sg_newsletter": true,
"sg_product_updates": false
}
Variables to populate in the email template (must match the email's defined variables). Supports strings, numbers, and booleans. Boolean values enable conditional content in templates.
Supported Types:
string
- Text values for names, URLs, messagesnumber
- Numeric values for amounts, counts, percentagesboolean
- True/false values for conditional content (e.g., show/hide sections)
{
"resetLink": "https://app.example.com/reset?token=abc123",
"expiryHours": 24,
"showUpgradePrompt": true
}
File attachments to include with the email. Maximum 10MB total across all files. This feature requires enablement - please contact founders@brew.new to activate attachments for your account.
Response
Email sent successfully
Success response for transactional email sending
Indicates the email was sent successfully
true