Skip to content

Bulk Operations ​

Squizy supports bulk update and bulk delete operations for all managed entities.

Bulk Update ​

Multiple records can be updated simultaneously using JSON Patch (RFC 6902) format. See the Update API reference for full endpoint details.

http
PATCH /api/product
Content-Type: application/json-patch+json

{
  "ids": ["AB-001", "AB-002", "AB-003"],
  "globalPatch": [
    { "op": "replace", "path": "/status", "value": "OUT_OF_STOCK" }
  ]
}

The globalPatch is applied to all records in ids. You can also provide specificPatches to apply per-record changes:

json
{
  "ids": ["AB-001", "AB-002"],
  "globalPatch": [
    { "op": "replace", "path": "/status", "value": "OUT_OF_STOCK" }
  ],
  "specificPatches": {
    "AB-001": [
      { "op": "replace", "path": "/price", "value": 149.99 }
    ]
  }
}

Field-Level Control ​

Not all fields can be bulk-updated. Use @SquizyField to control this:

java
// This field cannot be changed in bulk operations
@SquizyField(bulkUpdatable = false)
@NotNull
private String name;

bulkUpdatable defaults to true for updatable fields. Setting updatable = false on a field implicitly disables bulk updates as well.

Bulk Delete ​

Multiple records can be deleted in a single request:

http
DELETE /api/product?id=AB-001&id=AB-002&id=AB-003

Response: 204 No Content

Access Control ​

Bulk operations require the same authorities as their single-record counterparts (update for bulk update, delete for bulk delete). See RBAC.

Events ​

Bulk operations publish the same SquizyEntityAccessEvent as single-record operations, with all affected entities included in the values list. See Events.