Run

Ingest documents and run a Spec's pipeline in one call

Accepts one or more files, one or more file_urls, or a mix of both — at least one input is required. Ingests every input (metering each ingest leg), waits for OCR to finish, then compiles the named Spec's saved rail into a pipeline and starts it — the same compile step POST /v1/pipelines uses, minus the separate "upload documents first" step. Always returns 202; poll GET /v1/run/{id} or listen for the run.completed / run.failed webhook (POST /v1/webhooks). Requires write scope. Unlike POST /v1/process, this endpoint does not dedup — every call starts a fresh run. Content-based document dedup still applies per input within the call — see the documents response field.

post/v1/run

Request

  • Base URL
    https://api.talonic.com
  • Auth
    HTTP bearer

Request body multipart/form-data

object required
spec_id, string uuid required

The Spec whose saved rail runs. Accepts either a Spec (user_schema) id or a V2 Spec id (the id shown in the /specs editor) — a V2 id resolves to its linked schema's last published/materialized rail.

files, string[]

Zero or more document files (max 20 per call, 500 MB each). At least one of files/file_urls is required.

file_urls, string[]

Zero or more remote document URLs (SSRF-guarded downstream).

name, string

Optional display name for the run.

batch_id, string

Optional caller grouping key stamped on every document ingested by this call (documents.client_batch_id) and echoed by GET /v1/run/{id}. Opaque to the platform — an external job/batch id for grouping. A batch_id may span multiple POST /v1/run calls; batch-derived webhooks stream per document and re-emit on revision, so no single-call containment is required.

metadata, string

Optional JSON string of a FLAT object { [key]: string | number | boolean | null } (nested objects/arrays are rejected 400; limits: ≤50 keys, key ≤128 chars, string value ≤1024 chars). The validated object is persisted on the run request (echoed by GET /v1/run/{id}) AND stamped on every ingested document as documents.client_metadata.

file_metadata, string

Optional JSON string of a map { [inputKey: string]: ClientMetadata } for tagging individual files in a multi-file call — each value obeys the same constraints as metadata (≤50 keys, key ≤128 chars, string value ≤1024 chars). inputKey is the input's identity: for files, the uploaded filename exactly as echoed back in documents[] (filenames are NFC-normalized before matching, so an umlaut/NFD name still keys correctly); for file_urls, the exact URL string (no trim, no normalization). A key matching several same-named inputs applies to ALL of them; a key matching NO input is a 400 invalid_metadata naming the offending key, so a typo'd filename fails loudly instead of silently tagging nothing. Per input, the file's bag is merged OVER the call-level metadata — per-file wins per key, and null is a value (it overrides), never a deletion, so a per-file entry cannot unset a call-level key. The MERGED result must still satisfy the caps above (a 30-key call bag plus a disjoint 30-key file bag is rejected, not silently truncated) — 400 invalid_metadata otherwise. The map itself is capped at the call's max input count (20) entries and 64 KB of decoded JSON; the size cap binds BEFORE per-entry validation, so 20 individually-legal maximal bags can still exceed it. Container inputs (ZIP/email) key by the archive's filename only — a key can target the archive, never its extracted members, which inherit the archive's merged bag. The resolved per-input bag is echoed back in documents[].metadata on this response and on GET /v1/run/{id}.

pipeline_mode, 'new' | 'append'

Explicit override of the Spec's configured pipeline mode. new (the default when neither this nor the Spec sets a mode) creates a fresh pipeline per call. append adds this call's documents to the newest eligible existing pipeline on the Spec — so bulk uploads accumulate into one growing table instead of one pipeline per call. A pipeline is eligible when its config still matches the Spec (schema fields, policies, gates, assembly/review config) and it is under the append size cap; otherwise a fresh pipeline is created and becomes the new append target. Under append, completion is PER REQUEST: the run.completed webhook and GET /v1/run/{id} report this request's own documents (payloads carry run_id and are scoped to them), and the shared pipeline fires no pipeline-level run.* webhook.

ingestion_target, 'ingest' | 'extract'

How far the platform processes the run's documents beyond the Spec pipeline. ingest (default): after OCR, Stage-2 field capture runs asynchronously so the corpus becomes queryable by the agent surfaces (POST /v1/ask) and the pipeline's Transfer phase — the pipeline still starts the moment OCR markdown is ready, capture never delays it. extract: markdown-only; the documents are not askable.

dispatch, boolean

false = none of the Spec's Dispatch nodes fires for this request's payloads (multipart carries it as the string "true"/"false"). The shorthand for bindings with every node set to null. A skipped node is recorded as a skipped dispatch on the pipeline (GET /v1/pipelines/{id}/dispatches) and cannot be re-dispatched; a manual trigger of the node still works. Legacy document.structured / run.completed deliveries are not affected. Named dispatch, not deliver: the Spec already has a deliver (Data Product) stage.

bindings, string

Optional JSON string of { [dispatchNodeId]: destinationId | null }. Per Dispatch node of the Spec's published version: deliver this request's payloads to that destination instead of each binding's own (every binding of the node is re-pointed as a unit, keeping its field map, serializer and retry policy), or null to skip that node. Keys are the node ids shown in the Spec editor and in dispatch.* binding filters (stable per Spec version; a node re-added after deletion mints a new id). A key is accepted when the node is on the Spec's published version OR on the newest pipeline's frozen rail: the early trigger modes read the published version, on_run_completed reads the rail frozen when the pipeline was created (an append request reuses it), and a node on only one side is accepted with a warnings[] entry. 400 invalid_delivery_controls when a key names no Dispatch node, a value is not an active destination of this workspace, a value's connector cannot carry one of the node's bindings, or dispatch=false is combined with a non-null value. A node with no active binding is accepted with a warnings[] entry. Controls attach to a document's FIRST request on a pipeline (a re-submitted document keeps its original request's controls for later re-emissions). Under append, a pipeline-level payload (assembly / data product) ships the non-skipping requests' records and applies an override only when every contributing request names the same destination.

Response

Ingest + run accepted.

object required
run_id, string uuid
spec_id, string uuid
status, 'processing'
input_count, integer

Total files + file_urls accepted.

poll_url, string
documents, object[]

One entry per input, in input order — multipart files (in request order) first, then file_urls; documents.length === input_count. Byte-identical inputs in the same request share one processing identity, so GET /v1/run/{id}'s progress.total_documents can be lower than input_count. A byte-identical re-upload from a later request gets its own occurrence id and carries duplicate_of.

warnings, object[]

Present only when the accepted request carries a non-fatal note: no_binding_for_node (a bindings override names a Dispatch node that has no active binding, so nothing will be delivered for it); node_not_in_live_pipeline (the node is on the published version but not on the newest pipeline's frozen rail — if this request appends onto that pipeline, its on_run_completed trigger cannot see the node; the early trigger modes can); node_not_on_published_version (the node exists only on that pipeline's frozen rail — it governs on_run_completed there and nothing else).

Example response

{
  "poll_url": "/v1/run/3d44a4dc-e3e4-4bca-b079-a9c85bf75026",
  "documents": [
    {
      "document_id": "3d44a4dc-e3e4-4bca-b079-a9c85bf75026",
      "filename": "invoice.pdf",
      "size_bytes": 148213,
      "source": "file",
      "deduplicated": false
    }
  ]
}

Changes

No recorded changes to this operation across all 32 revisions of this API.