Salesforce Bulk API: Complete Guide
Quick Summary:
Bulk API is purpose-built for processing large volumes of records -- thousands to millions -- asynchronously, in batches, far more efficiently than making individual REST API calls per record.
What Is Bulk API?
Bulk API is designed specifically for moving large data volumes into and out of Salesforce efficiently. Rather than making one REST API call per record (which would be slow and consume API limits quickly at scale), Bulk API processes data in large batches asynchronously -- you submit a job, Salesforce processes it in the background, and you poll for results.
How to Use It
Create a job, specifying the object and operation type (insert, update, upsert, delete).
Upload your data (CSV or JSON) to the job.
Close the job to begin processing.
Poll the job status endpoint until processing completes.
Retrieve the results, reviewing both successful and failed records.
A Real-World Example
A nightly integration syncs 200,000 updated product records from an external inventory system into Salesforce custom objects. Bulk API 2.0 handles this efficiently as a single job submission, processing in the background, with the integration polling for completion rather than holding open 200,000 individual synchronous connections.
🚫 Common Mistake
Using standard REST API calls in a loop for genuinely large data volumes instead of Bulk API. This is both far slower and burns through daily API call limits much faster than a properly batched Bulk API job would.
💡 Pro Tip
Use Bulk API 2.0 rather than 1.0 for new integrations -- it handles batching automatically, removing a significant amount of manual complexity that 1.0 required.
Frequently Asked Questions
What\'s the difference between Bulk API and REST API for large data volumes?
Bulk API is specifically optimized for very large record volumes (thousands to millions), processing data asynchronously in batches; REST API is better suited to smaller, synchronous, real-time operations.
What\'s the difference between Bulk API 1.0 and 2.0?
Bulk API 2.0 simplifies the process significantly -- automatic batching, simpler job management -- compared to 1.0, which required manually splitting data into batches yourself.
What file format does Bulk API use?
CSV is standard, though JSON is also supported for Bulk API 2.0 operations.
Is Bulk API asynchronous?
Yes, Bulk API jobs process asynchronously -- you submit a job, then poll for its status rather than waiting for an immediate synchronous response like REST API.
What\'s the maximum file size for a single Bulk API batch?
Bulk API 2.0 automatically handles batching internally up to very large volumes; specific limits depend on record size and Salesforce edition.
Can Bulk API perform upsert operations?
Yes, using an external ID field the same way Data Loader does, letting you update existing records or insert new ones in the same job.
Does Bulk API trigger the same validation rules and automation as normal operations?
Yes, by default -- Bulk API respects standard validation rules, triggers, and automation unless specifically bypassed with appropriate settings.
How do I monitor a Bulk API job\'s progress?
Via the Bulk API job status endpoint, which reports how many records have been processed, succeeded, and failed as the job runs.
Can Bulk API operations be scheduled or automated?
Yes, commonly orchestrated via external scripts, middleware, or ETL tools that submit jobs on a schedule rather than requiring manual triggering each time.
What tools commonly use Bulk API under the hood?
Data Loader, when handling very large volumes, and most enterprise ETL/integration platforms use Bulk API rather than the standard REST API for genuinely large data operations.
Related Articles