POST
/
transactional
curl --request POST \
--url https://api.getbrew.ai/v1/transactional \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"email": "user@example.com",
"transactionalId": "te_password_reset",
"addToAudience": false,
"dataVariables": {
"resetLink": "https://app.example.com/reset-password?token=abc123",
"expiryHours": 24,
"userName": "John"
}
}'
{
"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 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.

Maximum length: 100

Body

application/json

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

Response

200
application/json

Email sent successfully

Success response for transactional email sending