Skip to main content
POST
/
v1
/
ingestion
/
jobs
import olira

olira.init(api_key="YOUR_API_KEY")
job = olira.create_ingestion_job(
    file="patients_and_logs.jsonl",
    idempotency_key="initial-onboarding-2026",
    require_confirmation=True,
)
IngestionJob(
    job_id="ing-job-001",
    status="awaiting_confirmation",
    stage="awaiting_confirmation",
    progress_pct=100.0,
    patients_processed=42,
    logs_processed=1250,
    logs_failed=3,
    error_summary=[...],
)
olira.create_ingestion_job(
    file: str | None = None,
    records: list[IngestRecord] | None = None,
    idempotency_key: str | None = None,
    require_confirmation: bool = True,
    rollback_on_cancel: bool = False,
    summary_types: list[str] | None = None,
    max_event_logs: int | None = None,
) -> IngestionJob
Requires scope: sdk:historical-ingest Provide either file= (JSONL path — SDK uploads to S3 then creates the job) or records= (inline list, ≤ 50,000 rows). Local validation runs before any network call. Phase 1 runs automatically; by default the job pauses at awaiting_confirmation for review before graph replay.

Parameters

file
str | None
Path to a JSONL file (patient and/or log rows). Max size from org SDK config (default 100 MB).
records
list[IngestRecord] | None
Inline records when file= is not used. One of file or records is required.
idempotency_key
str | None
Stable job key; prevents duplicate active/completed jobs (409). Reusable after FAILED.
require_confirmation
bool
default:"True"
When True (default), pause at awaiting_confirmation before Phase 2 replay.
rollback_on_cancel
bool
default:"False"
When True, delete patients created by this job on cancel. STALE logs are always deleted on cancel.
summary_types
list[str] | None
View summary_type identifiers to backfill in Phase 2; None = all active org templates.
max_event_logs
int | None
Per-patient cap on logs considered during view backfill only (cost control for log-dense patients).

Returns

IngestionJob — Job snapshot including job_id, status, stage, and progress counters.
job_id
str
Job identifier for polling and confirm/cancel.
status
str
e.g. queued, awaiting_confirmation, replaying, completed.
stage
str
Human-readable pipeline stage.
progress_pct
float
0–100 progress estimate.
patients_processed
int
Patients inserted or updated in Phase 1.
logs_processed
int
Logs successfully inserted as STALE rows.
logs_failed
int
Logs rejected during validation/insert.
error_summary
list[IngestionErrorSummary] | None
Up to 100 sample errors (line, code, message).

Raises

ExceptionWhen
ValidationErrorClient-side JSONL/records validation failed, or file exceeds size limit — no job created.
AuthErrorHTTP 401 or 403 — invalid API key or insufficient OAuth scope for this endpoint.
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")
job = olira.create_ingestion_job(
    file="patients_and_logs.jsonl",
    idempotency_key="initial-onboarding-2026",
    require_confirmation=True,
)
IngestionJob(
    job_id="ing-job-001",
    status="awaiting_confirmation",
    stage="awaiting_confirmation",
    progress_pct=100.0,
    patients_processed=42,
    logs_processed=1250,
    logs_failed=3,
    error_summary=[...],
)