Starts an async batch export that compiles selected patients into a zip of typed Parquets (logs, state_modules, view_blocks, events, extracted).
POST
/
v1
/
exports
import olira
from datetime import datetime, timedelta, timezone
from olira import ExportInclude
olira.init(api_key="YOUR_API_KEY")
end = datetime.now(tz=timezone.utc)
start = end - timedelta(days=30)
job = olira.create_export(
start=start,
end=end,
include=ExportInclude(
logs=True,
state_modules=True,
view_blocks=True,
events=True,
extracted=True,
),
patient_ids=["8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82"],
)
print(job.export_id, job.status)
using Olira;
OliraModule.Init(apiKey: "YOUR_API_KEY");
var job = OliraModule.CreateExport(
start: DateTimeOffset.UtcNow.AddDays(-30),
end: DateTimeOffset.UtcNow,
include: new ExportInclude
{
Logs = true,
StateModules = true,
ViewBlocks = true,
Events = true,
Extracted = true,
},
patientIds: ["8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82"]);
Console.WriteLine($"{job.ExportId} {job.Status}");
POST /v1/exports
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"start": "2026-07-11T00:00:00Z",
"end": "2026-08-10T00:00:00Z",
"patient_ids": ["8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82"],
"include": {
"logs": true,
"state_modules": true,
"view_blocks": true,
"events": true,
"extracted": true
}
}
ExportJob(
export_id="exp-job-001",
status="queued",
stage="queued",
progress_pct=0.0,
selection="patient_ids",
patient_count=1,
downloadable=False,
)
{
"error": true,
"status_code": 401,
"error_type": "authentication_error",
"message": "Could not validate credentials",
"details": [
{
"type": "authentication_error",
"message": "Could not validate credentials"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 403,
"error_type": "authorization_error",
"message": "Insufficient OAuth scope for this endpoint",
"details": [
{
"type": "authorization_error",
"message": "Insufficient OAuth scope for this endpoint"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 404,
"error_type": "not_found_error",
"message": "Patient not found",
"details": [
{
"type": "not_found_error",
"message": "Patient not found"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 422,
"error_type": "validation_error",
"message": "Request validation failed (1 error)",
"details": [
{
"type": "missing",
"message": "Field required",
"field": "patient_id",
"location": ["body", "patient_id"],
"input_value": null
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 429,
"error_type": "server_error",
"message": "Rate limit exceeded",
"details": [
{
"type": "rate_limit",
"message": "Too many requests; retry after backoff"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 500,
"error_type": "internal_server_error",
"message": "An internal server error occurred",
"details": [
{
"type": "internal_server_error",
"message": "An unexpected error occurred while processing your request"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
olira.create_export(
start: str | datetime,
end: str | datetime,
include: ExportInclude | dict,
patient_ids: list[str] | None = None,
cohort_id: str | None = None,
scope: Literal["project"] | None = None,
) -> ExportJob
OliraModule.CreateExport(
DateTimeOffset start,
DateTimeOffset end,
ExportInclude include,
IReadOnlyList<string>? patientIds = null,
string? cohortId = null,
string? scope = null,
) // -> ExportJob
sdk:state-read
Provide exactly one of patient_ids, cohort_id, or scope=“project”. Poll get_export until downloadable, then download_export for a presigned URL.
Parameters
str | datetime
required
Inclusive window start (UTC). Versions overlapping [start, end] are selected.
str | datetime
required
Inclusive window end (UTC).
ExportInclude | dict
required
Content selection. Each of logs, state_modules, view_blocks, events, extracted may be true/false or a filter object.
list[str] | None
Explicit patient ids (max 500). Mutually exclusive with cohort_id and scope.
str | None
Cohort whose membership is exported. Mutually exclusive with patient_ids and scope.
Literal["project"] | None
Use “project” to export every non-deleted patient in the resolved project.
Returns
ExportJob — Job snapshot including export_id, status, stage, and progress.
str
Export job identifier for polling and download.
str
queued | running | completed | completed_with_errors | failed | cancelled.
str | None
Pipeline stage (planning, exporting, finalizing, …).
float
0–100 progress estimate.
str | None
patient_ids | cohort | project.
int
Number of patients in the export.
bool
True when download_export can return a URL.
Raises
| Exception | When |
|---|---|
ValidationError | Missing/invalid selection (must provide exactly one of patient_ids, cohort_id, scope), bad window, or empty include. |
AuthError | HTTP 401 or 403 — invalid API key or insufficient OAuth scope for this endpoint. |
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. |
import olira
from datetime import datetime, timedelta, timezone
from olira import ExportInclude
olira.init(api_key="YOUR_API_KEY")
end = datetime.now(tz=timezone.utc)
start = end - timedelta(days=30)
job = olira.create_export(
start=start,
end=end,
include=ExportInclude(
logs=True,
state_modules=True,
view_blocks=True,
events=True,
extracted=True,
),
patient_ids=["8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82"],
)
print(job.export_id, job.status)
using Olira;
OliraModule.Init(apiKey: "YOUR_API_KEY");
var job = OliraModule.CreateExport(
start: DateTimeOffset.UtcNow.AddDays(-30),
end: DateTimeOffset.UtcNow,
include: new ExportInclude
{
Logs = true,
StateModules = true,
ViewBlocks = true,
Events = true,
Extracted = true,
},
patientIds: ["8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82"]);
Console.WriteLine($"{job.ExportId} {job.Status}");
POST /v1/exports
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"start": "2026-07-11T00:00:00Z",
"end": "2026-08-10T00:00:00Z",
"patient_ids": ["8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82"],
"include": {
"logs": true,
"state_modules": true,
"view_blocks": true,
"events": true,
"extracted": true
}
}
ExportJob(
export_id="exp-job-001",
status="queued",
stage="queued",
progress_pct=0.0,
selection="patient_ids",
patient_count=1,
downloadable=False,
)
{
"error": true,
"status_code": 401,
"error_type": "authentication_error",
"message": "Could not validate credentials",
"details": [
{
"type": "authentication_error",
"message": "Could not validate credentials"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 403,
"error_type": "authorization_error",
"message": "Insufficient OAuth scope for this endpoint",
"details": [
{
"type": "authorization_error",
"message": "Insufficient OAuth scope for this endpoint"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 404,
"error_type": "not_found_error",
"message": "Patient not found",
"details": [
{
"type": "not_found_error",
"message": "Patient not found"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 422,
"error_type": "validation_error",
"message": "Request validation failed (1 error)",
"details": [
{
"type": "missing",
"message": "Field required",
"field": "patient_id",
"location": ["body", "patient_id"],
"input_value": null
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 429,
"error_type": "server_error",
"message": "Rate limit exceeded",
"details": [
{
"type": "rate_limit",
"message": "Too many requests; retry after backoff"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 500,
"error_type": "internal_server_error",
"message": "An internal server error occurred",
"details": [
{
"type": "internal_server_error",
"message": "An unexpected error occurred while processing your request"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
⌘I
import olira
from datetime import datetime, timedelta, timezone
from olira import ExportInclude
olira.init(api_key="YOUR_API_KEY")
end = datetime.now(tz=timezone.utc)
start = end - timedelta(days=30)
job = olira.create_export(
start=start,
end=end,
include=ExportInclude(
logs=True,
state_modules=True,
view_blocks=True,
events=True,
extracted=True,
),
patient_ids=["8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82"],
)
print(job.export_id, job.status)
using Olira;
OliraModule.Init(apiKey: "YOUR_API_KEY");
var job = OliraModule.CreateExport(
start: DateTimeOffset.UtcNow.AddDays(-30),
end: DateTimeOffset.UtcNow,
include: new ExportInclude
{
Logs = true,
StateModules = true,
ViewBlocks = true,
Events = true,
Extracted = true,
},
patientIds: ["8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82"]);
Console.WriteLine($"{job.ExportId} {job.Status}");
POST /v1/exports
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"start": "2026-07-11T00:00:00Z",
"end": "2026-08-10T00:00:00Z",
"patient_ids": ["8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82"],
"include": {
"logs": true,
"state_modules": true,
"view_blocks": true,
"events": true,
"extracted": true
}
}
ExportJob(
export_id="exp-job-001",
status="queued",
stage="queued",
progress_pct=0.0,
selection="patient_ids",
patient_count=1,
downloadable=False,
)
{
"error": true,
"status_code": 401,
"error_type": "authentication_error",
"message": "Could not validate credentials",
"details": [
{
"type": "authentication_error",
"message": "Could not validate credentials"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 403,
"error_type": "authorization_error",
"message": "Insufficient OAuth scope for this endpoint",
"details": [
{
"type": "authorization_error",
"message": "Insufficient OAuth scope for this endpoint"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 404,
"error_type": "not_found_error",
"message": "Patient not found",
"details": [
{
"type": "not_found_error",
"message": "Patient not found"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 422,
"error_type": "validation_error",
"message": "Request validation failed (1 error)",
"details": [
{
"type": "missing",
"message": "Field required",
"field": "patient_id",
"location": ["body", "patient_id"],
"input_value": null
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 429,
"error_type": "server_error",
"message": "Rate limit exceeded",
"details": [
{
"type": "rate_limit",
"message": "Too many requests; retry after backoff"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}
{
"error": true,
"status_code": 500,
"error_type": "internal_server_error",
"message": "An internal server error occurred",
"details": [
{
"type": "internal_server_error",
"message": "An unexpected error occurred while processing your request"
}
],
"timestamp": "2026-05-06T12:00:00+00:00"
}

