Skip to main content
GET
/
v1
/
patients
import olira

olira.init(api_key="YOUR_API_KEY")
result = olira.list_patients(limit=50, offset=0)
for p in result.patients:
    print(p.id, p.email)
PatientListResult(
    patients=[
        Patient(
            id="8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
            email="ada@example.com",
            first_name="Ada",
            last_name="Lovelace",
            sex="unknown",
            timezone="UTC",
            status="active",
            phone_number=None,
            date_of_birth=None,
            created_at=None,
            external_identifiers=[],
            metadata=None,
        ),
    ],
    total=128,
    has_more=True,
)
olira.list_patients(
    limit: int = 100,
    offset: int = 0,
    external_system: str | None = None,
    external_value: str | None = None,
) -> PatientListResult
Requires scope: api:manage-patients Optionally filter by a single external identifier pair.

Parameters

limit
int
default:"100"
Page size.
offset
int
default:"0"
Pagination offset.
external_system
str | None
Filter: external id system name.
external_value
str | None
Filter: external id value (use with external_system).

Returns

PatientListResult
patients
list[Patient]
Patients in this page.
total
int
Total matching patients.
has_more
bool
Whether additional pages exist.

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")
result = olira.list_patients(limit=50, offset=0)
for p in result.patients:
    print(p.id, p.email)
PatientListResult(
    patients=[
        Patient(
            id="8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
            email="ada@example.com",
            first_name="Ada",
            last_name="Lovelace",
            sex="unknown",
            timezone="UTC",
            status="active",
            phone_number=None,
            date_of_birth=None,
            created_at=None,
            external_identifiers=[],
            metadata=None,
        ),
    ],
    total=128,
    has_more=True,
)