Webhook Subscriptions

Currently Supported Subscriptions

resource_typeeventdescription
Appointmentappointment_insertionFires upon complete or failed response from an integration when inserting an appointment into an EHR schedule.
Appointmentappointment_createdFires when NexHealth detects a new appointment has been created in the health record system. For appointments you create via the NexHealth API we will wait to fire this webhook until we successfully read the appointment back in on our next read cycle (~10 minutes).
Appointmentappointment_updatedFires when NexHealth detects a change to an appointment object in the health record system. For appointments you update via the NexHealth API we will wait to fire this webhook until we successfully read the change back in on our next read cycle (~10 minutes).
FormRequestform_request_completedFires when a patient submits a completed form.
Patientpatient_createdFires when NexHealth detects a new patient has been created via API or in the health record system.
Patientpatient_updatedFires when NexHealth detects a change to a patient object.
Procedureprocedure_createdFires when NexHealth detects a new procedure has been created in the health record system.
Procedureprocedure_updatedFires when NexHealth detects a change to a procedure object in the health record system (ex: status from scheduled to completed or inactive).
SyncStatussync_status_read_changeFires when an integration's read functionality status changes between red and green or vice versa.
SyncStatussync_status_write_changeFires when an integration's write functionality status changes between red and green or vice versa.

You can find example payloads for each subscription below.

appointment_insertion

{
   "institution_id": 1,
   "webhook_subscription_id": 1,
   "delivery_errors": [],
   "resource_type": "Appointment",
   "event_name": "appointment_insertion.complete",
   "event_time": "2022-03-30T09:50:20.174Z",
   "data": {
      "appointment": {
        // See Appointment response obect for field definitions
        // https://docs.nexhealth.com/reference/appointments-1#appointments-response-object
      }
   }
}

appointment_created

Note that appointments is an array and can contain multiple appointments.

{
   "institution_id": 1,
   "webhook_subscription_id": 2,
   "delivery_errors": [],
   "resource_type": "Appointment",
   "event_name": "appointment_created",
   "event_time": "2022-03-22T15:22:50.873Z",
   "data": {
      "appointments": [
         {
           // See Appointment response obect for field definitions
           // https://docs.nexhealth.com/reference/appointments-1#appointments-response-object
         }
      ]
   }
}

appointment_updated

The following fields can trigger appointment_update events:

patient_id
start_time
end_time
cancelled
missed
confirmed
location_id
sooner_if_possible
operatory_id
checked_out
checked_out_at
provider_id
note
appointment_type_id
deleted
descriptors

The previous_attributes field identifies the update that was made.

{
  "institution_id": 1,
  "webhook_subscription_id": 3,
  "delivery_errors": [],
  "resource_type": "Appointment",
  "event_name": "appointment_updated",
  "event_time": "2022-03-31T16:14:19.152Z",
  "data": {
    "appointment": {
      // See Appointment response obect for field definitions
      // https://docs.nexhealth.com/reference/appointments-1#appointments-response-object
    },
    "previous_attributes": { "cancelled": false, "cancelled_at": null }
  }
}

form_request_completed

{
   "institution_id": 1,
   "webhook_subscription_id":4,
   "delivery_errors": [],
   "resource_type": "FormRequest",
   "event_name": "forms_request_completed",
   "event_time": "2023-06-01 17:17:18.619Z",
   "data": {
      "formrequest": {
        "id": "XXgvYjHm06j85TAI1i15fU9i3vmKtFyH",
        "location_id": 1000,
        "appointment_id": 123456
      }
    }
}

patient_created

{
   "institution_id": 1,
   "webhook_subscription_id":5,
   "delivery_errors": [],
   "resource_type": "Patient",
   "event_name": "patient_created",
   "event_time": "2022-03-30T20:55:65.163Z",
   "data": {
	    "patients": [
        // See Patients response object for field definitions
        // https://docs.nexhealth.com/reference/patients-1#patients-response
      ]
    }
}

patient_updated

The following fields can trigger appointment_update events:

email
first_name
middle_name
last_name
bio
inactive
guarantor_id

The previous_attributes field identifies the update that was made.

{
   "institution_id": 1,
   "webhook_subscription_id": 6,
   "delivery_errors": [],
   "resource_type": "Patient",
   "event_name": "patient_updated",
   "event_time": "2022-10-20T05:19:37.312Z",
   "data": {
      "patient": {
         // See Patients response object for field definitions
         // https://docs.nexhealth.com/reference/patients-1#patients-response
       },
       "previous_attributes": {
         "inactive": true
       }   
    }
}

procedure_created

{
   "institution_id": 1,
   "webhook_subscription_id": 8,
   "delivery_errors": [],
   "resource_type": "Procedure",
   "event_name": "procedure_created",
   "event_time": "2022-10-20T05:19:37.312Z",
   "data": {
      "procedure": {
         // See Procedures response object for field definitions
         // https://docs.nexhealth.com/reference/procedures#procedures-response
       }
    }
}

procedure_updated

The previous_attributes field identifies the update that was made.

{
   "institution_id": 1,
   "webhook_subscription_id": 9,
   "delivery_errors": [],
   "resource_type": "Procedure",
   "event_name": "procedure_updated",
   "event_time": "2022-10-22T05:19:37.312Z",
   "data": {
      "procedure": {
         // See Procedures response object for field definitions
         // https://docs.nexhealth.com/reference/procedures#procedures-response
       },
      "previous_attributes": { "status": "scheduled" }
    }
}

sync_status_read_change and sync_status_write_change

{
   "institution_id": 1,
   "webhook_subscription_id": 7,
   "delivery_errors": [],
   "resource_type": "SyncStatus",
   "event_name": "sync_status_read_change.green",
   "event_time": "2022-03-22T15:06:39.001Z",
   "data": {
      "syncstatus": {
        // See Sync Status response object for field definitions
        // https://docs.nexhealth.com/reference/sync-status#sync-status-response
      }
   }
}

Example Response

{
  "code": false,
  "description": [
    [
      "Description"
    ]
  ],
  "error": [
    [
      "Error"
    ]
  ],
  "data": [
    {
      "id": 1,
      "webhook_endpoint_id": 1,
      "institution_id": 1,
      "resource_type": "Appointment",
      "event": "appointment_insertion",
      "active": true,
      "created_at": "2020-06-05T20:16:57.007Z",
      "updated_at": "2020-06-05T20:16:57.007Z"
    }
  ],
  "count": 2
}