Skip to content

Bulk Update Node Order

Given multiple parent nodes across hierarchy-enabled objects, update the order of each set of children.

PUT/api/{version}/composites/trees/{object_name}/batch
NameDescription
Content-Typeapplication/json (default) or text/csv
Acceptapplication/json (default) or application/xml or text/csv
NameDescription
object_nameThe name of the corresponding hierarchy-enabled object for which to update the node order in bulk. For example, edl__v, edl_item__v, or edl_template__v.
NameDescription
idParam
optional
To identify nodes in your input by a unique field on the corresponding record, add idParam={field_name} to the request endpoint. You can use any record field that has unique set to true in the record metadata. For example, idParam=external_id__v. If idParam is included, parent_id and id are not required in the request body.

Expressed as a JSON or a CSV.

NameDescription
parent_id
conditional
The parent node ID from the veeva_hierarchy_node table. Not required if idParam is included. If idParam is included, add parent_{field} as a unique field on the corresponding record instead.
id
conditional
The node ID from the veeva_hierarchy_node table. Not required if idParam is included. If idParam is included, add {field} as a unique field on the corresponding record instead.
order__v
required
An integer specifying the sibling ordering, indexed at 1.
{field_name}
conditional
The unique field name to use instead of the id. You must also add the idParam query parameter, such as idParam=external_id__v.
parent_{field}
conditional
The unique field name on the corresponding parent record to use instead of the parent_id. This field name should match the input of the idParam query parameter with a parent_ prefix.

If any child node update fails for a given parent, all children of that parent fail. Updates for other parent nodes still proceed.

On partial failure, the response includes both SUCCESS and FAILURE entries in the data array. Results are sorted by responseStatus (successes first), then by parent_id, then by order__v.

curl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/json" \
-d '[{"parent_id": "0000000000000AYI", "id": "0000000000000JLL", "order__v": 2}]' \
https://myvault.veevavault.com/api/v26.3/composites/trees/edl_template__v/batch
{
  "responseStatus": "SUCCESS",
  "data": [
    {
      "responseStatus": "SUCCESS",
      "data": {
        "parent_id": "0000000000000AYI",
        "id": "0000000000000JLL",
        "order__v": 1
      }
    }
  ]
}