Skip to main content
PUT
/
v1
/
patients
/
{patient_id}
import olira

olira.init(api_key="YOUR_API_KEY")
patient = olira.update_patient(
    patient_id="8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
    timezone="America/New_York",
)
Patient(
    id="8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
    first_name="Ada",
    last_name="Lovelace",
    email="ada@example.com",
    sex="unknown",
    timezone="America/New_York",
    status="active",
    phone_number=None,
    date_of_birth=None,
    created_at="2026-01-10T08:00:00Z",
    external_identifiers=[],
    metadata=None,
)
olira.update_patient(
    patient_id: str,
    first_name: str | None = None,
    last_name: str | None = None,
    email: str | None = None,
    phone_number: str | None = None,
    sex: str | None = None,
    timezone: str | None = None,
    external_identifiers: list[ExternalIdentifier] | None = None,
    metadata: dict[str, Any] | None = None,
) -> Patient
Requires scope: api:manage-patients Pass external_identifiers=[] to clear all external ids; metadata={} clears metadata.

Parameters

patient_id
str
required
Olira patient id.
first_name
str | None
New given name.
last_name
str | None
New family name.
email
str | None
New email.
phone_number
str | None
New phone.
sex
str | None
New sex/gender.
timezone
str | None
New timezone.
external_identifiers
list[ExternalIdentifier] | None
Replace external ids; [] clears.
metadata
dict[str, Any] | None
Replace metadata; {} clears.

Returns

Patient
id
str
Olira patient id.
first_name
str | None
Given name.
last_name
str | None
Family name.
sex
str | None
Sex/gender.
timezone
str
Timezone.
status
str
Status.
email
str | None
Email.
phone_number
str | None
Phone.
date_of_birth
str | None
DOB.
created_at
str | None
Created at.
external_identifiers
list[ExternalIdentifier]
External ids.
metadata
dict[str, Any] | None
Metadata.

Raises

ExceptionWhen
AuthErrorHTTP 401 or 403 — invalid API key or insufficient OAuth scope for this endpoint.
ValidationErrorHTTP 400, 404, or 422 — malformed JSON, unknown patient, or validation failure (message includes response excerpt).
ServerErrorHTTP 409 (e.g. conflicting external identifier) or repeated 5xx after retries; includes status_code when applicable.
RateLimitErrorHTTP 429 — rate limited; check retry_after (seconds).
NetworkErrorConnection timeout, DNS failure, or read error after retries.
import olira

olira.init(api_key="YOUR_API_KEY")
patient = olira.update_patient(
    patient_id="8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
    timezone="America/New_York",
)
Patient(
    id="8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
    first_name="Ada",
    last_name="Lovelace",
    email="ada@example.com",
    sex="unknown",
    timezone="America/New_York",
    status="active",
    phone_number=None,
    date_of_birth=None,
    created_at="2026-01-10T08:00:00Z",
    external_identifiers=[],
    metadata=None,
)