Definition
Bulk API 2.0 is a simplified, REST-based version of Salesforce's Bulk API designed for loading, querying, and deleting large datasets (millions of records). Unlike the original Bulk API, version 2.0 automatically splits data into batches, manages retries for failed records, and provides a streamlined interface with fewer API calls needed to manage jobs. It supports CSV input/output and is the recommended approach for high-volume data operations.
Real-World Example
When a senior developer at TerraForm Tech needs to streamline operations, they turn to Bulk API 2.0 to solve a complex business requirement that cannot be addressed with declarative tools alone. They implement Bulk API 2.0 with proper error handling, write 98% test coverage, and document the solution for future maintainers. The code passes security review on the first attempt.
Why Bulk API 2.0 Matters
Bulk API 2.0 is a simplified, REST-based version of Salesforce's Bulk API for high-volume data operations. Where Bulk API 1.0 required callers to explicitly manage jobs and batches (creating a job, adding batches, monitoring each batch), Bulk API 2.0 takes a CSV upload and handles the batching internally. The caller's job is simpler: submit the data, check status, retrieve results. The API decides how to split the data into batches and process them in parallel.
Bulk API 2.0 also includes automatic retry logic for transient errors, which reduces the amount of error handling the caller needs to implement. It supports insert, update, upsert, delete, and query operations, all with the same basic REST-based workflow. For most high-volume data operations, 2.0 is the recommended choice because it's simpler to work with, but Bulk API 1.0 still has use cases where fine-grained control over batching is needed, such as when different records need to be processed with different settings.
How Organizations Use Bulk API 2.0
- •TerraForm Tech — Migrated from Bulk API 1.0 to Bulk API 2.0 for their nightly data loads and found the migration straightforward. The new API's automatic batching eliminated about 200 lines of custom batch management code.
- •CodeBridge — Uses Bulk API 2.0 for a recurring archive job that processes millions of records weekly. The simpler interface makes the job easier to maintain, and the automatic retry handling removed a common source of flaky failures.
- •Quantum Labs — Chose Bulk API 2.0 for a one-time data migration because the total dataset was about 5 million records and the simpler interface meant faster implementation. The migration finished in under 4 hours, including retries handled automatically.
