POST
/
events
/
send
curl --request POST \
--url https://api.getbrew.ai/v1/events/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"email": "new.user@example.com",
"eventName": "userSignup",
"firstName": "Alex",
"lastName": "Johnson",
"eventProperties": {
"signupSource": "landing_page_a",
"planSelected": "free"
},
"subscriptionGroups": {
"sg_newsletter": true,
"sg_product_updates": false
}
}'
{
"success": true
}

Authorizations

Authorization
string
header
required

Include your Brew API key as a Bearer token in the Authorization header.

Example: Authorization: Bearer bw_api_your_key_here

Headers

Idempotency-Key
string

Unique identifier to prevent duplicate events. Especially important for purchase events or other critical actions where duplicates could cause issues.

Maximum length: 100

Body

application/json

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

Response

200
application/json

Event sent successfully and will trigger any matching automations

Success response for event sending