We're attempting to create multi-batch jobs in the Bulk API 2.0. Our previous single-batch workflow was to do:

  1. POST /services/data/v43.0/jobs/ingest
  2. PUT /services/data/v43.0/jobs/ingest/<job-id>/batches
  3. PATCH /services/data/v43.0/jobs/ingest/<job-id> to set the status to UploadComplete

However, if I make multiple PUT requests with my separate batches, then the PATCH request that closes the job receives a 400 with the following body:

        "message":"Found multipe contents for job: <7500H00000H673g>, please 'Close' / 'Abort' / 'Delete' the current Job then create a new Job and make sure you only do 'PUT' once on a given Job."

This indicates that making multiple PUT requests to /batches is not the correct way to upload multiple batches, but the examples in the API 2.0 docs don't use multiple batches, and the documentation for the PATCH endpoint doesn't comment to the effect that it should only be used once, and also doesn't say what you're supposed to do instead.

What is the correct approach is here?

1 Answer 1


Bulk API 2.0 simplifies uploading large amounts of data by breaking the files into batches automatically. All you have to do is upload a CSV file with your record data and check back when the results are ready.

Files must be in UTF-8 format. Files are converted to base64 when received by Salesforce. This conversion can increase the data size by approximately 50%. To account for the base64 conversion increase, upload data that does not exceed 100 MB.

  • 5
    So why is the endpoint called "batches"? That implies that you can upload more than one. Also what are you supposed to do if your data size exceeds the max? Create multiple jobs? If you can only upload one batch per job, why make multiple endpoints? Why not just allow uploading the data with the job? The whole design of this API is flawed and confusing. Commented Apr 15, 2019 at 16:38
  • I agree, this is very confusing, specifically when documentation say the following: contentUrl URL The URL to use for Upload Job Data requests for this job. Only valid if the job is in Open state. developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/… Commented Apr 27, 2022 at 3:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .