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

olira.init(api_key="YOUR_API_KEY")
result = olira.remove_patients_from_cohort(
    cohort_id="68582e4a0a0b3c1234567890",
    patient_ids=["8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82"],
)
print(result.patient_count)
CohortPatientMutationResult(cohort_id="68582e4a0a0b3c1234567890", patient_count=0)
olira.remove_patients_from_cohort(
    cohort_id: str,
    patient_ids: list[str],
) -> CohortPatientMutationResult
Requires scope: api:manage-patients Max 500 per call. Patient records are not affected.

Parameters

cohort_id
str
required
Olira-assigned cohort id.
patient_ids
list[str]
required
Olira patient ids to remove (max 500).

Returns

CohortPatientMutationResult
cohort_id
str
Cohort id.
patient_count
int
Total enrolled patients after the operation.

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.remove_patients_from_cohort(
    cohort_id="68582e4a0a0b3c1234567890",
    patient_ids=["8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82"],
)
print(result.patient_count)
CohortPatientMutationResult(cohort_id="68582e4a0a0b3c1234567890", patient_count=0)