Skip to content

Alongside the ZIP packaging system, data-service carries a second, older transfer mechanism: exporting modules and entities as a single JSON file and replaying that file into another space. It is genuinely one file — which is why people find it attractive — but it moves definitions of modules and entities and very little else. This page documents its format, its endpoints, and — plainly — what it will not carry, so you can decide when the packaging system is the right tool instead.

The two systems do not share code, formats or endpoints. Packaging lives in packaging-service under /api/packaging; this path lives in data-service under the core /api prefix. The similarity of their URL shapes (/v1/import/… in both) is coincidence, not compatibility.

The file is an ImportExportModel:

FieldTypeMeaning
specificationVersionnumberFile-format version. The current exporter writes 1; the import path does not branch on it
kind"DataEntity" | "DataModule"What the file transfers (ImportExportKindEnum)
dataModulesarray, optionalModule definitions — present for module-kind files
dataEntitiesarrayEntity definitions

Each entity in dataEntities is a FullDataEntity: the complete entity definition — fields, workflows, internal entities, form settings, sharing — plus embedded arrays the exporter fills in: triggers (the entity’s reactions), queries, views, lists (collections) and relations. Do not let those arrays mislead you about what the import will do with them; see What it will not carry below.

Portability comes from normalized names: the exporter rewrites entity-reference field sources from ids to entity normalized names, resolves auto-increment counters into inline options, and (for module exports) records each entity’s module by normalized name (exportEntities).

Both export endpoints respond with a file download — an application/json attachment named after the first exported resource. They write the response themselves, so the body is the bare JSON document, not the {success, result} envelope that wraps ordinary API responses (see Calling the HTTP API). The import endpoints below, by contrast, are ordinary enveloped operations.

Body: {"dataEntities": [{"id": "…"}, …]}. Exports the named entities as a kind: "DataEntity" file. Edit permission is checked per entity; a denial is a 403 with code CANNOT_EXPORT_ENTITY.

Body: {"dataModules": [{"id": "…", "dataEntities": [{"id": "…"}, …]}, …]}. Exports the named modules together with the listed entities of each, as a kind: "DataModule" file that carries both dataModules and dataEntities. Each module must exist in the calling space, and the per-entity permission check applies here too.

Import is deliberately two-phase, and the file travels by reference: upload the JSON to the storage service first, then pass its file id in the path. An unparseable file is rejected with IMPORT_FILE_IS_INVALID; a kind outside the enum with FILE_KIND_NOT_SUPPORTED.

Parses the file and reports what would happen, writing nothing. The body is {"moduleId": "…"} — optional in the schema, but for an entity-kind file it is required in practice: such a file carries no modules of its own, so without a target module the import cannot resolve where the entities land and fails with a module-not-found error (prepareImportData). For a module-kind file the body’s moduleId is ignored; modules come from the file.

The response is an ImportResultDto: per-item summaries for entities and modules — {resourceTempId, normalizedName, name, alreadyExists, allowOverride} — a dependencyMap of intra-file entity dependencies, and an errors[] array of {resourceTempId, path, errorCode, errorMessage}. Duplicated normalized names inside the file are flagged (ENTITY_DUPLICATED_INSIDE_IMPORT_FILE, MODULE_DUPLICATED_INSIDE_IMPORT_FILE), as are unresolvable entity references.

POST /v1/import/{fileId}/confirm — the apply

Section titled “POST /v1/import/{fileId}/confirm — the apply”

Same path shape, same body, plus one gate: confirming needs a license that includes administration — inspecting a package changes nothing, applying one is a configuration change (403 LICENSE_ADMIN_FEATURE_REQUIRED otherwise). The confirm re-runs the dry-run analysis and refuses entirely (IMPORT_FILE_IS_INVALID) if it reports any error, or any colliding resource that does not allow override — there is no partial apply and no per-resource opt-out.

When it proceeds, it creates or updates the modules, then creates or overwrites the entities in dependency order (sortEntitiesByDependencies; a reference cycle aborts with CIRCULAR_DEPENDENCY_DETECTED), and — for an entity-kind file only — recreates the reactions embedded as triggers. Entity creation and overwrite run asynchronously through the platform’s command bus, so the HTTP response confirms acceptance of the whole set rather than completed materialisation of every entity.

Since 1.10 two more checks run before anything is written, and each refuses the whole confirm:

  • Installed resources — overwriting a module or entity that came from an installed package, or creating an entity inside an installed module, is refused with 403 PACKAGE_RESOURCE_READ_ONLY. Fork the installation first; see installed resources.
  • The entity cap — when the tenant’s plan sets an entity cap, an import that would create more entities than the cap leaves room for is refused with 403 ENTITY_CAP_EXCEEDED.

Existing resources are matched by normalizedName within the target space, and the allowOverride flag in the dry-run report is the whole contract (isEntityExistsResult / isModuleExistsResult):

CaseOverwritable?
Entity exists, has no entries, name not reservedyes — the definition is overwritten in place
Entity exists and has entriesno — the import is blocked
Entity name is a reserved word (switch, new, class, …)no
Module existsyes — name, description, icon and sharing are updated
Module is the core moduleno

The entries rule is the one that surprises people: this mechanism can refresh the definition of an entity only while that entity is still empty in the target. Once real data exists, the JSON transfer will not touch it — schema evolution of a live entity is a different problem, and this tool declines it.

The file format looks richer than the import is. State of the code today:

  • Views, queries, collections, relations — embedded in the file by export, but never replayed: the import materialises only modules, entities and reactions, and the entity-creation path carries the entity definition alone. The embedded arrays are dead weight on arrival.
  • Reactions — only half-carried. An entity-kind confirm recreates the embedded triggers; a module-kind confirm drops them — its code path never dispatches the prepared reactions. If reactions must travel with a module, this path will not do it.
  • Entries — definitions only, never data. Nothing entry-shaped exists in the format.
  • Everything outside the module/entity pair — dashboards, reports, functions, system buttons, statistic queries, counter widgets, announcements, pages/generic views: no representation in the format at all.
  • Identity and permissions — no principal mapping, no value references, no permission grants beyond the sharing field embedded in the module and entity definitions.
  • Process — no session, no configure step, no per-resource actions, no payload overrides, no retry. Confirm is one shot: it applies everything or refuses everything.

Use this JSON path for what it is: a quick, single-file copy of module and entity skeletons between spaces — a starting schema, a template of empty entities, a definition refresh while the target is still empty.

Reach for the packaging system the moment any of the following is true: views, queries, reactions-with-modules, reports or any other resource type must travel; references to users, groups or entries need remapping rather than luck; existing target resources need per-resource create/overwrite/skip decisions; you need a validation report you can act on, payload overrides, retry, or an audit trail. That system’s single-file question — “can I get one JSON with everything?” — is answered honestly in The package format: a full solution package is a multi-file ZIP, and this JSON path is not a substitute for it.

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