Updates existing assets in the Data Catalog.
The PATCH Assets method allows you to update existing assets in the Data Catalog. This method follows the JSON Patch standard (RFC 6902), which provides a structured way to describe changes to a JSON document.
Understanding JSON Patch
JSON Patch is a format for describing changes to a JSON document. It consists of an array of operation objects, where each operation has:
- op: The operation type (add, remove, replace, copy, move, or test)
- path: A JSON Pointer that indicates where to apply the operation
- value: The value to use (for add, replace operations)
- from: Source path (for copy, move operation)
Key Difference from Regular PATCH
A regular patch is a simple merge operation. This is not supported by the PATCH Assets method. The PATCH Assets method implements the JSON patch standard.
The first example illustrates a simple merge operation. The method does not support the simple marge operation.
Simple merge operation (not supported)
This example illustrates a simple merge operation, which is not supported by the method.
{
"id": "65f00e903d974a9332140bf1",
"properties": [
{"name": "Name", "value": "New Name"}
]
}
JSON patch standard (supported)
This example illustrates implementation of the JSON patch standard operation, which is supported by the method.
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "replace",
"path": "/properties/0/value",
"value": "New Name"
}
]
}
Request
Header keys
| Key | Required | Type | Description |
|---|---|---|---|
| x-batch | No | boolean |
Enable asynchronous batch processing for large asset update operations. When true, returns HTTP 202 (Accepted) with execution tracking ID instead of HTTP 200 (OK) with updated assets. Use for more than 100 assets or when updates trigger expensive recalculations (display values, calculated fields, lineage aggregation). Batch mode processes updates in chunks of optimal size based on payload. |
Request body
The request body contains an array of contains an array of objects that update one or more assets. Each array item corresponds to an asset and that contains from the following properties.
| Ancestors | Property | Required | Type | Description |
|---|---|---|---|---|
| id | Yes | string | Object ID for asset (ObjectId format, matches ^[a-fA-F\d]{24}$). |
|
| patch | Yes | array(object) |
Array of JSON Patch operations. |
|
| patch | op | Yes | string |
Designates the update operation:
|
| patch | path | Yes | string | JSON Pointer path to the field. |
| patch | value | Yes | any | Value for add and replace operations. |
| patch | from | Yes | string | Source path for copy and move operations. |
| triggerWorkflow | No | boolean |
Default is true. Set to false to skip workflow triggers. |
Request body example
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "replace",
"path": "/properties",
"value":{
"name": "Name",
"value": "Sherlock_Mssql-08March2024"
}
"value":{
"name": "Description",
"value": "Test Description"
}
}
]
}
Response
Response body
Example status code responses for this method are shown here. To view the response schemas, you can download the Data Catalog APIs Open API Specification from the Precisely Developer Portal..
Response body properties
| Ancestors | Property | Required | Type | Description |
|---|---|---|---|---|
| data | array(object) | Data envelope for response. | ||
| data | id | No | string |
|
| data | parentId | No | string |
|
| data | assetTypeId | No | string |
|
| data | xref | No | array | |
| data | scoresValues | No | ||
| data | scoresUpdated | No | ||
| data | counter | No | object | |
| data/counter | value | Yes | number | |
| data/counter | valueWithPrefix | No | string | |
| data | color | No | string | |
| data | class | No | string |
This property is an enumerated string type (enum) set to one of these values:
|
| data | properties | No | array | |
| data | tags | No | array | |
| data | displayValue | No | string |
|
| data | assetTypeName | No | string | |
| data | path | No | array | |
| data | assetGroups | No | array | |
| data | semanticType | No | object | |
| data/semanticType | qualifier | Yes | string | |
| data/semanticType | overridden | No | boolean |
This property may be set to |
| data/semanticType | updatedAt | No | string |
|
| data | createdBy | No | string | |
| data | createdAt | No | string |
|
| data | updatedBy | No | string | |
| data | updatedAt | No | string |
|
| data | metrics | No | array | |
| data | assetTypeXrefs | No | array | |
| data | isPlaceholder | No | boolean |
This property may be set to |
| data | keyPath | No | string | |
| data | level | No | number | |
| data | displayPath | No | string | |
| data | location | No | string | |
| data | isLeaf | No | boolean |
This property may be set to |
Response examples
{
"data": [
{
"id": "fEdE078426900844f0944Ecc",
"assetTypeId": "d3AbCeBE2a1F760f22FCc78F",
"class": "Technical",
"createdBy": "Sample User",
"createdAt": "2024-10-01T07:51:41.666Z",
"updatedBy": "Sample User",
"updatedAt": "2004-10-06T08:44:23.634Z",
"xref": [
"Sample xref"
],
"color": "Sample color"
}
],
"links": {
"self": "https://api.cloud.precisely.com/assets"
}
}
{
"links": {
"self": "https://example.com/",
"next": "https://example.com/",
"prev": "https://example.com/"
},
"errors": [
{
"id": "string",
"status": 0,
"code": "string",
"detail": "string",
"source": {
"additionalProp1": {}
}
}
],
"data": {}
}
{
"statusCode": 400,
"error": "Bad Request",
"message": "Bad Request"
}
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Authentication required"
}
{
"statusCode": 404,
"error": "Not Found",
"message": "Resource not found"
}
{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded"
}
{
"statusCode": 500,
"error": "Internal Server Error",
"message": "An unexpected error occurred"
}
{
"statusCode": 503,
"error": "Service Unavailable",
"message": "Service temporarily unavailable"
}
{
"statusCode": 504,
"error": "Gateway Timeout",
"message": "Request timeout"
}
Using this method
Common operations
{
"op": "replace",
"path": "/fieldName",
"value": "new value"
}Adds a new value. For arrays, you can specify an index or use - to append.
{
"op": "add",
"path": "/xref",
"value": "new-xref-value"\
}
Removes a value at the specified path.
{
"op": "remove",
"path": "/fieldName"
}
Tests that a value at the path is equal to the specified value. Useful for conditional updates.
{
"op": "test",
"path": "/properties/0/name",
"value": "Name"
}
Risky method: Delete unspecified properties
This example replaces the properties array and deletes all field values that are not explicitly specified. This is considered risky because it deletes all properties except those specified.
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "replace",
"path": "/properties",
"value": [
{
"name": "Name",
"value": "New Name"
},
{
"name": "Description",
"value": "New Description"
}
]
}
]
}
]
After the completion this operation completes, the updated asset will have only the Name and Description properties. All other properties (such as Owner, Status, CreateDate will be deleted. The next section describes a safer method.
Recommended method: Update properties by index
To update a single property without affecting others, use an indexed path, as described in these examples.
[
{
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
op": "replace",
"path": "/properties/0/value",
"value": "Updated First Property Value"
}
]
}
][
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "replace",
"path": "/properties/0/value",
"value": "Updated Name"
},
{
"op": "replace",
"path": "/properties/1/value",
"value": "Updated Description"
},
{
"op": "replace",
"path": "/properties/3/value",
"value": "Updated Owner"
}
]
}
]How to find property indices
To update a property by index, you need to know its position in the properties array. To do this, first use GET /v2/catalog/assets/{id} to fetch the assets, then inspect the properties area to find the index of the property that you want to update.
Say you want to update owner and you get the following response:
{
"id": "65f00e903d974a9332140bf1",
"properties": [
{ "name": "Name", "value": "Current Name" }, // Index 0
{ "name": "Description", "value": "Current Desc" }, // Index 1
{ "name": "Status", "value": "Active" }, // Index 2
{ "name": "Owner", "value": "John Doe" } // Index 3
]
}
Owner is the third index, so you would use the path /properties/3/value.
Adding new properties
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "add",
"path": "/properties",
"value": {
"name": "NewField",
"value": "New Field Value"
}
}
]
}
]
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "add",
"path": "/properties/2",
"value": {
"name": "MiddleField",
"value": "Inserted at index 2"
}
}
]
}
]
Removing properties
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "remove",
"path": "/properties/2"
}
]
}
}
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "remove",
"path": "/properties"
}
]
}
]
Tag updates
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "replace",
"path": "/tags",
"value": [
{
"tagTypeId": "64c5be29903737baddf16f8c",
"value": "production"
},
{
"tagTypeId": "64c5be29903737baddf16f8d",
"value": "critical"
}
]
}
]
}
]
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "add",
"path": "/tags",
"value": {
"tagTypeId": "64c5be29903737baddf16f8c",
"value": "new-tag"
}
}
]
}
]
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "replace",
"path": "/tags/0/value",
"value": "updated-tag-value"
}
]
}
]
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "remove",
"path": "/tags/1"
}
]
}
]
Advanced examples
- Updates the first property value.
- Adds a new xref.
- Changes the asset color.
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "replace",
"path": "/properties/0/value",
"value": "Updated Name"
},
{
"op": "add",
"path": "/xref",
"value": "additional-xref"
},
{
"op": "replace",
"path": "/color",
"value": "#FF5733"
}
]
}
]
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "replace",
"path": "/properties/0/value",
"value": "Asset 1 Updated"
}
]
},
{
"id": "65f00e903d974a9332140bf2",
"patch": [
{
"op": "replace",
"path": "/properties/0/value",
"value": "Asset 2 Updated"
}
]
},
{
"id": "65f00e903d974a9332140bf3",
"patch": [
{
"op": "replace",
"path": "/properties/1/value",
"value": "Asset 3 Description Updated"
}
]
}
]
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "test",
"path": "/properties/2/value",
"value": "Draft"
},
{
"op": "replace",
"path": "/properties/2/value",
"value": "Published"
}
]
}
]
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "replace",
"path": "/semanticType/qualifier",
"value": "PII.EMAIL"
},
{
"op": "replace",
"path": "/semanticType/overridden",
"value": true
}
]
}
]
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "replace",
"path": "/semanticType/qualifier",
"value": "PII.EMAIL"
},
{
"op": "replace",
"path": "/semanticType/overridden",
"value": true
}
]
}
]/counter/valueWithPrefix directly. It is computed from the value.Update xref array
These examples demonstrate various ways to manage the xref (external reference) array.
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "add",
"path": "/xref",
"value": "new-external-reference"
}
]
}
]
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "replace",
"path": "/xref/0",
"value": "updated-external-reference"
}
]
}
]
[
{
"id": "65f00e903d974a9332140bf1",
"patch": [
{
"op": "remove",
"path": "/xref/1"
}
]
}
]
Common issues
Using /properties path instead of /properties/0/value deletes all other properties.
{
"op": "replace",
"path": "/properties",
"value": [
{
"name": "Name",
"value": "New Name"
}
]
}
{
"op": "replace",
"path": "/properties/0/value",
"value": "New Name"
}
{
"op": "add",
"path": "/properties",
"value": { "value": "Some Value" }
}
Fields you cannot update:
/counter/valueWithPrefix(computed from/counter/value)/createdBy/createdAt/id/assetTypeId