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.
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:
{
"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 path | Description |
|---|---|
GET /health | {"status":"ok"}. Anonymous. |
GET /api/auth/config | How to sign in: enabled, authority, audience, scope, clientId, roleClaim, developmentTokens. Anonymous; no secrets. |
POST /api/dev/token | Development only: { "subject": "dev-admin", "name": "Dev Admin", "minutes": 60 } → { access_token, token_type, expires_in }. |
GET /api/me | The caller: subject, name, isSystemAdmin, roles, and per-perspective read, write and manage. |
Entities
| Method and path | Description |
|---|---|
GET /api/entities | Query with the query language: $impl, $where, $order, $select, $skip, $take. Returns { items, skip, take, hasMore }. |
GET /api/entities/explain | The query plan for the same parameters, without running it. |
GET /api/entities/aggregate | Grouped totals. See Aggregation. |
POST /api/entities/query | A query in a JSON body, for queries too long for a URL: { implementing[], implementingAny[], where{}, filter, order, select[], skip, take }. |
POST /api/entities | Create. 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.
PATCH /api/entities/5f0c1b8e-2a43-4d0a-9d0e-0b6a1b9a7c11
If-Match: "3"
Content-Type: application/json
{ "creditLimit": 6000, "email": null }Schema
| Method and path | Description |
|---|---|
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}/interfaces | The 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 path | Who | Description |
|---|---|---|
GET /api/views | Read on the perspective | The views the caller can see. ?perspective= narrows the list. |
GET /api/views/{name} | Read | One view, with its problems. |
PUT /api/views/{name} | Manage | Create (201) or replace (200). See Views. |
DELETE /api/views/{name} | Manage | 204. |
GET /api/views/{name}/rows | Read | The 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 path | Who | Description |
|---|---|---|
GET /api/forms/layouts | Signed in | The layouts and their zones. |
GET /api/forms/webparts | Signed in | What can go on a form: field settings, and the web parts (built-in, and the latest version of each package). |
GET /api/forms | Read or Manage | The forms. ?perspective= narrows the list. |
GET /api/forms/{name} | Read or Manage | A form, with its problems. |
PUT /api/forms/{name} | Manage | Create or replace. |
DELETE /api/forms/{name} | Manage | 204. |
Workflows
System Admins only.
| Method and path | Description |
|---|---|
GET /api/workflows/nodes | The 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}/runs | Start a manual workflow: { "inputs": { … } }. 202 with the queued run; ?wait=true waits (up to 100 s) and returns it. |
GET /api/workflows/{name}/runs | Runs, 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 path | Who | Description |
|---|---|---|
GET /api/dashboards/webparts | Signed in | The installed web part packages, with their manifests and where they're served. |
GET /api/dashboards, GET /api/dashboards/{name} | Signed in | Dashboards, with each data source's resultColumns and parameterTypes, and problems. |
PUT /api/dashboards/{name}, DELETE /api/dashboards/{name} | System Admin | Create, replace or delete. |
POST /api/dashboards/{name}/data/{source} | Signed in | Run a data source with the caller's permissions: { "parameters": { "department": ["Legal"] }, "take": 100 } → { columns, rows }. |
POST /api/dashboards/data | System Admin | Run a data source that isn't saved: the designer's preview. |
Resources
| Method and path | Who | Description |
|---|---|---|
GET /api/resources/{path}, HEAD | Anyone for public; signed in for the rest | The file's bytes. Supports If-None-Match and Range. |
GET /api/resources | Signed in | The 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 Admin | 204. |
See Resources.
Security
System Admins only.
| Method and path | Description |
|---|---|
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 path | Description |
|---|---|
GET /api/plugins, GET /api/plugins/{id} | Plugins: state, handlers and triggers, workflow nodes, counts and recent errors. |
POST /api/plugins | Upload 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}/disable | Turn a plugin on or off. |
DELETE /api/plugins/{id} | Unload and delete it. Its schema stays. |
GET /api/plugins/sdk | The OmniCore.PlugIn NuGet package. |
Storage administration
System Admins only.
| Method and path | Description |
|---|---|
GET /api/stats | Entity count, file and live bytes, garbage, entities per perspective, and each index's size and state. |
POST /api/admin/compact | Rewrite 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 path | Description |
|---|---|
GET /api/connector/package | A 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/source | The generated C#, for review. |
See .NET connector.