ingest
Queue an ingestion run for one file, a batch, or an entire folder.
Cost class: job (pipeline compute per file; billed on completion).
Pass a :class:~ndi_service.app.platform_api.contracts.IngestionSelection to say what to process:
- {"type": "file_ids", "file_ids": [...]} — explicit file list.
- {"type": "path_prefix", "path_prefix": "reports/"} — a folder; stale_only=true restricts the run to files whose hash diverged.
The ingestion lane (PDF, Excel, audio, …) is chosen per file from its type; a caller does not name a lane.
Per-file outcomes, not a single verdict. A file already ingested at the same hash is skipped_unchanged (free) unless reingest_unchanged is set. A valid zero-row raw Parquet file is skipped_empty (free) and produces no searchable table. One corrupt file in a folder of 400 does not fail the run. It appears as a failed entry in result.outcomes. A job where every attempted file failed is failed. Its error.code is taken from the files, and error.detail carries the per-file reasons. That job has no result. Partial failures stay outcomes on a succeeded job.
This is the only call that makes files searchable. Uploading a file to the workspace ledger registers it; ingesting it builds the representations (search index, knowledge-graph nodes) that queries read.
Args: body: Ingestion parameters: selection and reingest flag. context: Resolved workspace plus the caller's access predicate. session: Database session. wait_seconds: Bounded inline wait (0 → immediate 202). idempotency_key: Replaying with the same key returns the original job. response: Injected by FastAPI for status-code management.
Returns: A :class:~ndi_service.app.platform_api.results.Job. On success the result is an :class:~ndi_service.app.platform_api.results.IngestionResult with per-file outcomes.
Request
- Base URLhttps://ndi-api.nace.ai (the document declares no server; this is the origin it was published from)
- AuthAPI key in header X-API-Key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Workspace identifier.
Query parameters
Bounded inline wait. 0 (the default) returns 202 immediately. Above 0 the route returns 200 with a terminal job if the work finished in time, and 202 with the still-running job if it did not. Either way, read status.
Headers
Replaying a request with the same key returns the original job with 200, never a second job. The key is kept with the job for replay and never cleared, so it must not contain personal data.
Request body
Response
Successful Response
Changes
No recorded changes to this operation across all 1 revision of this API.