Create cohort
Creates a named patient cohort in your organization.
POST
api:manage-patients
Cohorts start empty — use add_patients_to_cohort to enroll patients. Names must be unique per organization.
Parameters
Display name; unique per organization (1–200 characters).
Optional free-text description.
Returns
Cohort — Created cohort with Olira-assigned id.
Olira cohort id.
Display name.
Optional description.
Patient ids in this cohort.
ISO 8601 creation timestamp.
ISO 8601 last-updated timestamp.
Raises
| Exception | When |
|---|---|
AuthError | HTTP 401 or 403 — invalid API key or insufficient OAuth scope for this endpoint. |
ValidationError | HTTP 400, 404, or 422 — malformed JSON, unknown patient, or validation failure (message includes response excerpt). |
ServerError | HTTP 409 (e.g. conflicting external identifier) or repeated 5xx after retries; includes status_code when applicable. |
RateLimitError | HTTP 429 — rate limited; check retry_after (seconds). |
NetworkError | Connection timeout, DNS failure, or read error after retries. |
Previous
list_cohortsReturns all cohorts for your organization sorted by name, with patient and template assignment counts.
Next

