POST /api/v1/customers/bulk
Creates a batch of customers in one call. Two rules belong to this endpoint and to no other:
413, naming the limit. There is no
silent truncation — you would believe the whole file went through and lose its tail.| Role in the organization | This endpoint |
|---|---|
owner | Allowed |
admin | Allowed |
member | Allowed |
| Field | Type | Required | Description |
|---|---|---|---|
customers | array | yes | 1 to 200 rows |
customers[].name | string | yes | |
customers[].email | string | no | Unique inside the organization |
customers[].phone | string | no | |
customers[].notes | string | no |
curl -X POST -H "x-api-key: $VILLASLOT_API_KEY" -H "content-type: application/json" \
-d '{"customers":[{"name":"Tomas"},{"name":"Lina","email":"lina@example.com"}]}' \
"https://villaslot.app/api/v1/customers/bulk"200 OK — the report. summary.failed is not an error: read failed and fix those rows.{
"success": true,
"data": {
"summary": {"received": 3, "created": 2, "failed": 1},
"created": [{"id": "8d3e…", "name": "Tomas"}],
"failed": [{"index": 1, "error": "Erreur de validation : le nom est obligatoire."}]
}
}413 Payload Too Large — more than 200 rows. Nothing was created; split the batch.422 Unprocessable Entity — customers is missing or is not a list.401 Unauthorized — missing or invalid key, or a key whose bearer left the organization.404 Not Found — unknown id, or an id belonging to another organization. The two are
deliberately indistinguishable.429 Too Many Requests — over 120 requests in a minute for this key.index is the position in the array you sent, so you can match a failure back to your source
file.