Events
An event is something a contact did in your product: signed_up, trial_started, order_paid. Events can:
- start a flow whose trigger is this event name, such as an onboarding sequence on
signed_up(Flows); - filter a segment, such as "performed
order_paidin the last 30 days" (Segments).
Step-by-step example: Onboard users with events.
Record an event
POST /v1/events
Records an event for a contact, identified by email address, created if unknown. Allowed with a sending access key.
_, ., : or -, such as trial_started. Case-sensitive.{"plan": "pro", "amount": 49}. At most 50 keys and 10 KB.firstName, lastName and attributes (merged, same rules as contact attributes).true; with false, an unknown address answers 404.Idempotency-Key header, which wins when both are set.An Idempotency-Key header makes the request safe to retry: the event is recorded once and starts its flows once. See Idempotency.
curl https://api.kulamail.com/v1/events \
-H "Authorization: Bearer ml_your_api_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: trial-1042-started" \
-d '{
"email": "ada@example.com",
"name": "trial_started",
"properties": { "plan": "pro", "trial_days": 14 },
"contact": {
"firstName": "Ada",
"attributes": { "plan": "pro_trial" }
}
}'
await fetch('https://api.kulamail.com/v1/events', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.KULA_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': `trial-${user.id}-started`
},
body: JSON.stringify({
email: user.email,
name: 'trial_started',
properties: { plan: 'pro', trial_days: 14 },
contact: {
firstName: user.firstName,
attributes: { plan: 'pro_trial' }
}
})
})
{
"id": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
"contactId": "0d9e8f7a-6b5c-4d3e-2f1a-0b9c8d7e6f5a",
"name": "trial_started",
"properties": { "plan": "pro", "trial_days": 14 },
"occurredAt": "2026-10-17T09:30:00Z"
}
A replay of an earlier Idempotency-Key answers 200 with the header Idempotent-Replayed: true and the event recorded the first time.
| Status | Code | When |
|---|---|---|
| 400 | validation_error, bad_request | Invalid name, too many properties, invalid address or attributes, key over 200 characters |
| 400 | disposable_address | The event would create a contact with a disposable address |
| 404 | not_found | Unknown address and createContact is false |
Events of Kula
Kula records two events itself, when a contact uses a signup form or landing page. They appear in the contact's activity, trigger flows and filter segments like yours.
The prefix kula. is reserved: an event of that name sent by the API, the MCP or an import answers 400 reserved_event_name.
| Event | Recorded | Properties |
|---|---|---|
kula.form_joined | When a signup through a form takes effect: confirmation click with double opt-in, submission otherwise, or submission by a contact already subscribed | form_id, form_name, form_kind (FORM or PAGE), page_url, referrer, utm_source, utm_medium, utm_campaign, utm_content, utm_term |
kula.resource_downloaded | Each opening of the download link of an incentive, once per contact and form every 10 minutes | form_id, form_name, resource_name |
page_url is the page of your site holding the form, or the address of the landing page. A submission never confirmed records no event.
Good to know
- Events don't subscribe anyone. A contact created by an event belongs to no list, so it receives no campaign. Flows triggered by the event still email it.
- Personalize with attributes, not properties. Flow emails read
{{ contact.* }}, not event properties. Send values an email needs (the plan, the trial end date) incontact.attributes. - A flow only starts for active contacts. An event from an unsubscribed, bounced or complained contact is recorded but starts nothing.
- The same event twice starts the flow twice only if the flow lets contacts enter every time. By default, a contact goes through a flow once. Entry rules. A retry with the same
Idempotency-Keyis never a second event. - Stripe or another tool? No native integration: forward their webhooks to this route.