Add a customer
Create or sync a customer under the authenticated tenant.
POST
Creates a new customer record. Idempotent on email + phone: if a user with the same email and 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 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 phone + different email | 409 Conflict — phone already exists with a different email. |
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. 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, email, or phone), invalid phone format, 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.