Events are the raw signal Spotzee uses to trigger journeys, build behavioural segments, and drive reporting. Send events from your backend whenever a contact does something worth marketing on — completes a checkout, opens a feature for the first time, abandons a cart, hits a usage milestone.Documentation Index
Fetch the complete documentation index at: https://docs.spotzee.com/llms.txt
Use this file to discover all available pages before exploring further.
What you’ll build
A backend service that:- Captures domain events as they happen.
- Forwards each one to Spotzee with the contact’s
external_id. - Batches when traffic is bursty and retries on failure.
Prerequisites
You’ll need a
sk_ project key with write access. The browser-side equivalent uses a pk_ publishable key — see Authentication.Walkthrough
Pick stable contact IDs
Identify each event with the same
external_id you used to sync the contact. If the contact is anonymous (a not-yet-signed-up visitor), use anonymous_id instead — Spotzee stitches the two together when the contact later identifies.Choose an event name
Use snake_case verbs:
order_placed, subscription_renewed, feature_enabled. Stick to a small catalogue — every event you create is a hook journeys and segments can depend on, so churn in event names breaks downstream automation.Send a single event
POST /events accepts a single event or an array of up to 100. Single-event form:Batch when you can
For high-volume sources (queue consumers, ETL jobs, replay scripts), batch up to 100 events per call. Same endpoint — wrap them in an array.Per-item errors come back in the response — items that succeeded are committed.
Add identify alongside the event (optional)
If the event also reveals new contact information — say, a checkout that finally captures the contact’s email — include an
identify block. Spotzee upserts the contact in the same call, so a downstream segment that depends on email IS NOT NULL fires correctly.Retry safely on failure
Network blips happen. Add an
Idempotency-Key so a retry doesn’t double-count an event in reporting. A deterministic key (order_placed:ord_42) is easier than a UUID for replay scenarios — see Idempotency.Pitfalls to avoid
- Don’t send “view” events from your backend unless you have a real reason to. Page views belong in browser-side tracking with a
pk_key. Backend events should reflect domain transitions: orders, subscriptions, status changes. - Don’t churn the schema. If you add a field to
data, keep it. Removing it breaks segments and journeys that already depend on it. - Don’t forget
Spotzee-Version. It’s optional — but pinning a version makes your event payload’s behaviour predictable across releases. See API versioning.
Reference
- API surface — see Main API → Events
- Browser-side tracking — see Authentication → publishable keys
- Safe retries — see Idempotency
- Rate limits — see Rate limits