Story #29 Bulk API Semantics · Partial Failure

The Bulk Request That Was Only Partially Successful

"499 records updated. 1 failed. The API returned HTTP 200 and said nothing about the one"

PeopleCore's bulk provisioning endpoint returned HTTP 200 for requests that partially failed, with individual results embedded in the response body. Clients that checked only the status code assumed full success, leaving some accounts in inconsistent states.

What happened

PeopleCore’s bulk employee provisioning endpoint processed records independently and returned a result for each submitted item. The intent was correct—partial success was a supported outcome. But the HTTP status code for a partially successful request was 200, and the per-record results were nested inside a results array.

A large customer submitted a batch of 500 employee updates. Most were applied successfully. One failed due to a validation error. The API returned HTTP 200 with 499 success entries and 1 error entry in the results array.

The customer’s integration checked the HTTP status code, saw 200, and moved on without parsing the results array. The failed employee account was never updated, never retried, and never flagged. That employee tried to log in after the batch completed and found their account still configured incorrectly.

The issue wasn’t discovered until the employee reported the problem three weeks later.

Root cause

The partial failure semantics were defined in the response body but not signaled at the HTTP layer. HTTP 207 Multi-Status exists precisely for this pattern, but the API used 200. The client had no reason to inspect the body for errors after receiving 200. No contract test verified that a partially failed batch was detectable at the HTTP level.

The fix

The API was updated to return HTTP 207 for requests where at least one item failed. The response body structure remained the same—per-record results with explicit success and failure entries. HTTP 200 was reserved for fully successful batches. Contract tests were written for all-success, all-failure, and mixed-result batches, verifying both the status code and the results array.

Lesson learned

Bulk API contracts must define how partial failures are communicated—and that communication must be visible at the HTTP status code level, not hidden in the response body. Use HTTP 207 for multi-status responses.

The Bulk Request That Was Only Partially Successful