Create ingestion job
Starts a historical data ingestion job.
POST
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
Path to a JSONL file (patient and/or log rows). Max size from org SDK config (default 100 MB).
Inline records when file= is not used. One of file or records is required.
Stable job key; prevents duplicate active/completed jobs (409). Reusable after FAILED.
When True (default), pause at awaiting_confirmation before Phase 2 replay.
When True, delete patients created by this job on cancel. STALE logs are always deleted on cancel.
View summary_type identifiers to backfill in Phase 2; None = all active org templates.
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 identifier for polling and confirm/cancel.
e.g. queued, awaiting_confirmation, replaying, completed.
Human-readable pipeline stage.
0–100 progress estimate.
Patients inserted or updated in Phase 1.
Logs successfully inserted as STALE rows.
Logs rejected during validation/insert.
Up to 100 sample errors (line, code, message).
Raises
| Exception | When |
|---|---|
ValidationError | Client-side JSONL/records validation failed, or file exceeds size limit — no job created. |
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. |

