Skip to content
Engine API

Parallel runs

Parallel runs endpoints of the MedHook engine API: 19 operations with parameters, schemas and a curl example for each.

On this page

Run MedHook beside a Mirth Connect or Rhapsody engine before a cutover: read the incumbent's channel status, run a workflow in shadow mode on the same traffic, and compare the outputs.

List incumbent API connections

get/api/incumbents

Viewer. Never returns a password.

Auth: Bearer token (how to get one) · Operation: listIncumbentConnections

Responses

  • 200Connections.
    Response fields

    application/json · object

    • connectionsarray of object
      9 fields
      • idstring
      • namestring
      • kindstring

        One of: "mirth", "rhapsody"

      • baseUrlstring
      • authModestring

        One of: "basic", "session"

      • usernamestring
      • createdAtstring (date-time)
      • pinnedFingerprint256string

        The certificate pinned for this connection, when one is.

      • customCaboolean

        True when the connection verifies against an uploaded CA.

Example request

curl
curl "$ENGINE_URL/api/incumbents" \
  -H "Authorization: Bearer $TOKEN"

Add an incumbent API connection

post/api/incumbents

Operator. A read-only connection to a Mirth Connect REST API (basic auth or a session login; every request sends X-Requested-With: OpenAPI) or a Rhapsody REST API (basic auth). The password is stored encrypted and never returned. The host must pass the SSRF guard when used: list a private host in SSRF_ALLOWLIST. Audited as incumbent.connection_created. Creating a connection sends nothing to the server. A self-signed server (Rhapsody's default on 8444, Mirth's on 8443), as POST /api/migration/sources: trustFingerprint pins exactly that certificate, caPem verifies against the CA that signed it (host name included), not both. The trust is kept on the connection and audited as migration.source.cert_pinned (vendor, host and fingerprint) or migration.source.ca_uploaded (vendor, host, the CA's fingerprint and subject). Reads of the connection verify against it; without one, a self-signed server answers 502 INCUMBENT_CERT_UNTRUSTED with details.certificate to check.

Auth: Bearer token (how to get one) · Operation: createIncumbentConnection

Request body (required)

application/json · object

  • namestringrequired
  • kindstringrequired

    One of: "mirth", "rhapsody"

  • baseUrlstringrequired
  • authModestring

    session: Mirth only.

    One of: "basic", "session"

  • usernamestringrequired
  • passwordstring (password)required
  • trustFingerprintstring

    The SHA-256 fingerprint of the server certificate to pin, "AA:BB:…" as INCUMBENT_CERT_UNTRUSTED's details.certificate.fingerprint256 shows it. Not with caPem.

  • caPemstring

    A PEM CA certificate (or chain) to verify the server against, host name included. Not with trustFingerprint.

Responses

  • 201Created.
    Response fields

    application/json · object

    • idstring
    • namestring
    • kindstring

      One of: "mirth", "rhapsody"

    • baseUrlstring
    • authModestring

      One of: "basic", "session"

    • usernamestring
    • createdAtstring (date-time)
    • pinnedFingerprint256string

      The certificate pinned for this connection, when one is.

    • customCaboolean

      True when the connection verifies against an uploaded CA.

  • 400Invalid input, including a malformed `trustFingerprint` or `caPem`, or both at once.

    application/json · ApiError

  • 409`CONFLICT`: the name is taken.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/incumbents" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "kind": "mirth",
  "baseUrl": "https://mirth.example.test:8443/api",
  "authMode": "basic",
  "username": "string",
  "password": "string",
  "trustFingerprint": "string",
  "caPem": "string"
}'

Get an incumbent API connection

get/api/incumbents/{id}

Viewer. Never returns the password.

Auth: Bearer token (how to get one) · Operation: getIncumbentConnection

Parameters

NameInTypeDescription
idrequiredpathstring

Incumbent connection id (caller's workspace).

Responses

  • 200The connection.
    Response fields

    application/json · object

    • idstring
    • namestring
    • kindstring

      One of: "mirth", "rhapsody"

    • baseUrlstring
    • authModestring

      One of: "basic", "session"

    • usernamestring
    • createdAtstring (date-time)
    • pinnedFingerprint256string

      The certificate pinned for this connection, when one is.

    • customCaboolean

      True when the connection verifies against an uploaded CA.

  • 404Not found in this workspace.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/incumbents/<id>" \
  -H "Authorization: Bearer $TOKEN"

Change an incumbent connection's certificate trust

patch/api/incumbents/{id}

Operator. Changes the connection's certificate trust in place, keeping the connection, its id and its saved credentials (never re-entered here). Send exactly one of trustFingerprint (re-pin), caPem (replace the CA) or clearTrust: true (forget the pin or CA; the next read answers INCUMBENT_CERT_UNTRUSTED again); nothing else can be changed. A re-pin is never set blindly: the engine re-reads the certificate the server presents now (a TLS handshake through the SSRF guard; no HTTP request, so no credentials) and stores the pin only when its fingerprint is the one sent, else 409 INCUMBENT_CERT_FINGERPRINT_CHANGED and nothing is stored. Send the fingerprint the operator checked on the server, as the read's details.certificate.fingerprint256 showed it. A CA is stored once it parses; every read verifies against it, host name included. Audited as migration.source.cert_pinned (vendor, host, fingerprint and previousFingerprint256), migration.source.ca_uploaded (vendor, host, the CA's fingerprint and subject) or migration.source.trust_cleared (vendor, host, and previousFingerprint256 or previousCustomCa), never the PEM, the user or the password.

Auth: Bearer token (how to get one) · Operation: updateIncumbentConnectionTrust

Parameters

NameInTypeDescription
idrequiredpathstring

Incumbent connection id (caller's workspace).

Request body (required)

application/json · object

  • trustFingerprintstring

    The SHA-256 fingerprint of the certificate the server presents now, as checked on the server. The engine confirms the server presents it before pinning.

  • caPemstring

    A PEM CA certificate (or chain) to verify the server against, host name included. Replaces any pin.

  • clearTrustboolean

    Forget the pin or the CA.

    One of: true

Responses

  • 200The updated connection.
    Response fields

    application/json · object

    • idstring
    • namestring
    • kindstring

      One of: "mirth", "rhapsody"

    • baseUrlstring
    • authModestring

      One of: "basic", "session"

    • usernamestring
    • createdAtstring (date-time)
    • pinnedFingerprint256string

      The certificate pinned for this connection, when one is.

    • customCaboolean

      True when the connection verifies against an uploaded CA.

  • 400`BAD_REQUEST`: none or more than one of the three, a malformed fingerprint, a CA that can't be read, or another field. `INCUMBENT_PARSE`: a pin on an `http://` connection. `INCUMBENT_SSRF`: the host is private and not in `SSRF_ALLOWLIST`.

    application/json · ApiError

  • 404Not found in this workspace.

    application/json · ApiError

  • 409`INCUMBENT_CERT_FINGERPRINT_CHANGED`: the server presents another certificate than the one sent; `details.certificate` (what it presents now), `details.confirmedFingerprint256` (what was sent) and `details.pinnedFingerprint256` (the current pin, if any). Nothing is stored.

    application/json · ApiError

  • 502`INCUMBENT_NETWORK`: the server's certificate couldn't be read. Nothing is stored.

    application/json · ApiError

Example request

curl
curl -X PATCH "$ENGINE_URL/api/incumbents/<id>" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "trustFingerprint": "string",
  "caPem": "string",
  "clearTrust": true
}'

Delete an incumbent API connection

delete/api/incumbents/{id}

Operator. Runs that used it keep their messages. Audited as incumbent.connection_deleted.

Auth: Bearer token (how to get one) · Operation: deleteIncumbentConnection

Parameters

NameInTypeDescription
idrequiredpathstring

Incumbent connection id (caller's workspace).

Responses

  • 200Deleted.
  • 404Not found in this workspace.

    application/json · ApiError

Example request

curl
curl -X DELETE "$ENGINE_URL/api/incumbents/<id>" \
  -H "Authorization: Bearer $TOKEN"

Channel status view

get/api/incumbents/{id}/channels

Operator (a live outbound call to the incumbent). Reads the incumbent's channels live (Mirth: every channel, deployed ones with dashboard state and RECEIVED/SENT/ERROR/FILTERED/QUEUED counts; Rhapsody: routes and communication points with state and counts) and pairs each with the MedHook workflow that replaces it, by import provenance or by name. Read-only on both sides. Rate limited: 30 req / 60 s.

Auth: Bearer token (how to get one) · Operation: listIncumbentChannels

Parameters

NameInTypeDescription
idrequiredpathstring

Incumbent connection id (caller's workspace).

Responses

  • 200Channels with their matching workflow.
    Response fields

    application/json · object

    • readAtstring (date-time)
    • channelsarray of object
      12 fields
      • idstring
      • namestring
      • kindstring

        One of: "channel", "route", "communication point"

      • statestring
      • deployedboolean
      • folderstring
      • receivedinteger | null
      • sentinteger | null
      • erroredinteger | null
      • filteredinteger | null
      • queuedinteger | null
      • workflowobject | null
        4 fields
        • idstring
        • namestring
        • enabledboolean
        • matchedBystring

          One of: "import", "name"

  • 400`INCUMBENT_SSRF`: the host is private or reserved and not in `SSRF_ALLOWLIST`.

    application/json · ApiError

  • 404Not found in this workspace.

    application/json · ApiError

  • 502`INCUMBENT_AUTH`, `INCUMBENT_HTTP`, `INCUMBENT_NETWORK`, `INCUMBENT_TOO_LARGE`: the incumbent refused or could not be reached. `INCUMBENT_CERT_UNTRUSTED`: the server's certificate isn't trusted (self-signed, and nothing pinned on the connection); `details.certificate` has its `fingerprint256`, `subject`, `issuer`, `validFrom`, `validTo` and `selfSigned` to check. `INCUMBENT_CERT_FINGERPRINT_CHANGED`: the certificate isn't the one pinned; `details.pinnedFingerprint256` and `details.certificate` (the new one). Nothing is sent to the server until it is trusted.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/incumbents/<id>/channels" \
  -H "Authorization: Bearer $TOKEN"

List parallel runs

get/api/parallel-runs

Viewer. Counts and match rate per run; no message content. openFields is the number of fields that still differ (what Migration › Parallel runs lists to review), workflowEnabled whether the run's workflow is on, and sendTo where the sender should send once MedHook takes over (the trigger's MLLP listener address, or the webhook's absolute URL on ENGINE_PUBLIC_URL; null for a webhook when ENGINE_PUBLIC_URL is unset, and for other triggers).

Auth: Bearer token (how to get one) · Operation: listParallelRuns

Responses

  • 200Runs.
    Response fields

    application/json · object

    • runsarray of object
      15 fields
      • idstring
      • namestring
      • workflowIdstring
      • workflowNamestring | null
      • connectionobject | null
        3 fields
        • idstring
        • namestring
        • kindstring
      • incumbentChannelIdstring | null
      • ignoreFieldsarray of string
      • defaultIgnoreFieldsarray of string
      • statusstring

        One of: "active", "closed"

      • syncedThroughstring (date-time) | null
      • createdAtstring (date-time)
      • intakeobject
        2 fields
        • inboundstring
        • incumbentOutputstring
      • workflowEnabledboolean
      • sendTostring | null
      • summaryobject
        6 fields
        • messagesinteger
        • comparedinteger
        • matchedinteger
        • matchRatenumber | null

          matched / compared, 4 decimals; null before any compare.

        • openFieldsinteger
        • errorsinteger

Example request

curl
curl "$ENGINE_URL/api/parallel-runs" \
  -H "Authorization: Bearer $TOKEN"

Start a parallel run

post/api/parallel-runs

Operator. Compares one workflow, run in shadow mode (a dry run: nothing is delivered), with the incumbent's channel for the same traffic. ignoreFields adds to the defaults (MSH.7, MSH.10, meta.lastUpdated, meta.versionId): HL7 v2 SEG, SEG.n, SEG.n.m, SEG[k]…, or JSON paths (entry[*].fullUrl, $.id for the root only). Audited as parallel_run.created.

Auth: Bearer token (how to get one) · Operation: createParallelRun

Request body (required)

application/json · object

  • namestringrequired
  • workflowIdstringrequired
  • connectionIdstring | null
  • incumbentChannelIdstring | null

    Mirth channel id (needed for sync) or Rhapsody route id.

  • ignoreFieldsarray of string

Responses

  • 201Created. `captureToken` (shown this once) is the intake routes' credential.
    Response fields

    application/json · object

    • idstring
    • namestring
    • workflowIdstring
    • workflowNamestring | null
    • connectionobject | null
      3 fields
      • idstring
      • namestring
      • kindstring
    • incumbentChannelIdstring | null
    • ignoreFieldsarray of string
    • defaultIgnoreFieldsarray of string
    • statusstring

      One of: "active", "closed"

    • syncedThroughstring (date-time) | null
    • createdAtstring (date-time)
    • intakeobject
      2 fields
      • inboundstring
      • incumbentOutputstring
    • captureTokenstring
  • 400Invalid input, or the workflow or connection is not in this workspace.

    application/json · ApiError

  • 409`CONFLICT`: the name is taken.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/parallel-runs" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "workflowId": "string",
  "connectionId": "string",
  "incumbentChannelId": "string",
  "ignoreFields": [
    "string"
  ]
}'

Get a parallel run and its report summary

get/api/parallel-runs/{id}

Viewer. Counts, match rate, per-field mismatch counts and per message type. Field names only, no values.

Auth: Bearer token (how to get one) · Operation: getParallelRun

Parameters

NameInTypeDescription
idrequiredpathstring

Parallel run id (caller's workspace).

Responses

  • 200The run and its report.
    Response fields

    application/json · object

    • runobject
      12 fields
      • idstring
      • namestring
      • workflowIdstring
      • workflowNamestring | null
      • connectionobject | null
        3 fields
        • idstring
        • namestring
        • kindstring
      • incumbentChannelIdstring | null
      • ignoreFieldsarray of string
      • defaultIgnoreFieldsarray of string
      • statusstring

        One of: "active", "closed"

      • syncedThroughstring (date-time) | null
      • createdAtstring (date-time)
      • intakeobject
        2 fields
        • inboundstring
        • incumbentOutputstring
    • reportobject
      10 fields
      • messagesinteger
      • comparedinteger
      • matchedinteger
      • mismatchedinteger
      • errorsinteger
      • awaitingIncumbentinteger
      • awaitingMedhookinteger
      • matchRatenumber | null

        matched / compared, 4 decimals; null before any compare.

      • fieldMismatchesarray of object
        3 fields
        • fieldstring
        • messagesinteger
        • ratenumber
      • byMessageTypearray of object
        4 fields
        • messageTypestring
        • comparedinteger
        • matchedinteger
        • matchRatenumber | null

          matched / compared, 4 decimals; null before any compare.

  • 404Parallel run not found in this workspace.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/parallel-runs/<id>" \
  -H "Authorization: Bearer $TOKEN"

Change a parallel run's ignore rules or close it

patch/api/parallel-runs/{id}

Operator. New ignoreFields recompare every stored message. acceptField (Accept as expected) adds one differing field to them, for stored and future messages; it must be an ignore rule and cannot be sent with ignoreFields. A closed run refuses new messages. Audited as parallel_run.updated; an accept as parallel_run.field_accepted with field, acceptedBy and acceptedAt (never a value).

Auth: Bearer token (how to get one) · Operation: updateParallelRun

Parameters

NameInTypeDescription
idrequiredpathstring

Parallel run id (caller's workspace).

Request body (required)

application/json · object

  • ignoreFieldsarray of string
  • acceptFieldstring
  • statusstring

    One of: "active", "closed"

Responses

  • 200Updated.
    Response fields

    application/json · object

    • runobject
      12 fields
      • idstring
      • namestring
      • workflowIdstring
      • workflowNamestring | null
      • connectionobject | null
        3 fields
        • idstring
        • namestring
        • kindstring
      • incumbentChannelIdstring | null
      • ignoreFieldsarray of string
      • defaultIgnoreFieldsarray of string
      • statusstring

        One of: "active", "closed"

      • syncedThroughstring (date-time) | null
      • createdAtstring (date-time)
      • intakeobject
        2 fields
        • inboundstring
        • incumbentOutputstring
    • recomparedinteger
  • 400Invalid input.

    application/json · ApiError

  • 404Parallel run not found in this workspace.

    application/json · ApiError

Example request

curl
curl -X PATCH "$ENGINE_URL/api/parallel-runs/<id>" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "ignoreFields": [
    "string"
  ],
  "acceptField": "string",
  "status": "active"
}'

Delete a parallel run and its stored messages

delete/api/parallel-runs/{id}

Operator. Audited as parallel_run.deleted.

Auth: Bearer token (how to get one) · Operation: deleteParallelRun

Parameters

NameInTypeDescription
idrequiredpathstring

Parallel run id (caller's workspace).

Responses

  • 200Deleted.
  • 404Parallel run not found in this workspace.

    application/json · ApiError

Example request

curl
curl -X DELETE "$ENGINE_URL/api/parallel-runs/<id>" \
  -H "Authorization: Bearer $TOKEN"

Rotate a run's capture token

post/api/parallel-runs/{id}/capture-token

Operator. Makes a new capture token (the old one stops working at once) and returns it this once; only its SHA-256 is stored. Audited as parallel_run.capture_token_rotated.

Auth: Bearer token (how to get one) · Operation: rotateParallelRunCaptureToken

Parameters

NameInTypeDescription
idrequiredpathstring

Parallel run id (caller's workspace).

Responses

  • 200The new token.
    Response fields

    application/json · object

    • captureTokenstring
  • 404Parallel run not found in this workspace.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/parallel-runs/<id>/capture-token" \
  -H "Authorization: Bearer $TOKEN"

Revoke a run's capture token

delete/api/parallel-runs/{id}/capture-token

Operator. The run's intake routes refuse every caller until a new token is made. Audited as parallel_run.capture_token_revoked.

Auth: Bearer token (how to get one) · Operation: revokeParallelRunCaptureToken

Parameters

NameInTypeDescription
idrequiredpathstring

Parallel run id (caller's workspace).

Responses

  • 200Revoked.
  • 404Parallel run not found in this workspace.

    application/json · ApiError

Example request

curl
curl -X DELETE "$ENGINE_URL/api/parallel-runs/<id>/capture-token" \
  -H "Authorization: Bearer $TOKEN"

Send a copy of an inbound message (shadow run)

post/api/parallel-run-intake/{id}/inbound

Capture token only (X-Capture-Token). Runs the message through the run's workflow in shadow mode: trigger rules and every step run, adapters report what they would send and are never called, so nothing is delivered and no execution is stored. MedHook's output is stored for comparison, encrypted when the workflow's messages are. Rate limited per IP: 600 req / 60 s.

Auth: None, public route · Operation: parallelRunInbound

Parameters

NameInTypeDescription
idrequiredpathstring

Parallel run id (caller's workspace).

X-Correlation-Keyheaderstring

The key both sides of a message share (at most 1024 characters, stored as a keyed hash). Default: MSH-10.

X-Capture-Tokenrequiredheaderstring

The run's capture token (mhcap_…), also accepted as Authorization: Bearer mhcap_…. Engine JWTs and sessions are not accepted here.

Request body (required)

text/plain · string

application/json · object

  • messagestringrequired
  • correlationKeystring

Responses

  • 200Recorded.
    Response fields

    application/json · object

    • correlationKeystring
    • outcomestring

      One of: "pending_incumbent", "pending_medhook", "match", "mismatch", "error"

    • mismatchFieldsarray of string

      Field names only.

  • 400Empty message, bad JSON, no correlation key, or a key over 1024 characters.

    application/json · ApiError

  • 401No capture token, a wrong or revoked one, or one for another run.

    application/json · ApiError

  • 409`RUN_CLOSED`, `RUN_FULL` (10000 messages), or `WORKFLOW_GONE`.

    application/json · ApiError

  • 413`PAYLOAD_TOO_LARGE`: over 1 MB.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/parallel-run-intake/<id>/inbound" \
  -H "Content-Type: text/plain" \
  --data-binary @body

Capture the incumbent's output for a message

post/api/parallel-run-intake/{id}/incumbent-output

Capture token only (X-Capture-Token, set on the incumbent's extra HTTP destination). Stores the incumbent's output, encrypted when the workflow's messages are, and compares it with MedHook's shadow output for the same key. Rate limited per IP: 600 req / 60 s.

Auth: None, public route · Operation: parallelRunIncumbentOutput

Parameters

NameInTypeDescription
idrequiredpathstring

Parallel run id (caller's workspace).

X-Correlation-Keyheaderstring

The key both sides of a message share (at most 1024 characters, stored as a keyed hash). Default: MSH-10.

X-Capture-Tokenrequiredheaderstring

The run's capture token (mhcap_…), also accepted as Authorization: Bearer mhcap_…. Engine JWTs and sessions are not accepted here.

Request body (required)

text/plain · string

application/json · object

  • messagestringrequired
  • correlationKeystring

Responses

  • 200Recorded.
    Response fields

    application/json · object

    • correlationKeystring
    • outcomestring

      One of: "pending_incumbent", "pending_medhook", "match", "mismatch", "error"

    • mismatchFieldsarray of string

      Field names only.

  • 400Empty message, bad JSON, no correlation key, or a key over 1024 characters.

    application/json · ApiError

  • 401No capture token, a wrong or revoked one, or one for another run.

    application/json · ApiError

  • 409`RUN_CLOSED`, `RUN_FULL` (10000 messages), or `WORKFLOW_GONE`.

    application/json · ApiError

  • 413`PAYLOAD_TOO_LARGE`: over 1 MB.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/parallel-run-intake/<id>/incumbent-output" \
  -H "Content-Type: text/plain" \
  --data-binary @body

Pull a Mirth channel's processed messages into the run

post/api/parallel-runs/{id}/sync

Operator. Mirth runs only. Reads the channel's messages from the Mirth message API since since (default: where the last sync stopped, else the run's start), stores Mirth's first destination output, and shadow-runs each source message not already teed in. Read-only on Mirth. Audited as parallel_run.synced (counts only). Rate limited: 10 req / 60 s.

Auth: Bearer token (how to get one) · Operation: syncParallelRun

Parameters

NameInTypeDescription
idrequiredpathstring

Parallel run id (caller's workspace).

Request body

application/json · object

  • sincestring (date-time)
  • maxinteger

Responses

  • 200Synced.
    Response fields

    application/json · object

    • readinteger
    • recordedinteger
    • shadowedinteger
    • skippedinteger
    • throughstring (date-time) | null
  • 400`INCUMBENT_SSRF`: the host is private or reserved and not in `SSRF_ALLOWLIST`.

    application/json · ApiError

  • 404Parallel run not found in this workspace.

    application/json · ApiError

  • 409`NOT_SYNCABLE`, `RUN_CLOSED`, `RUN_FULL` or `WORKFLOW_GONE`.

    application/json · ApiError

  • 502`INCUMBENT_AUTH`, `INCUMBENT_HTTP`, `INCUMBENT_NETWORK`, `INCUMBENT_TOO_LARGE`: the incumbent refused or could not be reached. `INCUMBENT_CERT_UNTRUSTED`: the server's certificate isn't trusted (self-signed, and nothing pinned on the connection); `details.certificate` has its `fingerprint256`, `subject`, `issuer`, `validFrom`, `validTo` and `selfSigned` to check. `INCUMBENT_CERT_FINGERPRINT_CHANGED`: the certificate isn't the one pinned; `details.pinnedFingerprint256` and `details.certificate` (the new one). Nothing is sent to the server until it is trusted.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/parallel-runs/<id>/sync" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "since": "2026-01-01T00:00:00Z",
  "max": 200
}'

Cutover diff report with per-message detail

get/api/parallel-runs/{id}/report

Viewer; values are message content and read "[redacted]" for viewers. The summary plus every message's outcome and differing fields with both values. format=csv downloads one line per differing field. Every read is audited as parallel_run.report_exported (never values). values=0 (JSON only) is the fields-only report the parallel run panel reads: every role gets the viewer's masked rows (key label, "[redacted]" values and error, "[field]" for a name that could hold content, in the summary too), and it is not audited as an export.

Auth: Bearer token (how to get one) · Operation: getParallelRunReport

Parameters

NameInTypeDescription
idrequiredpathstring

Parallel run id (caller's workspace).

formatquerystring
valuesquerystring

0: the fields-only report, without values for any role and not audited as an export.

Responses

  • 200The report.
    Response fields

    application/json · object

    • runobject
      12 fields
      • idstring
      • namestring
      • workflowIdstring
      • workflowNamestring | null
      • connectionobject | null
        3 fields
        • idstring
        • namestring
        • kindstring
      • incumbentChannelIdstring | null
      • ignoreFieldsarray of string
      • defaultIgnoreFieldsarray of string
      • statusstring

        One of: "active", "closed"

      • syncedThroughstring (date-time) | null
      • createdAtstring (date-time)
      • intakeobject
        2 fields
        • inboundstring
        • incumbentOutputstring
    • generatedAtstring (date-time)
    • reportobject
      10 fields
      • messagesinteger
      • comparedinteger
      • matchedinteger
      • mismatchedinteger
      • errorsinteger
      • awaitingIncumbentinteger
      • awaitingMedhookinteger
      • matchRatenumber | null

        matched / compared, 4 decimals; null before any compare.

      • fieldMismatchesarray of object
        3 fields
        • fieldstring
        • messagesinteger
        • ratenumber
      • byMessageTypearray of object
        4 fields
        • messageTypestring
        • comparedinteger
        • matchedinteger
        • matchRatenumber | null

          matched / compared, 4 decimals; null before any compare.

    • messagesarray of object
      5 fields
      • correlationKeystring
      • messageTypestring | null
      • outcomestring

        One of: "pending_incumbent", "pending_medhook", "match", "mismatch", "error"

      • errorstring | null
      • mismatchesarray of object
        3 fields
        • fieldstring
        • incumbentstring
        • medhookstring

    text/csv · string

  • 404Parallel run not found in this workspace.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/parallel-runs/<id>/report" \
  -H "Authorization: Bearer $TOKEN"

Cut over: start delivering from MedHook

post/api/parallel-runs/{id}/cutover

The person confirmed the Cut over checklist (point the sender at MedHook, stop the old channel themselves, keep it for 30 days); nothing changes on the old engine and nothing is sent to the sender. The body is empty, or { override: { reason } } (10 to 500 characters) to cut over past unmet gates. The gates (at least MIGRATION_CUTOVER_MIN_MESSAGES compared messages, 100 by default; a run MIGRATION_CUTOVER_MIN_DAYS old, 7; MIGRATION_CUTOVER_MIN_PER_TYPE compared messages of every message type seen, 1) are recommendations: in a production workspace unmet gates answer 409 CUTOVER_HELD with gates until the body has an override, audited as migration.cut_over_override { runId, workflowId, reason, gates }; in a sandbox workspace they are advisory and migration.cut_over lists them as advisoryGates. 409 CUTOVER_BLOCKED with the Cut over button's reason while a difference is open, a message failed in MedHook's shadow run, or nothing was compared yet ("Accept or fix each difference first.", "No messages compared yet."); 409 RUN_CLOSED when the run is closed; 409 NOT_DEPLOYED for a workflow that was never deployed; 400 when a destination has no connection, as turning the workflow on refuses. Otherwise, in one transaction, the run closes (its shadow run stops), the workflow turns on, and the cut over is audited as migration.cut_over { interfaceId, workflowId, runId } plus workflow.enabled: ids and names only, never message content. The transaction repeats the difference check, so one captured meanwhile is still 409 CUTOVER_BLOCKED. If the listeners fail to reload after the commit, the answer is still 200, with a warning. Rate limited: 10 req / 60 s.

Minimum role: operator.

Auth: Bearer token (how to get one) · Operation: cutOverParallelRun

Parameters

NameInTypeDescription
idrequiredpathstring

Parallel run id (caller's workspace).

Request body

application/json · object

  • overrideobject
    1 field
    • reasonstring

      Why cut over now, past the unmet gates (10 to 500 characters). Audited.

Responses

  • 200Cut over: the run is closed and the workflow is on.
    Response fields

    application/json · object

    • runobject
      2 fields
      • idstring
      • statusstring

        "closed"

    • workflowobject
      3 fields
      • idstring
      • namestring
      • enabledboolean
    • warningstring

      Only when the listeners did not reload after the commit: the cut over still happened.

  • 400The request is malformed or fails validation.

    application/json · ApiError

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 409The request conflicts with the current state.

    application/json · ApiError

  • 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/parallel-runs/<id>/cutover" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "override": {
    "reason": "string"
  }
}'

A parallel run's differences per field

get/api/parallel-runs/{id}/differences

For every field that differs: the compared messages it differs in, its scope, one example of the old engine's value and MedHook's, and an explanation. Counts cover every stored message; examples come from the newest 200 differing messages. accepted is the run's own ignore rules, and acceptedDifferences gives each one the scope and example message saved when it was accepted (content-free: a count and a message id), that message opened again without the ignore rules, or else an example from the newest 50 matched and mismatched messages; Cut over waits until mismatched and errors are 0. Values are "[redacted]" without PHI access. With it, every value stays masked (patient fields by kind, everything else "•••", numeric results and timestamps included) unless reveal gives a reason, which shows them in clear and is audited as phi.revealed (the reason, never values); a reveal without PHI access is 403. Every read is audited as parallel_run.differences_viewed (counts only, never values).

Minimum role: viewer.

Auth: Bearer token (how to get one) · Operation: getParallelRunDifferences

Parameters

NameInTypeDescription
idrequiredpathstring

Parallel run id (caller's workspace).

revealquerystring

Show masked values in clear, for this reason. Audited as phi.revealed.

Responses

  • 200The differences.
    Response fields

    application/json · object

    • runIdstring
    • comparedinteger
    • mismatchedinteger
    • errorsinteger

      Messages MedHook's shadow run failed on.

    • matchRatenumber | null
    • valuesboolean

      Whether values are included (PHI access).

    • revealedboolean

      Whether values are in clear (a reveal).

    • acceptedarray of string
    • acceptedDifferencesarray of object
      5 fields
      • fieldstring

        The accepted field (one of the run's ignore rules).

      • scopestring | null

        "1 message", "3 messages" or "all messages": the compared messages it differed in when it was accepted; null for a rule accepted without one.

      • oldstring

        One example of the old engine's value, masked as in differences; "" without an example.

      • newstring

        The same message's MedHook value, masked the same way.

      • whystring | null

        Why it differs, or null.

    • differencesarray of object
      7 fields
      • fieldstring

        The field that differs (public name: "[field]" when the name could carry content). An ignore rule when acceptable.

      • messagesinteger

        Compared messages where it differs.

      • scopestring

        "1 message", "3 messages" or "all messages".

      • oldstring

        One example of the old engine's value: "[redacted]" without PHI access; masked for every role unless revealed (patient fields by kind, e.g. "T••• R•••", everything else "•••"); "" without an example.

      • newstring

        The same message's MedHook value, masked the same way.

      • whystring | null

        Why it differs, e.g. "MedHook adds the timezone offset."; null with no example, a hidden name or no known explanation. Never quotes a value.

      • acceptableboolean

        Accept as expected can add it to the run's ignore rules (acceptField).

  • 400The request is malformed or fails validation.

    application/json · ApiError

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/parallel-runs/<id>/differences" \
  -H "Authorization: Bearer $TOKEN"

Schemas

Named objects the operations above link to.

ApiError

The error body. error is always present. code is present on most errors and is the field to branch on; a few routes and the sign-in and role checks return only error (and sometimes detail).

  • errorstringrequired

    Human-readable error message.

  • codestring

    Machine-readable error code.

    One of: "BAD_REQUEST", "INVALID_REQUEST", "UNAUTHORIZED", "UNAUTHENTICATED", "FORBIDDEN", "NOT_FOUND", "CONFLICT", "UNPROCESSABLE_ENTITY", "RATE_LIMITED", "INTERNAL_ERROR", "SERVICE_UNAVAILABLE", "NOT_CONFIGURED", "SIGNATURE_REQUIRED", "INVALID_SIGNATURE", "TIMESTAMP_REQUIRED", "TIMESTAMP_INVALID", "TIMESTAMP_OUT_OF_TOLERANCE", "INVALID_CREDENTIALS", "INVALID_TOKEN", "PAYLOAD_TOO_LARGE", "INVALID_NDJSON", "PHI_NOT_AUTHORIZED", "PHI_IN_SANDBOX", "IN_PROGRESS", "RETRY_SCHEDULED", "WORKFLOW_DISABLED", "CONFLICTING_SCOPE", "ALREADY_DELIVERED", "CHAIN_TOO_DEEP", "NO_FAILED_DESTINATION", "STALE_SCOPE", "UNKNOWN_DESTINATION", "NO_DESTINATIONS", "NOT_A_MESSAGE", "AI_FEATURES_DISABLED"

  • detailsany

    Optional structured context about the error.