Triggers
Triggers endpoints of the MedHook engine API: 19 operations with parameters, schemas and a curl example for each.
On this page
- The workspace's webhooks as OpenAPI, for senders
- Send a webhook to a trigger
- Receive a webhook on a path (GET)
- Receive a webhook on a path
- Receive a webhook on a path (PUT)
- Receive a webhook on a path (PATCH)
- Receive a webhook on a path (DELETE)
- MLLP listener ingest (internal)
- WSDL of a Web Service Listener trigger
- Send a SOAP request to a Web Service Listener trigger
- Receive a Pub/Sub push delivery
- DICOM listener ingest (internal)
- Send an X12 document to triggers
- FHIR subscription callback
- List scheduled cron jobs
- Validate and preview a cron schedule
- Validate and preview a cron schedule (PUT)
- Reload cron schedules
- Delete a cron schedule
- Schemas
Inbound routes: webhooks, X12, FHIR subscription callbacks, cron schedules and the MLLP listener's internal ingest.
The workspace's webhooks as OpenAPI, for senders
get/api/triggers/webhook-schemas
An OpenAPI 3.1 document of the requested workspace's enabled webhook triggers (the deployed version's), for a sender to generate a client from. Each webhook id is one path, /api/triggers/webhook/{id} (a catch-all /api/webhooks/... path only when one of its triggers has a bodySchema), with an operationId from the workflow name (collisions numbered). The requestBody is the trigger's bodySchema, its $defs lifted into components/schemas (a different definition of the same name in another webhook is renamed Name_2); a trigger without one accepts any body ({}), and several triggers on one id accept a body any of them does (anyOf). Credentials are named, never given: HMAC signing is described in the operation text, expected headers are apiKey header schemes with the exact header name only, and a trigger with neither takes an engine bearer token. A catch-all path has no security: its webhook adapter profile is the credential (a signature, a header or a query parameter), which the operation text says. ?webhookId= narrows the document to one webhook; an id the workspace has no enabled webhook trigger for is 404. Audited as trigger.webhook_schemas.exported with the path count and workspace.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getWebhookSchemas
Parameters
| Name | In | Type | Description |
|---|---|---|---|
webhookId | query | string | Only this webhook id (1 to 500 characters). |
Responses
- 200The OpenAPI 3.1 document.
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/triggers/webhook-schemas" \
-H "Authorization: Bearer $TOKEN"Send a webhook to a trigger
post/api/triggers/webhook/{webhookId}
Delivers one event to every enabled workflow whose webhook trigger has this webhookId (routing reads webhookId only; the trigger's path is the HTTP Listener path a Mirth export uses). Partners call this route without an engine token, so the route authenticates the sender itself.
Signing. When the trigger has an HMAC secret, sign the exact request body with HMAC-SHA256 and send the lowercase hex digest as x-hub-signature-256: sha256=<hex>. The x-webhook-signature header is accepted as an alternative, and the sha256= prefix is optional. Compute the digest over the raw bytes you send, before any re-encoding. A missing or wrong signature is rejected with 403 INVALID_SIGNATURE. curl-style example: sig=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -hex | sed 's/^.* //'), then -H "x-hub-signature-256: sha256=$sig".
Replay window. Sign a timestamp with the body so a captured request cannot be replayed: send x-webhook-timestamp: <unix seconds> and sign <timestamp>.<body>, or send Standard Webhooks headers (webhook-id, webhook-timestamp, webhook-signature: v1,<base64 HMAC of id.timestamp.body>; a whsec_ secret is base64-decoded for the key). A signed timestamp more than timestampToleranceSeconds (300 by default) from the engine's clock is 401 TIMESTAMP_OUT_OF_TOLERANCE; with requireTimestamp: true a signature without one is 401 TIMESTAMP_REQUIRED. Refusals are audited as trigger.webhook.rejected. A repeated webhook-id is a duplicate, like a repeated Idempotency-Key.
Triggers without a secret. When the trigger lists expectedHeaders, they are the sender's credential: an API key (x-api-key: <key>) or a bearer token (Authorization: Bearer <token>). A request that carries every expected header of one trigger on this webhookId is accepted; any other is 401 INVALID_CREDENTIALS, audited as trigger.webhook.rejected. Values compare in constant time. Without expected headers the engine accepts the request only from a caller it already authenticated (an engine bearer token or a session), or when WEBHOOK_ALLOW_UNSIGNED=true. Otherwise the answer is 401 SIGNATURE_REQUIRED. The same answer comes back for an unknown webhookId, so ids cannot be probed. A named API client scoped to one workspace (create-engine-api-client --workspace) counts as such a caller only when every workflow behind the receiver is in its workspace; otherwise it gets the same answer as an unauthenticated caller.
Expected headers. A trigger can list expectedHeaders (the builder's "Required headers"), a map of header name to exact value. Names compare case-insensitively and values compare exactly. With an HMAC secret they do not replace the signature: a signed request that is missing one, or carries another value, does not match that trigger, and the response is 200 with matched: false. The engine masks credential-like header values, and every expectedHeaders value, before it stores them with the execution.
Idempotency. Send an Idempotency-Key (or X-Idempotency-Key) header to make retries safe. A repeated key does not run the workflow again: the response is 200 with duplicate: true. A repeat that arrives while the first is still being recorded gets 503 IN_PROGRESS with Retry-After. A trigger with deduplicate: false runs every delivery, for senders that reuse their keys.
Body schema. A trigger with a bodySchema (JSON Schema) runs only for a body that matches it. When no trigger on the webhook id accepts the body because a schema refused it, the answer is 400 BODY_SCHEMA_INVALID with problems, each a JSON Pointer and what is wrong (/patient/mrn: is required), never a value from the body. Nothing is recorded. The schema may use $ref to a definition in its root $defs (#/$defs/Patient, recursion allowed). A save also takes an OpenAPI operation's requestBody pasted as the bodySchema (with its components, or a whole OpenAPI 3.x or Swagger 2.0 document as { document, operationId }): it is stored as the subset, a reference into components/schemas becoming one into the root $defs; a keyword the check can't enforce (oneOf, anyOf, not, discriminator, if) is refused with its JSON Pointer. Each webhook's accepted schema is published as OpenAPI 3.1 at GET /api/triggers/webhook-schemas, for senders to generate clients.
Not run. A workflow that matched but took nothing (disabled) is 409 NOT_RUN, a license block 403, a PHI block 403 PHI_NOT_AUTHORIZED (license) or PHI_IN_SANDBOX (sandbox workspace): never a 200.
Accept, then process. A 200 means the delivery is recorded: one pending execution per matched workflow, run by the engine's work runner right after the response (status: accepted). The response does not wait for the workflows and does not carry their errors. When the engine cannot record the delivery it answers 503 with Retry-After; resend then.
Response. The trigger's response.mode sets the success answer. accepted (default): the body below. custom: response.statusCode (2xx, not 204 or 205) and response.body (up to 8 KiB, response.contentType), whose only tokens are ${executionId}, ${executionIds}, ${webhookId} and ${duplicate} (never message fields). destination (Mirth's respond from destination): the route waits up to response.timeoutMs (1-60 s, default 30 s) for the run, then answers response.statusCode with the output of step response.nodeId (a string as is, anything else JSON); 202 when the wait runs out, 502 when the run failed. A failed run that the workflow retries (maxWorkflowRetries) is followed to its last attempt within the same wait. It applies only when exactly one workflow accepted the delivery. A repeat with the same body waits on the first delivery's run; a repeated Idempotency-Key with a different body is 422 IDEMPOTENCY_KEY_REUSED and runs nothing. The output is PHI going back to the authenticated sender; a proxy in front needs an idle timeout above timeoutMs. Error answers (401, 403, 409, 413, 429, 503) are never replaced.
Bodies. JSON and application/fhir+json (a FHIR Bundle passes through unchanged), text/*, or FHIR Bulk Data NDJSON (application/fhir+ndjson, application/ndjson, application/x-ndjson), which becomes a collection Bundle with one entry per line. Any other type is read as JSON, then as text. A JSON body may carry a workflowId. The size limit is WEBHOOK_MAX_BODY_BYTES (10 MiB by default) and an NDJSON file may hold WEBHOOK_MAX_NDJSON_RESOURCES resources (1000 by default). Rate limit. TRIGGER_RATE_LIMIT_PER_MINUTE per webhook (600 by default), counted only for authenticated senders. A named API client with an inbound quota is also held to it across every webhook (429 CLIENT_QUOTA_EXCEEDED).
Auth: None, public route · Operation: receiveWebhookTrigger
Parameters
| Name | In | Type | Description |
|---|---|---|---|
webhookIdrequired | path | string | The |
x-hub-signature-256 | header | string |
|
x-webhook-timestamp | header | string | Unix seconds, signed with the body. Outside the trigger's |
webhook-id | header | string | Standard Webhooks message id, signed. Also the idempotency key when there is no |
webhook-timestamp | header | string | Standard Webhooks: unix seconds, signed, checked against the tolerance. |
webhook-signature | header | string | Standard Webhooks: space-separated |
Idempotency-Key | header | string | A key that is the same on every retry of one event. |
Request body
application/json · object
Responses
- 200Accepted, not yet processed. `matched` says whether a trigger took it.
Response fields
application/json · object
receivedbooleanmatchedbooleanFalse when no enabled trigger matched or a filter dropped the message.
statusstringaccepted: the delivery is recorded as pending executions; the workflows run after the response.One of: "accepted"
executionIdsarray of stringOne pending execution per matched workflow (poll
GET /api/executions/{id}for the outcome).errorsarray of stringMatched workflows skipped at intake (license, PHI). Run failures are not reported here.
duplicatebooleanA repeated
Idempotency-Key: nothing was recorded again;executionIdsare the first delivery's.messagestring
- 202`response.mode: destination` only. The delivery is accepted and will run, but it did not finish within `timeoutMs` (`timedOut: true`), or this replica already holds `WEBHOOK_SYNC_MAX_WAITERS` waits (`deferred: true`), or it is a repeat whose first delivery's input is no longer stored (`duplicate: true`, no output). Do not resend.
Response fields
application/json · object
statusstringOne of: "accepted"
executionIdsarray of stringtimedOutbooleandeferredbooleanduplicateboolean
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403Forbidden. `INVALID_SIGNATURE` or `INVALID_CREDENTIALS` (the sender failed authentication); `Valid license required` (the license is not valid and nothing ran); `PHI_NOT_AUTHORIZED` (a matched workflow handles PHI and the license does not authorize it; nothing ran); `PHI_IN_SANDBOX` (a matched workflow handles PHI and its workspace is a sandbox that blocks real PHI, Settings > Environments; nothing ran).
Response fields
application/json · object
errorstringcodestringremediationstring
- 409`NOT_RUN`: a workflow matched but none took the delivery (it is disabled, or no longer accepts deliveries). Nothing was recorded; resending won't help until the workflow is turned on.
Response fields
application/json · object
receivedbooleanmatchedbooleancodestringOne of: "NOT_RUN"
errorstring
- 413The body is larger than the limit.
application/json · ApiError
- 422`response.mode: destination` only. `IDEMPOTENCY_KEY_REUSED`: the `Idempotency-Key` was already used for a message with a different body. Nothing was run and no stored output is returned; send each message with its own key.
Response fields
application/json · object
errorstringcodestringOne of: "IDEMPOTENCY_KEY_REUSED"
- 429Too many requests. The trigger's own limit (`TRIGGER_RATE_LIMIT_PER_MINUTE`), or `CLIENT_QUOTA_EXCEEDED`: the named API client is past its inbound quota (`create-engine-api-client --inbound-per-minute`), counted per client across every inbound trigger, only for requests that passed authentication. Wait `Retry-After` seconds.
Response fields
application/json · object
errorstringcodestringOne of: "CLIENT_QUOTA_EXCEEDED"
limitintegerwindowSecondsinteger
- 500Unexpected server error.
application/json · ApiError
- 502`response.mode: destination` only. The run ended `failed`, `cancelled` or `partial` (`status`; with workflow retries, the last attempt, whose id is `executionId`), or the step's output is over `WEBHOOK_MAX_BODY_BYTES` (`code: RESPONSE_TOO_LARGE`). No error text is returned.
Response fields
application/json · object
statusstringexecutionIdstringcodestring
- 503Not accepted; nothing was recorded, resend after `Retry-After` seconds. `code` is `NOT_ACCEPTED` (the engine is shutting down, could not write the delivery, or the workflow's pending backlog reached `WORKFLOW_MAX_PENDING`) or `IN_PROGRESS` (a repeated `Idempotency-Key` whose first delivery is still being recorded).
Response fields
application/json · object
receivedbooleancodestringOne of: "NOT_ACCEPTED", "IN_PROGRESS"
messagestring
Example request
curl -X POST "$ENGINE_URL/api/triggers/webhook/<webhookId>" \
-H "Content-Type: application/json" \
-d '{}'Receive a webhook on a path (GET)
get/api/webhooks/{path}
Same as POST /api/webhooks/{path}.
Auth: None, public route · Operation: receiveWebhookPathGet
Parameters
| Name | In | Type | Description |
|---|---|---|---|
pathrequired | path | string | One or more path segments. |
Responses
- 200Received.
Response fields
application/json · object
receivedbooleantriggeredbooleanexecutionIdsarray of string
- 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 "$ENGINE_URL/api/webhooks/<path>"Receive a webhook on a path
post/api/webhooks/{path}
Catch-all receiver for any path under /api/webhooks/, for example /api/webhooks/partner/orders. The path must match the path of a webhook adapter profile. The route authenticates the sender with that profile's credential, by the same rules as the webhook trigger route, then dispatches to workflows whose webhook trigger uses the path (or the profile id) as its webhookId. The body is capped at WEBHOOK_MAX_BODY_BYTES (10 MiB by default) before the profile is looked up (413). Nothing recorded is 503 + Retry-After, a license block 403, a PHI block 403 PHI_NOT_AUTHORIZED or PHI_IN_SANDBOX, a matched workflow that took nothing 409 NOT_RUN. On success, the matched trigger's response setting wins when exactly one workflow accepted the delivery (see POST /api/triggers/webhook/{webhookId}); otherwise the profile's responseConfig status and content type apply (on success only). GET, PUT, PATCH and DELETE behave the same as POST, with the same credential (a signature is over the same body bytes, and over the empty body when there is none, as a DELETE may send); a run started by any method but POST has the method in its input as method (a POST's input has no method).
Auth: None, public route · Operation: receiveWebhookPath
Parameters
| Name | In | Type | Description |
|---|---|---|---|
pathrequired | path | string | One or more path segments, matched to a webhook adapter profile. |
Request body
application/json · object
Responses
- 200Received.
Response fields
application/json · object
receivedbooleanwebhookIdstringA fresh id for this receipt.
triggeredbooleanexecutionIdsarray of string
- 202`response.mode: destination` only. The delivery is accepted and will run, but it did not finish within `timeoutMs` (`timedOut: true`), or this replica already holds `WEBHOOK_SYNC_MAX_WAITERS` waits (`deferred: true`), or it is a repeat whose first delivery's input is no longer stored (`duplicate: true`, no output). Do not resend.
Response fields
application/json · object
statusstringOne of: "accepted"
executionIdsarray of stringtimedOutbooleandeferredbooleanduplicateboolean
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 403Forbidden. `INVALID_SIGNATURE` or `INVALID_CREDENTIALS` (the sender failed authentication); `Valid license required` (the license is not valid and nothing ran); `PHI_NOT_AUTHORIZED` (a matched workflow handles PHI and the license does not authorize it; nothing ran); `PHI_IN_SANDBOX` (a matched workflow handles PHI and its workspace is a sandbox that blocks real PHI, Settings > Environments; nothing ran).
Response fields
application/json · object
errorstringcodestringremediationstring
- 404Not found in the caller's workspace.
application/json · ApiError
- 409`NOT_RUN`: a workflow matched but none took the delivery (it is disabled, or no longer accepts deliveries). Nothing was recorded; resending won't help until the workflow is turned on.
Response fields
application/json · object
receivedbooleanmatchedbooleancodestringOne of: "NOT_RUN"
errorstring
- 413The body is larger than the limit.
application/json · ApiError
- 422`response.mode: destination` only. `IDEMPOTENCY_KEY_REUSED`: the `Idempotency-Key` was already used for a message with a different body. Nothing was run and no stored output is returned; send each message with its own key.
Response fields
application/json · object
errorstringcodestringOne of: "IDEMPOTENCY_KEY_REUSED"
- 429Too many requests. The trigger's own limit (`TRIGGER_RATE_LIMIT_PER_MINUTE`), or `CLIENT_QUOTA_EXCEEDED`: the named API client is past its inbound quota (`create-engine-api-client --inbound-per-minute`), counted per client across every inbound trigger, only for requests that passed authentication. Wait `Retry-After` seconds.
Response fields
application/json · object
errorstringcodestringOne of: "CLIENT_QUOTA_EXCEEDED"
limitintegerwindowSecondsinteger
- 500Unexpected server error.
application/json · ApiError
- 502`response.mode: destination` only. The run ended `failed`, `cancelled` or `partial` (`status`; with workflow retries, the last attempt, whose id is `executionId`), or the step's output is over `WEBHOOK_MAX_BODY_BYTES` (`code: RESPONSE_TOO_LARGE`). No error text is returned.
Response fields
application/json · object
statusstringexecutionIdstringcodestring
- 503Not accepted; nothing was recorded, resend after `Retry-After` seconds. `code` is `NOT_ACCEPTED` (the engine is shutting down, could not write the delivery, or the workflow's pending backlog reached `WORKFLOW_MAX_PENDING`) or `IN_PROGRESS` (a repeated `Idempotency-Key` whose first delivery is still being recorded).
Response fields
application/json · object
receivedbooleancodestringOne of: "NOT_ACCEPTED", "IN_PROGRESS"
messagestring
Example request
curl -X POST "$ENGINE_URL/api/webhooks/<path>" \
-H "Content-Type: application/json" \
-d '{}'Receive a webhook on a path (PUT)
put/api/webhooks/{path}
Same as POST /api/webhooks/{path}.
Auth: None, public route · Operation: receiveWebhookPathPut
Parameters
| Name | In | Type | Description |
|---|---|---|---|
pathrequired | path | string | One or more path segments. |
Request body
application/json · object
Responses
- 200Received.
Response fields
application/json · object
receivedbooleantriggeredbooleanexecutionIdsarray of string
- 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 PUT "$ENGINE_URL/api/webhooks/<path>" \
-H "Content-Type: application/json" \
-d '{}'Receive a webhook on a path (PATCH)
patch/api/webhooks/{path}
Same as POST /api/webhooks/{path}. The run's input has method: "PATCH".
Auth: None, public route · Operation: receiveWebhookPathPatch
Parameters
| Name | In | Type | Description |
|---|---|---|---|
pathrequired | path | string | One or more path segments. |
Request body
application/json · object
Responses
- 200Received.
Response fields
application/json · object
receivedbooleantriggeredbooleanexecutionIdsarray of string
- 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
- 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
Example request
curl -X PATCH "$ENGINE_URL/api/webhooks/<path>" \
-H "Content-Type: application/json" \
-d '{}'Receive a webhook on a path (DELETE)
delete/api/webhooks/{path}
Same as POST /api/webhooks/{path}. The body is optional: without one the run's data is {} and a signature is over the empty body. The run's input has method: "DELETE".
Auth: None, public route · Operation: receiveWebhookPathDelete
Parameters
| Name | In | Type | Description |
|---|---|---|---|
pathrequired | path | string | One or more path segments. |
Request body
application/json · object
Responses
- 200Received.
Response fields
application/json · object
receivedbooleantriggeredbooleanexecutionIdsarray of string
- 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
- 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
Example request
curl -X DELETE "$ENGINE_URL/api/webhooks/<path>" \
-H "Content-Type: application/json" \
-d '{}'MLLP listener ingest (internal)
post/api/triggers/mllp
Internal. The MLLP listener container calls this route for every HL7v2 message it receives on one of its listeners (TCP port 2575 for default; Helm mllp.listeners declares more, plain or TLS, MLLP or raw TCP). You do not call it from an integration; send HL7v2 (or, to a raw TCP listener, any data) to the listener instead. It authenticates with MLLP_ENGINE_TOKEN (at least 32 characters), valid on this route only, and has its own rate limit, MLLP_INGEST_RATE_LIMIT per minute (6000 by default).
The engine records a durable pending execution for each matched workflow and answers straight away with the ACK code the listener puts in MSA-1. AA: every matched workflow accepted the message, or the message was a repeat of an MSH-10 already accepted (duplicate: true). AE: a temporary problem, such as the database being down; the sender should retry. AR: no trigger matches the message type, or every matched workflow is blocked; resending will not help.
Auth: Bearer token (how to get one) · Operation: ingestMllpMessage
Request body (required)
application/json · object
contentstringraw: data that is not HL7, from a raw TCP listener (framingframeoreos). It has no MSH fields (messageTypemay be empty) and only triggers on that listener with no message types take it. Omitted for HL7.One of: "raw"
workflowIdstringOptional. Limit matching to one workflow.
messageTypestringrequiredMSH-9, for example
ADT^A01. Required for HL7; empty forcontent: raw.rawMessagestringrequiredThe HL7v2 message (or raw data) as received, decoded as UTF-8.
rawBytesstringThe received bytes, base64, when any is above 0x7F: a trigger with another charset (or
binary) uses these.messageControlIdstringMSH-10. Used to drop duplicates.
sendingAppstringMSH-3.
sendingFacilitystringMSH-4.
receivingAppstringMSH-5.
receivingFacilitystringMSH-6.
parsedMessageobjectThe listener's parsed segments.
timestampstring (date-time)listenerstringThe named listener that took the message (Helm
mllp.listeners; defaultdefault). Only triggers on that listener match.acceptAckTypestringMSH-15, when the sender set it. A listener in
msh15ack mode answers with a commit ACK (CA/CE/CR) as MSH-15 asks; the engine still answers AA/AE/AR.ackModestringThe listener's ack mode. A destination-mode trigger skips its wait only when this is
msh15andacceptAckTypeis set (the listener sends the commit ACK itself); withoriginal(also when omitted) it waits whatever MSH-15 says.One of: "original", "msh15"
Responses
- 200The ACK decision, whatever the code.
Response fields
application/json · object
ackstringrequiredOne of: "AA", "AE", "AR"
errorstringShort reason for AE and AR. It never contains message content.
executionIdsarray of stringwarningsarray of stringMatched routes that were skipped while others accepted (AA only).
duplicatebooleanOne of: true
ackBodystringRespond mode (#751): the ACK the workflow's Respond step built, as CR-separated HL7 segments. Starting with MSH it is the whole ACK, sent as is; otherwise the listener puts its own MSH before it.
- 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 -X POST "$ENGINE_URL/api/triggers/mllp" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "raw",
"workflowId": "string",
"messageType": "ADT^A01",
"rawMessage": "string",
"rawBytes": "string",
"messageControlId": "string",
"sendingApp": "string",
"sendingFacility": "string",
"receivingApp": "string",
"receivingFacility": "string",
"parsedMessage": {},
"timestamp": "2026-01-01T00:00:00Z",
"listener": "default",
"acceptAckType": "string",
"ackMode": "original"
}'WSDL of a Web Service Listener trigger
get/api/triggers/soap/{listenerId}
With ?wsdl: the trigger's WSDL, or a generated WSDL 1.1 describing Mirth's acceptMessage(arg0: string) (document/literal) at this address (ENGINE_PUBLIC_URL), so a Mirth sender's client works unchanged. Public for a listener with its own HMAC secret or WS-Security login; otherwise it needs an engine credential like the POST (401, the same answer for an unknown listener), unless WEBHOOK_ALLOW_UNSIGNED=true. 403 when a stored secret can't be decrypted; 404 without ?wsdl or for an unknown listener.
Auth: None, public route · Operation: getSoapTriggerWsdl
Parameters
| Name | In | Type | Description |
|---|---|---|---|
listenerIdrequired | path | string | The |
wsdl | query | string | Present (no value needed). |
Responses
- 200The WSDL.
text/xml · string
- 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
Example request
curl "$ENGINE_URL/api/triggers/soap/<listenerId>"Send a SOAP request to a Web Service Listener trigger
post/api/triggers/soap/{listenerId}
The Web Service Listener (Mirth's): a SOAP 1.1 (text/xml) or 1.2 (application/soap+xml) envelope to every enabled workflow whose soap trigger has this listenerId, takes this SOAP version and operation (the first element in Body) and passes its filter. The run gets the operation's content as data (the text of a single text-only child, such as Mirth's acceptMessage arg0, else JSON), the operation as standalone XML in bodyXml, the SOAPAction and the other header blocks; never the wsse:Security header.
Authentication. A trigger with an HMAC secret needs x-webhook-signature (or x-hub-signature-256) over the raw body; one with wsSecurity: UsernameToken needs a valid WS-Security UsernameToken (PasswordText, or PasswordDigest with a fresh nonce and a Created within 5 minutes; a replayed nonce is refused). With neither, only a caller the engine authenticated, unless WEBHOOK_ALLOW_UNSIGNED=true. A named API client scoped to one workspace (create-engine-api-client --workspace) counts as such a caller only when every workflow behind the receiver is in its workspace; otherwise it gets the same answer as an unauthenticated caller.
Safety. The body is capped at SOAP_MAX_BODY_BYTES (default 5 MiB, at most 50 MiB). A DOCTYPE or ENTITY declaration is refused as a Client Fault before parsing (no external entities, no entity expansion).
Answers. 200 with a response envelope once the runs are recorded (acceptMessageResponse with the execution ids, or step response.nodeId's output in mode destination). Faults: SOAP 1.1 uses HTTP 500, SOAP 1.2 400 for Sender and 500 for Receiver faults; 401/403 for a missing or bad credential, 413, 429, 503 + Retry-After when nothing was recorded, 403 for a license or PHI block, 409 when the matched workflow is disabled. Idempotency-Key works as for webhooks. Rate limited per listener by TRIGGER_RATE_LIMIT_PER_MINUTE, and a named API client by its inbound quota (429 CLIENT_QUOTA_EXCEEDED).
Auth: None, public route · Operation: receiveSoapTrigger
Parameters
| Name | In | Type | Description |
|---|---|---|---|
listenerIdrequired | path | string | The |
SOAPAction | header | string | SOAP 1.1 action. SOAP 1.2 sends it as the |
Request body (required)
text/xml · string
Responses
- 200The response envelope.
text/xml · string
- 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
- 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/triggers/soap/<listenerId>" \
-H "Content-Type: text/xml" \
--data-binary @bodyReceive a Pub/Sub push delivery
post/api/triggers/pubsub/{pushId}
The push endpoint of a pubsub trigger in push mode (#749). Configure the Pub/Sub push subscription with OIDC authentication: the route verifies the Google-signed ID token in Authorization: Bearer against each push trigger with this pushId (issuer accounts.google.com, the trigger's audience, and its serviceAccountEmail with a verified email). Exempt from the IP allowlist, as webhooks are.
The body is Pub/Sub's push envelope (message with base64 data, attributes, messageId, publishTime, orderingKey; subscription; deliveryAttempt). Each matching trigger records a pending execution before the route answers: Pub/Sub treats any 2xx as an acknowledgement. 200 once recorded, for a message the trigger filter drops, and for a duplicate (deduplicated by message id within the subscription); 503 + Retry-After when nothing was recorded, so Pub/Sub redelivers. GCP Healthcare FHIR store change notifications arrive this way; the run gets a fhir object with the action, resource type, id and name. Rate limited per push id by TRIGGER_RATE_LIMIT_PER_MINUTE.
Auth: None, public route · Operation: receivePubSubPush
Parameters
| Name | In | Type | Description |
|---|---|---|---|
pushIdrequired | path | string | The |
Request body (required)
application/json · object
messageobjectrequired5 fields
datastringBase64 message data.
attributesmap of stringmessageIdstringpublishTimestringorderingKeystring
subscriptionstringdeliveryAttemptinteger
Responses
- 200Recorded, filtered or a duplicate (acknowledged).
Response fields
application/json · object
receivedbooleanmatchedbooleanstatusstringOne of: "accepted"
executionIdsarray of stringduplicatebooleanOne of: true
- 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
- 503A dependency is not available.
application/json · ApiError
Example request
curl -X POST "$ENGINE_URL/api/triggers/pubsub/<pushId>" \
-H "Content-Type: application/json" \
-d '{
"message": {
"data": "string",
"attributes": {},
"messageId": "string",
"publishTime": "string",
"orderingKey": "string"
},
"subscription": "string",
"deliveryAttempt": 0
}'DICOM listener ingest (internal)
post/api/triggers/dicom
Internal. The DICOM listener container calls this route for every object it receives by C-STORE (Helm dicom.enabled, port 11112 by default). You do not call it from an integration; send DICOM to the listener instead. It authenticates with DICOM_ENGINE_TOKEN (at least 32 characters), valid on this route only, and has its own rate limit, DICOM_INGEST_RATE_LIMIT per minute (6000 by default).
The body is the object as a DICOM Part 10 file (application/dicom, at most DICOM_MAX_OBJECT_BYTES, 128 MiB by default); the x-medhook-dicom-meta header holds its metadata as base64url JSON (AE titles, SOP class and instance, study and series UIDs, modality, accession number, patient id, study date). The engine stores the object (DICOM_STORE_DIR, or the trigger's S3 profile) and records a pending execution for each matching dicom trigger with the metadata and a signed reference to the object, never its pixel data, before it answers. The listener answers the C-STORE from the result: accepted is Success, transient is Out of Resources (the sender retries), refused is a processing failure.
Auth: Bearer token (how to get one) · Operation: ingestDicomObject
Request body (required)
application/dicom · string (binary)
Responses
- 200Stored and recorded.
Response fields
application/json · object
resultstringrequiredOne of: "accepted"
executionIdsarray of stringduplicatebooleanOne of: true
- 400The request is malformed or fails validation.
application/json · ApiError
- 401No credential, or the token is invalid or expired.
application/json · ApiError
- 413The body is larger than the limit.
application/json · ApiError
- 422The request is well formed but cannot be processed.
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/triggers/dicom" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/dicom" \
--data-binary @bodySend an X12 document to triggers
post/api/triggers/x12
Routes one X12 interchange (837, 835, 270, 271 and others) to workflows with an x12 trigger. Send the raw X12 text, or JSON with rawData. The engine parses it from its ISA (the delimiters come from the ISA) and splits it: each transaction set (ST..SE) runs once for every trigger whose transactionSets takes it, with that set's parsed view as parsedData and the set in its own ISA/GS/GE/IEA as rawData. A body with no ISA is a 400. A resent set (same ISA13, GS06 and ST02 from the same sender and receiver) does not run again: the answer has duplicate: true and the original ids. A trigger with deduplicate: false runs every delivery. The source type is decided by the server (webhook here, upload for a dashboard session); a sourceType field or x-medhook-source-type header is ignored. Triggers with acknowledgments get a 999 (and a TA1) in the answer, or the raw EDI with Accept: application/edi-x12. What the 999/TA1 rejects never runs, whether or not a trigger asks for acknowledgments: a broken envelope (ISA13 not equal to IEA02, a wrong IEA01, no IEA) records nothing, a group with a GE error skips the whole group, and a set with a wrong SE01 or SE02 is skipped; the reasons are in errors. When that leaves nothing to run the answer is a 422 with status: "rejected". Rate limited per caller by TRIGGER_RATE_LIMIT_PER_MINUTE.
Accept, then process. A 200 means the delivery is recorded: one pending execution per matched workflow, run by the engine's work runner right after the response (status: accepted). The response does not wait for the workflows and does not carry their errors. When the engine cannot record the delivery it answers 503 with Retry-After; resend then.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: receiveX12Document
Request body (required)
application/json · object
rawDatastringrequiredThe X12 interchange, starting with ISA.
Responses
- 200Accepted, not yet processed.
Response fields
application/json · object
receivedbooleanmatchedbooleanFalse when no enabled trigger matched or a filter dropped the message.
statusstringaccepted: the delivery is recorded as pending executions; the workflows run after the response.One of: "accepted"
executionIdsarray of stringOne pending execution per matched workflow (poll
GET /api/executions/{id}for the outcome).errorsarray of stringMatched workflows skipped at intake (license, PHI). Run failures are not reported here.
transactionSetstringThe ST01 values, comma separated.
transactionSetsarray of stringmessagestringduplicatebooleanA resend of a transaction set already accepted (same ISA13, GS06 and ST02 from the same sender and receiver):
executionIdsare the first delivery's.acknowledgmentsobject2 fields
999array of string999 interchanges.
ta1stringA TA1 interchange.
- 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
- 422The request is well formed but cannot be processed.
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
- 503Not accepted; nothing was recorded, resend after `Retry-After` seconds. `code` is `NOT_ACCEPTED` (the engine is shutting down, could not write the delivery, or the workflow's pending backlog reached `WORKFLOW_MAX_PENDING`) or `IN_PROGRESS` (a repeated `Idempotency-Key` whose first delivery is still being recorded).
Response fields
application/json · object
receivedbooleancodestringOne of: "NOT_ACCEPTED", "IN_PROGRESS"
messagestring
Example request
curl -X POST "$ENGINE_URL/api/triggers/x12" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"rawData": "string"
}'FHIR subscription callback
post/api/triggers/fhir-subscription/{triggerId}
The rest-hook endpoint of a FHIR subscription trigger. Medplum posts the changed resource here (Content-Type: application/fhir+json). Medplum cannot hold an engine token, so the route checks the per-trigger token Medplum sends in x-medhook-subscription-token; the engine sets that token on the subscription for you. Rotating ENGINE_AUTH_SECRET invalidates the tokens, so re-sync the subscriptions after a rotation. If an x-medhook-trigger-id header is present it must equal triggerId. A resource outside the trigger's current scope (another resource type, or sent while the subscription has not yet picked up a saved change) does not run the workflow and is answered matched: false. Rate limited per trigger by TRIGGER_RATE_LIMIT_PER_MINUTE, and a named API client by its inbound quota (429 CLIENT_QUOTA_EXCEEDED). An API client scoped to one workspace presents the token too.
Duplicates. A notification is identified by the resource's resourceType/id/_history/meta.versionId (or meta.lastUpdated when there is no version id). A resend of a version already accepted does not run again: 200 with duplicate: true and the first delivery's executionIds. A resource with neither is never treated as a resend. A trigger with deduplicate: false runs every delivery.
Accept, then process. A 200 means the delivery is recorded: one pending execution per matched workflow, run by the engine's work runner right after the response (status: accepted). The response does not wait for the workflows and does not carry their errors. When the engine cannot record the delivery it answers 503 with Retry-After; resend then.
Auth: None, public route · Operation: receiveFhirSubscriptionCallback
Parameters
| Name | In | Type | Description |
|---|---|---|---|
triggerIdrequired | path | string | The id of the workflow trigger. |
x-medhook-subscription-token | header | string | The per-trigger token. Needed unless the caller is already authenticated. |
Request body (required)
application/json · object
Responses
- 200Accepted, not yet processed.
Response fields
application/json · object
receivedbooleanmatchedbooleanFalse when no enabled trigger matched or a filter dropped the message.
statusstringaccepted: the delivery is recorded as pending executions; the workflows run after the response.One of: "accepted"
executionIdsarray of stringOne pending execution per matched workflow (poll
GET /api/executions/{id}for the outcome).errorsarray of stringMatched workflows skipped at intake (license, PHI). Run failures are not reported here.
messagestringduplicatebooleanA resend of a resource version already accepted:
executionIdsare the first delivery's.
- 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
- 503Not accepted; nothing was recorded, resend after `Retry-After` seconds. `code` is `NOT_ACCEPTED` (the engine is shutting down, could not write the delivery, or the workflow's pending backlog reached `WORKFLOW_MAX_PENDING`) or `IN_PROGRESS` (a repeated `Idempotency-Key` whose first delivery is still being recorded).
Response fields
application/json · object
receivedbooleancodestringOne of: "NOT_ACCEPTED", "IN_PROGRESS"
messagestring
Example request
curl -X POST "$ENGINE_URL/api/triggers/fhir-subscription/<triggerId>" \
-H "Content-Type: application/json" \
-d '{}'List scheduled cron jobs
get/api/triggers/cron
Every enabled cron and schedule trigger with the next and last run the scheduler recorded (nextRun, lastRun; null before the first schedule). Read from the database, so every replica answers the same.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: listCronJobs
Responses
Example request
curl "$ENGINE_URL/api/triggers/cron" \
-H "Authorization: Bearer $TOKEN"Validate and preview a cron schedule
post/api/triggers/cron
Checks a cron expression and previews it; writes nothing. A workflow's schedule lives in its trigger (cronExpression or cron, timezone, exclusionDates, missedRuns), saved with the workflow; the scheduler builds its job from that on every reload. Besides the standard five fields, the day-of-week field accepts #N (the Nth weekday of the month, FRI#2), #L (the last weekday, FRI#L) and B (business days). The response shows how the engine read the expression and the next 5 runs after exclusion dates, in the time zone. Rate limited to 10 requests per minute.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: previewCronSchedule
Request body (required)
application/json · object
triggerIdstringOptional; echoed back.
cronExpressionstringrequiredexclusionDatesarray of string (date)Days to skip,
YYYY-MM-DD, read intimezone(calendar dates only).timezonestringIANA time zone; an unknown zone is 400. Default: the engine's.
Responses
- 200The schedule as the engine reads it.
Response fields
application/json · object
triggerIdstringcronExpressionstringnormalizedExpressionstringdescriptionstringThe schedule in words.
advancedPatternstringstandardor the advanced pattern found.exclusionDatesarray of stringtimezonestring | nullnextRunsarray of string (date-time)The next 5 runs (UTC instants) after exclusion dates, in
timezone.
- 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 -X POST "$ENGINE_URL/api/triggers/cron" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"triggerId": "string",
"cronExpression": "0 6 * * MON-FRI",
"exclusionDates": [
"2026-01-01"
],
"timezone": "America/New_York"
}'Validate and preview a cron schedule (PUT)
put/api/triggers/cron
Same body and result as POST /api/triggers/cron; writes nothing. Rate limited to 10 requests per minute.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: previewCronSchedulePut
Request body (required)
application/json · object
triggerIdstringcronExpressionstringrequiredexclusionDatesarray of stringtimezonestring
Responses
- 200The schedule as the engine reads it.
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
- 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 PUT "$ENGINE_URL/api/triggers/cron" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"triggerId": "string",
"cronExpression": "string",
"exclusionDates": [
"string"
],
"timezone": "string"
}'Reload cron schedules
patch/api/triggers/cron
Reloads every schedule from the database. Use it after you change schedules outside the API.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: reloadCronSchedules
Responses
Example request
curl -X PATCH "$ENGINE_URL/api/triggers/cron" \
-H "Authorization: Bearer $TOKEN"Delete a cron schedule
delete/api/triggers/cron
Removes the saved schedule. The running job stops at the next reload. Rate limited to 5 requests per minute.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: deleteCronSchedule
Parameters
| Name | In | Type | Description |
|---|---|---|---|
triggerIdrequired | query | string | The trigger whose schedule to remove. |
Responses
- 200Deleted.
Response fields
application/json · object
messagestringtriggerIdstring
- 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 -X DELETE "$ENGINE_URL/api/triggers/cron?triggerId=string" \
-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.