Create your first customer
From key to customer + contact + onboarding in one script.
This guide pushes a complete customer record through the API in a single Node script. You end with a customer, a primary contact, and an active onboarding — visible in https://my.pivotal.app/customers/<slug> when the script finishes.
Prerequisites
- A live API key (
pivotal_…) from Admin > API Keys. - Node 20+ or Bun. The script uses native
fetch. - A scratch slug — pick something that won’t collide with a real customer in your workspace. We’ll use
aurora-demo.
Export the key once:
The script
Run it:
What happened
Three rows landed:
- A customer in your workspace with
display_idassigned by Pivotal — the small integer that will appear in the URL. - A contact under that customer. Because
is_primary: true, the customer detail page surfaces her at the top of the contacts card. - An onboarding at the
before_getting_startedphase with a launch date 6+ weeks out.
The customer’s activity feed now has three rows, each labelled API: <key-name> as the actor. The same events flow into the per-workspace audit log at Admin > Logs.
Trying it again safely
Re-run the script. Because we sent Idempotency-Key on both creates, the second pass returns the cached responses instead of creating duplicates. Nice property to lean on inside webhook handlers and cron jobs.
Drop the Idempotency-Key headers and re-run — you’ll get 409 slug_taken on the customer create. That’s the expected behavior. Pick a fresh slug or send a PATCH instead.
Cleaning up
The aurora-demo customer is soft-deletable:
The associated contact and onboarding survive the delete but disappear from list views (the parent customer is gone from list views too). Reach out if you need a hard delete.
Next
- Set up two-way sync with your CRM in Integration sync.
- Drive an onboarding through its phases in Onboarding phases.
- Build the same flow in test mode — see Test mode.