@talonic/docs 0.21.8 → 0.21.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/content.js CHANGED
@@ -16619,7 +16619,7 @@ var sections28 = [
16619
16619
  "`delivery.failed` \u2014 An outbound delivery failed after all retry attempts.",
16620
16620
  "`process.completed` \u2014 A document processing run finished all steps and the result is available.",
16621
16621
  "`process.failed` \u2014 A document processing run failed. The error payload includes the step name and error detail.",
16622
- "`run.completed` \u2014 A `POST /v1/run` Spec pipeline finished; structured output is available (review-held fields null). The payload carries `records[]` \u2014 always an array, one `{document_id, filename, data}` entry per output row \u2014 alongside the legacy `structured_data` field kept for compatibility; prefer `records`.",
16622
+ "`run.completed` \u2014 A `POST /v1/run` Spec pipeline finished; structured output is available (review-held fields null). The payload carries `records[]` \u2014 always an array, one `{document_id, filename, data, metadata?, batch_id?}` entry per output row (`metadata`/`batch_id` are the submitting request's per-input tags, present only when set) \u2014 alongside the legacy `structured_data` field kept for compatibility; prefer `records`.",
16623
16623
  "`run.failed` \u2014 A `POST /v1/run` Spec pipeline failed because every document errored during ingest or extraction. When the failure occurred at the ingest leg, the `error` payload includes `document_ids`, the best-effort list of documents that were being ingested."
16624
16624
  ] },
16625
16625
  { type: "paragraph", text: "Most integrations subscribe to `extraction.complete` to trigger downstream processing, for example writing structured data to a database or notifying a user. A typical workflow is to pass `webhook_url` on `POST /v1/extract`, then handle the callback payload in your server without polling. New webhook configurations subscribe to `extraction.complete` and `extraction.failed` by default." },
@@ -16640,7 +16640,9 @@ var sections28 = [
16640
16640
  {
16641
16641
  "document_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
16642
16642
  "filename": "invoice-0847.pdf",
16643
- "data": { "vendor_name": "Acme Corp", "total_amount": 14250.00 }
16643
+ "data": { "vendor_name": "Acme Corp", "total_amount": 14250.00 },
16644
+ "metadata": { "source_system": "sap", "priority": 1, "cost_center": "AP-14" },
16645
+ "batch_id": "ERP-2026-07-14-001"
16644
16646
  }
16645
16647
  ],
16646
16648
  "structured_data": [
@@ -16661,10 +16663,10 @@ var sections28 = [
16661
16663
  { question: "What webhook events does Talonic send?", answer: "Events spanning the document, job, and run lifecycle: document.uploaded, document.processing, document.classified, extraction.started, extraction.complete, extraction.failed, job.created, job.started, job.phase_complete, job.complete, job.failed, review.approved, delivery.sent, delivery.failed, process.completed, process.failed, run.completed, and run.failed." },
16662
16664
  { question: "How do I subscribe to Talonic webhook events?", answer: "Create a webhook configuration with POST /v1/webhooks, passing your endpoint URL and an events array. If you omit events, the webhook subscribes to extraction.complete and extraction.failed by default. For a one-off callback, pass webhook_url directly on POST /v1/extract." },
16663
16665
  { question: "What is in the extraction.complete webhook payload?", answer: "The payload body contains event, delivery_id, timestamp, and a data object with document_id, extraction_id, filename, field_count, and confidence_overall. Fetch the full extracted fields with GET /v1/extractions/:id using the extraction_id." },
16664
- { question: "What is in the run.completed webhook payload?", answer: "The data object carries pipeline_id, schema_id, status, and records[] \u2014 always an array, one {document_id, filename, data} entry per output row, regardless of whether the run processed one document or many. The legacy structured_data field (a flat object for a single-document run, an array for multi-document) is still emitted for compatibility, but records is the field to build on since it always carries per-row document attribution." },
16666
+ { question: "What is in the run.completed webhook payload?", answer: "The data object carries pipeline_id, schema_id, status, and records[] \u2014 always an array, one {document_id, filename, data, metadata?, batch_id?} entry per output row, regardless of whether the run processed one document or many. metadata and batch_id are the submitting request's per-input tags (the merged bag if you used file_metadata), present only when the request set them. The legacy structured_data field (a flat object for a single-document run, an array for multi-document) is still emitted for compatibility, but records is the field to build on since it always carries per-row document attribution." },
16665
16667
  { question: "Can I get the list of supported events programmatically?", answer: "Yes. GET /v1/webhooks/events returns every supported event type with a description, so your integration can discover the catalog at runtime instead of hard-coding it." }
16666
16668
  ],
16667
- mentions: ["webhook events", "real-time notifications", "extraction.complete", "event subscription", "HTTP POST callback", "document lifecycle", "run.completed", "run.failed", "records[]"]
16669
+ mentions: ["webhook events", "real-time notifications", "extraction.complete", "event subscription", "HTTP POST callback", "document lifecycle", "run.completed", "run.failed", "records[]", "file_metadata", "batch_id"]
16668
16670
  },
16669
16671
  {
16670
16672
  slug: "webhook-security",
@@ -30252,6 +30254,7 @@ var sections52 = [
30252
30254
  { type: "paragraph", text: 'The **Run** endpoint, `POST /v1/run`, is the one-call front door for Spec pipelines: send one or more documents together with a `spec_id`, and the platform ingests every input, waits for OCR, compiles the Spec\'s saved rail into a pipeline, and starts it \u2014 extraction, resolution, validation, and delivery exactly as composed in the Spec editor. It replaces the two-step "upload documents, then `POST /v1/pipelines`" flow for integrations that push files as they arrive.' },
30253
30255
  { type: "paragraph", text: "Inputs are flexible: attach up to 20 `files` as multipart parts, pass remote `file_urls` for documents the platform should download, or mix both in one call. At least one input is required. The endpoint always answers `202 Accepted` immediately with a `run_id` and a `poll_url` \u2014 ingestion and the pipeline run continue asynchronously, so the caller never blocks on OCR or LLM work." },
30254
30256
  { type: "paragraph", text: "Two optional tagging fields ride along and are stamped on **every document** the call ingests: `batch_id`, an opaque grouping key for correlating the run with an external job or batch, and `metadata`, a flat key-value object for anything else the caller wants to carry through. Both are echoed back by `GET /v1/run/:id`, and both surface on the ingested documents (`batch_id` / `metadata` on the document reads)." },
30257
+ { type: "paragraph", text: "For a multi-file call, `file_metadata` tags individual inputs instead of stamping the same bag on every document: a JSON string keyed by each file's uploaded filename (or the exact `file_urls` entry), each value a flat object with the same shape and limits as `metadata`. Per file, its bag is merged over the call-level `metadata` \u2014 per-file wins on a shared key \u2014 and the resolved, per-input EFFECTIVE bag is what actually lands on the document and is echoed back in `documents[].metadata` on both this response and `GET /v1/run/:id`." },
30255
30258
  { type: "paragraph", text: "The 202 response carries a `documents[]` array \u2014 one entry per input, in the order you sent them \u2014 so you always know which platform document each upload became. Each entry has `document_id`, `filename`, `size_bytes`, and `source` (`file` or `file_url`). `document_id` is the **canonical** document: for a byte-identical re-upload it resolves to the existing document already on the platform rather than minting a new one, and the entry additionally carries `deduplicated: true` plus `linked_document_id`, the id of the thin per-upload link row created for this call. A first-time upload carries `deduplicated: false` and no `linked_document_id`." },
30256
30259
  { type: "paragraph", text: "The `ingestion_target` field controls how deep ingestion goes after OCR. The default, `ingest`, makes every document **askable**: once a document's OCR markdown is ready, Stage-2 field capture runs asynchronously in the background, extracting every field into the workspace corpus that [`POST /v1/ask`](post-ask) answers over and feeding the field registry. Capture follows the answers, it never delays them: the Spec pipeline starts the moment OCR markdown is ready, without waiting for capture. Pass `extract` to restore markdown-only ingestion: no background capture runs, and the documents do not join the askable corpus." },
30257
30260
  { type: "callout", variant: "info", text: "Unlike POST /v1/process, this endpoint does not deduplicate submissions \u2014 every call starts a fresh run. Byte-identical documents are still content-deduplicated at the ingestion layer (the run reads the canonical document's data)." },
@@ -30272,11 +30275,17 @@ var sections52 = [
30272
30275
  { name: "name", type: "string", description: "Optional display name for the run (max 200 chars)." },
30273
30276
  { name: "batch_id", type: "string", description: "Optional opaque grouping key (max 200 chars), stamped on every ingested document and echoed by GET /v1/run/:id." },
30274
30277
  { name: "metadata", type: "string", description: "Optional JSON string of a FLAT object { key: string | number | boolean | null }. Nested objects/arrays are rejected 400. Limits: \u226450 keys, key \u2264128 chars, string value \u22641024 chars. Persisted on the run and stamped on every ingested document." },
30278
+ { name: "file_metadata", type: "string", description: "Optional JSON string of a map { inputKey: { key: string | number | boolean | null } } for tagging individual files in a multi-file call. inputKey is the file's uploaded filename (matching what documents[] echoes back) or the exact file_urls entry. Per key, the file's bag is merged over the call-level metadata \u2014 per-file wins, and null overrides rather than deletes. A key matching no input 400s as invalid_metadata; a key matching several same-named files applies to all of them. Capped at 20 entries and 64 KB of decoded JSON." },
30279
+ { name: "pipeline_mode", type: "string", description: `Optional: "new" or "append". Overrides the Spec's configured pipeline mode for this call. append adds the documents to the newest eligible existing pipeline on the Spec instead of creating one, so bulk uploads accumulate into a single growing table. Omitted \u2192 the Spec's own setting (default new).` },
30275
30280
  { name: "ingestion_target", type: "string", default: "ingest", description: "ingest (default) or extract. ingest kicks async Stage-2 field capture after OCR so the documents become askable via POST /v1/ask; the Spec pipeline starts on the OCR markdown either way and never waits for capture. extract is markdown-only: no capture, documents are not askable." }
30276
30281
  ]
30277
30282
  }
30278
30283
  ]
30279
30284
  },
30285
+ { type: "heading", level: 2, id: "run-spec-append", text: "Append mode" },
30286
+ { type: "paragraph", text: "By default every `/v1/run` call creates its own pipeline. When the Spec's Source stage sets **pipeline mode: append** (or the call passes `pipeline_mode=append`), the platform instead appends the call's documents to the newest eligible existing pipeline for the Spec \u2014 so pushing 1,000 documents over many calls produces one growing table instead of one pipeline per call. A pipeline is eligible while its configuration still matches the Spec (schema fields, policies, validation gates, assembly and review config) and it is under the append size cap; a config edit or a full pipeline simply rotates to a fresh pipeline, which becomes the next calls' append target. No call ever fails because appending was not possible." },
30287
+ { type: "paragraph", text: "Under append mode, completion is **per request**, not per pipeline: the `run.completed` webhook fires when *this request's own documents* finish (its `structured_data` and `records[]` are scoped to them, and the payload carries the request's `run_id`), and `GET /v1/run/:id` reports status and progress for the request's documents only. The shared pipeline fires no pipeline-level `run.*` webhook of its own. Per-document `document.structured` deliveries are unaffected." },
30288
+ { type: "callout", variant: "info", text: "Append mode changes only how runs target pipelines \u2014 extraction, resolution, validation, and delivery behave identically. Set it once on the Spec's Source stage for connector-style integrations that push files continuously; use the per-call pipeline_mode override to force a fresh pipeline (e.g. a clean monthly table) without touching the Spec." },
30280
30289
  {
30281
30290
  type: "code",
30282
30291
  title: "curl",
@@ -30286,6 +30295,7 @@ var sections52 = [
30286
30295
  -F "spec_id=1fc7807e-e1aa-4504-b796-5709986e78ed" \\
30287
30296
  -F "batch_id=ERP-2026-07-14-001" \\
30288
30297
  -F 'metadata={"source_system":"sap","priority":1}' \\
30298
+ -F 'file_metadata={"invoice-0847.pdf":{"cost_center":"AP-14"}}' \\
30289
30299
  -F "files=@invoice-0847.pdf" \\
30290
30300
  -F "file_urls=https://example.com/contracts/msa-2026.pdf"`
30291
30301
  },
@@ -30305,7 +30315,8 @@ var sections52 = [
30305
30315
  { name: "documents[].size_bytes", type: "integer | null", description: "File size in bytes." },
30306
30316
  { name: "documents[].source", type: "string", description: '"file" or "file_url" \u2014 which input kind produced this document.' },
30307
30317
  { name: "documents[].deduplicated", type: "boolean", description: "true when this upload content-matched an existing document; document_id then points at that existing (canonical) document." },
30308
- { name: "documents[].linked_document_id", type: "uuid", description: "Present only when deduplicated is true \u2014 the id of the thin link row created for this specific upload." }
30318
+ { name: "documents[].linked_document_id", type: "uuid", description: "Present only when deduplicated is true \u2014 the id of the thin link row created for this specific upload." },
30319
+ { name: "documents[].metadata", type: "object", description: "This input's EFFECTIVE metadata for this request \u2014 the call-level metadata merged with its file_metadata entry (per-file wins). Present only when set. Under byte-identical dedup this can differ from GET /v1/documents/:id's metadata, which keeps the canonical document's tags from its first submission \u2014 this echo is the authoritative source for what THIS call tagged." }
30309
30320
  ]
30310
30321
  },
30311
30322
  {
@@ -30323,7 +30334,8 @@ var sections52 = [
30323
30334
  "filename": "invoice-0847.pdf",
30324
30335
  "size_bytes": 184320,
30325
30336
  "source": "file",
30326
- "deduplicated": false
30337
+ "deduplicated": false,
30338
+ "metadata": { "source_system": "sap", "priority": 1, "cost_center": "AP-14" }
30327
30339
  },
30328
30340
  {
30329
30341
  "document_id": "9f1e2d3c-4b5a-6789-0123-456789abcdef",
@@ -30342,7 +30354,7 @@ var sections52 = [
30342
30354
  type: "param-table",
30343
30355
  title: "Error responses",
30344
30356
  params: [
30345
- { name: "400", type: "missing_spec_id / no_input / invalid_metadata", description: "spec_id absent or malformed, no file or file_url supplied, or metadata is not a valid flat JSON object." },
30357
+ { name: "400", type: "missing_spec_id / no_input / invalid_metadata", description: "spec_id absent or malformed, no file or file_url supplied, metadata is not a valid flat JSON object, or file_metadata fails validation (a bad per-file bag, the merged bag exceeding the caps, or a key that matches no file/file_url \u2014 the error names the offending key)." },
30346
30358
  { name: "401", type: "unauthorized", description: "Missing or invalid API key." },
30347
30359
  { name: "402", type: "insufficient_credits", description: "Credit balance too low for the ingest work \u2014 no documents are ingested and no run is created." },
30348
30360
  { name: "413", type: "file_too_large", description: "A file exceeds your tier's per-file size cap." },
@@ -30364,9 +30376,11 @@ var sections52 = [
30364
30376
  { question: "Does polling count against my rate limit?", answer: "Polling GET /v1/run/:id is metered under the general read namespace, not the run submission namespace \u2014 frequent polling never burns your daily submission quota." },
30365
30377
  { question: "What happens if I run out of credits?", answer: "The call is rejected up front with 402 insufficient_credits before any document is ingested \u2014 no partial run is created. Top up and resubmit the same call." },
30366
30378
  { question: "What does ingestion_target do?", answer: "It sets how deep ingestion goes after OCR. The default, ingest, kicks asynchronous Stage-2 field capture once a document's OCR markdown is ready, which puts the document into the corpus POST /v1/ask answers over and feeds the field registry. The Spec pipeline starts on the OCR markdown in both modes and never waits for capture, so the default costs you no run latency. Pass extract for the old markdown-only behavior; those documents will not be askable." },
30367
- { question: "How do I match run.completed results back to my uploads?", answer: "Use document_id. Each entry in the submit response's documents[] array carries the canonical document_id for that input, and each row in the run.completed webhook's records[] array carries the same document_id (plus filename) for the output it produced \u2014 join on that field to attribute a structured row back to the file or URL you sent. For a deduplicated upload (deduplicated: true), document_id points at the pre-existing canonical document, and linked_document_id identifies the link row created for this specific call." }
30379
+ { question: "How do I match run.completed results back to my uploads?", answer: "Use document_id. Each entry in the submit response's documents[] array carries the canonical document_id for that input, and each row in the run.completed webhook's records[] array carries the same document_id (plus filename) for the output it produced \u2014 join on that field to attribute a structured row back to the file or URL you sent. For a deduplicated upload (deduplicated: true), document_id points at the pre-existing canonical document, and linked_document_id identifies the link row created for this specific call." },
30380
+ { question: "Should I use append mode for bulk uploads?", answer: "Yes, when you want one accumulated table: with pipeline_mode=append (or the Spec's Source stage set to append) every call adds its documents to the same pipeline, and each request still gets its own run.completed webhook scoped to its own documents. Keep the default (new) when each call should produce an isolated pipeline \u2014 e.g. one pipeline per customer folder." },
30381
+ { question: "How do I tag individual files differently in one call?", answer: "Use file_metadata instead of (or alongside) metadata: a JSON string mapping each file's filename, or each file_urls entry, to its own flat metadata object. Per file, that bag is merged over the call-level metadata \u2014 per-file wins on a shared key \u2014 and the resolved bag lands on the document and is echoed in documents[].metadata. A key that does not match any file or URL in the call fails the whole request with a 400 naming the bad key, so a typo never silently tags nothing." }
30368
30382
  ],
30369
- mentions: ["spec", "pipeline run", "one-call ingest", "batch_id", "client metadata", "multipart upload", "file_urls", "webhook", "documents[]", "deduplication", "linked_document_id"]
30383
+ mentions: ["spec", "pipeline run", "one-call ingest", "batch_id", "client metadata", "file_metadata", "multipart upload", "file_urls", "webhook", "documents[]", "deduplication", "linked_document_id", "pipeline_mode", "append mode"]
30370
30384
  },
30371
30385
  {
30372
30386
  slug: "poll-spec-run",
@@ -30405,6 +30419,7 @@ var sections52 = [
30405
30419
  { name: "spec_id", type: "uuid", description: "The Spec being run." },
30406
30420
  { name: "status", type: "string", description: "processing, completed, or failed. processing covers both the pre-pipeline ingestion/OCR wait and the pipeline actually executing." },
30407
30421
  { name: "pipeline_id", type: "uuid | null", description: "The compiled pipeline, once it exists." },
30422
+ { name: "pipeline_mode", type: "string", description: "Present only when recorded: the effective mode the run resolved to (new or append). Under append the pipeline is shared across requests, and status/progress are scoped to THIS request's own documents." },
30408
30423
  { name: "input_count", type: "integer", description: "Total inputs accepted at submission." },
30409
30424
  { name: "batch_id", type: "string | null", description: "The caller grouping key supplied on submission, echoed back." },
30410
30425
  { name: "metadata", type: "object | null", description: "The validated flat metadata object supplied on submission, echoed back." },
@@ -30412,6 +30427,7 @@ var sections52 = [
30412
30427
  { name: "progress", type: "object | null", description: "Present once the pipeline has started: total_documents, completed_documents, error_documents." },
30413
30428
  { name: "documents[]", type: "array", description: "The submit-time documents[] array, each entry augmented with a per-document status. Omitted for runs submitted before this field existed." },
30414
30429
  { name: "documents[].status", type: "string", description: "processing, completed, or failed for this specific document." },
30430
+ { name: "documents[].metadata", type: "object", description: "This input's EFFECTIVE per-request metadata (call-level metadata merged with its file_metadata entry, per-file wins), echoed from submission. Present only when set." },
30415
30431
  { name: "created_at", type: "string", description: "ISO 8601 submission timestamp." },
30416
30432
  { name: "updated_at", type: "string", description: "ISO 8601 last-transition timestamp." }
30417
30433
  ]
@@ -30439,6 +30455,7 @@ var sections52 = [
30439
30455
  "size_bytes": 184320,
30440
30456
  "source": "file",
30441
30457
  "deduplicated": false,
30458
+ "metadata": { "source_system": "sap", "priority": 1, "cost_center": "AP-14" },
30442
30459
  "status": "completed"
30443
30460
  }
30444
30461
  ],
@@ -30465,9 +30482,10 @@ var sections52 = [
30465
30482
  { question: "What do the three statuses mean?", answer: "processing = the run is in flight \u2014 either ingestion/OCR before a pipeline exists, or the Spec's compiled pipeline actually executing (both fold to the same word); completed = the run finished with usable output; failed = no usable output (every document errored, or ingestion itself failed \u2014 see error_message)." },
30466
30483
  { question: "When does a run count as failed?", answer: "Only when every document errored. A partially successful run \u2014 some documents completed, some errored \u2014 reports completed, with the error count in progress.error_documents, and the failing documents visible on the pipeline." },
30467
30484
  { question: "Where is the structured output?", answer: "Per document, at your delivery destinations: configure a binding on the document.structured signal (pipeline.capture deliverable) and each document's structured fields are pushed as a payload when it finishes. Alternatively read the pipeline's data product or record set via pipeline_id, or subscribe to run.completed and read its records[] array." },
30468
- { question: "What does the per-document status in documents[] tell me?", answer: "Whether that specific input has finished, independent of the overall run: processing, completed, or failed. This lets you show progress for individual uploads in a multi-file run instead of waiting for every document to settle. It is derived from live pipeline-document state, so it can complete before the top-level run status does." }
30485
+ { question: "What does the per-document status in documents[] tell me?", answer: "Whether that specific input has finished, independent of the overall run: processing, completed, or failed. This lets you show progress for individual uploads in a multi-file run instead of waiting for every document to settle. It is derived from live pipeline-document state, so it can complete before the top-level run status does." },
30486
+ { question: "What changes when pipeline_mode is append?", answer: "The pipeline behind the run is shared by many requests, so the poll reports YOUR request: status folds over this request's own documents (completed once they are all terminal, failed only when they all errored), and progress counts them \u2014 not the whole shared pipeline. The run.completed webhook is scoped the same way and carries this run_id." }
30469
30487
  ],
30470
- mentions: ["run status", "polling", "pipeline progress", "batch_id", "metadata echo", "run.completed webhook", "documents[] status"]
30488
+ mentions: ["run status", "polling", "pipeline progress", "batch_id", "metadata echo", "file_metadata", "run.completed webhook", "documents[] status"]
30471
30489
  }
30472
30490
  ];
30473
30491
 
package/dist/index.js CHANGED
@@ -916,7 +916,7 @@ function ApiReference({ LinkComponent }) {
916
916
  /* @__PURE__ */ jsx5(
917
917
  Sidebar,
918
918
  {
919
- title: "API Documentation",
919
+ title: "API Reference",
920
920
  sections: NAV_SECTIONS,
921
921
  activeId,
922
922
  onNavigate: handleNavigate,
@@ -1948,7 +1948,8 @@ function ApiReference({ LinkComponent }) {
1948
1948
  { name: "file_urls", type: "string[]", description: "Zero or more remote document URLs the platform downloads." },
1949
1949
  { name: "name", type: "string", description: "Optional display name for the run (max 200 chars)." },
1950
1950
  { name: "batch_id", type: "string", description: "Optional opaque grouping key (max 200 chars), stamped on every ingested document and echoed when polling." },
1951
- { name: "metadata", type: "string", description: "Optional JSON string of a FLAT object { key: string | number | boolean | null }. Nested objects/arrays rejected 400. Limits: \u226450 keys, key \u2264128 chars, string value \u22641024 chars. Stamped on every ingested document." }
1951
+ { name: "metadata", type: "string", description: "Optional JSON string of a FLAT object { key: string | number | boolean | null }. Nested objects/arrays rejected 400. Limits: \u226450 keys, key \u2264128 chars, string value \u22641024 chars. Stamped on every ingested document." },
1952
+ { name: "file_metadata", type: "string", description: "Optional JSON string of a map { inputKey: { key: string | number | boolean | null } } for tagging individual files in a multi-file call. inputKey is the file's uploaded filename (matching what documents[] echoes back) or the exact file_urls entry. Per key, the file's bag is merged over the call-level metadata \u2014 per-file wins, and null overrides rather than deletes. A key matching no input 400s as invalid_metadata; a key matching several same-named files applies to all of them. Capped at 20 entries and 64 KB of decoded JSON." }
1952
1953
  ]
1953
1954
  }
1954
1955
  ),
@@ -1957,6 +1958,7 @@ function ApiReference({ LinkComponent }) {
1957
1958
  -F "spec_id=1fc7807e-e1aa-4504-b796-5709986e78ed" \\
1958
1959
  -F "batch_id=ERP-2026-07-14-001" \\
1959
1960
  -F 'metadata={"source_system":"sap","priority":1}' \\
1961
+ -F 'file_metadata={"invoice-0847.pdf":{"cost_center":"AP-14"}}' \\
1960
1962
  -F "files=@invoice-0847.pdf"` }),
1961
1963
  /* @__PURE__ */ jsx5(CodeBlock, { title: "Response (202)", children: `{
1962
1964
  "run_id": "a8716d18-978d-4d19-8ca5-8b3784ca857c",
@@ -1970,7 +1972,8 @@ function ApiReference({ LinkComponent }) {
1970
1972
  "filename": "invoice-0847.pdf",
1971
1973
  "size_bytes": 184320,
1972
1974
  "source": "file",
1973
- "deduplicated": false
1975
+ "deduplicated": false,
1976
+ "metadata": { "source_system": "sap", "priority": 1, "cost_center": "AP-14" }
1974
1977
  }
1975
1978
  ]
1976
1979
  }` }),
@@ -1989,14 +1992,21 @@ function ApiReference({ LinkComponent }) {
1989
1992
  /* @__PURE__ */ jsx5("code", { children: "deduplicated: true" }),
1990
1993
  " plus ",
1991
1994
  /* @__PURE__ */ jsx5("code", { children: "linked_document_id" }),
1992
- ", the id of the thin per-upload link row created for that call."
1995
+ ", the id of the thin per-upload link row created for that call. Each entry\\'s optional",
1996
+ " ",
1997
+ /* @__PURE__ */ jsx5("code", { children: "metadata" }),
1998
+ " is that input\\'s EFFECTIVE bag \u2014 call-level ",
1999
+ /* @__PURE__ */ jsx5("code", { children: "metadata" }),
2000
+ " merged with its ",
2001
+ /* @__PURE__ */ jsx5("code", { children: "file_metadata" }),
2002
+ " entry, per-file winning on a shared key \u2014 present only when set."
1993
2003
  ] }),
1994
2004
  /* @__PURE__ */ jsx5(
1995
2005
  ParamTable,
1996
2006
  {
1997
2007
  title: "Errors",
1998
2008
  params: [
1999
- { name: "400", type: "error", description: "Missing spec_id, no input provided, or metadata is not a valid flat JSON object." },
2009
+ { name: "400", type: "error", description: "Missing spec_id, no input provided, metadata is not a valid flat JSON object, or file_metadata fails validation (a bad per-file bag, the merged bag exceeding the caps, or a key matching no file/file_url \u2014 the error names the offending key)." },
2000
2010
  { name: "402", type: "error", description: "Insufficient credits \u2014 rejected before any document is ingested." },
2001
2011
  { name: "413", type: "error", description: "A file exceeds your tier's per-file size cap." },
2002
2012
  { name: "429", type: "error", description: "Daily submission quota for the run namespace exhausted." }
@@ -2037,7 +2047,8 @@ function ApiReference({ LinkComponent }) {
2037
2047
  { name: "batch_id", type: "string | null", description: "The grouping key supplied on submission, echoed back." },
2038
2048
  { name: "metadata", type: "object | null", description: "The flat metadata object supplied on submission, echoed back." },
2039
2049
  { name: "progress", type: "object | null", description: "Once the pipeline started: total_documents, completed_documents, error_documents." },
2040
- { name: "documents[]", type: "array", description: "The submit-time documents[] array, each entry augmented with a per-document status (processing | completed | failed). Omitted for runs submitted before this field existed." }
2050
+ { name: "documents[]", type: "array", description: "The submit-time documents[] array, each entry augmented with a per-document status (processing | completed | failed). Omitted for runs submitted before this field existed." },
2051
+ { name: "documents[].metadata", type: "object", description: "This input's EFFECTIVE per-request metadata (call-level metadata merged with its file_metadata entry, per-file wins), echoed from submission. Present only when set. Under byte-identical dedup this can differ from GET /v1/documents/:id's metadata, which keeps the canonical document's tags from its first submission \u2014 this echo is authoritative for what THIS call tagged." }
2041
2052
  ]
2042
2053
  }
2043
2054
  ),
@@ -2061,6 +2072,7 @@ function ApiReference({ LinkComponent }) {
2061
2072
  "size_bytes": 184320,
2062
2073
  "source": "file",
2063
2074
  "deduplicated": false,
2075
+ "metadata": { "source_system": "sap", "priority": 1, "cost_center": "AP-14" },
2064
2076
  "status": "completed"
2065
2077
  }
2066
2078
  ],
@@ -4170,8 +4182,12 @@ function ApiReference({ LinkComponent }) {
4170
4182
  "A POST /v1/run Spec pipeline finished; structured output is available (review-held fields null). The payload carries ",
4171
4183
  /* @__PURE__ */ jsx5(InlineCode, { children: "records[]" }),
4172
4184
  " \u2014 always an array, one ",
4173
- /* @__PURE__ */ jsx5(InlineCode, { children: "{document_id, filename, data}" }),
4174
- " entry per output row \u2014 alongside the legacy ",
4185
+ /* @__PURE__ */ jsx5(InlineCode, { children: "{document_id, filename, data, metadata?, batch_id?}" }),
4186
+ " entry per output row (",
4187
+ /* @__PURE__ */ jsx5(InlineCode, { children: "metadata" }),
4188
+ "/",
4189
+ /* @__PURE__ */ jsx5(InlineCode, { children: "batch_id" }),
4190
+ " are the submitting request's per-input merged tags, echo-sourced and safe under dedup/append, present only when set) \u2014 alongside the legacy ",
4175
4191
  /* @__PURE__ */ jsx5(InlineCode, { children: "structured_data" }),
4176
4192
  " field kept for compatibility; prefer ",
4177
4193
  /* @__PURE__ */ jsx5(InlineCode, { children: "records" }),
@@ -5777,7 +5793,7 @@ function PlatformGuide({ LinkComponent }) {
5777
5793
  onNavigate: handleNavigate,
5778
5794
  mobileOpen: mobileNavOpen,
5779
5795
  onMobileClose: () => setMobileNavOpen(false),
5780
- footerLinks: [{ label: "API Documentation", href: "/docs" }],
5796
+ footerLinks: [{ label: "API Reference", href: "/docs" }],
5781
5797
  LinkComponent: LinkComp
5782
5798
  }
5783
5799
  ),
@@ -5855,33 +5871,46 @@ function PlatformGuide({ LinkComponent }) {
5855
5871
  ] }, n)) }),
5856
5872
  /* @__PURE__ */ jsx6(SubHeading, { id: "getting-started", children: "Getting Started" }),
5857
5873
  /* @__PURE__ */ jsxs6(P, { children: [
5858
- "Navigate using the sidebar. The platform is organized into three primary sections:",
5859
- /* @__PURE__ */ jsx6("strong", { children: " Sources" }),
5860
- " (ingest), ",
5861
- /* @__PURE__ */ jsx6("strong", { children: "Structuring" }),
5862
- " (process & validate), and ",
5863
- /* @__PURE__ */ jsx6("strong", { children: "Outputs" }),
5864
- " (deliver)."
5874
+ "Navigate using the sidebar, a flat set of sections that follow the flow left to right: ingest with ",
5875
+ /* @__PURE__ */ jsx6("strong", { children: "Sources" }),
5876
+ " and ",
5877
+ /* @__PURE__ */ jsx6("strong", { children: "Documents" }),
5878
+ ", browse the field registry in ",
5879
+ /* @__PURE__ */ jsx6("strong", { children: "Explore" }),
5880
+ ", compose a ",
5881
+ /* @__PURE__ */ jsx6("strong", { children: "Spec" }),
5882
+ " and run it under ",
5883
+ /* @__PURE__ */ jsx6("strong", { children: "Pipelines" }),
5884
+ ", approve held fields in ",
5885
+ /* @__PURE__ */ jsx6("strong", { children: "Review" }),
5886
+ ", and deliver through ",
5887
+ /* @__PURE__ */ jsx6("strong", { children: "Data Products" }),
5888
+ "."
5865
5889
  ] }),
5866
5890
  /* @__PURE__ */ jsx6(UiExcerpt, { title: "Sidebar Navigation", caption: "The sidebar provides access to all sections. Click the collapse button to save space. Press Cmd+K for global search.", children: /* @__PURE__ */ jsxs6("div", { className: "w-48 border border-void-border rounded-lg bg-void-bg p-3 space-y-0.5", children: [
5867
- /* @__PURE__ */ jsx6(MockNavItem, { label: "Dashboard" }),
5868
5891
  /* @__PURE__ */ jsx6(MockNavItem, { label: "Sources", active: true }),
5869
- /* @__PURE__ */ jsx6(MockNavItem, { label: "Documents", indent: true }),
5870
- /* @__PURE__ */ jsx6(MockNavItem, { label: "Field Registry", indent: true }),
5871
- /* @__PURE__ */ jsx6(MockNavItem, { label: "Structuring" }),
5872
- /* @__PURE__ */ jsx6(MockNavItem, { label: "Schemas", indent: true }),
5873
- /* @__PURE__ */ jsx6(MockNavItem, { label: "Cases", indent: true }),
5874
- /* @__PURE__ */ jsx6(MockNavItem, { label: "Runs", indent: true }),
5875
- /* @__PURE__ */ jsx6(MockNavItem, { label: "Validation", indent: true }),
5876
- /* @__PURE__ */ jsx6(MockNavItem, { label: "Outputs" })
5892
+ /* @__PURE__ */ jsx6(MockNavItem, { label: "Documents" }),
5893
+ /* @__PURE__ */ jsx6(MockNavItem, { label: "Explore" }),
5894
+ /* @__PURE__ */ jsx6(MockNavItem, { label: "Spec" }),
5895
+ /* @__PURE__ */ jsx6(MockNavItem, { label: "Pipelines" }),
5896
+ /* @__PURE__ */ jsx6(MockNavItem, { label: "Review" }),
5897
+ /* @__PURE__ */ jsx6(MockNavItem, { label: "Data Products" })
5877
5898
  ] }) }),
5878
5899
  /* @__PURE__ */ jsxs6(Callout, { children: [
5879
5900
  "The fastest path to results: upload documents in ",
5880
5901
  /* @__PURE__ */ jsx6("strong", { children: "Sources" }),
5881
- ", then go to",
5902
+ ", then use",
5882
5903
  " ",
5883
- /* @__PURE__ */ jsx6("strong", { children: "Structuring \u2192 Runs \u2192 New" }),
5884
- " to create your first extraction job."
5904
+ /* @__PURE__ */ jsx6("strong", { children: "Extract" }),
5905
+ " (\u2318J) for a quick single run, or compose a",
5906
+ " ",
5907
+ /* @__PURE__ */ jsx6("strong", { children: "Spec" }),
5908
+ " and run it as a ",
5909
+ /* @__PURE__ */ jsx6("strong", { children: "Pipeline" }),
5910
+ " shown under",
5911
+ " ",
5912
+ /* @__PURE__ */ jsx6("strong", { children: "Pipelines" }),
5913
+ "."
5885
5914
  ] }),
5886
5915
  /* @__PURE__ */ jsx6(SectionHeading, { id: "agent", children: "AI Agent" }),
5887
5916
  /* @__PURE__ */ jsxs6(P, { children: [
@@ -6038,15 +6067,15 @@ function PlatformGuide({ LinkComponent }) {
6038
6067
  ] }),
6039
6068
  /* @__PURE__ */ jsx6(P, { children: 'Documents sharing the same ontology type are automatically merged into one document type. When a new canonical type appears, it is auto-created with ontology metadata. Unresolvable documents are assigned "Unclassified Document".' }),
6040
6069
  /* @__PURE__ */ jsx6(SubHeading, { id: "document-detail", children: "Document Detail" }),
6041
- /* @__PURE__ */ jsx6(P, { children: "Click any document to see its detail page with four views:" }),
6070
+ /* @__PURE__ */ jsx6(P, { children: "Click any document to open its detail page: a data panel on the left with tabs, and a preview of the original file on the right." }),
6042
6071
  /* @__PURE__ */ jsx6(
6043
6072
  ParamTable,
6044
6073
  {
6045
6074
  params: [
6046
- { name: "Raw Extraction", type: "tab", description: "Every field the AI extracted, with confidence scores and source text." },
6047
- { name: "Resolved Data", type: "tab", description: "Fields mapped to the canonical registry with tier indicators." },
6048
- { name: "Processing Log", type: "tab", description: "Timeline of each processing stage with timing information." },
6049
- { name: "Original File", type: "tab", description: "View or download the source document." }
6075
+ { name: "All Extracted Fields", type: "tab", description: "Every field the AI extracted, with confidence scores and source text." },
6076
+ { name: "Used in", type: "tab", description: "The pipelines and data products this document contributes to." },
6077
+ { name: "Metadata", type: "tab", description: "Client-supplied metadata for the document. Shown only when the document carries metadata." },
6078
+ { name: "Processing Log", type: "tab", description: "Timeline of each processing stage with timing information. Administrators additionally see this tab, in advanced mode." }
6050
6079
  ]
6051
6080
  }
6052
6081
  ),
@@ -6061,7 +6090,7 @@ function PlatformGuide({ LinkComponent }) {
6061
6090
  /* @__PURE__ */ jsx6(SubHeading, { id: "field-registry", children: "Field Registry" }),
6062
6091
  /* @__PURE__ */ jsxs6(P, { children: [
6063
6092
  "Navigate to ",
6064
- /* @__PURE__ */ jsx6("strong", { children: "Sources \u2192 Field Registry" }),
6093
+ /* @__PURE__ */ jsx6("strong", { children: "Explore \u2192 Field Registry" }),
6065
6094
  " to explore the registry. Every canonical field is displayed with its tier, data type, occurrence count, and document types."
6066
6095
  ] }),
6067
6096
  /* @__PURE__ */ jsx6(UiExcerpt, { title: "Field Registry \u2014 Registry Table", caption: "Fields are organized by tier with occurrence counts, data types, and master instruction status.", children: /* @__PURE__ */ jsx6("div", { className: "border border-void-border rounded-lg overflow-hidden", children: /* @__PURE__ */ jsxs6("table", { className: "w-full text-[12px]", children: [
@@ -6124,10 +6153,9 @@ function PlatformGuide({ LinkComponent }) {
6124
6153
  ),
6125
6154
  /* @__PURE__ */ jsx6(P, { children: "Resolution runs concurrently across documents. Each document\u2019s fields are resolved in an isolated transaction to prevent lock contention. Occurrence rates are updated after each transaction commits, keeping the registry eventually consistent without blocking concurrent ingestion." }),
6126
6155
  /* @__PURE__ */ jsxs6(Callout, { children: [
6127
- "Pending confirmations from the confirm band appear in",
6128
- " ",
6129
- /* @__PURE__ */ jsx6("strong", { children: "Resolution \u2192 Pending Confirmations" }),
6130
- ". Accept to merge into an existing cluster, or reject to create a new field."
6156
+ "Field clustering runs automatically as documents are processed \u2014 semantically similar fields are merged into canonical concepts with no manual confirmation step. Review the resulting clusters in ",
6157
+ /* @__PURE__ */ jsx6("strong", { children: "Explore \u2192 Field Registry" }),
6158
+ "."
6131
6159
  ] }),
6132
6160
  /* @__PURE__ */ jsx6(SubHeading, { id: "master-instructions", children: "Master Instructions" }),
6133
6161
  /* @__PURE__ */ jsxs6(P, { children: [
@@ -6146,10 +6174,12 @@ function PlatformGuide({ LinkComponent }) {
6146
6174
  /* @__PURE__ */ jsx6(P, { children: "For each document type, Talonic generates a schema containing all Tier 1 and Tier 2 fields with occurrences in that type. Generated schemas are versioned \u2014 new versions are created when the registry changes. You can diff any two versions to see what changed." }),
6147
6175
  /* @__PURE__ */ jsx6(SubHeading, { id: "user-templates", children: "User Templates" }),
6148
6176
  /* @__PURE__ */ jsxs6(P, { children: [
6149
- "User templates are the primary way to define your output structure. Navigate to",
6177
+ "User templates are the primary way to define your output structure. Open the",
6150
6178
  " ",
6151
- /* @__PURE__ */ jsx6("strong", { children: "Structuring \u2192 Schemas" }),
6152
- " to create one."
6179
+ /* @__PURE__ */ jsx6("strong", { children: "Spec" }),
6180
+ " composer (",
6181
+ /* @__PURE__ */ jsx6(InlineCode, { children: "/specs" }),
6182
+ ") to create one."
6153
6183
  ] }),
6154
6184
  /* @__PURE__ */ jsx6("div", { className: "my-6 space-y-2", children: [
6155
6185
  { n: "1", label: "Create template", desc: "Give it a name and description." },
@@ -6241,9 +6271,15 @@ function PlatformGuide({ LinkComponent }) {
6241
6271
  /* @__PURE__ */ jsx6(P, { children: "Extraction jobs are the core of the platform \u2014 where schemas meet documents and AI agents produce structured data. A job produces a grid: rows = documents, columns = schema fields." }),
6242
6272
  /* @__PURE__ */ jsx6(SubHeading, { id: "creating-job", children: "Creating a Job" }),
6243
6273
  /* @__PURE__ */ jsxs6(P, { children: [
6244
- "Navigate to ",
6245
- /* @__PURE__ */ jsx6("strong", { children: "Structuring \u2192 Runs \u2192 New" }),
6246
- ". Select your template and documents, then click Start. Results appear progressively as each phase completes."
6274
+ "Compose a ",
6275
+ /* @__PURE__ */ jsx6("strong", { children: "Spec" }),
6276
+ " (",
6277
+ /* @__PURE__ */ jsx6(InlineCode, { children: "/specs" }),
6278
+ ") over your template and run it as a ",
6279
+ /* @__PURE__ */ jsx6("strong", { children: "Pipeline" }),
6280
+ ", or use ",
6281
+ /* @__PURE__ */ jsx6("strong", { children: "Extract" }),
6282
+ " (\u2318J) for a quick one-off. Results appear progressively as each phase completes."
6247
6283
  ] }),
6248
6284
  /* @__PURE__ */ jsx6(SubHeading, { id: "pipeline-overview", children: "The 4-Phase Pipeline" }),
6249
6285
  /* @__PURE__ */ jsx6(P, { children: "Every job runs through four phases. Each fills more cells in the output grid, reducing the problem space for the next. Results are visible as each phase completes." }),
@@ -6480,16 +6516,21 @@ function PlatformGuide({ LinkComponent }) {
6480
6516
  /* @__PURE__ */ jsx6(SubHeading, { id: "dataset-templates", children: "Dataset Templates" }),
6481
6517
  /* @__PURE__ */ jsx6(P, { children: "A dataset template defines a reusable output specification: which schema to use, which document types to include, column mappings, and default transforms. Templates ensure consistent data product generation across teams and time periods." }),
6482
6518
  /* @__PURE__ */ jsxs6(P, { children: [
6483
- "Navigate to ",
6484
- /* @__PURE__ */ jsx6("strong", { children: "Data Products \u2192 Dataset Templates" }),
6485
- " to manage templates. Each template is linked to a user schema and can be versioned independently. When creating a new job, select a template instead of configuring the output from scratch."
6519
+ "Manage templates at ",
6520
+ /* @__PURE__ */ jsx6(InlineCode, { children: "/assemble/templates" }),
6521
+ ". Each template is linked to a user schema and can be versioned independently. When creating a new job, select a template instead of configuring the output from scratch."
6486
6522
  ] }),
6487
6523
  /* @__PURE__ */ jsx6(SubHeading, { id: "assemblies", children: "Assemblies" }),
6488
6524
  /* @__PURE__ */ jsx6(P, { children: "An assembly combines documents from one or more sources into a single structured dataset based on a template. Assemblies track their constituent documents, source counts, and processing status." }),
6489
6525
  /* @__PURE__ */ jsxs6(P, { children: [
6490
- "Navigate to ",
6491
- /* @__PURE__ */ jsx6("strong", { children: "Data Products \u2192 Assemblies" }),
6492
- " to view and create assemblies. Each assembly shows its document count, linked schema, processing status, and the date it was created."
6526
+ "Assembly is configured as a rule on a ",
6527
+ /* @__PURE__ */ jsx6("strong", { children: "Spec" }),
6528
+ ": when its ",
6529
+ /* @__PURE__ */ jsx6("strong", { children: "Pipeline" }),
6530
+ " ",
6531
+ "runs, related documents are composed into a single assembled record, which appears with the run and in its ",
6532
+ /* @__PURE__ */ jsx6("strong", { children: "Data Product" }),
6533
+ "."
6493
6534
  ] }),
6494
6535
  /* @__PURE__ */ jsx6(Callout, { children: "Assemblies are the recommended way to produce production datasets. They provide a single audit trail from source documents through extraction, resolution, and validation to the final output." }),
6495
6536
  /* @__PURE__ */ jsx6(SectionHeading, { id: "validation-quality", children: "Validation & Quality" }),
@@ -6500,7 +6541,7 @@ function PlatformGuide({ LinkComponent }) {
6500
6541
  /* @__PURE__ */ jsxs6(P, { children: [
6501
6542
  "Manually-created reference datasets with known-correct values. Create from",
6502
6543
  " ",
6503
- /* @__PURE__ */ jsx6("strong", { children: "Validation \u2192 Golden Samples" }),
6544
+ /* @__PURE__ */ jsx6("strong", { children: "Review \u2192 Benchmarks" }),
6504
6545
  ". Benchmark runs compare extraction results against golden samples for per-field accuracy scoring with AI judge verdicts."
6505
6546
  ] }),
6506
6547
  /* @__PURE__ */ jsx6(SubHeading, { id: "approval-gates", children: "Approval Gates" }),
@@ -6514,7 +6555,7 @@ function PlatformGuide({ LinkComponent }) {
6514
6555
  /* @__PURE__ */ jsx6(SubHeading, { id: "approval-queue", children: "Approval Queue" }),
6515
6556
  /* @__PURE__ */ jsxs6(P, { children: [
6516
6557
  "Results that do not meet auto-approval thresholds are routed to the Approval Queue. Navigate to ",
6517
- /* @__PURE__ */ jsx6("strong", { children: "Review \u2192 Approval Queue" }),
6558
+ /* @__PURE__ */ jsx6("strong", { children: "Review \u2192 Queue" }),
6518
6559
  " to see all pending items. Each row shows the source document, schema, confidence score, and whether the result has been flagged by a validation rule."
6519
6560
  ] }),
6520
6561
  /* @__PURE__ */ jsx6(P, { children: "Filter the queue by status (pending, flagged), schema, or confidence range. Click \u201CReview\u201D on any row to inspect the extracted values, provenance trails, and validation check results before approving or rejecting." }),
@@ -6552,8 +6593,8 @@ function PlatformGuide({ LinkComponent }) {
6552
6593
  /* @__PURE__ */ jsx6(SubHeading, { id: "destinations", children: "Destinations" }),
6553
6594
  /* @__PURE__ */ jsxs6(P, { children: [
6554
6595
  "A destination is a connector + configuration + optional credentials. Slice-1 ships the webhook connector; S3, Google Sheets, Drive, SFTP, and Email arrive in later slices. Use ",
6555
- /* @__PURE__ */ jsx6("strong", { children: "Delivery \u2192 Destinations" }),
6556
- " to manage them from the dashboard, or",
6596
+ /* @__PURE__ */ jsx6("strong", { children: "Data Products \u2192 Delivery \u2192 Destinations" }),
6597
+ " to manage them, or",
6557
6598
  " ",
6558
6599
  /* @__PURE__ */ jsx6(InlineCode, { children: "POST /v1/delivery/destinations" }),
6559
6600
  " via the API. Every destination supports a live-ping ",
@@ -6871,10 +6912,12 @@ function PlatformGuide({ LinkComponent }) {
6871
6912
  ),
6872
6913
  /* @__PURE__ */ jsx6(SubHeading, { id: "dialects", children: "Dialects" }),
6873
6914
  /* @__PURE__ */ jsxs6(P, { children: [
6874
- "Dialects define the output format for structured data. They control how values are serialized when delivered or exported. A dialect can be shared across schemas or defined inline for a specific schema. Configure dialects in the",
6915
+ "Dialects define the output format for structured data. They control how values are serialized when delivered or exported. A dialect can be shared across schemas or defined inline for a specific schema. Configure dialects from the dialects drawer on",
6875
6916
  " ",
6876
- /* @__PURE__ */ jsx6("strong", { children: "Schema \u2192 Delivery" }),
6877
- " tab."
6917
+ /* @__PURE__ */ jsx6("strong", { children: "Spec" }),
6918
+ " (",
6919
+ /* @__PURE__ */ jsx6(InlineCode, { children: "/specs?drawer=dialects" }),
6920
+ ")."
6878
6921
  ] }),
6879
6922
  /* @__PURE__ */ jsx6(
6880
6923
  ParamTable,