Create a patient
/care/v1/patient/create/documentpatient:writeBAA requiredCreates 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_urlas 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_idreturns the same patient and a fresh link. - The connection is
pendinguntil the patient approves it. Nothing can be booked for the patient until the connection isactive. - To find out, trust the
connection.approvedevent or read the connection. Never trust thestatusin 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
addressAddressrequiredThe 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
citystringrequiredThe city.
Min length 1
countrystringrequiredThe two-letter country code, in capitals.
Pattern ^[A-Z]{2}$
line1stringrequiredThe first line of the street address.
Min length 1
line2stringnullableThe second line of the street address, if any.
postal_codestringrequiredThe postal code.
Min length 1
statestringrequiredThe two-letter province code, in capitals.
Pattern ^[A-Z]{2}$
date_of_birthstring (date)requiredThe patient's date of birth, as
YYYY-MM-DD. It must be in the past.emailstring (email)requiredThe patient's email address. The approval page sends its code to the address on the patient's Nurish'd account.
external_idstringrequiredYour 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_namestringrequiredThe patient's first name.
Min length 1 · Max length 100
last_namestringrequiredThe patient's last name.
Min length 1 · Max length 100
return_urlstringnullableWhere 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 carriesconnection_idandstatus, but never trust that status: trust theconnection.approvedevent or read the connection.Max length 2000
Response 200
connect_urlstringnullableSend 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_idreturns a fresh link.nullwhen the patient is not asked to approve now, and alwaysnullwhen you read the patient.connect_url_expires_atstring (date-time)nullableWhen
connect_urlstops working, in UTC.nullwheneverconnect_urlisnull.connectionCareConnectionrequiredThe 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)nullableWhen the patient approved the connection, in UTC.
nulluntil then.company_idstringrequiredThe ID of your company, the one that owns the connection.
connection_idstringrequiredThe ID of the connection. Use it to read or revoke the connection and to match
connection.approved,connection.declinedandconnection.revokedevents.created_atstring (date-time)requiredWhen the connection was created, in UTC.
external_idstringrequiredYour own ID for the patient, as you sent it.
revoked_atstring (date-time)nullableWhen the connection ended, in UTC.
nullwhile it has not ended.revoked_byenumnullableWho ended the connection:
patient(the patient),partner(your company) oradmin.nullwhile it has not ended.patientpartneradmin
scopesarray of enumrequiredWhat the patient allowed your company to do.
care.bookingsbooks and reads visits,care.reportsreads visit reports,care.health-profilereads and updates the health profile. Only the scopes your key may ask for are listed.statusenumrequiredpendinguntil the patient decides, thenactive,declinedorrevoked. Nothing can be booked for the patient until the connection isactive. Trust theconnection.approvedevent or read the connection; never trust the status in the return URL, because anyone can edit a URL.pendingactivedeclinedrevoked
userstring (uuid)requiredThe 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)requiredThe 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.
{
"error": {
"code": "not_found",
"message": "The object does not exist.",
"request_id": "req_0123456789abcdef0123456789abcdef"
}
}| Status | Code | Meaning |
|---|---|---|
401 | invalid_api_key | The API key is missing or not valid. |
403 | company_archived | This company is archived. |
403 | company_not_live | The company must be live to use prod keys. |
403 | company_suspended | This company is suspended. |
403 | scope_not_granted | This API key does not have the patient:write scope. |
409 | company_archived | This company is archived. |
409 | external_id_conflict | This external_id is already used for another person. Use the external_id this person was first created with. |
409 | person_already_connected | This email is already connected to your company under a different external_id. Keep using the external_id the person was first created with. |
422 | validation_error | body.external_id: Field required |
429 | rate_limited | Too many requests. Wait before calling again. |
500 | internal_error | Something went wrong on our side. Please try again later. |
502 | upstream_error | A Nurish'd service could not complete the request. |
503 | upstream_unavailable | A Nurish'd service is unavailable. Please try again later. |
504 | upstream_timeout | A Nurish'd service did not answer in time. Please try again. |