A batch endpoint needs a result per item
One bad row in a batch of 500 should not fail the other 499. If the endpoint answers 400, the only move the client has is to send all 500 again, and the rows that already landed get written twice.
{
"results": [
{ "index": 0, "status": "created", "id": "c_8f2a" },
{ "index": 1, "status": "error", "code": "email_invalid" }
]
}Answer 200, one entry per item in request order, and keep 4xx for a request you could not parse at all. The client retries the failures and nothing else.
httpapi-design