Creating patient accounts using OnCall Health's API

Sometimes, simply transferring patient data from your electronic medical record (EMR) or electronic health record (EHR) system into OnCall Health (as we discussed in the previous guide) is not enough. Depending on your workflow, you may want to generate OnCall Health login credentials for those patients as well.

Keep reading to learn more about how you can achieve this with OnCall Health's API.

Before you get started

Before proceeding, make sure you've met all of the requirements outlined on this page.

Creating patient accounts outside the context of an appointment

If your goal is to create patient accounts without also scheduling appointments for them in OnCall Health, this section will be useful for you.

Step 1: Identify the action in your EMR or EHR that should trigger a new patient account in OnCall Health

The right approach depends on your workflow and the capabilities of whatever EMR or EHR you're using.

Ideas you may wish to explore include triggering the creation of a new patient account in OnCall Health when:

  • a new patient chart is added to your EMR or EHR
  • data is added to a patient chart in your EMR or EHR indicating that patient's enrolment in virtual care
  • a button in your EMR or EHR is clicked to indicate an OnCall Health account should be created for a specific patient

Whichever approach you take, ensure the infrastructure you're using to make OnCall Health API calls is:

  1. Capable of being notified about the event occurring in your EMR or EHR and receiving the relevant patient data
  2. Capable of subsequently making an API call to OnCall Health using patient data associated with the event

Step 2: Using a POST request to the /contacts endpoint, create a roster contact for the patient (if one doesn't already exist)

Read this guide to learn more about roster contacts, their purpose, and the attributes you need to pass into OnCall Health's API to create one.

Your request body should look something like this.

   "name":"John Smith",
   "email":"[email protected]",

Contact your Customer Success Manager if you aren't sure what values to use for the division and provider attributes.

For the purpose of this guide, ensure the patient email address you send OnCall Health's API matches the email address the patient intends to login with.

Note: If you've been following our other guides, your organization may already have roster contacts. If you attempt to. create a roster contact with an email address that already exists in OnCall Health, the API will issue a response that looks like this.

    "Contact already exists."

If you receive this response, conduct a query to find the roster contact and store its URL for the next step.

If you successfully create a new roster contact, the URL you need will also be in the response body. Store it for use in the next step.

Step 3: Using a POST request to the /formassignment endpoint, assign a form to the roster contact

Reference this article to learn more about form assignments.

Your request body should look something like this.


Contact your Customer Success Manager if you aren't sure what value to use for the form attribute.

Step 4: The patient will receive an email inviting them to create an account and complete the form

When your patient clicks the "Complete form" button in that email, they will be redirected to a screen inviting them to set a secure password.

Creating patient accounts in the context of an appointment

If your goal is to create patient accounts in OnCall Health while also scheduling appointments, read this section of our guide to synchronizing patient data.

If you follow the steps in that section, OnCall Health will also trigger an email inviting the patient to create an account in preparation for their appointment.

If an account is already associated with the patient's email address, they will be prompted to login instead.

What happens next?

Once a patient has registered, they will be able to login and request appointments while authenticated (rather than being able to request appointments anonymously and potentially use an email address other than the one you were expecting, for example).

You may also find this form of onboarding useful from the perspective of ensuring a seamless experience. If your EMR or EHR also triggers emails when patient data is entered, for example, you may prefer triggering emails from OnCall Health at the same time (rather than triggering them when the patient books their first appointment).

Next steps

We hope this guide has helped you understand how to streamline the patient account creation process using OnCall Health's API. Keep reading our other guides for more information on building an integration between your EMR/EHR and OnCall Health.