Skip to main content
PUT
/
v1
/
cohorts
/
{cohort_id}
import olira

olira.init(api_key="YOUR_API_KEY")
cohort = olira.update_cohort(
    cohort_id="68582e4a0a0b3c1234567890",
    description="Updated weekly — oncology ward",
)
print(cohort.description)
Cohort(
    id="68582e4a0a0b3c1234567890",
    name="High-Risk Patients",
    description="Updated weekly — oncology ward",
    patient_ids=["8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82"],
    created_at="2026-06-25T10:00:00Z",
    updated_at="2026-06-25T12:00:00Z",
)
olira.update_cohort(
    cohort_id: str,
    name: str | None = None,
    description: str | None = None,
) -> Cohort
Requires scope: api:manage-patients All fields are optional; only supplied fields are changed.

Parameters

cohort_id
str
required
Olira-assigned cohort id.
name
str | None
New display name (1–200 characters); must be unique per organization.
description
str | None
New description.

Returns

Cohort
id
str
Cohort id.
name
str
Updated name.
description
str | None
Updated description.
patient_ids
list[str]
Enrolled patient ids (unchanged).
updated_at
str | None
ISO 8601 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")
cohort = olira.update_cohort(
    cohort_id="68582e4a0a0b3c1234567890",
    description="Updated weekly — oncology ward",
)
print(cohort.description)
Cohort(
    id="68582e4a0a0b3c1234567890",
    name="High-Risk Patients",
    description="Updated weekly — oncology ward",
    patient_ids=["8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82"],
    created_at="2026-06-25T10:00:00Z",
    updated_at="2026-06-25T12:00:00Z",
)