When using the PATCH method to update objects via the Automic Automation REST API, users may experience unexpected data loss. While many REST implementations use PATCH for partial updates to specific fields, the Automic Automation API implementation may strip attributes within an array or object if they are not explicitly included in the PATCH payload.
Symptoms
After performing a PATCH request to update a specific attribute of an object (such as a VARA value or an RA FTP connection setting), other attributes within the same section are deleted or reset to default values.
Examples of unexpected behavior:
value of a host destination without including "is_connection": 1 results in the connection being treated as a local file system path because the is_connection flag is reset to 0.value1 in a static VARA via PATCH without including value2 through value5 results in the removal of the data in columns 2-5.The PATCH method in the Automic Automation API does not perform a "deep merge" for all object types. When updating arrays or nested structures (like static_values or RA attributes), the API often replaces the existing array/structure with the new one provided in the payload. Any existing data omitted from the payload is removed.
Resolution To prevent data loss when using the PATCH method, follow these best practices:
GET request on the object to retrieve the current full data structure.PATCH payload, include the full array or object structure for the section you are modifying, ensuring all existing values you wish to keep are present alongside your changes.PATCH behavior matches expectations for the specific object type.
Example: Safe Update for VARA values To update value1 while preserving value2-5, the payload must include all columns:
{ "data": { "vara": { "static_values": [ { "key": "####", "validity_range": "FREI", "value1": "UPDATED_VALUE", "value2": "EXISTING_VALUE", "value3": "EXISTING_VALUE", "value4": "EXISTING_VALUE", "value5": "EXISTING_VALUE" } ] } }}
For more details on REST API structures, see the AE REST API documentation.