Skip to main content
Parse converts a document into structured text. OCR runs when the file needs it; ocr_applied on the result says whether it did. For a retained asynchronous Parse, GET /v1/jobs/{job_id}/parse-progress/events streams snapshot events with ready units and their content_url. Authenticate with the same API key as the job. Fetch each unit URL to read its bounded markdown preview; replace an existing unit by its index and revision instead of appending duplicates. On reconnect, the first snapshot contains current state. The plain GET /v1/jobs/{job_id}/parse-progress endpoint returns the same snapshot. Native OCR can publish checked pages before the document finishes, including at all effort levels. Presentations and diagrams publish pages; spreadsheets publish sheets after their shared preparation stage. Some providers and formats return everything together. Cache hits can finish immediately; a run waiting on another cache producer may have no preview. Zero-retention runs use complete delivery. Previews may arrive out of order: display their original page numbers. A new generation replaces the old preview. Preview tables, captions, and grounding can change during final assembly. A unit is limited to 64K characters and snapshots to 1,000 ready units; truncated and more disclose those bounds. Continue using the normal job status and final result for completion, failure, cancellation, exports, usage and billing. A dropped preview connection never cancels the job.

Zero-retention workspace delivery

Zero-retention Parse returns its result inline by default. For a file in a workspace, set result_delivery: "workspace" and pass the ID of a writable customer-storage workspace in output_workspace_id. You can submit with wait_seconds=0 and poll the job. The destination can use S3 or Azure Blob. The same option works for Extract, Split, Classify and Ground; see document operations. After success, the job reports result_state: "not_retained" and result_download_url. Download that path with your API key. It serves result.json from the customer workspace. The JSON uses relative paths for published artifacts. Resolve them against the download URL. When you request Markdown or text, the same location serves the complete rendering as document.md or document.txt. The JSON can contain a preview for large results. For unsealed workspaces, X-NDI-Output-Object gives the object key relative to the workspace storage root. Sealed workspaces use authenticated API downloads. The customer controls the lifetime of the delivered objects. NDI keeps job, binding and integrity metadata to authorize downloads after transient inputs expire. The API checks current workspace access, the source file’s access labels and both storage bindings when you download a member. return_ocr_data is unavailable in this mode. Standard Parse options for automatic OCR still apply.

Streaming previews

For retained Parse, wait_seconds=0 is the default and returns a job ID immediately. Complete-result clients keep using jobs.get or jobs.wait. Subscribe separately for previews:
Connections last up to 55 seconds. Reconnect after a clean close for the latest snapshot. Replace units by generation/index/revision; discard the old generation on parser retry. unavailable events or failed part reads mean that previews stopped, not that parsing failed. Continue normal job polling and never leave an indefinite preview spinner. Closing a connection does not cancel the job. first_ready_at records successful publication of the first nonempty preview. all_ready_at means all selected units were saved; tables, descriptions and final assembly may still be running. Show “All pages parsed / Preparing final result” until the normal job finishes. Preserve readable content and scroll position on completion; final results are authoritative for export and billing. Terminal snapshots contain no units. Python supports jobs.parse_progress(job_id), jobs.parse_progress_events(job_id) and jobs.parse_progress_part(job_id, generation, revision), in both sync and async clients. TypeScript supports jobs.parseProgress(job_id), jobs.parseProgressEvents(job_id) and jobs.parseProgressPart(job_id, generation, revision). jobs.events() remains the job-status stream and does not carry page text. See Python job management and TypeScript job management.

Result workspace

Document operations accept an optional output_workspace_id for retained artifacts. The destination must be a workspace you can access and write to; access to every source is checked separately. With one source workspace, that workspace is the default. Reusing a Parse result inherits the workspace holding that result. If several workspaces are involved and any uses customer storage, choose an explicit destination. Ambiguous requests return 422. Workspace-free uploads and URLs keep their existing default unless you choose a workspace. Selecting a destination does not move or ingest the original file, and it does not change the job’s retention policy.

Sources

Upload, URL, workspace file, or a prior parse (ParseResultSource / { type: "parse_result", job_id }). A parse request with a parse_result source cannot select pages or set include_images: it is refused with 422 invalid_request. See Sources.

Useful options

Checkbox forms

The default parse_mode="low" may omit checkbox selection marks. When checked and unchecked states matter, use parse_mode="medium" or parse_mode="high" and verify the parsed output against the form before relying on those states.

Async batch

Share one AsyncNdiClient. Each jobs.wait polls independently.
TypeScript is already async — Promise.all over the same client.

Errors

  • invalid_request — extra body fields, bad source
  • unsupported_file_type
  • JobFailedError — job status=failed (for example corrupt_file). A password on a non-PDF source is accepted with 202, then the job fails with error.code invalid_request

Next