Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Batch, Bulk API entry
How-to guide

How to use Bulk API 2.0 for a data load

Bulk API 2.0 requires a client (Data Loader, MuleSoft, custom code, or the Salesforce CLI). The mechanics are straightforward; the discipline is in chunking, idempotency, and monitoring.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 19, 2026

Bulk API 2.0 requires a client (Data Loader, MuleSoft, custom code, or the Salesforce CLI). The mechanics are straightforward; the discipline is in chunking, idempotency, and monitoring.

  1. Authenticate against the Salesforce API

    Use OAuth (preferably JWT Bearer flow) to obtain an access token. The token authenticates every Bulk API call.

  2. Create a job

    POST to /services/data/vNN.0/jobs/ingest with the operation, object, and content type. Salesforce returns a Job ID.

  3. Upload the CSV payload

    PUT the CSV content to the job's upload endpoint. Bulk API 2.0 handles chunking internally; the client uploads as one payload.

  4. Close the job

    PATCH the job state to UploadComplete. Salesforce begins processing the records on the async layer.

  5. Poll status and download results

    Poll the job status endpoint every 30 to 60 seconds. When JobComplete, GET the successful and failed record results as CSV.

Gotchas
  • Bulk API operations are async. Synchronous behaviour requires the client to poll until completion.
  • Each row can succeed or fail independently. Production integrations must download the failed-row CSV and retry only those.
  • Use Upsert with an external ID for idempotency. Insert + Update logic written by hand is error-prone at bulk scale.
  • Very large queries (hundreds of millions of records) need PK Chunking enabled via HTTP header. Without it, the query may fail with memory errors.

See the full Batch, Bulk API entry

Batch, Bulk API includes the definition, worked example, deep dive, related terms, and a quiz.