Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Step 4: Close the Job

When you're finished submitting batches to Salesforce, close the job. Closing the job tells Salesforce that you're done submitting batches for the job, which allows the monitoring page in Salesforce to return more meaningful statistics on the progress of the job.
  1. Create a text file called close_job.txt containing the following text:
    1<?xml version="1.0" encoding="UTF-8"?>
    2<jobInfo xmlns="http://www.force.com/2009/06/asyncapi/dataload">
    3  <state>Closed</state>
    4</jobInfo>
  2. Using a command-line window, execute the following cURL command:

    curl https://instance.salesforce.com/services/async/67.0/job/jobId -H "X-SFDC-Session: sessionId" -H "Content-Type: application/xml; charset=UTF-8" -d @close_job.txt

    instance is the portion of the <serverUrl> element and sessionId is the <sessionId> element that you noted in the login response. jobId is the job ID that was returned when you created the job.

    This cURL command updates the job resource state from Open to Closed.