Skip to content

API reference

Patient lifecycle

Enroll, update and cancel patients.

Enroll, update or cancel patients from your system of record. Use the REST route, or the webhook-compatible route if your platform can only send webhooks.

Every endpoint on this page

patient.created needs the patient's email and enrolls them into the active protocol named by programKey (or protocolId). With neither, it uses the environment's active protocol, only when exactly one is active. The external patient ID is stored only as a keyed hash.

Responses

StatusMeaning
202Event accepted or an identical retry recognized.
400The request is malformed or violates the operation contract.
401The API credential is missing, invalid, expired, or revoked.
403The organization hasn't signed its BAA, so patient features (and API keys) are off. An owner or administrator signs it in Settings; it takes effect at once.
404The resource is not accessible in this credential's environment.
409The idempotency identifier was reused with different content, or an update is out of sequence.

202 body

FieldTypeDescription
acceptedRequiredbooleanAlways true.
duplicateRequiredboolean
401 response
{
  "code": "INVALID_API_CREDENTIAL",
  "message": "API credential is invalid."
}
403 response
{
  "code": "BAA_REQUIRED",
  "message": "Sign your BAA to turn on patient features. An owner or administrator can sign it in Settings."
}

Submit a patient lifecycle event

POST/client/patient-events

API key. Authorization: Bearer nzh_sb_… in sandbox, nzh_prod_… in production: Authentication.

Request body

FieldTypeDescription
eventIdRequiredstring (uuid)
typeRequiredstringOne of patient.created, patient.updated, patient.cancelled.
externalPatientIdRequiredstring1–200 characters.
firstNamestring1–80 characters.
lastNamestring1–80 characters.
dateOfBirthstring (date)
phonestring7–30 characters.
emailstring (email)Required for patient.created: check-ins are sent by email.Up to 254 characters.
protocolIdstring (uuid)Send this or programKey, not both.
programKeystringThe protocol's program key, e.g. glp1-maintenance: the stable way to choose a protocol, set in Workforce → Protocols.Matches ^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$.
checkInCadenceDaysinteger1 to 30.
cURL
curl "https://api.nezercare.com/client/patient-events" \
  --request POST \
  --header "Authorization: Bearer $NEZER_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "eventId": "6987074c-f976-4b17-817d-a0f17dc3a6da",
    "type": "patient.created",
    "externalPatientId": "patient_12345",
    "firstName": "Taylor",
    "lastName": "Example",
    "email": "taylor@example.com",
    "dateOfBirth": "1990-06-15",
    "programKey": "glp1-maintenance",
    "checkInCadenceDays": 7
  }'
Update a patient
{
  "eventId": "4a3b3472-70fd-48d8-a36b-d95173eac9c2",
  "type": "patient.updated",
  "externalPatientId": "patient_12345",
  "email": "new-address@example.com"
}
Cancel a patient pathway
{
  "eventId": "61594921-0f40-4a0d-91ec-88517503485f",
  "type": "patient.cancelled",
  "externalPatientId": "patient_12345"
}

Submit a patient lifecycle event through the webhook-compatible route

POST/client/webhooks/patient-events

API key. Authorization: Bearer nzh_sb_… in sandbox, nzh_prod_… in production: Authentication.

Request body

FieldTypeDescription
eventIdRequiredstring (uuid)
typeRequiredstringOne of patient.created, patient.updated, patient.cancelled.
externalPatientIdRequiredstring1–200 characters.
firstNamestring1–80 characters.
lastNamestring1–80 characters.
dateOfBirthstring (date)
phonestring7–30 characters.
emailstring (email)Required for patient.created: check-ins are sent by email.Up to 254 characters.
protocolIdstring (uuid)Send this or programKey, not both.
programKeystringThe protocol's program key, e.g. glp1-maintenance: the stable way to choose a protocol, set in Workforce → Protocols.Matches ^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$.
checkInCadenceDaysinteger1 to 30.
cURL
curl "https://api.nezercare.com/client/webhooks/patient-events" \
  --request POST \
  --header "Authorization: Bearer $NEZER_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "eventId": "6987074c-f976-4b17-817d-a0f17dc3a6da",
    "type": "patient.created",
    "externalPatientId": "patient_12345",
    "firstName": "Taylor",
    "lastName": "Example",
    "email": "taylor@example.com",
    "dateOfBirth": "1990-06-15",
    "programKey": "glp1-maintenance",
    "checkInCadenceDays": 7
  }'
Update a patient
{
  "eventId": "4a3b3472-70fd-48d8-a36b-d95173eac9c2",
  "type": "patient.updated",
  "externalPatientId": "patient_12345",
  "email": "new-address@example.com"
}
Cancel a patient pathway
{
  "eventId": "61594921-0f40-4a0d-91ec-88517503485f",
  "type": "patient.cancelled",
  "externalPatientId": "patient_12345"
}