Skip to main content

Data API Overview

The data branch (/data/{tenant}) is the primary API generated from the data model. It exposes every class as a REST resource — creating, reading, updating, deleting, querying, and exporting objects, plus file upload/download and a live event stream.

All paths in this branch are tenant-scoped: the first segment after /data is the tenant identifier.

/data/{tenant}/...

TypeFQN to URL mapping

Classes are identified in the model by their TypeFQNnamespace.name, for example commons.company. In the API, that identity is translated to URL segments by a fixed set of rules:

  • The namespace is dropped. Only the name part appears in the URL; the namespace is implicit in the tenant context. commons.company and my-project.company both address a resource named company.
  • Collections use the plural form. The plural is derived automatically from the singular name using English inflection rules (via the Evo inflector), so companycompanies, personpeople, agreementagreements. You never write the plural in the model — it is always computed.
  • The name is normalized to lower-first. EmploymentAgreement in the model is addressed as employmentAgreements in the URL.
ContextFormExample
Collection (list, create)pluralGET /data/{tenant}/companies
Single objectplural + idGET /data/{tenant}/companies/{id}
Related sub-resource (multi-valued / inverse)pluralGET /data/{tenant}/countries/{id}/companies
Single-valued relation field (inside object JSON)singular{ "country": "/data/{tenant}/countries/{id}" }

The internal type id is a deterministic UUID derived from the full namespace.name, so the same TypeFQN always maps to the same UUID — but that UUID does not appear in data URLs; the plural REST name does.

TODO

Confirm and document how a plural REST name is resolved back to a specific class when two namespaces define the same name (e.g. both commons.company and my-project.company). Explain the disambiguation rule (or that collisions are disallowed) and what happens on an unknown or ambiguous type name.

Endpoint map

The data branch is documented across the following pages. Every endpoint from the generated DataController is listed here; pages marked (stub) still need to be written.

Objects — Objects (stub)

MethodPathPurpose
POST{typeName}Create an object.
POST{referenceTypeName}/{referenceId}/{typeName}Create an object related to an existing one.
GET{typeName}/{id}Get a single object.
GET{typeName}/ownGet the caller's own object of this type.
PATCH{typeName}/{id}Partially update an object.
DELETE{typeName}/{id}Delete an object.

Querying — Querying objects (stub)

MethodPathPurpose
GET{typeName}List/query objects of a type (filtered, paged, sorted).
GET{relatedTypeName}/{relatedId}/{typeName}List objects related to a given object.
GET{typeName}/distinctDistinct values for a field over a filtered set.
GET{relatedTypeName}/{relatedId}/{typeName}/distinctDistinct values within a related list.
GET{typeName}/values/{fieldName}Filtered values for a field of a type.

Aggregations — Aggregations

Sum/avg/count over a filtered set. Standalone and related variants.

Global search — Global search

Full-text search across a tenant.

Files — Files (stub)

MethodPathPurpose
GETuploadObtain a signed upload URI.
GETdownload/{id}Obtain a signed download URI.

Exports — Reports & exports (stub)

MethodPathPurpose
GET{typeName}/{id}/reports/{reportName}Generate a report document and get its URI.
GETexcel/{typeName}Export a filtered list to Excel.
GETexcel/{relatedTypeName}/{relatedId}/{typeName}Export a related list to Excel.

Operations & events — Operations (stub)

MethodPathPurpose
POSTimportImport objects from an Excel file.
POSTloadDefaultDataLoad the model's default data.
POSTrebuildRebuild the tenant's data.
POST{typeName}/recalculateRecalculate formulas for a type.
POST{typeName}/syncSync a type.
DELETE(root) ?name=&deleteTenant=Delete tenant data (optionally the tenant).
GETeventStreamServer-sent event stream of data changes.