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.

Restore deleted entities

Use GET /project/{projectId}/branch/{id}/deleted-entities to list a branch’s deleted items, newest first. Continue with the last row’s cursor as the before query parameter until next_cursor is null. Restore one item with POST /project/{projectId}/entities/{entityId}/restore, passing branch_id when needed, or restore several in one transaction with POST /project/{projectId}/entities/restore/batch and JSON entityIds and an optional branchId. Restored items return with the fields, links, and position they had when deleted. Restoring a child does not restore its parent; restore the parent too if the child should appear in hierarchy views. These restore endpoints return 204 on success. Read the branch again before retrying after a timeout.