# Events API

Track customer behavior to drive automations and segments.

## Endpoint

- `POST /v1/events`

Track behavior to power automations and segments. Identify the contact by `email` (auto-created if unknown) or `contact_id`.

## Track an event

**Body parameters**

- `event` — *string*, required — Event name, e.g. `Purchased`. Stored with a normalized key.
- `email` — *string*, optional — Identify the contact by email (auto-created if unknown).
- `contact_id` — *string*, optional — Identify the contact by id instead of email.
- `properties` — *object*, optional — Arbitrary metadata (product_id, category, …).
- `value` — *number*, optional — Monetary value for revenue tracking.
- `currency` — *string*, optional — ISO currency code for value, e.g. usd.
- `quantity` — *integer*, optional — Item quantity for the event (e.g. units purchased).
- `occurred_at` — *string*, optional — ISO 8601 timestamp of when the event happened. Defaults to now.

Provide either `email` or `contact_id`.

```bash
curl -X POST https://emailbump.com/api/v1/events \
  -H "Authorization: Bearer ebk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jamie@example.com",
    "event": "Purchased",
    "value": 49.0,
    "currency": "usd",
    "properties": { "product": "Widget" }
  }'
```
