How Bulk API Works
Step One: Create a Job
Step Two: Monitor a Job
Step Three: Close a Job
Step Four: Get Job Details
Step Five: Abort a Job
Limits
Map Data Fields
Bulk API End-of-Life Policy
Previous PDF Versions
Create a job by sending a POST request to this URI. The request body identifies the type of object processed in all associated batches.
URI: /services/async/APIversion/job
Example XML request body
1<?xml version="1.0" encoding="UTF-8"?>
2<jobInfo
3 xmlns="http://www.force.com/2009/06/asyncapi/dataload">
4 <operation>insert</operation>
5 <object>Account</object>
6 <contentType>CSV</contentType>
7</jobInfo>Example XML response body
1<?xml version="1.0" encoding="UTF-8"?>
2<jobInfo
3 xmlns="http://www.force.com/2009/06/asyncapi/dataload">
4 <id>750D00000004SkLIAU</id>
5 <operation>insert</operation>
6 <object>Account</object>
7 <createdById>005D0000001b0fFIAQ</createdById>
8 <createdDate>2015-12-15T21:41:45.000Z</createdDate>
9 <systemModstamp>2015-12-15T21:41:45.000Z</systemModstamp>
10 <state>Open</state>
11 <concurrencyMode>Parallel</concurrencyMode>
12 <contentType>CSV</contentType>
13 <numberBatchesQueued>0</numberBatchesQueued>
14 <numberBatchesInProgress>0</numberBatchesInProgress>
15 <numberBatchesCompleted>0</numberBatchesCompleted>
16 <numberBatchesFailed>0</numberBatchesFailed>
17 <numberBatchesTotal>0</numberBatchesTotal>
18 <numberRecordsProcessed>0</numberRecordsProcessed>
19 <numberRetries>0</numberRetries>
20 <apiVersion>36.0</apiVersion>
21 <numberRecordsFailed>0</numberRecordsFailed>
22 <totalProcessingTime>0</totalProcessingTime>
23 <apiActiveProcessingTime>0</apiActiveProcessingTime>
24 <apexProcessingTime>0</apexProcessingTime>
25</jobInfo>Example JSON request body
1{
2 "operation" : "insert",
3 "object" : "Account",
4 "contentType" : "JSON"
5}Example JSON response body
1{
2 "apexProcessingTime" : 0,
3 "apiActiveProcessingTime" : 0,
4 "apiVersion" : 36.0,
5 "concurrencyMode" : "Parallel",
6 "contentType" : "JSON",
7 "createdById" : "005D0000001b0fFIAQ",
8 "createdDate" : "2015-12-15T20:45:25.000+0000",
9 "id" : "750D00000004SkGIAU",
10 "numberBatchesCompleted" : 0,
11 "numberBatchesFailed" : 0,
12 "numberBatchesInProgress" : 0,
13 "numberBatchesQueued" : 0,
14 "numberBatchesTotal" : 0,
15 "numberRecordsFailed" : 0,
16 "numberRecordsProcessed" : 0,
17 "numberRetries" : 0,
18 "object" : "Account",
19 "operation" : "insert",
20 "state" : "Open",
21 "systemModstamp" : "2015-12-15T20:45:25.000+0000",
22 "totalProcessingTime" : 0
23}In these samples, the contentType field indicates that the batches associated with the job are in CSV format. For alternative options, such as XML or JSON, see JobInfo.
The operation value must match that shown in JobInfo. For example, you get an error if you use INSERT instead of insert.
Warning
See Also