Create a Batch of Records

Create multiple records. You can create, update, and delete up to 200 records in a single request.
Resource
1/ui-api/records/batch
Available Version
59.0
HTTP Method
POST
Example
This example creates an account and a contact, and updates a record.
1POST /ui-api/records/batch
1{
2  "allOrNone": false,
3  "operations": [
4    {
5      "type": "CREATE",
6      "records": [
7        {
8          "apiName": "Account",
9          "fields": {
10            "Name": "Global Media"
11          }
12        },
13        {
14          "apiName": "Contact",
15          "fields": {
16            "LastName": "Smith"
17          }
18        }
19      ]
20    },
21    {
22      "type": "Update",
23      "records": [
24        {
25          "fields": {
26            "Id": "001xx000003Gaf9AAC",
27            "NumberOfEmployees": 1000
28          }
29        }
30      ]
31    }
32  ]
33}
Request Body
Name Type Description Required or Optional Available Version
recordInput Batch Record Input The batch of record input. Required 59.0
Request Parameters
Name Type Description Required or Optional Available Version
useDefaultRule Boolean

For a Case or Lead, specifies whether to use the default (active) assignment rule. If you specify useDefaultRule, don’t specify an assignmentRuleId.

For an Account, specifies whether to apply the default territory assignment rules.

The default value is false.

See AssignmentRuleHeader in SOAP API Developer Guide.

Optional 64.0
Response Body
Batch Results
Usage
When creating a batch of records, you must include the required apiName field in Batch Operation Input. Don’t include the Id field. Otherwise, a 400 HTTP status code with an INVALID_BATCH_REQUEST error is returned.
Receiving a 400 HTTP status code with an INVALID_INPUT error can be caused by one of these reasons.
  • The operations field is missing or empty.
  • The operation type is missing.
  • The operations field doesn’t contain a records field or the records field is empty.