Skip to content

API Reference

Consystence exposes two HTTP surfaces, differing in audience and addressing:

  • The in-cell server API/api/... served cell-direct from a tenant’s own cell at https://{org}.consystence.com. This is the canonical programmatic surface — what external integrations, the SDK, and the CLI call (the org subdomain CNAMEs straight to the cell). It covers site setup and activation, the controller/tag engineering model, historian ingest, and tenant administration.
  • The account control-plane API/api/... at https://account.consystence.com: account identity, tenant listing and routing hand-off, sandbox provisioning, and org management. See below.

The in-cell API is served by the Consystence server — one codebase published as either a cloud organisation/cell manager or an on-premises site server (the mode is baked into the artifact at publish time); which endpoints are active depends on the mode. For how the platform is organised into accounts, cells, orgs, and sites, see the platform overview and org & site model.

flowchart LR
  Client["API client<br/>(browser, CLI, integration)"]
  Srv["In-cell server API<br/>{org}.consystence.com/api/..."]
  Acc["Account control plane<br/>account.consystence.com/api/..."]
  Client -->|"Authorization: Bearer / X-Api-Key csk_*"| Srv
  Client -->|"Authorization: Bearer"| Acc

Everything under /api/... (plus /auth/... and /.well-known/jwks.json) is the server’s own surface, reached directly at the org subdomain {org}.consystence.com. It is grouped roughly as follows:

AreaEndpoint groupsPurpose
Engineering modelsites, controllers, datapoints, controller tag management, instances, electrical, subscriptionsDefine sites, controllers (ControlLogix / PLCnext / Modbus), tags, device instances, the electrical model, and data subscriptions.
Operationsedge commands, operational reads, historian ingest, AI endpointsIssue edge commands, read live operational state (instance tag values, historian trend windows, active alarms, the command-audit ledger), ingest historian/model data into a cell, and serve AI completions (the site-facing /api/ai group — health and completions — plus the cloud proxy /api/cloud/ai/*).
Tenant administrationadmin/orgs, members, domains, admin/api-keys, sync keysManage organisations, memberships and roles, domain bindings, and API keys. Licence state is read inline on the org detail; issuance lives in the account console.
Configurationadmin/config, admin/orgs/{slug}/configThe audited platform config store (platform-admin: list, set/unset by key, audit trail, reload) and the org-scoped config keys (gated on the org’s own owner/admin).
Identity & sessionauth/login, auth/callback, auth/token, auth/logout, jwks.jsonInteractive login/callback and session token issuance. OIDC discovery is consumed, not served.
Lifecyclesetup/status, setup/site-activation, setup/reset, provisionSetup status, code-keyed site activation, factory reset, and org provisioning (account → cell).

The account service at https://account.consystence.com exposes its own small JSON API — the machine seam behind the account console and the CLI’s account context (see the CLI). Callers authenticate as the CIAM account identity (keyed on the Entra oid):

EndpointPurpose
GET /api/meThe signed-in account’s profile.
GET /api/tenantsThe account’s tenants — slug, canonical domain, org type, and status (never a cell host).
GET /route?tenant={slug}Hand-off to a tenant’s own host: 302 to the canonical domain; 404 when the account has no (or no such) tenant; 409 with a tenant list when ambiguous; a suspended tenant bounces to the billing surface.
POST /api/provisionSelf-serve sandbox provisioning into {slug}.consystence.dev: 200 provisioned or already provisioned, 202 accepted — pending operator approval ({"status":"pending_approval"}), 400 invalid or reserved slug, 409 slug conflict or quota ceiling, 429 rate-limited, 402 entitlement denied, 502 upstream failure (the intent is durable — a retry resumes idempotently).
/api/orgs/*Org management: create/list orgs, org detail and licences, tier requests, invites, member removal, and org-scoped provisioning.

The in-cell surface sits behind a single multi-scheme selector (“MultiAuth”) that picks an authentication handler per request. In brief, the schemes are:

  • CIAM Bearer — Entra External ID tokens from id.consystence.com (Authorization: Bearer …). The stable membership key is the Entra oid; email is a verified attribute, not the identity.
  • X-Api-Key — tenant API keys, prefix csk_, minted at POST /api/admin/api-keys (shown in plaintext once). See API keys.
  • Locally-issued JWT — site-PIN tokens for offline-capable on-premises sites.
  • TestScheme — test-only.

There is no email/password sign-in, no /register, no MFA or switch-org endpoint, and no refresh for CIAM. Platform-admin is a Consystence-staff role, not a licence authority. The full selector, policies, and token flows are covered in the authentication model.

The in-cell surface is unversioned; the generated OpenAPI document currently reports v0.1. A versioned public API surface may be introduced later as a deliberate product decision — there is none today.

Errors are a flat JSON object with a single error string — not RFC 7807 ProblemDetails:

{ "error": "Device instance 'PP-01' already exists at site 'pit-1'" }

Some endpoints attach extra context fields alongside error (for example a list of missing IDs); successful action endpoints may return { "message": "…" }. Status codes follow HTTP convention: 400 validation, 401/403 auth, 404 not found, 409 conflict. A handful of operator endpoints (for example org re-bootstrap conflicts) return RFC 7807 problem responses instead — treat the flat error object as the convention, not an invariant.

Sites are addressed by their code as a path segment (/api/sites/{code}) — a site is a path under the org, never its own domain. Device types use reusable dotted IDs (consystence.pump.centrifugal); device instances are per-site and carry an asset number (PP-01). See the type system.

The machine-generated endpoint list is published as rendered OpenAPI at /api/reference/. It is CLI-scoped: it documents the supported public (CLI-exposed) endpoint surface — the paths the CLI drives — with each path’s verbs, tags, and request/response schemas. Server-to-server and operator-internal endpoints are documented in the companion guides instead.

For task-oriented depth, start with the guide that matches your goal: