---
schema_version: "1"
id: 439b373351b680795a34ddba1608b37c9ea7cd7143c2052d0808340a0edd471f
title: Update a Batch of Records
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/uiapi/ui_api_resources_records_batch_update.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_records_batch_update.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7a723d11280193e6ef2a71fd3fdd1e05e89a07dd8f5d1ea9fd2ba519725f8395
description: Update multiple records. You can create, update, and delete up to 200 records in a single request.
---
# Update a Batch of Records

Update multiple records. You can create, update, and delete up to 200 records in a single request.

Resource

/ui-api/records/batch

Available Version

59.0

HTTP Method

POST

Example

This example updates multiple records.

POST /ui-api/records/batch

{
  "allOrNone": false,
  "operations": \[
    {
      "type": "Update",
      "records": \[
        {
          "fields": {
            "Id": "001xx000003Gaf9AAC",
            "NumberOfEmployees": 1000
          }
        },
        {
          "fields": {
            "Id": "001xx000003GanDAAS",
            "NumberOfEmployees": 5000
          }
        },
      \]
    },
  \]
}

Request Body

| Name | Type | Description | Required or Optional | Available Version |
| --- | --- | --- | --- | --- |
| recordInput | [Batch Record Input](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_requests_batch_input.htm "A description of multiple operations for a request to create, update, or delete a batch of records.") | The batch of record input. | Required | 59.0 |

Request Parameters

<table class="featureTable sort_table" summary="">





              <thead class="thead sorted" align="left">
                <tr>
                  <th class="featureTableHeader vertical-align-top " id="d79433e177">Name</th>

                  <th class="featureTableHeader vertical-align-top " id="d79433e180">Type</th>

                  <th class="featureTableHeader vertical-align-top " id="d79433e183">Description</th>

                  <th class="featureTableHeader vertical-align-top " id="d79433e186">Required or Optional</th>

                  <th class="featureTableHeader vertical-align-top " id="d79433e189">Available Version</th>

                </tr>

              </thead>

              <tbody class="tbody">
                <tr>
                  <td class="entry" headers="d79433e177" data-title="Name"><samp class="codeph nolang">useDefaultRule</samp></td>

                  <td class="entry" headers="d79433e180" data-title="Type">Boolean</td>

                  <td class="entry" headers="d79433e183" data-title="Description">
                    <p class="p">For a Case or Lead, specifies whether to use the default (<samp class="codeph nolang">active</samp>) assignment rule. If you specify
                      <samp class="codeph nolang">useDefaultRule</samp>, don’t specify an
                      <samp class="codeph nolang">assignmentRuleId</samp>.
                    </p>

                    <p class="p">For an Account, specifies whether to apply the default territory assignment
                      rules. </p>

                    <p class="p">The default value is <samp class="codeph nolang">false</samp>.</p>

                    <p class="p">See <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.264.0.api.meta/api/sforce_api_header_assignmentruleheader.htm" target="_blank" title="HTML (New Window)">AssignmentRuleHeader</a> in <em class="ph i">SOAP API Developer Guide</em>.</p>

                  </td>

                  <td class="entry" headers="d79433e186" data-title="Required or Optional">Optional</td>

                  <td class="entry" headers="d79433e189" data-title="Available Version">64.0</td>

                </tr>

              </tbody>

            </table>

Response Body

[Batch Results](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_responses_batch_results.htm#ui_api_responses_batch_results "The results from a request to a batch resource. Results include information for each subrequest in the batch.")

Usage

When updating a batch of records, you must include the Id field. Don’t include the apiName field in [Batch Operation Input](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_requests_batch_operation_input.htm "Represents the operation type and record data to create, update, and delete in a batch.").

You can’t perform multiple operations on the same record in one request. An update operation using an Id value that’s used in another update or delete operation can’t be processed. 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.

#### See Also

- [Create a Batch of Records](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_records_batch_post.htm "Create multiple records. You can create, update, and delete up to 200 records in a single request.")
- [Delete a Batch of Records](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_records_batch_delete.htm "Delete multiple records. You can create, update, and delete up to 200 records in a single request.")