Developers

Search the docs

Search guides and headings.

Create a patient

POST/care/v1/patient/create/document
Scope: patient:writeBAA required

Creates a patient, or connects to the patient's existing Nurish'd account, and starts a connection with them. Nothing can be booked for a patient until they approve the connection, so the answer carries a connect_url:

  • Send the patient to connect_url as a full page or a new tab. Never open it inside a frame or a web view.
  • The patient confirms with a code sent to the email on their Nurish'd account, signs the health privacy agreement and the telehealth consent, and approves.
  • The link is valid for 24 hours and works once. Calling create again with the same external_id returns the same patient and a fresh link.
  • The connection is pending until the patient approves it. Nothing can be booked for the patient until the connection is active.
  • To find out, trust the connection.approved event or read the connection. Never trust the status in the return URL, because anyone can edit a URL.

The address is required: a dietitian must be licensed in the patient's province, and a visit cannot be booked for a patient with no address. The patient is asked to allow every care permission your key can use: care.bookings when it holds booking:write, care.reports when it holds report:read, and care.health-profile when it holds health-profile:read or health-profile:write. A key with none of those is refused with scope_not_granted. The answer never says whether the email already had a Nurish'd account.

A patient is known to your company under one external_id. Two requests are refused with a 409 and create nothing: external_id_conflict when the external_id already belongs to a patient with a different email, and person_already_connected when the email is already connected under a different external_id. To change the id you use for a patient, keep using the first one.

Needs the patient:write scope, which needs a signed BAA.

Request body

  • addressAddressrequired

    The patient's home address. Required: a dietitian must be licensed in the patient's province, and a visit cannot be booked for a patient with no address. It is saved only on a new Nurish'd account; an existing account is never changed.

    Show child attributesHide child attributes
    • citystringrequired

      The city.

      Min length 1

    • countrystringrequired

      The two-letter country code, in capitals.

      Pattern ^[A-Z]{2}$

    • line1stringrequired

      The first line of the street address.

      Min length 1

    • line2stringnullable

      The second line of the street address, if any.

    • postal_codestringrequired

      The postal code.

      Min length 1

    • statestringrequired

      The two-letter province code, in capitals.

      Pattern ^[A-Z]{2}$

  • date_of_birthstring (date)required

    The patient's date of birth, as YYYY-MM-DD. It must be in the past.

  • emailstring (email)required

    The patient's email address. The approval page sends its code to the address on the patient's Nurish'd account.

  • external_idstringrequired

    Your own ID for the patient (your customer ID), 1 to 200 characters. Sending the same ID again returns the same patient and a fresh link.

    Min length 1 · Max length 200

  • first_namestringrequired

    The patient's first name.

    Min length 1 · Max length 100

  • last_namestringrequired

    The patient's last name.

    Min length 1 · Max length 100

  • return_urlstringnullable

    Where the patient goes after the approval page. It must be one of the return URLs registered for your company, otherwise the call answers validation_error. The URL carries connection_id and status, but never trust that status: trust the connection.approved event or read the connection.

    Max length 2000

Response 200

  • connect_urlstringnullable

    Send the patient to this link as a full page or a new tab, never inside a frame or a web view. The patient confirms with a code sent to the email on their Nurish'd account, signs the health privacy agreement and the telehealth consent, and approves. It is valid for 24 hours and works once. Calling create again with the same external_id returns a fresh link. null when the patient is not asked to approve now, and always null when you read the patient.

  • connect_url_expires_atstring (date-time)nullable

    When connect_url stops working, in UTC. null whenever connect_url is null.

  • connectionCareConnectionrequired

    The connection with your company. Nothing can be booked for the patient until its status is active.

    Show child attributesHide child attributes
    • approved_atstring (date-time)nullable

      When the patient approved the connection, in UTC. null until then.

    • company_idstringrequired

      The ID of your company, the one that owns the connection.

    • connection_idstringrequired

      The ID of the connection. Use it to read or revoke the connection and to match connection.approved, connection.declined and connection.revoked events.

    • created_atstring (date-time)required

      When the connection was created, in UTC.

    • external_idstringrequired

      Your own ID for the patient, as you sent it.

    • revoked_atstring (date-time)nullable

      When the connection ended, in UTC. null while it has not ended.

    • revoked_byenumnullable

      Who ended the connection: patient (the patient), partner (your company) or admin. null while it has not ended.

      • patient
      • partner
      • admin
    • scopesarray of enumrequired

      What the patient allowed your company to do. care.bookings books and reads visits, care.reports reads visit reports, care.health-profile reads and updates the health profile. Only the scopes your key may ask for are listed.

    • statusenumrequired

      pending until the patient decides, then active, declined or revoked. Nothing can be booked for the patient until the connection is active. Trust the connection.approved event or read the connection; never trust the status in the return URL, because anyone can edit a URL.

      • pending
      • active
      • declined
      • revoked
    • userstring (uuid)required

      The ID of the patient's Nurish'd user the connection is with. Use it to read the patient and, later, to book visits for them.

  • userstring (uuid)required

    The ID of the patient's Nurish'd user. Use it to read the patient and, later, to book visits for them. Your own ID for the patient is connection.external_id.

Errors

Every error has this shape. Branch on code, not on message. request_id equals the X-Request-Id response header.

jsonError response
{
  "error": {
    "code": "not_found",
    "message": "The object does not exist.",
    "request_id": "req_0123456789abcdef0123456789abcdef"
  }
}
StatusCodeMeaning
401invalid_api_keyThe API key is missing or not valid.
403company_archivedThis company is archived.
403company_not_liveThe company must be live to use prod keys.
403company_suspendedThis company is suspended.
403scope_not_grantedThis API key does not have the patient:write scope.
409company_archivedThis company is archived.
409external_id_conflictThis external_id is already used for another person. Use the external_id this person was first created with.
409person_already_connectedThis email is already connected to your company under a different external_id. Keep using the external_id the person was first created with.
422validation_errorbody.external_id: Field required
429rate_limitedToo many requests. Wait before calling again.
500internal_errorSomething went wrong on our side. Please try again later.
502upstream_errorA Nurish'd service could not complete the request.
503upstream_unavailableA Nurish'd service is unavailable. Please try again later.
504upstream_timeoutA Nurish'd service did not answer in time. Please try again.

All error codes and what to do about them