---
schema_version: "1"
id: 952fdcaaeaf80545e533cceedd3b2c7f850dd9c31c6bda90db64d5b51b60b9d3
title: Batch Request Body
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/api-rest/guides/resources/requests-composite-batch.md
canonical_url: https://developer.salesforce.com/docs/platform/api-rest/guide/requests-composite-batch.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: dd8f4bb9c965bd435fdb5012e6d9bd387f937cb40162ab454f852f89e94c5ace
products:
  - REST API Developer Guide
  - Platform Developer Content
---

# Batch Request Body

Describes a collection of subrequests to execute with the Composite Batch resource.

## Batch Collection Input

The request body contains a `batchRequests` collection that includes subrequests to execute.

**Properties**

|Name|Type|Description|Required or Optional|
|----|----|-----------|--------------------|
|`batchRequests`|[Subrequest](#subrequest)[]|Collection of subrequests to execute.|Required|
|`haltOnError`|Boolean|Controls whether a batch continues to process after a subrequest fails. The default is `false`. If the value is `false` and a subrequest in the batch doesn’t complete, Salesforce attempts to execute the subsequent subrequests in the batch. If the value is `true` and a subrequest in the batch doesn’t complete due to an HTTP response in the 400 or 500 range, Salesforce halts execution. It returns an HTTP 412 status code and a `BATCH_PROCESSING_HALTED` error message for each subsequent subrequest. The top-level request to `/composite/batch` returns HTTP 200, and the `hasErrors` property in the response is set to `true`. This setting is only applied during subrequest processing, and not during initial request deserialization. If an error is detected during deserialization, such as a syntax error in the [Subrequest](#subrequest) request data, Salesforce returns an HTTP 400 `Bad Request` error without processing any subrequests, regardless of the value of `haltOnError`. An example where this could occur is if a subrequest has an invalid `method` or `url` field.|Optional|

**Root XML Tag:** `<batch>`

**JSON example**

```nolang
{
"batchRequests" : [
    {
    "method" : "PATCH",
    "url" : "v68.0/sobjects/account/001D000000K0fXOIAZ",
    "richInput" : {"Name" : "NewName"}
    },{
    "method" : "GET",
    "url" : "v68.0/sobjects/account/001D000000K0fXOIAZ?fields=Name,BillingPostalCode"
    }]
} 
```

## Subrequest

Contains the resource, method, and accompanying information for the subrequest.

**Properties**

|Name|Type|Description|Required or Optional|
|----|----|-----------|--------------------|
|`binaryPartName`|String|The name of the binary part in the multipart request. When multiple binary parts are uploaded in one batch request, this value is used to map a request to its binary part. To prevent name collisions, use a unique value for each `binaryPartName` property in a batch request. If this value exists, a `binaryPartNameAlias` value must also exist.|Optional|
|`binaryPartNameAlias`|String|The `name` parameter in the Content-Disposition header of the binary body part. Different resources expect different values. See [Insert or Update Blob Data](https://developer.salesforce.com/docs/platform/api-rest/do-me/dome-sobject-insert-update-blob.md). If this value exists, a `binaryPartName` value must also exist.|Optional|
|`method`|String|The method to use with the requested resource. For a list of valid methods, refer to the documentation for the requested resource.|Required|
|`richInput`| |The input body for the request. The type depends on the request specified in the `url` property.|Optional|
|`url`|String|The resource to request. The URL can include any query string parameters that the subrequest supports. The query string must be URL-encoded. You can use parameters to filter response bodies. You cannot apply headers at the subrequest level.|Required|

**Root XML Tag:** `<request>`

**JSON example**

```nolang
{
    "method" : "GET",
    "url" : "v68.0/sobjects/account/001D000000K0fXOIAZ?fields=Name,BillingPostalCode"
}
```

