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

olira.init(api_key="YOUR_API_KEY")
assignment = olira.assign_cohort_template(
    cohort_id="68582e4a0a0b3c1234567890",
    summary_type="symptom_overview",
)
print(assignment.id)
CohortTemplateAssignment(
    id="68582e4a0a0b3c0987654321",
    summary_type="symptom_overview",
    template_id="68582e4a0a0b3c1111111111",
    cohort_id="68582e4a0a0b3c1234567890",
    assigned_at="2026-06-25T10:30:00Z",
)
olira.assign_cohort_template(
    cohort_id: str,
    summary_type: str,
) -> CohortTemplateAssignment
Requires scope: api:manage-patients Patients in the cohort will have this summary type included in their effective template set. Snapshot documents are seeded for existing patients in the background.

Parameters

cohort_id
str
required
Olira-assigned cohort id.
summary_type
str
required
Summary type slug (e.g. symptom_overview).

Returns

CohortTemplateAssignment
id
str
Assignment id.
summary_type
str
Assigned summary type slug.
template_id
str
Resolved template id at assignment time.
cohort_id
str
Cohort id.
assigned_at
str | None
ISO 8601 assignment 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")
assignment = olira.assign_cohort_template(
    cohort_id="68582e4a0a0b3c1234567890",
    summary_type="symptom_overview",
)
print(assignment.id)
CohortTemplateAssignment(
    id="68582e4a0a0b3c0987654321",
    summary_type="symptom_overview",
    template_id="68582e4a0a0b3c1111111111",
    cohort_id="68582e4a0a0b3c1234567890",
    assigned_at="2026-06-25T10:30:00Z",
)