Add a customer
Create or sync a customer under the authenticated tenant.
POST
Creates a new customer record.
Note: when
phone is optional. Idempotent on email, and on phone
when provided: if a user with the same email (and, when you send one, the same phone)
already exists, the call succeeds, updates their environment membership, and optionally
stores your customerId if they don’t have one yet.
Sync behavior
| Scenario | Result |
|---|---|
| New email + new/no phone | Customer created. 201 Created. |
| Existing email + matching phone (exact match) | Customer synced — environment membership updated, customerId stored if not already set. 200 OK. |
| Existing email + different phone | 409 Conflict — email already exists with a different phone number. |
| Existing email, no phone sent this call | Customer synced — treated as a match on email alone, not a phone conflict. 200 OK. |
| Existing phone + different email | 409 Conflict — phone already exists with a different email. |
phone is omitted from a call, dedup for that call falls back to email only —
Zquence can’t detect a phone conflict it was never told about. Send phone on every call
if you want strict dedup across both fields.
Query parameters
Place the new customer into this specific environment. If omitted, the environment is resolved from the authenticated API key.
Body
Full display name of the customer.
Valid RFC 5322 email address. Stored lowercase. Used as the primary deduplication key alongside
phone.Phone number. Optional. When provided, must be 6–30 characters — E.164 format strongly recommended (e.g.
+14155552671). Normalized to E.164 on write.Your system’s identifier for this customer (e.g. a CRM ID, Stripe customer ID, or database UUID). Stored as-is and returned on every customer read. Useful for correlating Zquence customers back to your own data.
- On create: stored immediately.
- On sync (existing user): stored only if the customer does not already have an
customerId. Pass it on every sync call to ensure it is captured even if the first call didn’t include it.
Returns
Customer’s MongoDB ObjectId.
Display name.
Normalized lowercase email address.
Normalized E.164 phone number.
Owning tenant identifier.
Primary environment this customer belongs to.
Your system’s customer identifier, if provided.
"inactive" on first creation. Advances to "active" once the customer accepts a Zquence account invitation.ISO 8601 UTC creation timestamp.
ISO 8601 UTC last-updated timestamp.
Error codes
| Status | Meaning |
|---|---|
400 | Missing required field (name or email), invalid phone format (if phone was sent), or tenantId not resolvable. |
401 | Missing or invalid API key pair. |
409 | Email exists with a different phone, or phone exists with a different email. |
Webhook events
Firestenant.users.invite on successful creation of a new customer.