Skip to main content
GET
/
v1
/
cohorts
import olira

olira.init(api_key="YOUR_API_KEY")
result = olira.list_cohorts()
for c in result.data:
    print(c.id, c.name, c.patient_count)
CohortListResult(
    data=[
        CohortListItem(
            id="68582e4a0a0b3c1234567890",
            name="High-Risk Patients",
            description="Patients flagged for weekly review",
            patient_count=12,
            template_assignment_count=2,
            created_at="2026-06-25T10:00:00Z",
            updated_at="2026-06-25T10:00:00Z",
        ),
    ],
)
olira.list_cohorts() -> CohortListResult
Requires scope: api:manage-patients

Returns

CohortListResult
data
list[CohortListItem]
Cohorts in the organization.
data[].id
str
Cohort id.
data[].name
str
Display name.
data[].description
str | None
Optional description.
data[].patient_count
int
Number of enrolled patients.
data[].template_assignment_count
int
Number of assigned summary types.
data[].created_at
str | None
ISO 8601 creation timestamp.
data[].updated_at
str | None
ISO 8601 last-updated timestamp.

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_cohorts()
for c in result.data:
    print(c.id, c.name, c.patient_count)
CohortListResult(
    data=[
        CohortListItem(
            id="68582e4a0a0b3c1234567890",
            name="High-Risk Patients",
            description="Patients flagged for weekly review",
            patient_count=12,
            template_assignment_count=2,
            created_at="2026-06-25T10:00:00Z",
            updated_at="2026-06-25T10:00:00Z",
        ),
    ],
)