How do you design REST APIs for bulk operations?

Answer

Bulk operations allow clients to create, update, or delete multiple resources in a single request, reducing round trips. Common approaches: Batch create: POST /users/batch with an array of user objects in the body — return 207 Multi-Status with per-item success/failure. Bulk update: PATCH /orders with { "ids": [1,2,3], "status": "shipped" } — update a field on multiple resources. Bulk delete: DELETE /users with { "ids": [1,2,3] } in the body (non-standard but pragmatic). Return a 207 Multi-Status response that details the outcome per item: success, partial failure, or total failure. Set a reasonable limit on batch size (e.g., 100 items per request) to prevent resource exhaustion. Process items transactionally (all or nothing) or individually (return per-item errors) based on business requirements.