A batch endpoint accepts an array of items — records to create, ids to delete — in a single request, saving a round trip per item. Because some items can succeed while others fail, the response reports each one separately, and 207 Multi-Status is the status code for exactly that situation: "look inside, the outcomes differ".
The response body lists a status per item, usually in the same order as the request or keyed by an id the client supplied. Designs differ on atomicity: some batches are all-or-nothing and answer a single 4xx if any item is invalid; others commit what they can and report the rest. The API has to document which.
That a 2xx on a batch means everything worked. 207 is in the success class, and a client that checks only response.ok will report success while half its records were rejected. Batch clients must iterate the per-item results.
POST /friends/v1/characters/bulk validates each item separately and answers 207 when some fail, and POST /friends/v1/characters/bulk-delete reports partial success the same way; send one bad item among good ones to see it.
All glossary terms · Testing techniques · All 39 mock REST APIs
Last updated