Skip to main content
A batch applies multiple writes in one transaction. Every write in that batch succeeds together, or a transaction failure rolls them all back. These examples use the authentication variables from the quickstart and a PROJECT_ID. cURL uses Bash and jq; Python uses requests; JavaScript uses Node.js 22 or later with .mjs files. First discover the project’s data model and select a category ID. Set BRANCH_ID to a branch where you intend to make changes; the alias master writes directly to Base.

Create entities

Each entry requires entityType and name. The server generates an entity ID when id is omitted. branchId applies to the entire batch.
The response is an array of entity states in the same order as the request. Save each returned id for later updates. Newly created entities are assigned to the authenticated user as owner.

Set values

Each update identifies an entity, a field key, and a value. The example updates the built-in name field on the entities just created.
The response contains the current state of each touched entity once, in first-touched order. To update custom fields, use their fields[].key and a value matching the field type returned by the data model. Tag options expose names; stage options also expose stable IDs.

Handle a failed batch

The create batch and the value batch above are separate transactions. If the second transaction fails, the entities created by the first request still exist. Correct the failed value request and retry that step after confirming current state. Both entities and updates must contain at least one entry. Send only writes for one project and one branch in each request. A transaction failure rolls back that transaction’s writes. A network timeout or an error while returning the response does not prove rollback: the write could already have committed. Read the affected entities on the same branch before retrying. Do not automatically repeat a create request with server-generated IDs.