---
schema_version: "1"
id: b8c9123b4f841e6d0c003a85f148966f3618613a552fcbdbf920a6a126410de0
title: Update a Record and Get Its Field Values in a Single Request
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/api-rest/guides/do-me/dome-composite-batch.md
canonical_url: https://developer.salesforce.com/docs/platform/api-rest/guide/dome-composite-batch.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: df8c404a094a5e93ad1c1402de7ce531a36748da4f0f44a00d59860a5465fd6c
products:
  - REST API Developer Guide
  - Platform Developer Content
---

# Update a Record and Get Its Field Values in a Single Request

Use the Composite Batch resource to execute multiple requests in a single API call.

The following example updates the name on an account and gets some of the account’s field values in a single request. The batch.json file contains the subrequest data.

## Update a record and query its name and billing postal code in a single request

```nolang
curl https://MyDomainName.my.salesforce.com/services/data/v68.0/composite/batch/ -H "Authorization: Bearer token -H "Content-Type: application/json" -d "@batch.json"
```

## Request body batch.json file

```nolang
{
"batchRequests" : [
    {
    "method" : "PATCH",
    "url" : "v68.0/sobjects/account/001D000000K0fXOIAZ",
    "richInput" : {"Name" : "NewName"}
    },{
    "method" : "GET",
    "url" : "v68.0/sobjects/account/001D000000K0fXOIAZ?fields=Name,BillingPostalCode"
    }]
} 
```

## Response body after successfully executing the subrequests

```nolang
{
   "hasErrors" : false,
   "results" : [{
      "statusCode" : 204,
      "result" : null
      },{
      "statusCode" : 200,
      "result": {
         "attributes" : {
            "type" : "Account",
            "url" : "/services/data/v68.0/sobjects/Account/001D000000K0fXOIAZ"
         },
         "Name" : "NewName",
         "BillingPostalCode" : "94105",
         "Id" : "001D000000K0fXOIAZ"
      }
   }]
}
```

**See Also**  


-   [Composite Batch](https://developer.salesforce.com/docs/platform/api-rest/resources/resources-composite-batch.md)

