On this page

Resource $resend

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​

  • Failed Notification Recovery: Retry subscription notifications that failed due to temporary network issues or downstream service outages
  • Debugging Subscriptions: Test subscription logic during development by manually triggering notifications
  • Data Synchronization: Force re-sync of specific resources to external systems after fixing integration issues
  • Selective Replay: Re-trigger a specific subscription for a resource instead of all subscriptions
  • Integration Testing: Verify that subscriptions fire correctly without creating new test data
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:

OptionDescriptionData TypeDefault Value
verboseIndicates if verbose logging should be enabled.booleanfalse
interactionSubscriptions 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 | deleteupdate
subscriptionA specific Subscription to trigger, formatted as Subscription/<id>. If left undefined, all Subscriptions will be triggered.stringundefined

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"
      }
    }
  ]
}