Table of Contents


Update a record

Use this REST endpoint to update an entity record or a collection of records. Provide the updated record information in your request data and use the PATCH method of the resource with a specific record ID to update that record. Records in a single file must be of the same object type.

JSON data format:

curl PATCH 'https://{domain}/api/3.0/entity/{entity_name}/{record_id}'
 -H 'Content-Type: application/json'
 -H 'Accept: application/json'
 -H 'Authorization: Bearer {access_token}'
 -d '{record(s) in JSON format}'


XML data format:

curl PATCH 'https://{domain}/api/3.0/entity/{entity_name}/{record_id}' 
  -H 'Content-Type: application/xml'
  -H 'Accept: application/xml'
  -H 'Authorization: Bearer {access_token}'
  -d '{record(s) in XML format}'


Request

entity_name string Required

Use the entity’s API name in the REST resource path to specify the type of record you want to update.

record_id string Optional
Use this parameter to outline which record should be edited. If you also include the ID field in the payload, the ID values should match. Do not include "record_id" if you wish to edit more than one record.


Request Body

JSONdata string Required

Provide the entity data in JSON or XML format. The payload may represent a single record or an array of records. The entries must have an ID value. For optimal performance, we recommend limiting the number of records to fewer than 400.

Attention: The body payload cannot exceed 20 MB in size.

 
Example

curl PATCH 'https://{domain}/api/3.0/entity/contact/00100000000001F0001'
 -H 'Content-Type: application/json'
 -H 'Accept: application/json'
 -H 'Authorization: Bearer {access_token}'
 -d '{
     "Id": "00200000000001F0001",
     "BillingStreet": "52 Minthorn blvd",
     "BillingCountry": "CA"
    }'

 

Successful Response

HTTP 200 OK

{
   "id": "00100000000001F0001",
   "success": true,
   "errors": [],
}

If your request payload contains an array of entities, the response will also be an array. Each item (ID) in the response corresponds to its matching record in the original payload, in the same order.

 

Failed Response

HTTP 406 Not Acceptable

{
    "errors": [
        {
            "code": "Missing_Field",
            "fieldName": "LastName",
            "message": "You must enter a value."
        }
    ],
    "id": null,
    "success": false
}

The error message may include a property name, indicating which entity field the error is associated with.

 

Note: If the payload is an array of entity data, the response can include a collection of successfully saved items (with their IDs) and any items that failed to save (with corresponding error messages).

 

What Is Next?