Docs menu

REST API

Consumer endpoints live under /ox-api/ on your workspace host (https://openx.fathym.com). The full OpenAPI spec, filtered to your access rights, is at GET /ox-api/openapi. Every call takes a bearer token - see Call the API from your app for which token and headers to send, and Auth & Tokens. There is no GraphQL API; use REST or connect any AI over MCP.

Warm queries

Run a named warm query - GET /ox-api/warm-queries/{lookup}

Runs a saved warm query by its lookup (or its API path). A query's declared parameters are read from the query string.

curl -X GET 'https://openx.fathym.com/ox-api/warm-queries/{lookup}' \
  -H 'Authorization: Bearer YOUR_TOKEN'

The answer is one JSON object with an output for each output the query declares, keyed by the output's name. A query saved as plain text has one, named result. A row is a list of values in the order of Columns, not a record:

{
  "Engine": "steps",
  "Outputs": {
    "result": {
      "Status": "Succeeded",
      "Columns": [{ "Name": "Hour", "Type": "datetime" }, { "Name": "Signups", "Type": "long" }],
      "Rows": [["2026-10-18T09:00:00Z", 12]],
      "Page": { "Truncated": false }
    }
  }
}

An output's Status is Succeeded, Skipped or Failed; a Skipped or Failed one carries no Columns or Rows, and a Failed one carries a Code, a Message and a Remedy. Page.Truncated is true, with a Reason, when the source cut the table. The API adds no row cap of its own; the engine's limits apply (see Limits). A saved query that does not exist is 404; one with no query text yet is 400.

Run a draft query - POST /ox-api/warm-queries

Body: the envelope { WarmQuery, Arguments?, Steps?, Sample?, CheckOnly?, Compile? }, with the whole draft record as WarmQuery: the same shape a saved query has, its Details with Steps and Outputs (over MCP, get_workspace with kinds: ["WarmQueries"] returns saved ones to start from). CheckOnly: true checks it and reads no data; Sample returns the first rows of one step. A draft run is bounded to 10,000 rows a step, 30 seconds and a 100-row preview, and saves nothing. A bare { "Query": ... } body is refused with WARM_QUERY_BODY_LEGACY.

Compile: true goes one step further than CheckOnly: it runs the same save rules, then asks the engine to plan each step against this workspace's real data. It answers 200 { Valid, Refusals, Steps }. Steps holds, per step, the Columns the step's text would answer (each with its Name and Type). A step the engine refuses, a wrong column name or text that is not valid KQL, is a refusal that names the Step, carries a Remedy, and gives the engine's own words in EngineDetail. Send Steps with Compile to compile only the steps you name. CheckOnly keeps its contract and calls no engine. Compile is the step between checking a draft and running it.

What compiling reads depends on the step's engine:

EngineWhat Compile doesWhat the step's entry in Steps holds
kqlAzure Data Explorer plans the text against the real table. No rows are read.Columns, each with a Name and a Type
cosmos-nosqlReads one document of the step's container with the step's own query, on the workspace's own Cosmos account, within at most 5,000 RU (the step's own Limits.CostBudgetRU when that is lower).Columns with the Name of each field of that document and its JSON Type, never a value, and a Note. No columns when the step read no document or its rows are plain values

The Note on a Cosmos step says what compiling did not prove: Cosmos holds no schema, so only the query text was checked, and a wrong field name is not an error in Cosmos, it reads as missing. Check a Cosmos field name against the documents retrieve_inventory returns with includeSample (see retrieve_inventory).

A draft run answers Warnings beside its outputs, an empty list when there is nothing to say. A warning never stops a run, and it names a column, an output or a step, never a row value. Each is { Code, Message, Remedy }, with Output, Step or Column when one applies, and Nearest on FIELD_NOT_SENT:

CodeMeans
NO_ROWSAn output came back with no rows. Check the time window and the filters
EMPTY_COLUMNA column is null or blank text in every row the run shows, often a field no device sends. A hint from those rows only, and Message says how many it saw. An empty object, an empty list or a date is a value and never warns
TAKE_WITHOUT_ORDERA kql step takes rows with take or limit and no order first, so each run can answer other rows
FIELD_NOT_SENTA kql step reads a payload field (Column, such as RawData.temp) that no device of the query's connections sent in the last 7 days. Nearest names the 3 closest fields they did send. When those 7 days cannot be read, it is not warned

A saved query's run answers no Warnings.

Cold-data export

A data connection or a surface

GET /ox-api/downloads/data-connections/{lookup}/cold streams one data connection's stored cold files, and GET /ox-api/downloads/surfaces/{surfaceLookup} the stored cold files of every connection on a surface, in one file. The rows come back in the response; there is no second step.

Query keyMeaning
fromStart of the window (ISO 8601). Default: 7 days before to
toEnd of the window (ISO 8601). Default: now
formatcsv or jsonl. Default jsonl
downloadtrue (or just download) answers the rows as an attachment
curl 'https://openx.fathym.com/ox-api/downloads/data-connections/<lookup>/cold?format=csv&download=true' \
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Any other key is refused with 400 COLD_FILE_UNKNOWN_QUERY_KEY, naming the keys it reads. Another format is 400 COLD_FILE_BAD_FORMAT, another download value 400 COLD_FILE_BAD_DOWNLOAD, and a window that cannot be read, or a from after to, 400 COLD_EXPORT_BAD_WINDOW.

A warm query's rows as a file

A warm query's whole result can be built as one file, on the query's own address. Two reserved query keys turn the address into the download: $cold, which takes only true, and $requestId, which names one build.

StepSaved queryDraft
StartPOST /ox-api/warm-queries/{lookup}?$cold=truePOST /ox-api/warm-queries?$cold=true
FetchGET /ox-api/warm-queries/{lookup}?$cold=true&$requestId=<id>GET /ox-api/warm-queries?$cold=true&$requestId=<id>
ListGET /ox-api/warm-queries/{lookup}?$cold=trueGET /ox-api/warm-queries?$cold=true

In a shell, quote the URL in single quotes, or the shell reads $cold as a variable:

curl -X POST 'https://openx.fathym.com/ox-api/warm-queries/<lookup>?$cold=true' \
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"format": "csv"}'

curl 'https://openx.fathym.com/ox-api/warm-queries/<lookup>?$cold=true&$requestId=<requestId>' \
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Start. A saved query takes its declared parameters in the query string, as a run does, and an optional body { format, from, to, includeHeaders }: format is csv (the default) or jsonl, and includeHeaders (a csv header row) is on unless you send false. A draft sends its envelope { WarmQuery, Arguments?, Steps? } plus those keys. The answer is 202 { status: "building", requestId, downloadUrl }, with a Location header for the fetch and Retry-After: 2. The file builds in the background, even if you hang up.

Fetch. 202 { status: "building", requestId } while it builds. Then the file, once: text/csv or application/x-ndjson, as an attachment. A second fetch is 404 COLD_EXPORT_NOT_FOUND. Only the caller who started a build can fetch it; anyone else gets 403 COLD_EXPORT_OTHER_CALLER. A finished file is kept for one hour.

List. $cold=true with no $requestId lists your own downloads of that query, never anyone else's.

The file is every row; there is no paging and no row cap. To get fewer rows, say so in the query.

StatusCodeWhen
405none (Allow: GET)A POST to a saved query with no $cold key: a saved query runs on GET
405none (Allow: POST)A GET of /ox-api/warm-queries with no $cold key: a draft runs on POST
400WARM_QUERY_RESERVED_KEY_INVALID$cold with any value but true ($cold=false too), $requestId on a GET without $cold=true, or $requestId on a POST
400WARM_QUERY_RESERVED_KEY_UNKNOWNAny other query key starting with $. The answer names it, and the known keys
400COLD_EXPORT_UNKNOWN_BODY_KEYA body key the start does not read, such as page or pageSize
400COLD_EXPORT_MODE_REFUSEDA draft start with Sample, CheckOnly or Compile: none makes a file
409COLD_EXPORT_CHECK_REFUSEDThe query fails the checks made before anything is built; Refusals lists each
409TELEMETRY_REQUIRES_PRIVATE_IOT"Set up IoT for this workspace first. Telemetry is read only from the workspace's own analytics database, and this workspace does not have one yet." (was 503; the status moved, the Code did not)
500COLD_EXPORT_INTERRUPTEDThe build was lost when the api restarted; start it again
500COLD_EXPORT_FAILEDThe build failed
422another COLD_EXPORT_... codeThe build refused the query, in its own words. A run refusal keeps its own status and code

A request that has no $cold key where its method needs one gets the 405 before any other check. Reserved keys are case-sensitive, so $Cold is an unknown key. Because every query key starting with $ is reserved, a warm query's parameter names may not start with $. A warm query that names one is refused when it is saved, proposed or accepted, as PARAMETER_NAME_RESERVED: "Name the parameter without the leading $."

There is no /cold suffix on a warm query's address: a warm query named cold is an ordinary saved query.

Where it is listed. The API catalogue (GET /ox-api/openapi) lists the POST beside the GET on each saved query's address, and GET /ox-api/warm-queries beside the draft POST. Each declares $cold, and the fetch routes declare $requestId too. Because they are catalogue routes, a person's or a job's directory token reaches them as it reaches any other catalogue route, on the rights its access cards grant; see Call the API from your app. A team key reaches every route above in Team or Hybrid mode.

In the API Manager. The Warm Queries tab shows each of these as a card. A saved query's card under Configured Queries has $cold and $requestId fields in Try it; the POST and the draft's GET are cards under Generic Endpoints. Try it shows the answer as text in the window. See API Explorer.

From an AI. The MCP server's call_api passes $cold and $requestId through. Start the file with { "route": "POST /warm-queries/<lookup>", "query": { "$cold": true }, "body": { "format": "csv" } }, then fetch it once with { "route": "GET /warm-queries/<lookup>", "query": { "$cold": true, "$requestId": "<requestId>" } }. See call_api.

Live stream

GET /ox-api/live-stream (WebSocket) - streams events as they arrive. Optional filters: connection, surface.

Open it with an API key whose rights include Workspace.Telemetry.Read, sent as Authorization: Bearer <key> on the WebSocket handshake. A browser socket cannot set that header, so a key opens it from a server or a script; a signed-in OpenX page opens it on its own sign-in. The stream is the key's own workspace, and in App mode it is closed to keys, as every /ox-api route is.

StatusCodeMeaning
403OX_LIVE_STREAM_RIGHT_MISSINGThe key does not hold Workspace.Telemetry.Read
426OX_LIVE_STREAM_UPGRADE_REQUIREDThe request was a plain GET, not a WebSocket upgrade
401The key is expired, revoked or not valid, or App mode is on

Change feed

GET /ox-api/eac-changes/stream (Server-Sent Events) - emits a message after every committed change to your workspace.

Connect an AI (MCP)

/ox-api/mcp (Streamable HTTP, ⛔ not SSE) - the MCP endpoint any AI uses to read your warm queries and build via proposals. Per-client setup is in Bring Any AI.

The transport is owned by @fathym/eac's MCP processor, not by this surface: it builds the MCP SDK's WebStandardStreamableHTTPServerTransport (SDK 1.27.1). Streamable HTTP frames some responses as text/event-stream, so an event stream on the wire is ⛔ not SSE and ⛔ not a reason to reconfigure a client for SSE.

Change history

Once Provenance is set up, OpenX records saved changes to tracked records and the corrections made to your data (what is and is not recorded is on the Compliance Matrix). The concept guide is Ship with Confidence; the how-to is Change History & Corrections.

Scope is a filter, not part of the path. Reads pass scopeKey as a query parameter; writes carry ScopeKey in the body. Leave it off an activity-log read and you get the workspace-level Platform-Config records - the platform's own change history, which the earlier per-log URL shape had no way to address. Corrections always describe a change to a scope's data, so scopeKey is required on every corrections endpoint.

target names the container and is always a query parameter, on reads and writes alike: PlatformConfig, AccessControl, DomainEvents, DomainAmendments or DomainSignatures. Leave it off and the route infers one: a request with a scopeKey reads that scope's domain container, and one without reads PlatformConfig. An unknown target, a workspace target together with a scopeKey, or a domain target without one, is a 400 that says so, never a guess. Provenance that has not been set up answers 409 PROVENANCE_NOT_PROVISIONED (it answered 503 before 2026-10-22; the status moved, the Code did not).

Activity log (what changed, when, by whom):

  • POST /ox-api/provenance/events - append an event (ScopeKey in the body; actor and timestamp are server-set, never caller-supplied).
  • GET /ox-api/provenance/events/query - query events (scopeKey, target, entityId, entityType, actionType, userId, startDate, endDate, data, fromSequence, toSequence, limit, offset).
  • POST /ox-api/provenance/events/verify - verify the chain, and optionally one record in it (body: ScopeKey, plus an optional RecordID).
  • GET /ox-api/provenance/events/head - the newest record's RecordID and Hash, and nothing more.
  • GET /ox-api/provenance/events/export - export events (format=csv|json, scopeKey, and the query's filters, data included).

Append an event. The body reads ScopeKey (required: an event is written to a scope), ActionType, EntityType and EntityID (required), and NodeID, BeforeState, AfterState, Name and Description (optional). A body key the route does not read, UserID and Hash included, is refused by name with 400 UNKNOWN_BODY_KEY; it is never dropped. UserID and Timestamp are set from the signed-in identity and the server clock, and RecordID, PreviousHash and Hash are computed in the append. The answer is 201 with the stored record. There is no check on the values of ActionType or EntityType: any non-empty text is stored as written. A call with no identity is 401, a missing ScopeKey is 400 SCOPE_REQUIRED, and a record that fails the schema is 400. The first write to a new scope builds that scope's storage, so it is slower than the ones after it, by seconds.

Query events. Newest first, as a JSON array; a scope that has never been written to is 200 with an empty array, not 404. An absent or blank filter means "do not filter on this". limit defaults to 100. A fromSequence, toSequence, limit or offset that is not a non-negative integer is a 400, never read as 0. Three headers describe the answer: x-provenance-scanned (the records actually read, the cost signal), x-provenance-has-more (true when you have a prefix, not the whole history) and x-provenance-target (which container answered). To walk a log that is still growing, use fromSequence and toSequence rather than offset: the scan runs newest first, so an offset is a position in a list that gains records at the end you started from, while a sequence number names one record for good.

Search by a field inside the saved data. data=<BeforeState|AfterState>.<dotted.path>=<value> keeps the events whose saved BeforeState or AfterState holds exactly that value at that path; send it more than once to combine filters. For example ?data=AfterState.Status=Released&data=AfterState.Lot.Number=42. You name the path; OpenX knows nothing about what your app saves. The rules:

  • The path ends at the first =, so a value may contain =.
  • The value is typed by how it is written: a JSON number, true, false, null or a quoted string is that value, and anything else is the text as sent. =42 is the number and ="42" the string, and the two never match each other.
  • null matches a field saved as null. A missing field is not null, and a missing path never matches.
  • Arrays are not searched: a path cannot step into one, and a field whose value is an array or an object matches nothing.
  • Every data filter must hold, as must every other filter in the request. A blank value (data=AfterState.Status=) filters nothing; use ="" to find an empty string.
  • Limits: a path of 1 to 8 names after the side (each starts with a letter or _, then letters, digits, _ or -, up to 64 characters), a value of at most 256 characters, at most 5 data filters, and each side and path once. Anything else is a 400 PROVENANCE_DATA_FILTER_INVALID naming the filter, with a Remedy.

The filter runs before offset and limit, like every other filter, so a page holds up to limit matching events and x-provenance-has-more: true means more matches exist. x-provenance-scanned still counts every record read, so a narrow filter on a long log can read a lot and return little. The export applies the same filter in the same way and records it in its footer's Query line.

Export events. format is json (the default) or csv; it takes the same filters as a query (no offset) and a limit of 10,000 by default. It downloads as an attachment named provenance-<scope>.csv or .json (provenance-<target>.csv for a workspace container, with the target in lower case, such as provenance-platformconfig.csv). The CSV columns are RecordID, Timestamp, UserID, ActionType, EntityType, EntityID, BeforeState, AfterState, PreviousHash and Hash, with the two states written as JSON in their cells, and it ends with a manifest footer after the line # --- PROVENANCE EXPORT MANIFEST ---: the file's SHA-256 Digest (over every byte before that line), the chain head it was taken against (HeadRecordID, HeadHash), RecordCount, ScannedCount, HasMore and the Query. The manifest says ChainVerified: false: an export does not verify the chain, so call verify if you need that. The digest also comes back in the x-provenance-digest header, with x-provenance-export-version. An export has no paging. If x-provenance-has-more is true you have a prefix of the log; narrow the date range or the scope instead.

RecordID is optional, and leaving it off asks a different question. Omit it and you get a whole-chain verification, genesis to tip - which is what a "verify this log" button wants, and what you need when you hold no record id. Supply one and you additionally get that record's own digest recomputed. A supplied id must be the 12-digit zero-padded sequence the platform assigned; a malformed one is rejected rather than treated as "verify everything", because a typo must never come back as a clean bill of health.

verify returns independent verdicts, and the differences matter. Valid is this record's digest, recomputed and compared - and it is null when you did not name a record, because nothing was recomputed. It is never true in that case: that would claim a check that never ran. ChainValid is the whole container's chain. A valid record on a broken chain - Valid: true with ChainValid: false - is a real state, and usually the one an auditor cares about most. Empty tells you whether there was anything to check at all: ChainValid: true with Empty: true means the container is unwritten or does not exist, not that everything checks out. BrokenAt identifies the first bad link, ForkDetected flags a split chain, and Reason puts the verdict in words.

A whole-chain verify reads every record in the container and recomputes every digest. It is authoritative, and it is not cheap - it is a deliberate action, not something to poll.

The key must be left out, not blanked: a RecordID sent as "", null or 0 is a 400, because it looks like a variable that did not get filled in. An unknown record is 404 "Record not found".

The answer also carries Checked (how many records the verdict walked, so a pass over none reads differently from a pass over ten thousand), Target (which container was verified, in the body here rather than in a header), Head (the newest record's RecordID and Hash on a whole-chain verify, and null on a record-scoped one or an empty container) and Range. Two runs that quote the same Head verified the same chain state.

fromSequence and toSequence on the query string limit a verify to a window. That verdict is a segment proof, not an inclusion proof: it says the records in the window link to each other and to the one below it, and it cannot say the window reaches the chain head. Range is echoed back for that reason, and is null for a genesis-to-tip verify. A fromSequence above toSequence is a 400.

Corrections (documented edits, original always preserved):

  • POST /ox-api/provenance/amendments - create a correction (reason + before/after, ScopeKey in the body); pending or applied depending on whether approval is required.
  • GET /ox-api/provenance/amendments - query corrections (scopeKey, entityId, entityType, reasonCategory, amendedBy, status, dates, limit, offset). A decided correction keeps Status pending and carries Decision and DecisionRecordID; status matches the decision.
  • GET /ox-api/provenance/amendments/chain?entityId=... - the full correction chain for one record, oldest first, ordered by chain link rather than by timestamp (scopeKey required).
  • GET /ox-api/provenance/reason-categories - the configurable reason list, workspace-wide and unscoped (defaults include data-entry-error, transcription-error, recalculation, delayed-entry, and others).
  • POST /ox-api/provenance/amendments/{id}/approve - approve a pending correction (a second person, when two-person approval is on; scopeKey on the query string).
  • POST /ox-api/provenance/amendments/{id}/reject - reject one, with a reason.

Signatures (a person's recorded sign-off on one provenance record, on its own chain in the DomainSignatures container of the scope):

  • POST /ox-api/provenance/signatures/check - may this person sign now? Asked before the record is shown.
  • POST /ox-api/provenance/signatures/step-up - ask for a signing challenge, for an app that writes the record after the login.
  • POST /ox-api/provenance/signatures - sign a record.
  • POST /ox-api/provenance/signatures/batch - sign a list of records with one login.
  • GET /ox-api/provenance/signatures - read the signatures about a record, an entity or a ceremony.
  • GET /ox-api/provenance/signatures/certificate - a printable certificate of those signatures.
  • GET /ox-api/provenance/signatures/seal-keys - the public keys that check each signature's seal.
  • GET /ox-api/provenance/signature-meanings - the meanings this workspace accepts.
  • GET /ox-api/provenance/signature-events - the newest signature event deliveries.

Signature event subscriptions have no route: a person sets them in Cloud -> Provenance -> Signature events. How a signature is made, step by step, is in Sign Records from Your App.

A signing refusal answers its status with { "Code": "<code>", "error": "<what happened and how to fix it>" }, plus the fields named for that code below. Nothing is written, and each refused signing is recorded in the workspace's AccessControl history. Do not renew the person's token on a signing refusal: a renewal could turn a refusal into a signature the person did not make.

May this person sign now? POST /ox-api/provenance/signatures/check with { "Meaning": "Approval", "TargetType": "DomainEvents" }, before your app writes or shows the record. It needs no record and no digest, and it writes and spends nothing, so ask as often as you need. It needs Workspace.Provenance.Sign. The OK is 200:

{
  "Allowed": true,
  "Meaning": "Approval",
  "TargetType": "DomainEvents",
  "ProofForms": ["Nonce", "Challenge"],
  "Login": {
    "Authority": "<your login system>",
    "ClientID": "<the client to log in with>",
    "Scopes": ["openid", "profile"],
    "Prompt": "login",
    "MaxAgeSeconds": 900
  }
}

Login is the login to run against your login system: always prompt=login, and max_age set to MaxAgeSeconds, the freshness window for this meaning (15 minutes unless the workspace sets another window; a meaning can only shorten it). ProofForms lists the forms the sign route takes, preferred first.

StatusCodeWhen
401noneNo signed-in identity
403SIGNER_NOT_A_PERSONThe caller is not a person. Reason names which: CONNECTED_APP, APP_SIGNER, DELEGATED_AI or SWAPPED_TOKEN
403JOB_SIGNATURE_REFUSEDAn automated job asked
403ACCESS_RIGHT_REQUIREDThe person does not hold Workspace.Provenance.Sign. Carries MissingRights and a Remedy
403SIGNER_LOGIN_NOT_TRUSTEDThe person did not come through the API door on a login from the workspace's signing App Identity (an OpenX sign-in, or another App Identity's login)
400noneMeaning or TargetType is missing, or TargetType is not a container
400SIGNATURE_MEANING_NOT_CONFIGUREDThe meaning is not one of this workspace's. Carries submitted and allowed
409PROVENANCE_NOT_PROVISIONEDProvenance is not set up
409STEP_UP_PROVIDER_UNAVAILABLEThe workspace's login system is not ready to sign in with

Sign a record. The body has Pointer, SignatureMeaning, DisplayedDigest and Proof; CeremonyID only to join a ceremony that already exists; and an optional Comment from the signer (up to 1000 characters), kept on the signature.

{
  "Pointer": { "ScopeKey": "study-7", "Target": "DomainEvents", "RecordID": "000000000042" },
  "SignatureMeaning": "Approval",
  "DisplayedDigest": "<the SHA-256 digest of the record, as your client showed it>",
  "Proof": {
    "IdToken": "<the ID token from the person's login>",
    "Salt": "<the salt the nonce was made with>"
  }
}

Proof is the person's own login, made for this record and meaning, in one of two forms, never both:

  • Nonce form, { "IdToken", "Salt" }: your app worked out the login's nonce with computeSigningLoginNonce from @o-industrial/common over the workspace, the record, its digest, the meaning and a salt of at least 16 random bytes (base64url, no padding). OpenX works the nonce out again from its own digest of the record, so a login made for one record or meaning signs no other.
  • Challenge form, { "IdToken", "ChallengeID" }: the login's nonce is a signing challenge from step-up (below), for an app that writes the record after the login.

OpenX checks that the ID token comes from the login system this workspace trusts for signing, with its public keys; that its nonce is the one for this signature; that the login is inside the freshness window; that it is the signer's own; and that it has not signed before. Each login signs once. The signature records the signer's printed name (and title, when the login gives one), the login system, the signer's id there, the calling app, the proof form and the login time, all from the verified token and never from the body.

A signature with no Proof is refused 401 and nothing is written. Today that answer is the older REAUTH_REQUIRED re-authentication, which is being retired for signatures and is not described here; from wave 3 of the signing rollout it is PROOF_REQUIRED. Sign with a Proof.

Pointer is a tuple: Target and RecordID are both required, because the same RecordID exists in every container of a scope (the first is always 000000000000), so a bare id is a 400. The scope comes from Pointer.ScopeKey or the scopeKey query parameter, and a scope is required. The signer, the time, the digest bound and the rights the signer held are all set by the server from the session. A SignedBy, SignedAt, BindingDigest, GrantedRights, RecordID, PreviousHash or Hash you send is ignored, never honoured and never a 400. DisplayedDigest is compared and then discarded; it is not stored. The answer is 201 with the stored signature, including its CeremonyID (a new one unless you joined one), the EntityType and EntityID of the record, and the Meaning.

The digest check, and the 409. The server computes its own SHA-256 digest over the stored record and compares it with the DisplayedDigest you sent. If they differ, the answer is 409, and no signature is written:

{
  "Code": "SIGNATURE_DIGEST_MISMATCH",
  "error": "The record changed between render and signing. No signature was written. Re-read the record and sign again.",
  "Expected": "<the server's digest>",
  "Displayed": "<the digest you sent>"
}

This is the point of the route: it detects a record that changed between the moment the signer saw it and the moment they signed it, so a signature never attests a state that did not exist. Re-read the record and sign again. Joining a ceremony with the same CeremonyID and an equal digest is what shows two signers signed the same content.

The other refusals:

StatusCodeWhen
401noneNo signed-in identity. Checked before the body is read, so a caller learns nothing about whether it was well formed
403JOB_SIGNATURE_REFUSEDAn automated job cannot sign. A signature is a person's act
400nonePointer without Target and RecordID, no DisplayedDigest, no SignatureMeaning, or no scope
400SIGNATURE_COMMENT_INVALIDComment is not text of at most 1000 characters
400PROOF_MALFORMEDProof is not IdToken with either Salt or ChallengeID, or the salt is under 16 bytes
400SIGNATURE_MEANING_NOT_CONFIGUREDThe meaning is not one of this workspace's. Carries submitted and allowed
404noneThe record to sign is not in the target container
409SIGNATURE_DIGEST_MISMATCHThe record changed after it was shown (above)
403TWO_PERSON_SAME_SIGNERWith two people required, this person already signed the ceremony or the record
409TWO_PERSON_DIGEST_MISMATCHThe ceremony being joined was opened on another record
403PROOF_NOT_FROM_LOGIN_SYSTEMThe ID token is not from the login system this workspace trusts for signing, or does not verify. TokenCode says why
403LOGIN_NOT_FOR_THIS_RECORDThe login was made for another record, meaning, list or challenge
401LOGIN_TOO_OLDThe login is older than the freshness window
403LOGIN_NOT_THE_SIGNERThe login is another person's
403PROOF_HAS_NO_NAMEThe ID token carries no name. Claim names the claim to turn on
409LOGIN_ALREADY_USEDThis login already signed
401CHALLENGE_EXPIREDThe signing challenge ran out, or is not known
409CHALLENGE_SPENTThe signing challenge already signed, or a signature using it is being written now
503SIGNATURE_SEAL_UNAVAILABLEThe workspace's Key Vault could not seal the signature. Try again

From wave 3 the sign route also refuses, as the check does: 403 SIGNER_NOT_A_PERSON with its Reason, 403 SIGNER_LOGIN_NOT_TRUSTED for a login that is not from the workspace's signing App Identity, and 403 SIGNING_APP_IDENTITY_NOT_SET while the workspace has not picked one in Cloud -> Provenance -> Signing.

A first signature in a scope builds the scope's signature storage, so it is slower than the ones after it.

Sign a list. POST /ox-api/provenance/signatures/batch signs several records the person was shown as one list, under one login. It needs Workspace.Provenance.Sign.

{
  "Items": [
    {
      "Pointer": { "ScopeKey": "study-7", "Target": "DomainEvents", "RecordID": "000000000042" },
      "DisplayedDigest": "<the digest you showed>",
      "Meaning": "Approval"
    }
  ],
  "Proof": { "IdToken": "<the ID token>", "Salt": "<the salt the batch nonce was made with>" }
}

Items holds 1 to 256 records, all in one scope, with no record and meaning listed twice. One Proof covers the list: in the Nonce form its nonce is computeSigningBatchNonce over the workspace and every item (target type, record id, the record's digest, the meaning), in any order; in the Challenge form it is a signing challenge asked for with exactly this list (below).

The answer is 201 { "BatchID", "BatchManifestDigest", "Records" }, the signatures in the order you sent them. A 202 { "Code": "PROVENANCE_BATCH_FINISHING", "BatchID", "Landed", "Pending" } means every signature is sealed and accepted and OpenX is finishing the chain exactly as sealed: do not send the list again. A 503 PROVENANCE_BATCH_PENDING (an earlier batch in the scope is still landing) or PROVENANCE_BATCH_JOURNAL_UNAVAILABLE wrote nothing and spent no login: send the list again shortly.

It is all or nothing. A refusal about one item names it by its Index in Items: a meaning the workspace does not list (400 SIGNATURE_MEANING_NOT_CONFIGURED, with submitted and allowed), a record that is not there (404), a record that changed after it was shown (409 SIGNATURE_DIGEST_MISMATCH, with Expected and Displayed), and the two-person refusals when the item's meaning asks for two people. Nothing is written. A proof made for another list answers 403 LOGIN_NOT_FOR_THIS_RECORD, so a proof for records A and B cannot sign A, B and C; the same login again answers 409 LOGIN_ALREADY_USED. The login must be inside the shortest freshness window of the meanings in the list, or the answer is 401 LOGIN_TOO_OLD. The caller is checked as for one signature (a job is refused, the right to sign), and a vault that cannot seal is 503 SIGNATURE_SEAL_UNAVAILABLE with the login still unused. One login is spent. Each signature opens its own ceremony (to join a ceremony that exists, sign that record on its own) and carries ProofForm Batch, the BatchID and the BatchManifestDigest: the lowercase hex SHA-256 of the canonical JSON of the workspace, the scope and the sorted items with their digests, with no salt.

Read signatures. GET /ox-api/provenance/signatures needs a scopeKey and one of three ways in, each on its own: targetType with targetRecordId (the record attested), entityType with entityId (the entity signed about), or ceremonyId (every signature joined to one ceremony). Each pair travels whole, so half of one is a 400, and a request that names none of the three is a 400. targetRecordId must be the 12-digit zero-padded sequence, because a malformed id would match nothing and an empty answer reads as "nobody has signed this". A targetType that is not a known container is a 400. Filters that are present all apply, and limit, offset, fromSequence and toSequence behave as they do on the activity log. The answer is a JSON array of the whole stored records, newest first, with the same three headers as the activity log: x-provenance-scanned, x-provenance-has-more (if it is true, you are holding a prefix, and must not present it as complete) and x-provenance-target, which is always DomainSignatures: a target query parameter cannot point this read at another chain. A record with no signatures is 200 with an empty array. There is no route that verifies a signature's chain.

Meanings. GET /ox-api/provenance/signature-meanings answers { "meanings": [...], "configured": true|false }. Read it rather than hard-coding the list: it is the same source the sign route validates against. configured is false while the workspace still has the platform's default list, which is Review, Verification, Approval, Authorization, Responsibility and Authorship. A workspace that has not set up Provenance answers 409 PROVENANCE_NOT_PROVISIONED.

A certificate. GET /ox-api/provenance/signatures/certificate reads the signatures exactly as GET /ox-api/provenance/signatures does: the same scopeKey, the same three ways in (ceremonyId, targetType with targetRecordId, or entityType with entityId), the same 400s and paging. It answers a printable page (text/html) with one section per signer: the printed name, title, account, meaning, time in UTC, the record type and id, BindingDigest, the link status (Intact, Changed, RecordMissing or NotChecked, checked again on this read), the seal key and its verdict (Valid, Invalid, Unsealed or NotChecked), the proof form, the login time and methods, the login system, the calling app, the comment, and the list for a signature made in a batch. A field the signature does not carry prints as "not recorded", never filled in. Everything is text: no image of a signature, and the page loads nothing else and runs no script, so your app may embed or print it. Add format=json for the same certificate as JSON, with a field the signature does not carry left out. It needs Workspace.Provenance.Read.

Seal keys. GET /ox-api/provenance/signatures/seal-keys answers { "Keys": [{ "KeyID", "Algorithm", "PublicKey" }] }: every version of the key in the workspace's own Key Vault that seals signatures, newest first, each PublicKey a JWK. A signature's LinkSealKeyID names the version that sealed it. With the public key anyone can check a seal without OpenX: ES256 over the canonical JSON of the signature's BindingDigest, CeremonyID, Meaning, SignedAt, SignedBy, TargetRecordID and TargetType. Keys is empty before the first sealed signature, and a vault that cannot be read is 503 SIGNATURE_SEAL_UNAVAILABLE. It needs Workspace.Provenance.Read. The offline command that checks a whole export is in Verify Without Us.

Signature event deliveries. GET /ox-api/provenance/signature-events answers { "Deliveries": [{ "EventID", "Type", "Hook", "State", "Attempts", "LastStatus"?, "LastError"?, "OccurredAt", "UpdatedAt" }] }, newest first: one entry per event sent to one subscription. Type is Signed, Refused or LinkChanged. State is Retrying between attempts, Delivered on a 2xx answer, and DeadLetter once every attempt has failed; a dead letter is not sent again. LastStatus is your receiver's last HTTP status, and LastError says in OpenX's words why the last attempt failed. Hook is the subscription's name, never its address, a header or the secret. It needs Workspace.Provenance.Read. What a delivery carries, and how to check its signature, is in Sign Records from Your App.

A signing challenge. For the Challenge form, your app asks before the login, with POST /ox-api/provenance/signatures/step-up and the body { "Signing": { "Meaning": "Approval", "TargetType": "DomainEvents", "TargetRecordID"?: "000000000042" } }. Name the record when you know it. The answer is 200:

{
  "ChallengeID": "<64 lowercase hex characters>",
  "ExpiresAt": "<when it runs out>",
  "Binding": {
    "Meaning": "Approval",
    "TargetType": "DomainEvents",
    "TargetRecordID": "000000000042"
  },
  "Login": {
    "Authority": "...",
    "ClientID": "...",
    "Scopes": ["..."],
    "Prompt": "login",
    "MaxAgeSeconds": 900
  }
}

The challenge is bound to the signer, the meaning, the target type and the record when named. Run Login with the ChallengeID as the nonce, do your write, then sign with "Proof": { "IdToken": "...", "ChallengeID": "..." }. A challenge signs once and is spent with that signature; used for another meaning, target type or record it is refused LOGIN_NOT_FOR_THIS_RECORD, and a second time CHALLENGE_SPENT. It is never a grant to sign again.

For a list, ask with { "Signing": { "Items": [{ "TargetType", "TargetRecordID", "Meaning" }] } }, the same items you will post to batch; the challenge then signs exactly that list, once.

OpenX's own windows also use step-up, with a Purpose, to ask for a fresh sign-in before an act such as turning off a data store's delete protection. That fresh sign-in covers one use of that act and never signs a record.

Data stores

Endpoints for the CosmosDB accounts your workspace provisions and owns (see CosmosDB Setup). The account's credentials are resolved on the server; no key for the account is supplied on any call. Each route needs the data-store access right it names in GET /ox-api/openapi, and a caller without it is 403 DATA_STORE_RIGHT_MISSING.

List what is in an account - GET /ox-api/data-stores/{lookup}/containers

{lookup} is the data store's lookup, not a database's. The list is read from Azure, so it is what is provisioned, not what the workspace has declared: a container made outside the workspace still appears, with Declared: false. A container the workspace declared but Azure does not hold does not appear.

{
  "Listed": true,
  "Containers": [
    {
      "DatabaseLookup": "ops",
      "DatabaseName": "ops",
      "ContainerName": "readings",
      "PartitionKeyPath": "/deviceId",
      "DataClass": "operational",
      "Declared": true
    }
  ]
}

Listed is the point of the shape. Listed: true with an empty Containers means the account really is empty. Listed: false means OpenX could not look, and carries a Code and a Reason in place of Containers: it is never an empty list. The codes are STORE_NOT_FOUND (404), and, with status 200, CREDENTIAL_UNAVAILABLE, RESOURCE_GROUP_MISSING, TOKEN_UNAVAILABLE and UNREACHABLE. This is a read of the account's control plane: a green answer does not mean the document routes below will work, which also needs the data-plane grant (see Data stores troubleshooting).

Documents - the table path is the document collection, with no /documents segment:

GET    /ox-api/data-stores/{store}/databases/{database}/tables/{table}
POST   /ox-api/data-stores/{store}/databases/{database}/tables/{table}
GET    /ox-api/data-stores/{store}/databases/{database}/tables/{table}/{documentId}
PUT    /ox-api/data-stores/{store}/databases/{database}/tables/{table}/{documentId}
DELETE /ox-api/data-stores/{store}/databases/{database}/tables/{table}/{documentId}

The path names a store and a database that have to agree, a single-document call takes the partitionKey query key unless the table is partitioned on /id, and the refusals come in a fixed order. The whole of it, with every code, is Database Table Endpoints. Containers are made and removed in the window and by proposal, not by this API: there is no route that creates or deletes one.

API Sources: Pull Now

POST /api/workspaces/api-sources/{lookup}/pull - runs one poll of an API Source now, as the Pull Now button does: it calls the source's endpoint, applies its Response Mapping and forwards the result to the data connection that points at the source.

Not an /ox-api route. It sits under /api/workspaces/ on your workspace host, so it is not in GET /ox-api/openapi and not in the API Manager's route list. It is an action on a source you already configured, not a platform route. The API Manager's API Sources tab shows each source's route with a cURL and a TypeScript snippet, once the workspace has an API source.

{lookup} is the source's lookup. Send the same header as the snippets do, and no body:

curl -X POST 'https://openx.fathym.com/api/workspaces/api-sources/<lookup>/pull' \
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
  -H 'Accept: application/json'

The answer is { success, data, rawResponse, latencyMs, error, forwarded }:

FieldHolds
successtrue when the source answered with JSON and, if a connection points at the source, the data reached it
dataThe result after the Response Mapping
rawResponseThe source's own JSON, before the mapping
latencyMsHow long the pull took
errorThe reason, when success is false
forwardedtrue when the data reached the data connection that points at the source

A pull that reached the source but failed (an error status from it, a reply that is not JSON, an address OpenX will not fetch, or data that did not reach the connection) answers 200 with success: false and the reason in error, so check success, not the status. A failed pull is also a red entry in the Live Stream. A successful one adds none of its own: the forwarded data shows as the connection's entry.

StatusWhen
200The pull ran. Read success
400The source has no endpoint, or its settings are not valid
404No API source with that lookup
503The source's credentials could not be read from the workspace's vault for this pull

The endpoint must be one OpenX can treat as public: https, no user name or password in the address, a public host, no redirect, and a JSON answer, and the pull gives up after 15 seconds. A refused address answers 200 with success: false and an error that starts with an OUTBOUND_ code, for example OUTBOUND_HOST_NOT_PUBLIC.

A source that runs on a schedule is polled by its Azure Function, not by this route; the route is for pulling by hand, from your own code or a test.

Reading the workspace

GET /ox-api/workspace reads this workspace's configuration as stored, with every secret left out. Over MCP it is the read behind get_workspace, and call_api can call it as GET /workspace. It reports what is stored, not what is deployed. It answers 200:

FieldWhat it holds
EaCThe workspace as stored. A stored credential reads back as its $secret: reference, or as a redaction marker if it was saved in the clear. A cloud's subscription, tenant and billing ids read as a stable code for this workspace, never as stored
ClearFieldsThe paths, as Collection.field, of credentials that were stored in the clear. Paths only, never a value
WithheldThe parts of the workspace left out for the rights the caller holds. Only a key, a job or a connected AI gets it; a signed-in person reads the whole workspace, below
NotSetUpWhat is on but waits on a set-up step, below. Always present, an empty list when nothing waits
HiddenRoutesThe routes the caller could call but that wait on a set-up step, below. Always present, an empty list when nothing waits
CloudStatusThe state of each connected cloud's key, as it was last checked (at most five minutes ago). See get_workspace

Who may read it

A connected AI reads with its card in the workspace. Any other caller through the /ox-api door, a key or a job, needs the Workspace.Access.Manage right, and is refused with OXAPI_SCOPE_REFUSED without it.

Rights narrow what you read

A key, a job or a connected AI reads the basics, every part no read rule covers, and the parts its rights cover. Each part it is not covered for is left out of EaC and named in Withheld:

FieldMeaning
KindThe part left out, such as DataConnections
NeedsThe rights that cover it
Modeall when the key needs every one of Needs, any when one is enough
ReasonIn plain words: the connection does not carry those rights, and the part is not empty

A part left out is not an empty part: read Withheld before you conclude the workspace holds none. This route names a part only when the workspace holds records of it. If the caller's rights could not be read, every part with a read rule is left out. get_workspace limits the same way, by the same code, and also names a part you ask for in kinds.

What is not set up yet

Some capabilities are on but hide their routes until a set-up step is done. The workspace read lists them in two places. Both are present and empty when nothing is waiting:

ListWhat it holds
NotSetUpEach active kind that hides routes, once per kind and Code: Kind, Code, Reason, Remedy and, where there is one, Requires. The same for every caller, not narrowed by rights
HiddenRoutesThe hidden routes whose required rights the caller holds: Method, PathTemplate, Category, Owner, and the same Code, Reason, Remedy, Requires. A route needing a right the caller does not hold is not listed

A hidden route is left out of the OpenAPI spec. Called anyway, it answers 409 in its owner's words, the same Code, Reason, Remedy and Requires as its HiddenRoutes entry, in a body that also holds them as one error sentence: see A route that is not set up yet. Do the set-up step the Remedy names and read again: the entry is gone once the step is done.

Authentication

Every /ox-api endpoint takes a Bearer JWT; which one is on Auth & Tokens. The API Keys window makes its key with a route of the workspace window's own, which needs your signed-in session rather than a key.

Internal route. This is the route the workspace window uses. It is not part of /ox-api, not a public API, and may change.

GET /workspace/api/keys/jwt?minutes=60&scopes=...

Query keyMeaning
minutesLifetime in minutes (expMinutes also works). Default 60, at most 90 days (129,600). Not a number, or above the maximum, is 400 MINUTES_INVALID; a value of zero or less makes a one-minute key
scopesA comma-separated list of the rights the key carries. Left out, it carries every right you hold. Present but empty is 400 SCOPES_EMPTY

A key never carries more than your own rights, and never the platform-administrator right, which stays with a signed-in session. It answers { Token, jti, ExpiresAt } only once its record is written, so a key can always be listed and revoked. No session is 401 SESSION_REQUIRED. GET /workspace/api/keys/api lists your keys, and DELETE /workspace/api/keys/jwt/{jti} revokes one.

The OpenAPI spec

GET /ox-api/openapi - the full OpenAPI 3.1 spec for your workspace, filtered to your access rights (you see only the endpoints you can call). The in-product API Manager is this spec made browsable, with a Try-Me and ready-to-copy snippets.

Responses and errors

A successful query returns its outputs, as set out under Warm queries. Errors come back as an envelope:

{ "HasError": true, "Messages": { "Error": "Warm query \"x\" was not found..." } }

Status codes are set where applicable, and a route's own pages name its own codes:

StatusMeansWhat to do
400Invalid input, for example no saved query textRead the message: it names the field or key, and a named Code where there is one
401Missing or invalid tokenCheck the token and its expiry, and make a new one if it expired
403Outside your access rightsSee which right is missing (MissingRights) and ask someone who can grant it
404Not foundCheck the lookup or path
409The state does not allow it, such as approving a record that is not pending, or a capability is not set upRead the message and the Remedy: they name the state, or the step to set up first, for example Provenance, or IoT for a telemetry query
500Server errorTry again; if it keeps happening, tell Fathym what you called and when
503The api could not read or reach something it needs, such as your workspaceTry again shortly

Changed 2026-10-22: a refusal that means "a capability is not set up" (TELEMETRY_REQUIRES_PRIVATE_IOT, PROVENANCE_NOT_PROVISIONED, CALZ_NOT_PROVISIONED, CLOUD_NOT_CONNECTED, a kind that is not active such as PRIVATE_LANDING_ZONE_REQUIRED, COLD_CAPTURE_INCOMPLETE, COLD_CLOUD_UNUSABLE, ARCHIVE_DESTINATION_MISSING) now answers 409, not 503, with the same body and a Remedy. The status moved; the Code did not. If your app branched on 503 for one of these, branch on the Code instead. 503 stays for "could not read or reach" (WORKSPACE_EAC_UNAVAILABLE, COLD_CAPTURE_READ_FAILED).

A route that is not set up yet

A route your workspace has not set up yet is left out of the OpenAPI spec. If a caller finds the address elsewhere and calls it anyway, the answer is 409, in the words of the part of OpenX that owns the route:

{
  "error": "Telemetry is read only from the workspace's own analytics database, and this workspace does not have one yet. Deploy IoT in the Data Fabric window. The new database starts empty, and every device gets a new key when its data connection moves: re-flash each device with its new Device ConnStr (primary) from Inspector → Connection Info.",
  "Code": "TELEMETRY_REQUIRES_PRIVATE_IOT",
  "Reason": "Telemetry is read only from the workspace's own analytics database, and this workspace does not have one yet.",
  "Remedy": "Deploy IoT in the Data Fabric window. The new database starts empty, and every device gets a new key when its data connection moves: re-flash each device with its new Device ConnStr (primary) from Inspector → Connection Info.",
  "Requires": ["IoT"]
}
FieldMeaning
CodeThe stable name of what is missing. Branch on this, not on the sentences
ReasonWhy the route cannot answer yet
RemedyWhat to do next, naming the window
RequiresThe record kinds still missing, in the order they are set up. Absent when the owner names none
errorThe Reason and the Remedy as one sentence pair

Rights are checked first. A caller who lacks a right the route needs is refused 403, and so learns nothing about whether the route is set up. The same answer comes from every way in: the /ox-api door, an AI calling through MCP, and OpenX's own pages. Do the step, call again: there is nothing to clear on the caller's side. The API Manager lists what is waiting under Not set up yet.

The route that lists what is waiting, and the routes you could call but it hides, is Reading the workspace.

A refusal at the door comes back differently. A 401 is always the same plain { "Message": "This request could not be authorized." }, whatever the reason, and a 403 for a missing right carries Code: OXAPI_REQUIRED_RIGHTS_MISSING and the MissingRights. Every door refusal is on API refusals.

Limits

A draft run is bounded (10,000 rows a step, 30 seconds, a 100-row preview). A saved query's run keeps the engine's limits: 250,000 rows a step and about 200 seconds. Only a cold-data export has no cap. There is no per-request rate limiting today.

On fathym.com: OpenX →

On this page