Blog
Dec 16, 2025 - 3 MIN READ
Salesforce Bulk API 2.0 in a hurry

Salesforce Bulk API 2.0 in a hurry

A straightforward guide to using Salesforce Bulk API 2.0

Bryan Ferreira

Bryan Ferreira

TLDR Checklist:

  • Create job with object and operation
  • Upload CSV data to job
  • Close job by setting state to UploadComplete
  • Request job status until the status is JobComplete
  • Check successful and failed records

The steps

1. Create a Job

Create a job specifying the object and operation type.

POST /services/data/v65.0/jobs/ingest

{
  "object": "Account",
  "operation": "update"  // or "insert", "upsert", "delete"
}

Response:

{
  "id": "750xx000000XXXXAAA",
  "operation": "update",
  "object": "Account",
  ...// We will be just using the id from here
}

2. Upload data

Upload your data in batches as CSV.

PUT /services/data/v65.0/jobs/ingest/750xx000000XXXXAAA/batches

Content-Type: text/csv

Id,TextExampleField__c,NumberExampleField__c
001Xx000003XXXXAAA,Sample Text,12345
001Xx000003XXXXAAA,Another Text,67890

Keep in mind:

  • You can upload multiple batches to one job
  • You need to put the Content-Type for the request as text/csv

3. Close the Job

Send a request notifying that all the data has been uploaded.

PATCH /services/data/v65.0/jobs/ingest/750xx000000XXXXAAA

{
  "state": "UploadComplete"
}

After this request, Salesforce will proceed to process all the uploaded data from the batches.

4. Check how the Job is doing

Send a GET request to check the job status, until the state is JobComplete.

GET /services/data/v65.0/jobs/ingest/750xx000000XXXXAAA

Response:

{
  "id": "750xx000000XXXXAAA",
  "state": "JobComplete", 
  "numberRecordsProcessed": 2,
  "numberRecordsFailed": 0,
  // Other fields that we won't be using
}

If the status is Failed or Aborted, something went wrong. Then you can check the error messages in the KOs section below.

4.1 Check results, OKs and KOs

OKs

GET /services/data/v65.0/jobs/ingest/750xx000000XXXXAAA/successfulResults/

KOs

GET /services/data/v65.0/jobs/ingest/750xx000000XXXXAAA/failedResults/

And that's it!

© 2025