API Design · Middle · Question 60 of 75
How should an API expose actions on many items, like 'archive 500 messages'?
- 1With 500 separate DELETE requests
- 2With a GET request containing all IDs
- ✓Correct answer: With a batch endpoint (e.g.
POST /messages:batchArchivewith IDs) within a size limit, possibly as an async job for large batches
Explanation
Batch endpoints reduce overhead; limits and async processing protect the server.