Skip to content
Engine API

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

NameInTypeDescription
tabquerystring

Which items.

formatquerystring

csv for a download.

Responses

  • 200The items.
    Response fields

    application/json · object

    • itemsarray of object
    • countsobject
  • 400The request is malformed or fails validation.

    application/json · ApiError

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

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
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

  • 200Done.
    Response fields

    application/json · object

    • discardedinteger
    • skippedarray of string
  • 400The request is malformed or fails validation.

    application/json · ApiError

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

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
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 stringrequired
  • allDestinationsboolean

Responses

  • 200Done.
    Response fields

    application/json · object

    • replayedarray of string
    • skippedarray of string
    • inProgressarray of string
    • scheduledarray of string
    • failedarray of object
      4 fields
      • idstring
      • controlIdstring
      • errorstring
      • codestring
  • 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
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 object
      16 fields
      • lanestring

        dq:<workflowId>:<destinationId>.

      • workflowIdstring
      • workflowNamestring
      • destinationIdstring

        The router destination (edge) id.

      • labelstring

        The destination's name.

      • depthinteger

        Queued deliveries waiting, the head's waiting retry included.

      • oldestAtstring (date-time) | null

        When the oldest waiting delivery was queued.

      • statestring

        closed: 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) | null

        When the waiting retry is due.

      • lastErrorstring | null
      • heldExecutionIdstring | null

        The held message's latest attempt.

      • pausedAtstring (date-time) | null
      • pausedBystring | null
      • profileIdstring | null

        The adapter profile the destination step delivers through.

      • headErrorstring | null

        The head failure's class, never its text: refused (the far side refuses or resets connections).

        One of: "refused"

      • msgTypestring | null

        The 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
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

NameInTypeDescription
lanerequiredpathstring

The URL-encoded lane id, dq:<workflowId>:<destinationId>.

hoursqueryinteger

The window in hours, 1-24 (default 3).

Responses

  • 200The detail.
    Response fields

    application/json · object

    • lanestring
    • hoursinteger

      The window, in hours.

    • pointsarray of integer

      30 depths over the window, oldest first: the deepest sample of each slice, 0 where none.

    • peakinteger

      The deepest point.

    • drainPerSecinteger | null

      Messages per second the queue is draining at, if falling.

    • maxIntervalMsinteger | null

      The head's longest retry backoff, from its queue.

    • stuckarray of object

      The first 3 waiting messages, in delivery order. No message content.

      5 fields
      • idstring

        The queued delivery's execution id.

      • controlIdstring

        MSH-10, else the id.

      • typestring

        Message type and trigger event, or empty.

      • atstring (date-time)
      • attemptsinteger

        Settled 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
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

NameInTypeDescription
lanerequiredpathstring

The URL-encoded lane id, dq:<workflowId>:<destinationId>.

actionrequiredpathstring

pause, resume or retry.

Responses

  • 200Done. `changed` is false when there was nothing to do.
    Response fields

    application/json · object

    • lanestring
    • actionstring

      One of: "pause", "resume", "retry"

    • changedboolean
    • executionIdstring

      retry: 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
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).

  • errorstringrequired

    Human-readable error message.

  • codestring

    Machine-readable error code.

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

  • detailsany

    Optional structured context about the error.