A batch endpoint needs a result per item
One bad row in a batch of 500 shouldn't fail the other 499. If the endpoint answers 400, all the client can do is 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 with one entry per item, in request order, and save 4xx for a request you couldn't parse at all. Then the client retries the failures and nothing else.
httpapi-design