Messages
Messages endpoints of the MedHook engine API: 21 operations with parameters, schemas and a curl example for each.
On this page
- List messages
- Get one message
- Reprocess a message search
- Stream messages
- Message totals and rate
- Search messages
- List your saved searches
- Save a search
- Delete a saved search
- Your PHI reveal window
- Show PHI for the next few minutes
- Hide PHI now
- Export messages as CSV
- Versions a replay can run on
- Dry-run or replay messages
- Ask a second admin to approve a replay
- A replay approval request
- Approve a replay over 1,000 messages
- Needs action, grouped by cause
- Why a message failed (Agent · cause and fix)
- Live MLLP connections
- Schemas
Inbound messages, as the Messages screen reads them.
List messages
get/api/messages
Executions of every trigger type (mllp, webhook, x12, fhir-subscription, polling, cron, schedule, manual, replay), newest first, with cursor paging. Each row may carry failure, the kind of failure of a failed or partly failed run (unreachable, timeout, auth, conflict, rate-limit, server, version, filter, data, uncertain, rejected), never the error text. A row may also carry destinations ([{ name, state }], state ok, failed or queued: the run's send steps by step name) and failedStep (the number the message's Steps tab gives the last failed step row: every step row counted from 1 in start order, retries and loop items included), read for the whole page from the steps' metadata, one row per step (G-messages-3); a count=1 read and the CSV export have neither. A row may also carry peer (#946): { address, tunnel, ambiguousTunnels? }, the sender's address as intake stored it (an MLLP listener's socket address; a webhook's client address through CLIENT_IP_SOURCE) and the { id, name, source? } of the tunnel whose most specific remote subnet holds it (source: "fortigate" for a tunnel on the customer's FortiGate, by the subnets the engine sees), tunnel: null when none does, or ambiguousTunnels when two or more hold it equally (none is picked); absent when intake stored no address (other trigger types, older listener images). Totals and the rate are GET /api/messages/stats. A row's status is its run's stored status, except filtered for a completed run whose every router destination filtered the message out (G-messages-1; clients that switch on the execution status see this new value), and the CSV status column reads the same. Rows carry only the patient's family name, given initial and MRN, as one patient label. PHI is masked by default (R38): the label reads D••• J••• · 48•••• until phi=reveal&reason= shows DOE, J · 483920 (audited as phi.revealed); a count=1 read has no patient and is never a reveal. control:, an exact correlation:, mrn:, sender:, the type filter, body: and HL7 field terms (once the body index is built) pick their candidates through indexes over the whole window; the query language then runs in memory over at most 2,000 rows per request: when it stops there before filling the page, scanCapped is true and nextCursor continues the search. A lone id-shaped bare term is also looked up as control: on the first page. With count=1 it returns only { total: { count, complete, scanned } }: the matches over the whole window, exact when complete, else a lower bound after 10,000 rows. A search that runs past MESSAGE_SEARCH_TIMEOUT_MS (default 20 s) answers 503 SEARCH_TIMEOUT. A search that reads message bodies is audited with the field names used, never the values. Viewers never see message content (G32): their rows have patient: null, and a search with free text or any HL7 field is refused with 403 PHI_SEARCH_FORBIDDEN (they may search control, correlation, type, workflow, status, ack and source). A query that can carry a patient (a field of PID, PD1, NK1, GT1, IN1 or IN2, such as PID.3, PID.5, PID.7 and PID.11, or mrn:, body:, json: or free text) is a 400 PATIENT_SEARCH_IN_URL ("Send patient searches in the request body"), whatever the role: send it to POST /api/messages/search, so it never reaches access logs, browser history or a Referer.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: listMessages
Parameters
| Name | In | Type | Description |
|---|---|---|---|
q | query | string | A query in the message query language. Top-level |
workflowId | query | string | Only this workflow. |
type | query | string | Message type, for example |
since | query | integer | Only the last N minutes (at most 90 days). Not with |
from | query | string (date-time) | Start of an absolute range on the received time (ISO-8601 date-time with an offset or Z). Not with |
to | query | string (date-time) | End of the range (ISO-8601 date-time). Must not be before |
ack | query | string | ACK code. |
triggerType | query | string | Comma list of source trigger types: mllp, webhook, x12, fhir-subscription, polling, cron, schedule, manual, replay. Unknown types are a 400. |
cursor | query | string | From |
limit | query | integer | Rows per page, 1 to 200. |
count | query | string | Set to |
format | query | string | Set to |
phi | query | string |
|
reason | query | string | Why PHI is shown, with |
grant | query | string | With |
Responses
- 200A page of messages.
Response fields
application/json · object
messagesarray of objectnextCursorstring | nullscannedintegerRows read in memory for this page.
scanCappedbooleanThe search stopped at its 2,000-row scan cap before filling the page; continue with
nextCursor.jsonParseBudgetExhaustedbooleanA
json:term read as much JSON text as one request may (32 MiB, each row's JSON counted once). The page stopped before the row it could not read;nextCursorcontinues there. Narrow the search.remediationstringWith
jsonParseBudgetExhausted: how to narrow the search.readAtstring (date-time)The server time just before the read (ISO-8601). Open
GET /api/messages/stream?after=with it so messages that arrive meanwhile are streamed.
- 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
- 500Unexpected server error.
application/json · ApiError
- 503A dependency is not available.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/messages" \
-H "Authorization: Bearer $TOKEN"Get one message
get/api/messages/{id}
One message for the inspector: message, raw, format, segments, output, outputFormat, trace, steps (metadata only), notRun, error and tunnel. notRun lists the workflow's steps a failed or filtered run never reached ([{ nodeId, nodeName }], downstream of the failed step or of the routers that filtered it, at most 100; empty otherwise), read from the version a run that waited ran on, else the workflow's current deployed version, else its live save (a run records no version otherwise, so after a redeploy an older run reads the current graph), for the Trace tab's not run rows. output is what the workflow produced: its FHIR (outputFormat: fhir), else the last completed transform step's output (json, hl7v2, x12, xml or text), else null. It contains the full message body (PHI), so every read is audited as message.viewed with the control id, type and workflow, and for a masked view the keyed hash of the patient's MRN (never the MRN) so the PHI access tab finds the view (a reveal's phi.revealed row carries it instead). context=ack_queue_replay (the ACK queue's Edit & replay) is kept on those records as the reason the message was opened; any other context is a 400. calls lists the runs its Call workflow steps started (childExecutionId, workflowId, workflowName, nodeName, mode; ids and names only). With part=step&step={id} it returns one step of the Steps tab as { step }: its input, output, error, console logs, mapping warnings, a JS step's channel map (vars) and global map writes (globalOps) when it made any, and for a step that failed on an API call apiResponse (status, method, host, headers limited to content-type, retry-after and request ids, body up to 8 KB, bodyBytes, truncated; the body is masked while PHI is masked); a viewer gets the name, status, timing, warnings and apiResponse without its body (body: null, bodyWithheld: true) only. With part=attempts it returns only { attempts }: whether a retry or replay is running or scheduled. That form has no message body and is not audited. With part=outcome it returns only { outcome }: what the message's run came to, for the replay modal (status, done, filtered, failedStep as { stepId, nodeName } or null, and answer, the HTTP status or ACK code the destination answered the failed step with, or null). No body, path, header or error text, so it is not audited; the replay modal polls it until done. With part=meta it returns metadata only, the same for every role: message (with patient null), format, segments (segment codes, at most 200, never field values), segmentCount, outputFormat, error and tunnel; audited as message.viewed with part: meta. The assistant's get_message reads this form. With part=exists it returns only { exists: true } (404 when the message is not in this workspace): it reads nothing of the message, so it is not a view and is not audited; the assistant checks the side panel's selected message with it on every turn. PHI is masked by default (R38): an operator gets the patient label, raw, the segment cards, output, trace text and error masked (names keep their initials, ids their first two characters, dates become ••••-••-••, the sex (PID.8) •, other PHI •••) with phiMasked: true, audited with masked: true; phi=reveal&reason= returns them as stored and also writes phi.revealed. The same applies to part=step (console lines are withheld while masked: logs: [] and logsWithheld) and part=deliveries (path, bodies and errors masked). A viewer gets the message without content (G32): raw is empty, segments is empty, output and outputFormat are null, trace lines keep their tag but no text, message.patient is null and redacted is true; the read is audited with redacted: true. part=step and part=deliveries reads are audited the same way: an operator's masked read names the patient's keyed hash, a viewer's names none.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getMessage
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | Message (execution) id. |
part | query | string |
|
step | query | string | With |
context | query | string | The screen opening the message, kept on its audit record as the reason: |
phi | query | string |
|
reason | query | string | Why PHI is shown, with |
grant | query | string | With |
Responses
- 200The message.
application/json · object
- 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 "$ENGINE_URL/api/messages/<id>" \
-H "Authorization: Bearer $TOKEN"Reprocess a message search
post/api/messages/reprocess
Replays every message the search matches (query: the GET /api/messages filters), through its own workflow or through targetWorkflowId. First call with dryRun: true: it returns the count, the cap (max, BULK_REPROCESS_MAX, default 1000) and the search pinned in time (query: a relative since becomes from/to, an open search is closed at now). Then send that query back with confirmCount; a different count now is a 409 COUNT_CHANGED, more than the cap a 400 TOO_MANY. The replays are queued as work items and run at the engine's normal concurrency. A message that is still running, or whose stored content could not be decrypted, is skipped and listed in skipped (never sent). overwrite: true marks each original reprocessed and links it to its replacement; a later bulk reprocess leaves those originals out. Operators and admins only, one at a time per workspace, rate limited, audited once as message.bulk_reprocessed with counts and the query's field names, never the searched values.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: reprocessMessages
Request body (required)
application/json · object
queryobjectdryRunbooleanconfirmCountintegertargetWorkflowIdstringoverwriteboolean
Responses
- 200The preview (`dryRun`) or the run.
Response fields
application/json · object
countintegermaxintegeroverCapbooleancompletebooleanqueryobjectmatchedintegerqueuedintegeroverwrittenintegerundecryptableintegerskippedarray of object2 fields
idstringcodestring
executionsarray of object2 fields
originalIdstringexecutionIdstring
- 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 -X POST "$ENGINE_URL/api/messages/reprocess" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": {},
"dryRun": true,
"confirmCount": 0,
"targetWorkflowId": "string",
"overwrite": true
}'Stream messages
get/api/messages/stream
Server-Sent Events of message summaries, with the same filters as GET /api/messages. It sends event: message for each message received or finished, event: watermark ({ at }) when the time it has read up to moves, and a comment heartbeat every 15 seconds (totals and the rate are GET /api/messages/stats). A message that was running is sent again when its ACK is known, so upsert by id. Opening streams is rate limited per client. Viewers get rows without the patient and cannot stream a search on message content (403 PHI_SEARCH_FORBIDDEN), as in GET /api/messages. PHI is masked by default (R38): operators get the masked patient label unless the stream opens with phi=reveal&reason=, audited once as phi.revealed when it opens. A query that can carry a patient (a field of PID, PD1, NK1, GT1, IN1 or IN2, such as PID.3, PID.5, PID.7 and PID.11, or mrn:, body:, json: or free text) is a 400 PATIENT_SEARCH_IN_URL ("Send patient searches in the request body"), whatever the role: send it to POST /api/messages/search, so it never reaches access logs, browser history or a Referer.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: streamMessages
Parameters
| Name | In | Type | Description |
|---|---|---|---|
q | query | string | A query in the message query language. Top-level |
workflowId | query | string | Only this workflow. |
type | query | string | Message type. |
from | query | string (date-time) | Start of an absolute range on the received time (ISO-8601 date-time with an offset or Z). Not with |
to | query | string (date-time) | End of the range (ISO-8601 date-time). Must not be before |
triggerType | query | string | Comma list of source trigger types: mllp, webhook, x12, fhir-subscription, polling, cron, schedule, manual, replay. Unknown types are a 400. |
phi | query | string |
|
reason | query | string | Why PHI is shown, with |
grant | query | string | With |
sample | query | integer | Send about 1 message in N, picked by a hash of the message id (the same messages each time, so an ACK update follows its message). 1 to 1000, default 1 (every message). The Messages page asks for 50 once traffic reaches 2 messages a second. Search always reads every message. |
message | query | string | A message id that is always sent, inside the sample or not (a deep link to one message). |
after | query | string (date-time) | Start the stream here instead of now (ISO-8601 date-time): the |
Responses
- 200An event stream.
text/event-stream · string
- 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
- 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/messages/stream" \
-H "Authorization: Bearer $TOKEN"Message totals and rate
get/api/messages/stats
The caller's workspace: inbound messages (retries included) received since 00:00 UTC, the rate over the last minute in messages a second, what needs action (the Messages nav badge's count, from the same list as GET /api/attention, reused for 10 seconds per workspace; null when it can't be read), and 40 buckets over the window with the failed runs in each. SQL aggregates over an index range; today's count is kept per engine replica and extended by the minutes since. Counts only, no message content. Rate limited to 120 requests per minute.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getMessageStats
Parameters
| Name | In | Type | Description |
|---|---|---|---|
window | query | string | The rate graph's window: |
Responses
- 200The totals and the buckets.
Response fields
application/json · object
windowstringOne of: "15m", "1h"
bucketMsintegerLength of one bucket in milliseconds.
todayintegerMessages received since 00:00 UTC.
perSecondnumberMessages a second over the last minute, one decimal.
needActioninteger | nullWhat needs action (GET /api/attention
badges.messages, the Needs action groups' messages), or null.bucketsarray of object3 fields
atstring (date-time)Bucket start.
totalintegerfailedinteger
generatedAtstring (date-time)
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
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 "$ENGINE_URL/api/messages/stats" \
-H "Authorization: Bearer $TOKEN"Search messages
post/api/messages/search
Searches every message with the query in the body: the same search, rows, count and CSV export as GET /api/messages, which refuses a patient search in its URL (PATIENT_SEARCH_IN_URL). The Messages page sends every Enter here. phi=reveal&reason= stays a query parameter (a reason, never a value). Viewers may search but not message content (403 PHI_SEARCH_FORBIDDEN: they may search control, correlation, type, workflow, status, ack and source). A read: audited as message.searched with the field names used and, for a patient search, patientSearch and a keyed hash of an exact MRN (PID.3:483920, mrn:483920), never a value; an export as message.export. Rate limited at 120 requests a minute; an export shares the 10 a minute export limit.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: searchMessages
Parameters
| Name | In | Type | Description |
|---|---|---|---|
phi | query | string |
|
reason | query | string | Why PHI is shown, with |
Request body (required)
application/json · object
qstringA query in the message query language (at most 500 characters), as
qonGET /api/messages:PID.5:DOE*,since:24h PID.3:483920,correlation:req-7f3a,json:$.patient.id:TP-0001.cursorstringFrom
nextCursorof the previous page.limitintegerRows per page, 1 to 200.
countbooleanThe match count over the window only.
formatstringcsvto download the search asPOST /api/messages/exportdoes, with no patient column.One of: "csv"
Responses
- 200A page of messages, `{ total }` with `count`, or the CSV with `format`.
Response fields
application/json · object
messagesarray of objectnextCursorstring | nullscannedintegerRows read in memory for this page.
scanCappedbooleanThe search stopped at its 2,000-row scan cap before filling the page; continue with
cursor.jsonParseBudgetExhaustedbooleanA
json:term read as much JSON text as one request may (32 MiB). The page stopped before the row it could not read; continue withcursor, or narrow the search. An export that runs out answers 413EXPORT_TOO_LARGE.remediationstringWith
jsonParseBudgetExhausted: how to narrow the search.
- 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
- 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
- 503A dependency is not available.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/messages/search" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"q": "string",
"cursor": "string",
"limit": 50,
"count": true,
"format": "csv"
}'List your saved searches
get/api/messages/saved-searches
The caller's own saved searches on Messages, oldest first, shown under the built-in presets of Saved searches. Saved searches belong to the caller and the workspace the request is verified for: nobody lists or deletes another person's, and each workspace has its own. The name and the query are encrypted at rest and never written to logs or the audit log. Not audited.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: listMessageSavedSearches
Responses
- 200Your saved searches.
Response fields
application/json · object
searchesarray of object5 fields
idstringnamestringThe label shown under the built-in presets.
querystringThe message query it runs, as
qonPOST /api/messages/search.phibooleanIt searches message content (free text or an HL7 field): disabled for viewers.
createdAtstring (date-time)
- 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
- 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 "$ENGINE_URL/api/messages/saved-searches" \
-H "Authorization: Bearer $TOKEN"Save a search
post/api/messages/saved-searches
Saves a search for the caller in the workspace. query must be a valid message search (at most 500 characters). Every role may save their own; a viewer can't save a search on message content (403 PHI_SEARCH_FORBIDDEN). Up to 25 per person per workspace (409 SAVED_SEARCH_LIMIT). Saved searches belong to the caller and the workspace the request is verified for: nobody lists or deletes another person's, and each workspace has its own. The name and the query are encrypted at rest and never written to logs or the audit log. Audited as saved_search.created with the field names the query uses and whether it reads content, never the name or the query. Rate limited at 30 requests a minute.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: createMessageSavedSearch
Request body (required)
application/json · object
namestringrequired1 to 60 characters.
querystringrequiredA query in the message query language:
type:ADT^* status:failed since:24h.
Responses
- 201The saved search.
Response fields
application/json · object
searchobject5 fields
idstringnamestringThe label shown under the built-in presets.
querystringThe message query it runs, as
qonPOST /api/messages/search.phibooleanIt searches message content (free text or an HL7 field): disabled for viewers.
createdAtstring (date-time)
- 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
- 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 -X POST "$ENGINE_URL/api/messages/saved-searches" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"query": "string"
}'Delete a saved search
delete/api/messages/saved-searches
Deletes one of the caller's saved searches in the workspace; anyone else's is a 404. Saved searches belong to the caller and the workspace the request is verified for: nobody lists or deletes another person's, and each workspace has its own. The name and the query are encrypted at rest and never written to logs or the audit log. Audited as saved_search.deleted. Rate limited at 30 requests a minute.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: deleteMessageSavedSearch
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | query | string | The saved search id. |
Responses
- 200Deleted.
Response fields
application/json · object
deletedbooleanidstring
- 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
- 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 -X DELETE "$ENGINE_URL/api/messages/saved-searches?id=string" \
-H "Authorization: Bearer $TOKEN"Your PHI reveal window
get/api/phi/reveal-grant
The longest window the engine allows (maxMinutes, 0 = off), whether the caller may open one (canGrant: false for viewers and API clients) and their open window, or null. A window belongs to the signed-in person and the workspace the request is verified for; API clients name a reason on each request instead. Windows are off unless the engine sets PHI_REVEAL_WINDOW_MAX_MINUTES (Helm phi.revealWindowMaxMinutes) above 0. Reads no PHI; not audited.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getPhiRevealGrant
Responses
- 200The caller's window state.
Response fields
application/json · object
maxMinutesintegercanGrantbooleangrantobject5 fields
idstringSend it as
grantwithphi=revealon a read.reasonstringOne of: "troubleshooting", "patient-request", "audit"
minutesintegerstartedAtstring (date-time)expiresAtstring (date-time)
- 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
- 500Unexpected server error.
application/json · ApiError
Example request
curl "$ENGINE_URL/api/phi/reveal-grant" \
-H "Authorization: Bearer $TOKEN"Show PHI for the next few minutes
post/api/phi/reveal-grant
Opens a reveal window for minutes (1 to maxMinutes) with a reason, ending any window the caller already has. Reads that send phi=reveal&grant=<id> then show PHI until it expires or is ended, each checked on the server and audited as phi.revealed with grantId. Audited as phi.reveal_window_started (reason, minutes, expiry); if that record can't be written the window doesn't open (500 PHI_REVEAL_NOT_RECORDED). 409 PHI_REVEAL_WINDOW_OFF while windows are off; a viewer gets 403 PHI_REVEAL_FORBIDDEN. A window belongs to the signed-in person and the workspace the request is verified for; API clients name a reason on each request instead. Windows are off unless the engine sets PHI_REVEAL_WINDOW_MAX_MINUTES (Helm phi.revealWindowMaxMinutes) above 0.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: openPhiRevealGrant
Request body (required)
application/json · object
reasonstringrequiredOne of: "troubleshooting", "patient-request", "audit"
minutesintegerrequired1 to the engine's maxMinutes.
Responses
- 201The open window.
Response fields
application/json · object
grantobject5 fields
idstringSend it as
grantwithphi=revealon a read.reasonstringOne of: "troubleshooting", "patient-request", "audit"
minutesintegerstartedAtstring (date-time)expiresAtstring (date-time)
maxMinutesinteger
- 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
- 409The request conflicts with the current state.
application/json · ApiError
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/phi/reveal-grant" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"reason": "troubleshooting",
"minutes": 0
}'Hide PHI now
delete/api/phi/reveal-grant
Ends the caller's open reveal window in this workspace (Hide now). Audited as phi.reveal_window_ended. ended is false when none was open. A window belongs to the signed-in person and the workspace the request is verified for; API clients name a reason on each request instead. Windows are off unless the engine sets PHI_REVEAL_WINDOW_MAX_MINUTES (Helm phi.revealWindowMaxMinutes) above 0.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: endPhiRevealGrant
Responses
- 200Ended.
Response fields
application/json · object
endedboolean
- 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
- 500Unexpected server error.
application/json · ApiError
Example request
curl -X DELETE "$ENGINE_URL/api/phi/reveal-grant" \
-H "Authorization: Bearer $TOKEN"Export messages as CSV
post/api/messages/export
Downloads a search as CSV (Messages › Export), with the query in the body so a patient term never sits in a URL. Columns time,id,type,workflow,status,ack,result (operational only: no patient, MRN or message content for any role, and phi=reveal adds none; result is the Stream's Result sentence, PHI-masked). Read from the newest message in pages of 1,000; above 50,000 matches (or 250,000 rows read) it is a 413 EXPORT_TOO_LARGE, "Exports stop at 50,000 messages. Narrow the search." X-Export-Rows is the row count. Audited as message.export with the count, the field names used and a keyed hash of the query, never the query. Its own rate limit, 10 requests a minute, shared by every CSV export. Viewers may export, but not search message content (403 PHI_SEARCH_FORBIDDEN).
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: exportMessages
Request body (required)
application/json · object
qstringA query in the message query language (at most 500 characters), as
qonGET /api/messages:type:ADT^* status:failed since:15m. No other key.
Responses
- 200The CSV, as an attachment (`messages-YYYYMMDD-HHmm.csv`).
text/csv · string
- 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
- 413The body is larger than the limit.
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
- 503A dependency is not available.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/messages/export" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"q": "string"
}'Versions a replay can run on
get/api/messages/replay
The workflow's live version (the deployed one, or the newest save when nothing was ever deployed) and the newest save when it is newer (draft, else null). Version numbers only.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getMessageReplayVersions
Parameters
| Name | In | Type | Description |
|---|---|---|---|
workflowIdrequired | query | string | The messages' workflow. |
Responses
- 200The versions.
Response fields
application/json · object
workflowIdstringworkflowNamestringliveintegerdraftinteger | null
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 404Not found in the caller's workspace.
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 "$ENGINE_URL/api/messages/replay?workflowId=string" \
-H "Authorization: Bearer $TOKEN"Dry-run or replay messages
post/api/messages/replay
Replays messages of one workflow. A dry run (dryRun: true) runs each message (at most 200, within a 20 s budget; checked says how many) through target.version without delivering or storing anything and answers how many would reach a destination (a run that does not fail and whose write-side adapter step produces its send), the change lines against the original run (PHI masked) and a token. A replay must send the token of a dry run of the same ids, version and edit, by the same person, within 15 minutes (409 DRY_RUN_REQUIRED), runs only on the live version (409 VERSION_NOT_LIVE) and is paced at rate messages a second. Over 1,000 messages a replay needs a second admin's approval: approvalId of an approved request (POST /api/messages/replay-approvals) for the same ids, version and rate, asked for by the caller, spent once after the intent is audited (403 APPROVAL_REQUIRED without one, 403 APPROVAL_MISMATCH for another selection, 404 for another workspace's); if the enqueue then fails with nothing queued the approval is put back, and if it fails part-way the queued replays are audited and the answer is 500 REPLAY_PARTIAL. edit (one message) replays an edited copy, linked to the original through replayOfExecutionId; an HL7 v2 edit (raw, fields) applies only to a message received as HL7 (400 EDIT_NOT_HL7 otherwise), a JSON edit (jsonFields, json) only to a message with a JSON body: a webhook's JSON body, a polled item or a FHIR subscription's resource (400 EDIT_NOT_JSON otherwise), and an edit holding more masked values (•••) than the stored message is 400 MASKED_INPUT. A field patch (edit.fields, G-messages-8) is applied to the stored message, so fields the operator didn't change, masked patient fields included, stay as received; a value still holding • keeps the stored value; a field the message lacks, MSH.1 or MSH.2 (the separators), a value with a segment or field separator, or a patch that changes nothing (every value still holding • or equal to the stored one) is 400 INVALID_EDIT. A JSON path patch (edit.jsonFields) works the same way on the stored body: a path it lacks, or one naming an object or list, or a patch that changes nothing, is 400 INVALID_EDIT; a whole-JSON edit (edit.json, made from the revealed message) may add or remove keys, and text that is not a JSON object or array is 400 INVALID_EDIT. The edited body replaces the one the run's input held, whole; the rest of the input (the trigger, a poll's polledAt, a webhook's headers) stays as stored, and a polled item's replay never moves the poll's cursor. Audited as message.replay_started (before anything is queued; 503 AUDIT_UNAVAILABLE if it cannot be written) and message.replayed, with the actor, the count, the version and the rate (and the changedFields of a field patch or any JSON edit: field names or paths only, the first 500, with changedFieldCount when there were more), never message content or a field's value.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: replayMessages
Request body (required)
application/json · object
idsarray of stringrequiredtargetobjectrequired1 field
versionintegerrequired
rateintegerMessages a second.
One of: 10, 50, 200
dryRunbooleanOnly run the dry run.
tokenstringThe dry run's token (a replay).
approvalIdstringA second admin's approval (a replay of more than 1,000 messages).
editobject | object | object | objectOne message's edit. HL7 v2: the whole edited text (
raw, made from the revealed message), or only the changed fields (fields, G-messages-8). JSON: only the changed values by path (jsonFields), or the whole edited body (json, made from the revealed message).4 fields
option 1object1 field
rawstringrequiredThe edited message.
option 2object1 field
fieldsobjectrequiredChanged HL7 v2 fields by key (
RXE.2, a repeated segmentOBX[2].5, MSH shifted by one), 1 to 500, applied to the stored message; a value still holding•keeps the stored value.
option 3object1 field
jsonFieldsobjectrequiredChanged JSON values by path (
data.status,lines[1].qty,[0].idfor an array body), 1 to 500, applied to the stored body; each path must name a string, number, true/false or null the body has. A value still holding•keeps the stored value.
option 4object1 field
jsonstringrequiredThe whole edited body as JSON text (an object or array); it may add or remove keys.
Responses
- 200The dry run (`dryRun: true`). A replay answers 202 with `{ queued, executions: [{ originalId, executionId }], skipped: [{ id, code, error }], version, rate, loggedBy }`; `loggedBy` is the signed-in person's initials, from their name, else their email; an API client's from its name. A change line reads `Same failure at step N on vX` when the dry run fails at the step the original run failed on with the same error (ids and numbers aside); another error there is shown as it is.
Response fields
application/json · object
totalintegercheckedintegerMessages the dry run ran (at most 200).
wouldDeliverintegerchangesarray of object2 fields
signstring+added,~changed,=unchanged or why it would not send.One of: "+", "~", "="
textstringOne line; PHI values read
•••.
tokenstringapprovalstringOne of: "not-needed", "required"
- 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
- 503A dependency is not available.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/messages/replay" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"string"
],
"target": {
"version": 1
},
"rate": 10,
"dryRun": true,
"token": "string",
"approvalId": "string",
"edit": {
"raw": "string"
}
}'Ask a second admin to approve a replay
post/api/messages/replay-approvals
A replay of more than 1,000 messages needs a second admin's approval. Ask for it after the dry run: token is that dry run's, for the same ids and version, by the same person (409 DRY_RUN_REQUIRED). 1,000 or fewer need none (400 APPROVAL_NOT_NEEDED); approvals need named, signed-in people (403 APPROVAL_NEEDS_NAMES). The request expires after 24 h and shows in Needs you (GET /api/attention, kind approval): a waiting one for the admins who may approve it, an approved one for its requester. One open request per replay: when the caller already has a waiting or approved, unexpired request for the same ids, version and rate, the answer is 200 with that request and nothing is created. Audited as message.replay.approval_requested with the actor, the count, the version and the rate, never the ids or message content.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: requestMessageReplayApproval
Request body (required)
application/json · object
idsarray of stringrequiredOver 1,000 ids. The validator accepts 1 to 10,000 and answers 400
APPROVAL_NOT_NEEDEDfor 1,000 or fewer.versionIdintegerrequiredThe version the replay runs on.
rateintegerrequiredMessages a second.
One of: 10, 50, 200
tokenstringrequiredThe dry run's token.
Responses
- 201The new request (200: the caller's open request for the same replay).
Response fields
application/json · object
idstringstatusstringrequestedwaits for a second admin;approvedlets the requester replay once;usedafter that replay;expired24 h after the request.One of: "requested", "approved", "used", "expired"
workflowIdstringcountintegerMessages the replay covers (over 1,000).
versionintegerThe version the replay runs on.
rateintegerMessages a second.
One of: 10, 50, 200
idsarray of stringThe message (execution) ids.
requestedBystring | nullWho asked, by name when the engine has one.
approvedBystring | nullWho approved, by name when the engine has one.
requestedAtstring (date-time)approvedAtstring (date-time) | nullexpiresAtstring (date-time)minebooleanThe caller asked for it (and replays once it is approved).
canApprovebooleanThe caller may approve it: a signed-in admin other than the requester, while it waits.
approveBlockedstring | nullWhy the caller can't approve, while it waits.
- 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 -X POST "$ENGINE_URL/api/messages/replay-approvals" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"string"
],
"versionId": 1,
"rate": 10,
"token": "string"
}'A replay approval request
get/api/messages/replay-approvals/{id}
One request for a second admin's approval, in the caller's workspace (404 otherwise): its state, the selection, who asked and approved, and what the caller may do. Ids and counts only. fields=status (the requester's poll while it waits) answers without ids and requestedBy.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getMessageReplayApproval
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The approval request id. |
fields | query | string |
|
Responses
- 200The request.
Response fields
application/json · object
idstringstatusstringrequestedwaits for a second admin;approvedlets the requester replay once;usedafter that replay;expired24 h after the request.One of: "requested", "approved", "used", "expired"
workflowIdstringcountintegerMessages the replay covers (over 1,000).
versionintegerThe version the replay runs on.
rateintegerMessages a second.
One of: 10, 50, 200
idsarray of stringThe message (execution) ids.
requestedBystring | nullWho asked, by name when the engine has one.
approvedBystring | nullWho approved, by name when the engine has one.
requestedAtstring (date-time)approvedAtstring (date-time) | nullexpiresAtstring (date-time)minebooleanThe caller asked for it (and replays once it is approved).
canApprovebooleanThe caller may approve it: a signed-in admin other than the requester, while it waits.
approveBlockedstring | nullWhy the caller can't approve, while it waits.
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 404Not found in the caller's workspace.
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 "$ENGINE_URL/api/messages/replay-approvals/<id>" \
-H "Authorization: Bearer $TOKEN"Approve a replay over 1,000 messages
post/api/messages/replay-approvals/{id}/approve
A signed-in admin other than the requester approves the replay; it replays nothing (the requester replays, once, with approvalId). The requester is 403 SELF_APPROVAL; another workspace's request 404; one that is approved, used or expired 409 APPROVAL_NOT_PENDING. Audited as message.replay.approved with the approver, the requester, the count, the version and the rate.
Minimum role: admin.
Auth: Bearer token (how to get one) · Operation: approveMessageReplay
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The approval request id. |
Responses
- 200The approved request.
Response fields
application/json · object
idstringstatusstringrequestedwaits for a second admin;approvedlets the requester replay once;usedafter that replay;expired24 h after the request.One of: "requested", "approved", "used", "expired"
workflowIdstringcountintegerMessages the replay covers (over 1,000).
versionintegerThe version the replay runs on.
rateintegerMessages a second.
One of: 10, 50, 200
idsarray of stringThe message (execution) ids.
requestedBystring | nullWho asked, by name when the engine has one.
approvedBystring | nullWho approved, by name when the engine has one.
requestedAtstring (date-time)approvedAtstring (date-time) | nullexpiresAtstring (date-time)minebooleanThe caller asked for it (and replays once it is approved).
canApprovebooleanThe caller may approve it: a signed-in admin other than the requester, while it waits.
approveBlockedstring | nullWhy the caller can't approve, while it waits.
- 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 -X POST "$ENGINE_URL/api/messages/replay-approvals/<id>/approve" \
-H "Authorization: Bearer $TOKEN"Needs action, grouped by cause
get/api/messages/groups
The workspace's failed messages of the last 7 days (the ACK queue's, discarded ones left out), grouped by workflow and error signature (digits, ids and host:port stripped), plus each open or probing destination queue with messages waiting as one queued-retrying group of its depth. A credential refusal (401/403) is error-auth, with the workflow's paused queue in lane when there is one; any other paused queue with messages waiting is a queued-paused group. Largest first, at most 50 groups, each listing at most 50 messages (a queue: its first 5, in lane order). Each group carries what the Agent · cause and fix card needs, so the client builds its deterministic text and actions with no other request: fixVersion, adapterProfileId/adapterProfileName, a queue's target and tunnel, and the lane's pausedAt. Titles, details and fixes have the messages' patient values masked; no message content. Not audited (read-only, no content).
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: listMessageGroups
Responses
- 200The groups.
Response fields
application/json · object
groupsarray of object22 fields
keystringStable:
lane:<lane>orsig:<workflow>:<kind>:<hash>.kindstringOne of: "queued-retrying", "queued-paused", "ae-rejected", "ar-rejected", "error-auth"
kindLabelstringQueued · retrying,Queued · paused,AE · rejected,AR · rejected,Error · auth.tonestringOne of: "warn", "err"
titlestringThe newest error, patient values masked
•••.workflowIdstringworkflowNamestringcountintegerfirstAtstring (date-time) | nulllastAtstring (date-time) | nullmessagesarray of object6 fields
idstringThe ACK queue id (first delivery), or the queued row.
executionIdstringThe newest attempt (what a replay acts on).
controlIdstringtypestringatstring (date-time)detailstringType, state and tries; no values.
moreintegerHow many more the group holds than it lists.
fixstring | nullThe suggested fix, patient values masked.
diagnoseIdstring | nullThe message
/diagnosisexplains the group by.laneobject | null5 fields
lanestringlabelstringThe destination's name.
statestringOne of: "open", "half-open", "paused"
nextProbeAtstring (date-time) | nullpausedAtstring (date-time) | nullWhen a person paused the queue.
replayablebooleanFalse for a queue group: it delivers on its own.
stepstring | nullThe failing step's name; null for a queue.
fixVersioninteger | nullAE: the workflow's draft (newest save, newer than the deployed version) whose content was saved after the first failure (dated by its newest version snapshot), the version
Dry run {n} on v{n}opens the replay modal on; else null.adapterProfileIdstring | nullAuth: the failing step's adapter profile in this workspace; else null.
adapterProfileNamestring | nulltargetstring | nullA queue: the host:port its errors name; else null.
tunnelobject | null2 fields
namestringupbooleanThe tunnel is healthy.
needActionintegerWhat needs action: every group's messages, not only the 50 listed. The same count as GET /api/attention
badges.messagesand the Messages header (G-messages-11).
- 401No credential, or the token is invalid or expired.
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 "$ENGINE_URL/api/messages/groups" \
-H "Authorization: Bearer $TOKEN"Why a message failed (Agent · cause and fix)
get/api/messages/{id}/diagnosis
The troubleshooting autopilot's deterministic diagnosis of one failed message (no model, so it works with AI off): its class, the cause, the kind of fix and the profile or tunnel it names. Message content is withheld: no error text or values. Read-only and not audited; another workspace's message is 404.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getMessageDiagnosis
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The message (execution) id. |
Responses
- 200The diagnosis.
Response fields
application/json · object
classstringOne of: "data", "mapping", "destination", "auth", "tunnel", "config", "unknown"
causestringfixstring | nullOne of: "mapping", "code-table", "profile", "wait"
profileobject | null2 fields
idstringnamestring
tunnelobject | null2 fields
idstringnamestring
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 404Not found in the caller's workspace.
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 "$ENGINE_URL/api/messages/<id>/diagnosis" \
-H "Authorization: Bearer $TOKEN"Live MLLP connections
get/api/mllp/connections
Who is connected right now. For each MLLP listener a workflow of this workspace listens on: every connected peer across the listener pods (address, the tunnel whose remote subnets hold it, connected since, last frame received and sent, frames and bytes in the last 5 and 15 minutes, last ACK code, idle time) and the last 10 closed connections. For each MLLP destination (adapter profile) of this workspace: its pooled connections (open, in use, idle, waiting) summed over engine processes, traffic and the last connect error's class. Built from snapshots each process writes every 5 s; source is local (with a note) when Redis is unreachable and only this engine process's view is shown. Addresses, times, counts and ACK codes only, never message content. Rate limited: 120 req / 60 s.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: listMllpConnections
Responses
- 200The connections.
Response fields
application/json · object
generatedAtintegerEpoch milliseconds.
sourcestringOne of: "redis", "local"
notestring | nulllistenersarray of object10 fields
namestringThe listener's name (Helm mllp.listeners).
portintegertlsbooleanframingstringmllp, frame or eos.
workflowsarray of object2 fields
idstringnamestring
processesintegerListener pods reporting it; 0 when none is.
connectionsintegerOpen connections over every pod.
connectionsRefusedintegerConnections refused at maxConnections.
peersarray of object15 fields
addressstringThe peer's IP address.
portinteger | nullThe peer's source port.
instancestringThe listener pod holding the connection.
tunnelobject | null2 fields
idstringnamestring
connectedAtintegerEpoch milliseconds.
closedAtintegerRecently closed connections only. Epoch milliseconds.
idleMsintegerSince the last frame either way, or the connect.
lastReceivedAtinteger | nullThe last frame received. Epoch milliseconds.
lastSentAtinteger | nullThe last frame sent. Epoch milliseconds.
lastAckstring | nullThe last ACK code (MSA-1, or the raw TCP code), e.g. AA.
lastAckAtinteger | nullWhen that ACK was sent or read. Epoch milliseconds.
received5mobject2 fields
framesintegerbytesinteger
received15mobject2 fields
framesintegerbytesinteger
sent5mobject2 fields
framesintegerbytesinteger
sent15mobject2 fields
framesintegerbytesinteger
recentlyClosedarray of objectUp to 10 per listener, newest first.
15 fields
addressstringThe peer's IP address.
portinteger | nullThe peer's source port.
instancestringThe listener pod holding the connection.
tunnelobject | null2 fields
idstringnamestring
connectedAtintegerEpoch milliseconds.
closedAtintegerRecently closed connections only. Epoch milliseconds.
idleMsintegerSince the last frame either way, or the connect.
lastReceivedAtinteger | nullThe last frame received. Epoch milliseconds.
lastSentAtinteger | nullThe last frame sent. Epoch milliseconds.
lastAckstring | nullThe last ACK code (MSA-1, or the raw TCP code), e.g. AA.
lastAckAtinteger | nullWhen that ACK was sent or read. Epoch milliseconds.
received5mobject2 fields
framesintegerbytesinteger
received15mobject2 fields
framesintegerbytesinteger
sent5mobject2 fields
framesintegerbytesinteger
sent15mobject2 fields
framesintegerbytesinteger
destinationsarray of object19 fields
profileIdstringnamestringThe adapter profile's name.
hoststringportintegertlsbooleanframingstringtunnelobject | null2 fields
idstringnamestring
processesintegerEngine processes holding state for it.
poolobject4 fields
openintegerinUseintegeridleintegerwaitingintegerSends waiting for a connection.
lastConnectErrorobject | null2 fields
kindstringOne of: "refused", "timeout", "unreachable", "dns", "reset", "tls", "blocked", "pool-busy", "other"
atintegerEpoch milliseconds.
idleMsinteger | nulllastReceivedAtinteger | nullThe last frame received. Epoch milliseconds.
lastSentAtinteger | nullThe last frame sent. Epoch milliseconds.
lastAckstring | nullThe last ACK code (MSA-1, or the raw TCP code), e.g. AA.
lastAckAtinteger | nullWhen that ACK was sent or read. Epoch milliseconds.
received5mobject2 fields
framesintegerbytesinteger
received15mobject2 fields
framesintegerbytesinteger
sent5mobject2 fields
framesintegerbytesinteger
sent15mobject2 fields
framesintegerbytesinteger
- 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
- 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 "$ENGINE_URL/api/mllp/connections" \
-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).
errorstringrequiredHuman-readable error message.
codestringMachine-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"
detailsanyOptional structured context about the error.