POST
/
v1
/
tenants
/
add-user-bulk
curl https://api.zquenceeee.com/v1/tenants/add-user-bulk \
  -H "x-api-key: $ZQUENCE_PUBLIC_KEY" \
  -H "x-api-secret: $ZQUENCE_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "name": "James Carter",
      "email": "james.carter@example.com",
      "phone": "+447911123456",
      "customerId": "cus_Kq3mN8xLp2vT"
    },
    {
      "name": "Emily Thompson",
      "email": "emily.thompson@example.com",
      "phone": "+14155550193",
      "customerId": "cus_Rp7wQ2nMk4uS"
    }
  ]'
{
  "created": [
    {
      "id": "6a25cdac36bc6230704b5b59",
      "name": "James Carter",
      "email": "james.carter@example.com",
      "phone": "+447911123456",
      "tenantId": "bc41c6ab-7206-4033-b632-4d1cfa86d840",
      "environmentId": "69f9b5fa0600ccbf9c677005",
      "customerId": "cus_Kq3mN8xLp2vT",
      "status": "inactive",
      "createdAt": "2026-06-07T10:00:00.000Z",
      "updatedAt": "2026-06-07T10:00:00.000Z"
    },
    {
      "id": "6a25cdac36bc6230704b5b60",
      "name": "Emily Thompson",
      "email": "emily.thompson@example.com",
      "phone": "+14155550193",
      "tenantId": "bc41c6ab-7206-4033-b632-4d1cfa86d840",
      "environmentId": "69f9b5fa0600ccbf9c677005",
      "customerId": "cus_Rp7wQ2nMk4uS",
      "status": "inactive",
      "createdAt": "2026-06-07T10:00:01.000Z",
      "updatedAt": "2026-06-07T10:00:01.000Z"
    }
  ],
  "createdCount": 2,
  "skippedEmails": [],
  "skippedPhones": [],
  "skippedCount": 0
}
Batch version of Add a customer. Applies the same idempotent sync logic per entry: existing exact-match customers are synced (environment membership updated, customerId stored if missing) while conflicting entries are skipped.

Sync behavior per entry

ScenarioResult
New email + new phoneCustomer created, included in created.
Existing email + matching phoneCustomer synced — environment membership updated, customerId stored if not already set. Included in created.
Existing email + different phoneEntry skipped. Email added to skippedEmails.
Existing phone + different emailEntry skipped. Phone added to skippedPhones.
Duplicate within the same requestSecond occurrence silently deduplicated.

Query parameters

environmentId
string
Assign all customers in this batch to a specific environment. If omitted, the environment is resolved from the authenticated API key.

Body

A JSON array of customer objects. Each object accepts the same fields as Add a customer.
[].name
string
required
Full display name.
[].email
string
required
Valid RFC 5322 email. Used as a deduplication key alongside phone.
[].phone
string
required
Phone number (6–30 chars). E.164 format recommended (e.g. +14155552671).
[].customerId
string
Your system’s identifier for this customer. Stored on create; applied to existing customers only if they don’t already have one.

Returns

created
array
Array of full customer objects that were newly created or successfully synced in this call.
createdCount
number
Number of customers in created.
skippedEmails
string[]
Emails that were skipped due to a conflict (existing email with a different phone).
skippedPhones
string[]
Phone numbers that were skipped due to a conflict (existing phone with a different email).
skippedCount
number
Total count of distinct skipped identifiers (skippedEmails + skippedPhones deduplicated).

Error codes

StatusMeaning
400Empty array, no valid entries after normalization, or tenantId not resolvable.
401Missing or invalid API key pair.
409Every entry in the batch already conflicts — no new users could be created or synced.
curl https://api.zquenceeee.com/v1/tenants/add-user-bulk \
  -H "x-api-key: $ZQUENCE_PUBLIC_KEY" \
  -H "x-api-secret: $ZQUENCE_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "name": "James Carter",
      "email": "james.carter@example.com",
      "phone": "+447911123456",
      "customerId": "cus_Kq3mN8xLp2vT"
    },
    {
      "name": "Emily Thompson",
      "email": "emily.thompson@example.com",
      "phone": "+14155550193",
      "customerId": "cus_Rp7wQ2nMk4uS"
    }
  ]'
{
  "created": [
    {
      "id": "6a25cdac36bc6230704b5b59",
      "name": "James Carter",
      "email": "james.carter@example.com",
      "phone": "+447911123456",
      "tenantId": "bc41c6ab-7206-4033-b632-4d1cfa86d840",
      "environmentId": "69f9b5fa0600ccbf9c677005",
      "customerId": "cus_Kq3mN8xLp2vT",
      "status": "inactive",
      "createdAt": "2026-06-07T10:00:00.000Z",
      "updatedAt": "2026-06-07T10:00:00.000Z"
    },
    {
      "id": "6a25cdac36bc6230704b5b60",
      "name": "Emily Thompson",
      "email": "emily.thompson@example.com",
      "phone": "+14155550193",
      "tenantId": "bc41c6ab-7206-4033-b632-4d1cfa86d840",
      "environmentId": "69f9b5fa0600ccbf9c677005",
      "customerId": "cus_Rp7wQ2nMk4uS",
      "status": "inactive",
      "createdAt": "2026-06-07T10:00:01.000Z",
      "updatedAt": "2026-06-07T10:00:01.000Z"
    }
  ],
  "createdCount": 2,
  "skippedEmails": [],
  "skippedPhones": [],
  "skippedCount": 0
}