Request Surescripts Medication History via API

When requesting a patient's Surescripts Medication History via API in Akute, an organization can set up webhooks in Akute to be sent when there is resolved request for the medication history

Webhooks can be set up in the Settings->Developer section in Akute.


The medication history webhook contains many fields detailing information about the PA meta data (e.g. case id), PA history, and PA status. Below is documentation explaining the data structure and the meaning of the fields.

  1. Create a webhook in the Settings->Developer section in Akute
  2. Make an API GET request to /v1/medications/history
    1. Documentation can be found here
    2. This logs that the patient consented to your team requesting their Surescripts medication history
    3. Makes the initial request to Surescripts to get the patient history
    4. Surescripts takes up to 10 minutes to respond with the results
  3. Akute will send a webhook to the URL created in step 1 with the medication history
    1. The webhook payload will look like the code block below
    2. A payload data.medications of [] will be sent if there is no history
    3. If history exists, the medications array will follow the same schema as our GET medications API
  4. You can also request the previous history that your team has requested via this GET url /v1/medications/history/cached

Webhook structure (example):

event_id: "evt-0d78b17648ed4c9580c5e0c4d68a7740",
event_type: "request",
resource_type: "MedicationHistory",
data: {
  patient_id: "c8ba4545-e052-43df-913a-c551ae72fdf5",
  external_patient_id: "1234",
  start_date: "2023-12-25",
  end_date: "2024-01-15",
  medications: []
}

To test in staging and receive a response with non-empty array of medication, please create a patient with the following demographics and test with their chart (all other patients will always have no medication history):

{
  first_name: "Winston",
  middle_name: "Barnaby",
  last_name: "Addington",
  address_line_1: "178 Paradise Crescent",
  address_city: "Royal Palm Beach",
  address_state: "FL",
  address_zipcode: "33411",
  date_of_birth: "1940-03-14",
  sex: "male",
  primary_phone_number: "6082516774",
  primary_phone_type: "mobile"
}

Still need help? Contact Us Contact Us