reconcile
Detect divergence between storage and the file ledger; optionally act on it.
Cost class: job (storage listing + hash comparison; billed on completion).
Reconciliation compares the customer-visible storage tree against the ledger and records the result there. The scan itself never modifies stored bytes or derived representations. It marks:
- discovered — objects in storage with no ledger row.
- stale — rows whose observed_hash no longer matches the stored object.
- orphans — rows whose object is gone from storage.
Set auto_ingest=true to chain a POST /workspaces/{id}/ingestions automatically when divergence is found. Without it, reconciliation still updates the ledger but starts no ingestion. The ingestion_job_id in the result points to that job so you can poll it separately.
selection.stale_only on the chained ingestion is the routine case: it re-ingests exactly the stale files and is a no-op when nothing diverged.
path_prefix scopes the scan; omit it (or pass null) to scan the whole workspace.
Args: body: Reconciliation parameters: optional path scope and auto-ingest 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 a :class:~ndi_service.app.platform_api.results.ReconciliationResult with counts and file-id lists. ingestion_job_id is set when auto_ingest was requested.
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.