Key Concepts
- Flow — what the parse produces. There are two flows:
submissionparses a document into a structured submission, andpolicyparses it into a structured policy. - Target — what a parse runs over: a single
fileId, or afolderId(the folder is recursively flattened to its live, ready files and parsed together as one run). A folder of N documents is one run, not N. - Parse run — one task in the pipeline. A trigger first enqueues the
flow-agnostic
extractstage, which hands off to the per-flowcreate_<flow>_v<N>stage. Each of these tasks is its own run record in the listing. - Idempotent per-target dedupe — re-triggering the same target for the same
flow collapses to a
duplicateoutcome instead of enqueuing the work twice, so retries and double-calls are safe.
API Endpoints
Permissions
How It Works
- Upload and finalize the document(s) through the
Company Files API — create an upload
intent,
PUTthe bytes to the signed URL, then finalize so the file isready. (Finalize no longer parses; parsing is reachable only via trigger-parse.) - Trigger the parse over the finalized file(s) and/or folder(s) for a flow
(
submissionorpolicy). The response returns one outcome per target, each with the resolvedparseTaskName, anenqueued/duplicateoutcome, and arunId. - Poll the runs with List Parse Runs until they reach a terminal status.
Run Lifecycle
A run’sstatus is one of:
running— the run is in flight (or waiting on scanning / retrying).succeeded— the run completed.failed— the run failed terminally. The internal retry states (failed_retrying,failed_permanent,failed_vanished) all collapse tofailed; afailedrun that recorded a message surfaces it on theerrorfield.
extract stage self-gates and backs off until every file in the target is
ready.
Example: Parse an Uploaded Submission
folderIds array with the
policy flow. Provide at least one of fileIds or folderIds.
Listing is a flat, per-task view. Each run record is one pipeline task, not
one logical end-to-end run:
runId is the task row’s id, flow is null for
the flow-agnostic extract stage, and target is currently always null (the
specific file or folder a run parsed is not yet persisted on the run row).Related Resources
- Company Files API — upload and finalize the documents you parse
- Entities API — the submissions and policies parsing produces
- Roadmap — overall API direction
