Writing Data
Section titled “Writing Data”This is the write-side guide for an external client: the operations that create and change Entries, the result shapes bulk operations return per row, what validation failures actually look like on the wire, how conflicts and unique-value collisions surface, and the one write gate that has nothing to do with your credential. The shared conventions — envelope, error model, status-code resolution — live in Calling the HTTP API; the full error-code catalogue lives in Errors and retries. Every error body on this page is shown as it arrives: enveloped, success: false, with the machine-readable code in error.code.
The write surface
Section titled “The write surface”The core Entry write operations:
| Operation | Path | Notes |
|---|---|---|
| Create | POST /api/v1/entities/{entity}/entries | Body is a CreateDataEntryDto: value (required), specificationVersion (default 1), optional saveAsInvalid, systemButtonId, draft fields. Returns the created Entry. |
| Update, full value | PATCH /api/v1/entities/{entity}/entries/{id} | The body carries the Entry’s full value. Returns the updated Entry. |
| Update, JSON Patch | PATCH /api/v2/entities/{entity}/entries/{id} | Body is an array of JSON Patch operations, applied server-side (fast-json-patch). Prefer it when you touch a few fields — it narrows both the payload and the blast radius. |
| Batch create | POST /api/v1/entities/{entity}/entries/batch | One main Entry plus related Entries per relation, created in a single call. |
| Archive | DELETE /api/v1/entities/{entity}/entries/{id} | Soft delete; reversible with PATCH …/{id}/restore. |
| Permanent delete | DELETE /api/v2/entities/{entity}/entries/{id}/permanent | Irreversible. |
Batch create returns per-row results, not all-or-nothing: a mainResult of {id, success, error} and, per relation, an entries array of {id, index, success, error}. Through a view, every relation you write must be one of the view’s configured relations, or the whole call fails with 403 before anything is created.
Bulk operations and per-row results
Section titled “Bulk operations and per-row results”Bulk update and bulk upgrade select their targets the same way: either an explicit dataEntriesIds array or a selectAllModel — a “select all matching” descriptor with a sourceMode (all entries, a collection, or a relation), an optional query criteria tree, search, and appliedQuickFilters. Supplying neither is a 400. Before a large run, POST /api/v1/entities/{entity}/entries/versions/count previews how the selection spreads across entity schema versions, as {version, count} pairs.
Bulk update applies a list of updateDefinitions — each {field, type, value} where type selects the value source: 0 fixed value, 1 expression, 2 the field’s default, 3 null (BulkUpdateFieldValueSourceEnum). Two variants:
-
PATCH /api/v1/entities/{entity}/bulk-updateruns synchronously and returns the per-row accounting directly:{"success": true,"result": {"successfulUpdates": 8,"savedAsInvalid": 1,"failures": [{ "entryId": "3f2c…", "errors": ["ENTRY_VALIDATION_ERROR"] }]}}A partial success is the normal case, not an edge case: iterate
failuresand handle each row. Theerrorsarray carries error-code strings (or, for untyped failures, raw messages) — the same codes you would get from the single-row operation, minus thedetails. When you need the details for a failing row, replay that row alone through the single-Entry endpoint. -
PATCH /api/v2/entities/{entity}/bulk-updateis asynchronous: it enqueues the work and returns a message id inside the envelope ({"success": true, "result": "<messageId>"}). PollGET /api/v1/job/{messageId}for the outcome — the pattern is described in Long-running work.
Bulk upgrade rewrites Entries onto a newer entity schema version, with the same selector and the same per-row response shape (successfulUpgrades + failures). v1 is deprecated; v2 runs synchronously; PATCH /api/v3/entities/{entity}/bulk-upgrade is the asynchronous variant returning a message id. One accounting trap in the synchronous v1 path: a selected row whose stored entityVersion does not match the request’s entryVersion is skipped silently — it appears in neither successfulUpgrades nor failures, so the numbers may not add up to the rows you selected.
saveInvalidEntries (and saveAsInvalid on single writes) lets a row that fails value validation be stored anyway, flagged invalid, instead of failing — such rows are counted in savedAsInvalid. On view-scoped calls this is only honored when the view’s edit configuration allows saving invalid entries; otherwise the flag is quietly forced off.
Validation failures and their details
Section titled “Validation failures and their details”Two validation layers reject a write, with different codes and different details shapes.
Request-body validation — the schema check on the DTO itself — fails with 422 and code VALIDATION_FAILED. Its details are per-violation objects of {path, code, message, info}; an enum violation, for instance, reports code: "enum", the offending path, and info.allowedValues (see InvalidEnumValue, which mirrors exactly this shape).
Entry-value validation — the platform validating value against the Entity’s fields — fails with 400. Each single failure is code ENTRY_VALIDATION_ERROR with details {fieldName, reason}, where reason is a human-readable sentence such as "Field is required!". When every failure in a write is a field-validation failure, the writer groups them into one code ALL_ENTRY_VALIDATION_ERROR whose details are the array of those per-field objects; a mixed failure returns only the first error. A grouped failure arrives like this:
// HTTP 400{ "success": false, "result": { "errorCode": "ALL_ENTRY_VALIDATION_ERROR", "errorMessage": "Entry validation errors", "service": "data-service", "details": [ { "fieldName": "email", "reason": "Field is required!" }, { "fieldName": "skills", "reason": "the value of skills should be an array" } ], "retryable": false }, "error": { "code": "ALL_ENTRY_VALIDATION_ERROR", "message": { "en": "Entry validation errors", "ar": "أخطاء في تحقق من المدخل" }, "traceId": "…" }}Note where the details are: error itself carries only code, message and traceId. The field-level details ride on result, which on a failure holds the serialized platform exception — populated, not null. That placement comes from a response-body factory the code itself flags for refactoring, so branch your logic on error.code and the HTTP status, and read result.details defensively — errors relayed from another service can carry a different residue.
Since 1.8 — a write that would add, remove or reorder the rows of a repeatable block containing a sensitive field the caller cannot read is rejected with 400 and code SENSITIVE_FIELD_WRITE_NOT_ALLOWED: stored sensitive values re-associate with rows by position only, so a row-count change cannot be reconciled safely.
Repeatable-block rows. A repeatable block’s rows are written as one array that replaces the stored array, and each row carries a server-owned __id (Since 1.10). Echo the ids you read: two rows with the same __id in one array fail with 400 ENTRY_VALIDATION_ERROR (reason duplicate __id in <field>: <ids>). Through a view that grants only some of the block’s columns, the stored values of the other columns are restored for each row (Since 1.4), but from release 1.10.1 only for rows whose __id matches a stored row; a row sent without an id is a new row and gets nothing restored (Since 1.10). The full contract is on Block: saving rows through a view.
Update conflicts
Section titled “Update conflicts”Since 1.10 — Entries now carry an optimistic-concurrency token of their own. An earlier version of this page said they did not; that is no longer true, and a client written against the old advice is losing updates it could be catching.
updateIdentifier is a token the server keeps on every Entry and rotates on every write. You do not create it, and you cannot set it: it arrives with the Entry on every read, and the server replaces it each time the Entry changes.
The check is opt-in per request. There is no tenant-wide switch, no global setting and no feature flag to turn on — you opt in on the one write you want guarded, by sending back the token you read with the copy you are changing. Omit it and the write behaves exactly as it always has: last writer wins.
There are exactly three ways to send it, and no header form — no If-Match, no ETag:
| Operation | Where the token travels |
|---|---|
PATCH /api/v1/entities/{entity}/entries/{id} | Body property updateIdentifier, alongside value |
PATCH /api/v2/entities/{entity}/entries/{id} | Query parameter updateIdentifier — this operation’s body is a JSON Patch array and cannot carry it |
PUT /api/v1/views/{id}/entries/{entryId} | Body property updateIdentifier |
So the recipe is four steps, and it is the same on all three:
- Read the Entry with whatever call you already make. The token rides on the response — no extra request.
- Keep the token next to the copy you are editing, not next to the form payload you are about to send. It describes the version you read.
- Send it back with your change, in the position the table above gives for your operation.
- On a
409, re-read, re-apply, re-send. The response tells you someone else wrote the Entry after you read it. Re-read to get the current copy and the current token, re-apply your intended change on top of it, and send again. Never retry the same request unchanged — it carries the stale token and will conflict identically every time.
An Entry that has no stored token yet is never rejected on that account: the comparison is skipped, the token is stamped on that write, and the Entry is guarded from its next write onward. There is no migration to run and nothing for your client to detect first.
Definition objects have worked this way for longer. Entities, Views, Queries, relations and collections all carry an updateIdentifier that you read with the object and must send back unchanged; if it no longer matches what is stored — someone else saved in between — the write fails with 409 and code UPDATE_CONFLICT (UpdateIdentifierConflictException). Entry conflicts return the identical body:
// HTTP 409{ "success": false, "result": { "errorCode": "UPDATE_CONFLICT", "errorMessage": "Update conflict updateIdentifier value not match with the one in the database", "service": "data-service", "retryable": false }, "error": { "code": "UPDATE_CONFLICT", "message": { "en": "UPDATE_CONFLICT", "ar": "" }, "traceId": "…" }}The recovery is always the same: re-read the object, reapply your change on the fresh copy, and resubmit with the new updateIdentifier. Do not retry the stale request — it will fail identically every time. A definition write can also fail with a locked-object error when another user holds an edit lock on the object; that one clears when the lock does.
A client that also holds a socket connection can hear about the change before it tries to save: the entries/value-updated event now carries the Entry’s current updateIdentifier, so a page can compare it against the token it holds and warn the user rather than waiting for the 409. That is a live, best-effort notice and not a substitute for the check — see Real-Time.
Unique-value collisions
Section titled “Unique-value collisions”When a write violates a unique field, the storage layer surfaces a MongoDB duplicate-key error (code 11000). The data plane normalises it — in the writer’s create, update and upgrade paths, with a final backstop in the shared reject provider — into a 400 with code UNIQUE_VALUE and a details.field describing the collision:
// HTTP 400{ "success": false, "result": { "errorCode": "UNIQUE_VALUE", "errorMessage": "email is unique", "service": "", "details": { "field": { "path": "email", "originalPath": "value.email", "value": "jane@example.com" } }, "retryable": false }, "error": { "code": "UNIQUE_VALUE", "message": { "en": "UNIQUE_VALUE", "ar": "" }, "traceId": "…" }}path is the field as you know it — the storage prefix is stripped from the index key, so value.email becomes email — while originalPath keeps the raw key and value is the offending value (UniqueValueException). Treat UNIQUE_VALUE as terminal for that payload: retrying without changing the value fails identically. In bulk operations the same collision appears as a per-row failure instead of failing the batch.
The human-verification gate on anonymous writes
Section titled “The human-verification gate on anonymous writes”Since 1.8 — Entry create and both update operations assert human verification before writing. The gate is narrower than it sounds, and for most headless clients it never fires — all three conditions must hold:
- the request is view-scoped, targeting a Data View whose anonymous configuration has
humanVerification.enabled: true, and - the caller is anonymous — no authenticated user on the request.
A signed-in user, an application token, or any OAuth-authenticated client is never challenged. The gate exists for the remaining case: driving a public anonymous form programmatically. There the client must solve an Altcha proof-of-work challenge — fetch it from GET /api/human/challenge, compute the solution, and send it in the x-altcha-token header with the write. The gateway verifies the solution and injects x-human-verification: true upstream, stripping any client-supplied copy of that header first so it cannot be spoofed. An anonymous write without a valid solution fails with 403 and the message Human verification required to perform this action. Configuring the feature is an administrator concern — see Human Verification.
Write refusals added in 1.10 Since 1.10
Section titled “Write refusals added in 1.10 Since 1.10”Five refusals a write client can newly meet on the 1.10 line. Each is a stable code — none is worth retrying unchanged except the 503s:
| Status | error.code | When | What to do |
|---|---|---|---|
400 | MISSING_REQUIRED_PARAMETER | An entry or draft create (POST /api/v1/entities/{entity}/entries, …/entries/draft, and the two /api/v1/views/{id}/entries forms) sent with no body at all. The create body is now required; a request with a body is validated as before. | Send the CreateDataEntryDto. |
403 | ENTRY_CAP_EXCEEDED | Creating an entry — single, batch, draft or through a proxy — when the tenant’s plan limit is reached and no overage is granted. Updates, archives and reads are never refused. details: {cap, hardLimit, current}. | Stop creating; the tenant’s administrator must raise the plan or archive entries. |
400 | FILE_EXPIRED | The save references an uploaded temporary file that expired before the save promoted it. details lists {fileId, fieldName?, path?, reason} per file. | Upload the file again and re-save with the new id. |
503 | STORAGE_SERVICE_UNAVAILABLE | Storage could not be reached and the save adds a file that is not already on the entry. A save that adds no new file goes ahead. | Retry with backoff. |
503 | TENANT_IN_MAINTENANCE | Multi-tenant deployments: the tenant’s data is being restored, or the tenant is being moved. Comes with Retry-After. | Wait Retry-After seconds, then retry. |
Executing a workflow action that is hidden on the entry is now 422 WORKFLOW_ACTION_EXECUTION_NOT_ALLOWED, and taking ownership of a step that already has an owner is 422 CURRENT_STEP_ALREADY_OWNED — both used to be 500. The complete list is under Typed refusals and Plan limits.
Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27