Use this flow when you already have a customer record system (a CRM, a billing platform, your own database) and want Spotzee to mirror those contacts so you can market to them.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 repeatable job that:- Reads a batch of contacts from your source system.
- Sends them to Spotzee with
external_idset to your stable customer ID. - Uses an
Idempotency-Keyso timeouts and retries are safe. - Walks through every page of source data without re-importing what’s already in.
Prerequisites
You’ll need a
sk_ project key with write access. See Authentication for how to mint one.Walkthrough
Pick a stable identifier
Choose the field in your source system that uniquely identifies a customer and never changes — usually the primary key from your customers table. Pass it to Spotzee as
external_id on every contact.Spotzee uses external_id as the upsert key: re-syncing the same external id updates the existing contact rather than creating a duplicate.Map your fields to Spotzee's schema
Spotzee contacts have a small set of first-class fields (
email, phone, external_id, locale, timezone, first_name, last_name) and a flexible data object for anything else. Map your CRM columns to first-class fields where they line up; put everything else into data.| Your column | Spotzee field |
|---|---|
customers.id | external_id |
customers.email_address | email |
customers.phone_e164 | phone |
customers.locale | locale |
| everything else | data.<your_key> |
Batch in groups of 100
POST /contacts/batch accepts up to 100 contacts per call. That’s the sweet spot for throughput and error handling — a smaller batch limits the blast radius of a partial failure.Send each batch with an idempotency key
Generate a unique key per batch (a UUID derived from the first and last
external_id works well — it’s deterministic, so a retry from a queue uses the same key).Handle partial failures
The response includes a per-item
errors[] array. Items that succeeded are committed; failed items are returned with their external_id and a code from the error catalogue. Retry only the failed items in a fresh request.Walk every page of source data
Use cursor pagination on your source system the same way you’d page Spotzee — see Pagination. Persist the cursor so a crashed job resumes where it stopped.
Pitfalls to avoid
- Don’t loop one contact at a time. Single-contact
POST /contactsworks, but you’ll burn rate-limit budget needlessly. Always batch. - Don’t reuse the same idempotency key for two different batches. Spotzee returns
409 idempotency_key_mismatchif you do. See Idempotency for the exact semantics. - Don’t write back to your source from the response. Spotzee returns its own
idfor each contact, but you should key offexternal_idon your side — that way a re-import doesn’t break.
Reference
- API surface — see Main API → Contacts
- Pagination — see Pagination
- Safe retries — see Idempotency
- Rate limits — see Rate limits