---
schema_version: "1"
id: 86b45c862743edbb4893ad908f2429a84965d51270080ab7dcf109911f3b6bf3
title: Delete 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_delete.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_records_batch_delete.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2ea145218b532ab152c3cca360a3fe60ee3ae5571733dc6db8c7ea25176bf8d5
description: Delete multiple records. You can create, update, and delete up to 200 records in a single request.
---
# Delete a Batch of Records

Delete 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 deletes multiple records.

POST /ui-api/records/batch

{
  "allOrNone": false,
  "operations": \[
    {
      "type": "Delete",
      "records": \[
        {
          "fields": {
            "Id": "001xx000003GanDAAS"
          }
        },
        {
          "fields": {
            "Id": "001xx000003Gaf9AAC"
          }
        }
      \]
    }
  \]
}

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 |

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 deleting a batch of records, you must include the required 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. A delete 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.")
- [Update a Batch of Records](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_records_batch_update.htm "Update multiple records. You can create, update, and delete up to 200 records in a single request.")