ACK Queue
ACK Queue endpoints of the MedHook engine API: 6 operations with parameters, schemas and a curl example for each.
On this page
Messages that got AE or AR, or never reached a destination.
List messages that need attention
get/api/ack-queue
Messages of every trigger type from the last 7 days that got AE or AR, or never reached a destination, each with its retry state. For sources other than MLLP the code is the run's outcome, derived from its status, not an HL7 ACK. counts always covers every tab. format=csv downloads the chosen tab (operational fields only) and is audited.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: listAckQueue
Parameters
| Name | In | Type | Description |
|---|---|---|---|
tab | query | string | Which items. |
format | query | string |
|
Responses
Example request
curl "$ENGINE_URL/api/ack-queue" \
-H "Authorization: Bearer $TOKEN"Discard ACK queue items
post/api/ack-queue/discard
Hides up to 500 items from the queue. The executions stay for the audit trail and can still be opened from Messages. An id that is not a message in this workspace is skipped. Discarding the message that holds an ordering lane (onError: hold) releases the hold, and the lane's waiting messages run.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: discardAckQueueItems
Request body (required)
application/json · object
idsarray of stringrequired
Responses
Example request
curl -X POST "$ENGINE_URL/api/ack-queue/discard" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"string"
]
}'Replay ACK queue items
post/api/ack-queue/replay
Replays up to 50 items at once. Each item's newest attempt is replayed. An item whose newest attempt is still running (inProgress), whose next automatic retry is waiting (scheduled), or that is not in this workspace's queue is skipped. A partial run re-sends only to the destinations that failed; allDestinations: true resends every item to every destination. The replays are queued in one transaction, each in its original's place in its ordering lane, so an ordered lane re-runs them in arrival order. Needs a valid license.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: replayAckQueueItems
Request body (required)
application/json · object
idsarray of stringrequiredallDestinationsboolean
Responses
- 200Done.
Response fields
application/json · object
replayedarray of stringskippedarray of stringinProgressarray of stringscheduledarray of stringfailedarray of object4 fields
idstringcontrolIdstringerrorstringcodestring
- 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
Example request
curl -X POST "$ENGINE_URL/api/ack-queue/replay" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"string"
],
"allDestinations": true
}'List destination queues
get/api/destination-queues
Every router destination of this workspace with "queue until delivered" that has messages waiting, a failed head or a pause. A queued destination delivers one message at a time, in order; a retryable failure is retried until it is delivered or passes the queue's max age (at most 7 days). Uncertain and rejected deliveries are never resent. No message content.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: listDestinationQueues
Responses
- 200The queues.
Response fields
application/json · object
queuesarray of object16 fields
lanestringdq:<workflowId>:<destinationId>.workflowIdstringworkflowNamestringdestinationIdstringThe router destination (edge) id.
labelstringThe destination's name.
depthintegerQueued deliveries waiting, the head's waiting retry included.
oldestAtstring (date-time) | nullWhen the oldest waiting delivery was queued.
statestringclosed: delivering. open: the head failed and waits for its retry. half-open: one probe is in flight. paused: an operator paused it. blocked: the head was uncertain or rejected and waits for a decision in the ACK queue.
One of: "closed", "open", "half-open", "paused", "blocked", "idle"
nextProbeAtstring (date-time) | nullWhen the waiting retry is due.
lastErrorstring | nullheldExecutionIdstring | nullThe held message's latest attempt.
pausedAtstring (date-time) | nullpausedBystring | nullprofileIdstring | nullThe adapter profile the destination step delivers through.
headErrorstring | nullThe head failure's class, never its text: refused (the far side refuses or resets connections).
One of: "refused"
msgTypestring | nullThe head message's HL7 type code, e.g. "ORM".
- 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/destination-queues" \
-H "Authorization: Bearer $TOKEN"Destination queue depth history and stuck messages
get/api/destination-queues/{lane}/detail
The Queues tab's expanded row: the queue's depth over the last hours (1-24, default 3) as 30 points, from depth samples the engine records at most once a minute and keeps a day; the drain rate; and the first 3 waiting messages with their attempts. The lane must belong to a workflow of this workspace (404 otherwise). Read-only, no message content. Rate limited: 120 req / 60 s.
Minimum role: viewer.
Auth: Bearer token (how to get one) · Operation: getDestinationQueueDetail
Parameters
| Name | In | Type | Description |
|---|---|---|---|
lanerequired | path | string | The URL-encoded lane id, |
hours | query | integer | The window in hours, 1-24 (default 3). |
Responses
- 200The detail.
Response fields
application/json · object
lanestringhoursintegerThe window, in hours.
pointsarray of integer30 depths over the window, oldest first: the deepest sample of each slice, 0 where none.
peakintegerThe deepest point.
drainPerSecinteger | nullMessages per second the queue is draining at, if falling.
maxIntervalMsinteger | nullThe head's longest retry backoff, from its queue.
stuckarray of objectThe first 3 waiting messages, in delivery order. No message content.
5 fields
idstringThe queued delivery's execution id.
controlIdstringMSH-10, else the id.
typestringMessage type and trigger event, or empty.
atstring (date-time)attemptsintegerSettled attempts so far.
- 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/destination-queues/<lane>/detail" \
-H "Authorization: Bearer $TOKEN"Pause, resume or retry a destination queue
post/api/destination-queues/{lane}/{action}
pause: nothing more is sent until resumed (a delivery in flight finishes). resume: clears the pause. retry: the waiting retry (or the next queued message) is due now instead of at its backoff. The lane must belong to a workflow of this workspace (404 otherwise). Audited as destination.queue.paused, destination.queue.resumed or destination.queue.retried. Rate limited: 30 req / 60 s.
Minimum role: operator.
Auth: Bearer token (how to get one) · Operation: changeDestinationQueue
Parameters
| Name | In | Type | Description |
|---|---|---|---|
lanerequired | path | string | The URL-encoded lane id, |
actionrequired | path | string |
|
Responses
- 200Done. `changed` is false when there was nothing to do.
Response fields
application/json · object
lanestringactionstringOne of: "pause", "resume", "retry"
changedbooleanexecutionIdstringretry: the delivery made due now.
- 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 -X POST "$ENGINE_URL/api/destination-queues/<lane>/<action>" \
-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.