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 events. Especially important for purchase events or other critical actions where duplicates could cause issues.
100
Body
Provide the contact's email, event details, and optionally contact information to update. Event properties become available as variables in triggered emails.
Contact Matching: 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.
Custom Contact Properties: Include any custom contact properties as top-level fields. Custom properties can be strings, numbers, booleans, or dates. You must create custom properties in Brew before using them in API calls.
For detailed information about creating and managing custom properties, see our Custom Properties documentation.
Request body for sending an event
Email address of the contact to associate with this event
"user@example.com"
Name of the event (used to trigger automations)
"purchaseComplete"
Contact's first name (will update contact if they exist, or set when creating new contact)
"Alex"
Contact's last name (will update contact if they exist, or set when creating new contact)
"Johnson"
Unique external user ID (e.g., from your app or CRM)
"user_12345"
Custom source value to track where the contact came from (defaults to "API")
"Website signup"
Whether the contact is subscribed to marketing emails
Additional data about the event (available as variables in triggered emails)
{
"orderTotal": 149.99,
"productName": "Pro Plan",
"isFirstPurchase": true
}
Subscription groups to add the contact to
{ "sg_customers": true }
Response
Event sent successfully and will trigger any matching automations
Success response for event sending
Indicates the event was processed successfully
true