Developers

REST API

The database's HTTP API: entities, schema, views, forms, workflows, dashboards and more.

Every part of OmniCore talks to the database through its HTTP API. Responses are JSON. Every endpoint except /health, /api/auth/config, public resources and (in Development) /api/dev/token needs a bearer token.

powershell
Invoke-RestMethod https://omnicore.example.com/api/me -Headers @{ Authorization = "Bearer $token" }

Errors

Errors are RFC 7807 problem details (application/problem+json). Validation errors list every problem:

json
{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "Entity failed schema validation",
  "status": 400,
  "detail": "Entity failed schema validation: ...",
  "errors": ["Interface 'Customer' requires field 'accountNumber' (Account Number)."]
}

What each status means is in HTTP status codes.

Service

Method and pathDescription
GET /health{"status":"ok"}. Anonymous.
GET /api/auth/configHow to sign in: enabled, authority, audience, scope, clientId, roleClaim, developmentTokens. Anonymous; no secrets.
POST /api/dev/tokenDevelopment only: { "subject": "dev-admin", "name": "Dev Admin", "minutes": 60 } → { access_token, token_type, expires_in }.
GET /api/meThe caller: subject, name, isSystemAdmin, roles, and per-perspective read, write and manage.

Entities

Method and pathDescription
GET /api/entitiesQuery with the query language: $impl, $where, $order, $select, $skip, $take. Returns { items, skip, take, hasMore }.
GET /api/entities/explainThe query plan for the same parameters, without running it.
GET /api/entities/aggregateGrouped totals. See Aggregation.
POST /api/entities/queryA query in a JSON body, for queries too long for a URL: { implementing[], implementingAny[], where{}, filter, order, select[], skip, take }.
POST /api/entitiesCreate. Body: the entity with _interfaces and fields; _id is optional. 201 with Location and an ETag.
GET /api/entities/{id}Read. Takes $select, and If-None-Match (304 when unchanged).
PUT /api/entities/{id}Replace the fields and perspectives the caller can see. Others are kept.
PATCH /api/entities/{id}JSON merge patch: listed fields are set, null removes one, others are untouched. What a form should use to save.
DELETE /api/entities/{id}Delete. 204.
GET /api/entities/{id}/views/{perspective}The entity through one perspective: its fields in order, with display names, types, required flags and values, and the other perspectives to switch to.
PUT /api/entities/{id}/interfaces/{perspective}Add a perspective, optionally with field values (usually its required fields) in the same write.
DELETE /api/entities/{id}/interfaces/{perspective}Remove a perspective. Its values are kept; removing the last one deletes the entity.

Optimistic concurrency. Every response carries the entity's version as an ETag ("3"). Send it back as If-Match on PUT, PATCH, DELETE and the perspective endpoints, and a stale version is a 412. Or put _version in the body (a 409 if stale). Without either, writes are atomic, and the last writer wins.

http
PATCH /api/entities/5f0c1b8e-2a43-4d0a-9d0e-0b6a1b9a7c11
If-Match: "3"
Content-Type: application/json

{ "creditLimit": 6000, "email": null }

Schema

Method and pathDescription
GET /api/schema{ fields, interfaces, relationships } visible to the caller.
GET /api/schema/fields, GET /api/schema/fields/{name}Field definitions.
GET /api/schema/fields/{name}/interfacesThe perspectives that use a field.
PUT /api/schema/fields/{name}Define or update a field: { "displayName": "Credit Limit", "type": "Decimal", "description": "..." }. The type can't change.
GET /api/schema/interfaces, GET /api/schema/interfaces/{nameOrId}Perspectives, with their ids.
PUT /api/schema/interfaces/{name}Define or update a perspective: { "displayName": "Customer", "fields": [{ "field": "accountNumber", "required": true }, { "field": "email" }] }.
GET /api/schema/relationships, GET /api/schema/relationships/{name}Relationships, with their kind and ends.
PUT /api/schema/relationships/{name}Define or replace a relationship. Needs Manage on both perspectives. See Relationships.
DELETE /api/schema/relationships/{name}Remove a relationship. 204.

Views

Method and pathWhoDescription
GET /api/viewsRead on the perspectiveThe views the caller can see. ?perspective= narrows the list.
GET /api/views/{name}ReadOne view, with its problems.
PUT /api/views/{name}ManageCreate (201) or replace (200). See Views.
DELETE /api/views/{name}Manage204.
GET /api/views/{name}/rowsReadThe table: search, $order, $where, related, $skip, $take.

related=CustomerOrders:<id> keeps only the rows that refer to that entity through the relationship: what a sub-grid shows. The response has columns (with heading, type and, for relationship columns, references), rows (each with _id, _version, its values and _display names), total and hasMore.

Forms

Method and pathWhoDescription
GET /api/forms/layoutsSigned inThe layouts and their zones.
GET /api/forms/webpartsSigned inWhat can go on a form: field settings, and the web parts (built-in, and the latest version of each package).
GET /api/formsRead or ManageThe forms. ?perspective= narrows the list.
GET /api/forms/{name}Read or ManageA form, with its problems.
PUT /api/forms/{name}ManageCreate or replace.
DELETE /api/forms/{name}Manage204.

Workflows

System Admins only.

Method and pathDescription
GET /api/workflows/nodesThe node types, with their inputs and outputs.
GET /api/workflows, GET /api/workflows/{name}Workflows, with problems and (for one) its startValues.
PUT /api/workflows/{name}, DELETE /api/workflows/{name}Create, replace or delete. Deleting removes its runs too.
POST /api/workflows/{name}/runsStart a manual workflow: { "inputs": { … } }. 202 with the queued run; ?wait=true waits (up to 100 s) and returns it.
GET /api/workflows/{name}/runsRuns, newest first (?take=, default 50, at most 200).
GET /api/workflows/{name}/runs/{id}A run, with each step's inputs, outputs, log, error and the connection taken.

Dashboards

Method and pathWhoDescription
GET /api/dashboards/webpartsSigned inThe installed web part packages, with their manifests and where they're served.
GET /api/dashboards, GET /api/dashboards/{name}Signed inDashboards, with each data source's resultColumns and parameterTypes, and problems.
PUT /api/dashboards/{name}, DELETE /api/dashboards/{name}System AdminCreate, replace or delete.
POST /api/dashboards/{name}/data/{source}Signed inRun a data source with the caller's permissions: { "parameters": { "department": ["Legal"] }, "take": 100 } → { columns, rows }.
POST /api/dashboards/dataSystem AdminRun a data source that isn't saved: the designer's preview.

Resources

Method and pathWhoDescription
GET /api/resources/{path}, HEADAnyone for public; signed in for the restThe file's bytes. Supports If-None-Match and Range.
GET /api/resourcesSigned inThe catalogue: prefix, $skip, $take.
PUT /api/resources/{path}Signed in (new); uploader or System Admin (replace)Upload the raw body. X-OmniCore-Access: public or signed-in. If-Match or If-None-Match: * make it conditional.
PATCH /api/resources/{path}Uploader or System Admin{ "access": "public" }.
DELETE /api/resources/{path}Uploader or System Admin204.

See Resources.

Security

System Admins only.

Method and pathDescription
GET /api/security/roles, GET /api/security/roles/{name}Roles with their per-perspective permissions.
PUT /api/security/roles/{name}{ "description": "...", "permissions": { "Contact": ["Read"], "Customer": ["Read", "Write"] } }. Read, Write, Manage or All.
DELETE /api/security/roles/{name}Deletes the role and removes it from every assignment.
GET /api/security/assignments, GET /api/security/assignments/{subject}Role assignments.
PUT /api/security/assignments/{subject}{ "roles": ["Sales"], "displayName": "Sam from Sales" }. URL-encode subjects (auth0|123 → auth0%7C123).
DELETE /api/security/assignments/{subject}Removes an assignment.

Plugins

System Admins only.

Method and pathDescription
GET /api/plugins, GET /api/plugins/{id}Plugins: state, handlers and triggers, workflow nodes, counts and recent errors.
POST /api/pluginsUpload an .opl (raw body or multipart, up to 64 MB). 201 with the plugin and the schema it added.
POST /api/plugins/{id}/enable, POST /api/plugins/{id}/disableTurn a plugin on or off.
DELETE /api/plugins/{id}Unload and delete it. Its schema stays.
GET /api/plugins/sdkThe OmniCore.PlugIn NuGet package.

Storage administration

System Admins only.

Method and pathDescription
GET /api/statsEntity count, file and live bytes, garbage, entities per perspective, and each index's size and state.
POST /api/admin/compactRewrite the log keeping only live data, and rebuild the indexes. Blocks reads and writes while it runs.
GET /api/indexes, GET /api/indexes/{field}Field indexes.
PUT /api/indexes/{field}Create an index (201), or confirm it exists (200). Blocks writes while it builds.
DELETE /api/indexes/{field}Drop an index. One a relationship uses can't be dropped.

Connector package

Method and pathDescription
GET /api/connector/packageA NuGet package with typed interfaces and a LINQ client for the schema the caller can see. Takes packageId, version, namespace and contextName.
GET /api/connector/sourceThe generated C#, for review.

See .NET connector.