Batch upsert customers by external ID
Create or update multiple customers by external system ID. Supports up to 100 customers per request with stale update protection.
Related endpoints
GET /customers/{customerId}/invoices— List customer invoicesGET /customers/{customerId}/subscriptions— List customer subscriptionsGET /customers/{customerId}/orders— List customer ordersGET /customers/{customerId}/payments— List customer paymentsPOST /customers— Create a new customerGET /customers— List customersGET /customers/{id}— Get customer by IDPATCH /customers/{id}— Update customer details
Common errors
400 invalid_request— malformed payload or failed validation.401 unauthenticated— missing, malformed, or revoked API key.403 permission_denied— key lacks the required scope, or the resource belongs to a different merchant.
Idempotency
Pass an Idempotency-Key header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see the idempotency guide.
x-api-key<token>
Your RevKeen API key (powered by Unkey). Get it from Dashboard > Settings > API Keys. Use rk_sandbox_* for test mode and rk_live_* for production.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
Stuck on an error response? Ask the RevKeen assistant to explain it.
curl -X PUT "https://api.revkeen.com/v2/customers/external/batch" \
-H "x-api-key: $REVKEEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": "practicehub",
"customers": [
{
"external_id": "PAT-12345",
"email": "john@example.com",
"name": "John Doe",
"phone": "+1-555-123-4567",
"address_line1": "string",
"address_line2": "string",
"city": "string",
"state": "string",
"postal_code": "string",
"country": "US",
"tax_id": "string",
"tax_id_country": "string",
"notes": "string",
"metadata": {},
"external_updated_at": "2026-01-01T00:00:00Z"
}
]
}'{
"created": 5,
"updated": 10,
"skipped": 2,
"failed": [
{
"external_id": "string",
"error": "string"
}
]
}{
"error": "Bad request"
}{
"error": "Unauthorized"
}{
"error": "Forbidden"
}