Skip to content

Batch process entity operations (create, overwrite, update, delete)

POST
/api/v2026-01/projects/entities/batch
curl --request POST \
--url https://api.zstrike.io/api/v2026-01/projects/entities/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-op-id: example' \
--header 'x-session-id: example' \
--data '{ "entities": [ { "operation": "create", "uid": { "id": "alice" }, "attrs": { "email": "alice@example.com", "name": "Alice Smith" }, "parents": [ { "id": "users" } ] }, { "operation": "overwrite", "uid": { "id": "bob" }, "attrs": { "email": "bob.updated@example.com", "name": "Bob Johnson", "role": "admin" }, "parents": [ { "id": "admins" } ] }, { "operation": "update", "uid": { "id": "charlie" }, "attrs_patches": [ { "op": "replace", "path": "/email", "value": "charlie.new@example.com" }, { "op": "remove", "path": "/tempField" } ], "add_parents": [ { "id": "admins" } ], "remove_parents": [ { "id": "guests" } ] }, { "operation": "delete", "uid": { "id": "dave" } } ] }'

Batch process multiple entity operations in a single request.

CREATE Operation: Creates a new entity with uid, attrs, and parents. Fails if entity already exists.

OVERWRITE Operation: Creates a new entity or replaces an existing one with the provided uid, attrs, and parents.

UPDATE Operation: Updates an existing entity using JSON Patch operations for attrs and add/remove operations for parents.

  • attrs_patches: Array of JSON Patch operations (replace/remove) to apply to entity attributes
  • add_parents: Array of parents to add (duplicates are ignored)
  • remove_parents: Array of parents to remove

DELETE Operation: Deletes an entity by uid.

x-op-id
required
string

Operation ID

x-session-id
required
string

Session ID

Media typeapplication/json
object
entities
required
Array
>= 1 items
One of:
object
operation
required
string
Allowed values: create
uid
required
object
type
required
string
id
required
string
attrs
required
object
parents
required
Array<object>
object
type
required
string
id
required
string

Examples

Examplemixed_operations

Mixed operations example

{
"entities": [
{
"operation": "create",
"uid": {
"id": "alice"
},
"attrs": {
"email": "alice@example.com",
"name": "Alice Smith"
},
"parents": [
{
"id": "users"
}
]
},
{
"operation": "overwrite",
"uid": {
"id": "bob"
},
"attrs": {
"email": "bob.updated@example.com",
"name": "Bob Johnson",
"role": "admin"
},
"parents": [
{
"id": "admins"
}
]
},
{
"operation": "update",
"uid": {
"id": "charlie"
},
"attrs_patches": [
{
"op": "replace",
"path": "/email",
"value": "charlie.new@example.com"
},
{
"op": "remove",
"path": "/tempField"
}
],
"add_parents": [
{
"id": "admins"
}
],
"remove_parents": [
{
"id": "guests"
}
]
},
{
"operation": "delete",
"uid": {
"id": "dave"
}
}
]
}

Batch operation results

Media typeapplication/json
object
code
string
description
string
success
boolean
data
object
message
string
totalOperations
integer
successCount
integer
failureCount
integer
results
Array<object>
object
index
integer
operation
string
entity
string
success
boolean
errors
Array<object>
object
index
integer
operation
string
entity
string
error
string
op_id
string
timestamp
string format: date-time

Example

{
"code": "S200",
"description": "Operation Successful",
"success": true,
"data": {
"message": "Batch processing completed. 3 succeeded, 1 failed.",
"totalOperations": 4,
"successCount": 3,
"failureCount": 1
},
"op_id": "op_example",
"timestamp": "2025-11-25T07:47:24.158Z"
}

Bad Request

Media typeapplication/json
object
code
string
description
string
success
boolean
errors
Array<string>
op_id
string
timestamp
string format: date-time

Example

{
"code": "E400",
"description": "Bad Request",
"success": false,
"errors": [
"Error Message 1",
"Error Message 2"
],
"op_id": "op_example"
}

Unauthorized

Media typeapplication/json
object
code
string
description
string
success
boolean
errors
Array<string>
op_id
string
timestamp
string format: date-time

Example

{
"code": "E401",
"description": "Unauthorized",
"success": false,
"errors": [
"Unauthorized"
],
"op_id": "op_example"
}

Forbidden

Media typeapplication/json
object
code
string
description
string
success
boolean
errors
Array<string>
op_id
string
timestamp
string format: date-time

Example

{
"code": "E403",
"description": "Forbidden",
"success": false,
"errors": [
"Forbidden"
],
"op_id": "op_example"
}

Not Found

Media typeapplication/json
object
code
string
description
string
success
boolean
errors
Array<string>
op_id
string
timestamp
string format: date-time

Example

{
"code": "E404",
"description": "Not Found",
"success": false,
"errors": [
"Not Found"
],
"op_id": "op_example"
}

Internal Server Error

Media typeapplication/json
object
code
string
description
string
success
boolean
errors
Array<string>
op_id
string
timestamp
string format: date-time

Example

{
"code": "E500",
"description": "Internal Server Error",
"success": false,
"errors": [
"Internal Server Error"
]
}