Resource $resend | Medplum

The $resend operation manually triggers subscription notifications for a specific resource. This is invaluable for debugging subscription workflows, recovering from failed notifications, and replaying events during development or after system issues.

When a subscription notification fails or you need to reprocess a resource through your subscription pipeline, $resend lets you re-trigger the workflow without modifying the underlying resource—ensuring your integrations stay synchronized.

Use Cases

Admin Required

The User, Bot, or ClientApplication invoking this operation must have project admin credentials.

Parameters

The operation takes an optional option parameter, which is an object containing three fields:

Option Description Data Type Default Value
verbose Indicates if verbose logging should be enabled. boolean false
interaction Subscriptions can be configured to trigger only when a resource is created or deleted as opposed to any update. This option allows you to specify which interaction type will be sent. update | create | delete update
subscription A specific Subscription to trigger, formatted as Subscription/<id>. If left undefined, all Subscriptions will be triggered. string undefined

Invoke the $resend operation

const medplum = new MedplumClient();

// auth...

await medplum.post(medplum.fhirUrl(<resourceType>, <id>, '$resend'), {

verbose: true,

interaction: 'update',

subscription: 'Subscription/123'
});
medplum login

medplum post '<resourceType>/<id>/$resend' {"verbose":"true","interaction":"update","subscription":"Subscription/123"}
curl 'https://api.medplum.com/fhir/R4/<resourceType>/<resourceId>/$resend' \

-X 'POST' \

-H 'authorization: Bearer MY_ACCESS_TOKEN' \
-H 'content-type: application/fhir+json' \
--data-raw '{"verbose":"true","interaction":"update","subscription":"Subscription/123"}'

Output

If successful, you will receive the following OperationOutcome

{

"resourceType": "OperationOutcome",

"id": "ok",

"issue": [\
\
    {\
\
      "severity": "information",\
\
      "code": "informational",\
\
      "details": {\
\
        "text": "All OK"\
\
      }\
\
    }\
\
  ]

}