@talonic/docs 0.21.30 → 0.21.31

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
@@ -18166,7 +18166,8 @@ var sections31 = [
18166
18166
  "`process.completed` \u2014 A document processing run finished all steps and the result is available.",
18167
18167
  "`process.failed` \u2014 A document processing run failed. The error payload includes the step name and error detail.",
18168
18168
  "`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`.",
18169
- "`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."
18169
+ "`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.",
18170
+ "`run.cancelled` \u2014 A Spec pipeline was stopped through `POST /v1/run/:id/cancel` or `POST /v1/pipelines/:id/cancel`. Every live `/v1/run` request on the pipeline receives its own event (`run_id` set); the pipeline-level copy has none. The payload carries `reason` and `cancelled_at`, never output rows; results completed before the cancel stay readable."
18170
18171
  ] },
18171
18172
  { 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." },
18172
18173
  { type: "paragraph", text: "The `data` object of each payload is event-specific. For `extraction.complete` it includes the `document_id`, `extraction_id`, `filename`, `field_count`, and `confidence_overall` score. Use the `extraction_id` to fetch the full result via `GET /v1/extractions/:id` when the payload does not contain all the fields you need." },
@@ -33934,10 +33935,10 @@ var sections56 = [
33934
33935
  seoTitle: "Poll a Spec Run \u2014 GET /v1/run/:id \u2014 Talonic Docs",
33935
33936
  description: "Poll a /v1/run request by id: run status folded with live pipeline progress, per-document completion counts, and the echoed batch_id and metadata tags.",
33936
33937
  content: [
33937
- { type: "paragraph", text: "The **Poll a Run** endpoint, `GET /v1/run/:id`, reads a `/v1/run` request by the `run_id` returned on submission. The response folds the request row together with the compiled pipeline's live progress. The public status vocabulary is three states: `processing` covers both ingestion/OCR (before a pipeline exists) and the compiled pipeline actually executing, ending at `completed` or `failed`." },
33938
+ { type: "paragraph", text: "The **Poll a Run** endpoint, `GET /v1/run/:id`, reads a `/v1/run` request by the `run_id` returned on submission. The response folds the request row together with the compiled pipeline's live progress. The public status vocabulary is four states: `processing` covers both ingestion/OCR (before a pipeline exists) and the compiled pipeline actually executing, ending at `completed`, `failed`, or `cancelled` (the run, or the pipeline behind it, was stopped through `POST /v1/run/:id/cancel` or `POST /v1/pipelines/:id/cancel`)." },
33938
33939
  { type: "paragraph", text: "Once the pipeline exists, `pipeline_id` is set and a `progress` object reports per-document counts \u2014 how many documents finished, and how many errored. A run reports `failed` only when **every** document errored (no usable output); a run where some documents succeeded and some errored completes with the error count visible in `progress.error_documents`." },
33939
33940
  { type: "paragraph", text: "The response also echoes `documents[]` \u2014 the same array returned at submission, each entry augmented with a per-document `status` (`processing`, `completed`, or `failed`) so you can tell which specific inputs are still in flight without waiting for the whole run to finish. `documents[]` is omitted for runs submitted before this field existed." },
33940
- { type: "callout", variant: "info", text: "Poll this endpoint, not the pipeline: the run request is the stable public handle, and its status is folded live at read time. The same terminal states also fire the run.completed / run.failed webhooks, so poll or subscribe \u2014 whichever fits your integration." },
33941
+ { type: "callout", variant: "info", text: "Poll this endpoint, not the pipeline: the run request is the stable public handle, and its status is folded live at read time. The same terminal states also fire the run.completed / run.failed / run.cancelled webhooks, so poll or subscribe \u2014 whichever fits your integration. To stop a run, POST /v1/run/:id/cancel \u2014 it cancels the whole pipeline behind the request, including other requests appended to it." },
33941
33942
  {
33942
33943
  type: "endpoint",
33943
33944
  method: "GET",
@@ -33962,7 +33963,7 @@ var sections56 = [
33962
33963
  params: [
33963
33964
  { name: "run_id", type: "uuid", description: "The run request id." },
33964
33965
  { name: "spec_id", type: "uuid", description: "The Spec being run." },
33965
- { name: "status", type: "string", description: "processing, completed, or failed. processing covers both the pre-pipeline ingestion/OCR wait and the pipeline actually executing." },
33966
+ { name: "status", type: "string", description: "processing, completed, failed, or cancelled. processing covers both the pre-pipeline ingestion/OCR wait and the pipeline actually executing; cancelled means the run was stopped and finished documents keep their results." },
33966
33967
  { name: "pipeline_id", type: "uuid | null", description: "The compiled pipeline, once it exists." },
33967
33968
  { 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." },
33968
33969
  { name: "input_count", type: "integer", description: "Total inputs accepted at submission." },
@@ -34041,7 +34042,7 @@ var sections56 = [
34041
34042
  content: [
34042
34043
  { type: "paragraph", text: '`GET /v1/run/{id}/results` returns **this `/v1/run` request\'s own structured rows** as poll-able JSON \u2014 the same governed read behind `GET /v1/pipelines/{id}/results` (review holdback, demoted-field projection, `__` diagnostics filtering, assembly awareness), scoped to exactly the documents *this call* submitted. It answers "what did MY submitted documents produce," which is the question most `/v1/run` integrations actually have, without needing to track the compiled `pipeline_id` at all.' },
34043
34044
  { type: "paragraph", text: "This route is ALWAYS the per-document view, scoped to the request's own `documents[]` echo, uniformly across `new` and `append` pipeline modes. This is a **deliberate divergence** from the per-run `run.completed` webhook: for an unscoped, non-append assembly run, that webhook actually delivers COMPOSED rows. Composed output for an assembly run lives at `GET /v1/pipelines/{id}/results?view=composed` instead \u2014 this response's `links.composed_results` points there once a pipeline exists, so the divergence is always discoverable from the response itself." },
34044
- { type: "paragraph", text: "Only `document_id` and `include` filter the rows here. `run_id`, `view`, `since`, `until`, and `status` are pipeline-route-only parameters \u2014 supplying any of them 400s with `unsupported_filter` rather than silently ignoring it, since the run itself already IS the scope and its time window is already bounded. `include=cells,provenance,audit` behave exactly as on the pipeline route: `cells` for per-field value/status/confidence/source, `provenance` for a stable kind-tagged audit projection, `audit` for the bounded cell-version trail \u2014 see [Pipeline Results](get-pipeline-results) for the full shape and the held-value redaction rules (a held field's value is never exposed under any include)." },
34045
+ { type: "paragraph", text: "Only `document_id` and `include` filter the rows here. `run_id`, `view`, `since`, `until`, and `status` are pipeline-route-only parameters \u2014 supplying any of them 400s with `unsupported_filter` rather than silently ignoring it, since the run itself already IS the scope and its time window is already bounded. `include=cells,provenance,provenance.nested,audit` behave exactly as on the pipeline route: `cells` for per-field value/status/confidence/source, `provenance` for the per-field entry the webhook sidecar also carries (kind, quote, `match` grade, confidence, path, markdown offsets), `provenance.nested` for per-leaf entries of structured fields, `audit` for the bounded cell-version trail \u2014 see [Pipeline Results](get-pipeline-results) for the full shape and the held-value redaction rules (a held field's value is never exposed under any include)." },
34045
34046
  { type: "paragraph", text: "Two zero-states return `200` with an empty page and a `scope_note` explaining why \u2014 never `404` \u2014 since pollers hit these windows constantly: no compiled pipeline exists yet for this run (still ingesting, or it failed before a pipeline was created), or the run predates per-request document tracking (an echo-less legacy row whose membership is unknowable, so an honest empty page beats a guess). The envelope's `status` folds the same three-state vocabulary as `GET /v1/run/{id}` (`processing`/`completed`/`failed`) and, unlike the pipeline route's own `status`, it DOES settle even when the underlying pipeline is shared under append mode \u2014 poll this route, not the pipeline route, for append integrations that need a status that eventually reaches `completed`." },
34046
34047
  { type: "callout", variant: "info", text: 'Prefer this endpoint over GET /v1/pipelines/{id}/results whenever your integration thinks in terms of "my /v1/run call", not "the pipeline it landed on" \u2014 it needs no pipeline_id bookkeeping and its status always settles, even under append mode.' },
34047
34048
  {
@@ -34055,7 +34056,7 @@ var sections56 = [
34055
34056
  title: "Query parameters",
34056
34057
  params: [
34057
34058
  { name: "document_id", type: "string", description: "Comma-separated document UUIDs (1-100), intersected with this run's own documents echo." },
34058
- { name: "include", type: "string", description: "Comma-separated subset of cells, provenance, audit." },
34059
+ { name: "include", type: "string", description: "Comma-separated subset of cells, provenance, provenance.nested, audit." },
34059
34060
  { name: "limit", type: "integer", default: "25", description: "Maximum records per page (max 100)." },
34060
34061
  { name: "cursor", type: "string", description: "Pagination cursor from a previous response's pagination.next_cursor." }
34061
34062
  ]
@@ -39462,7 +39463,7 @@ curl -s -X POST "https://api.talonic.com/v1/pipelines/$PIPELINE_ID/data-product"
39462
39463
  { name: "until", type: "string", description: "ISO 8601 timestamp. Only records with completed_at at or before this bound." },
39463
39464
  { name: "status", type: "string", description: "Comma-separated subset of complete, partial, error, processing." },
39464
39465
  { name: "view", type: "string", description: "composed or documents. Defaults to composed when the run has an assembly product set, else documents." },
39465
- { name: "include", type: "string", description: "Comma-separated subset of cells, provenance, audit." },
39466
+ { name: "include", type: "string", description: "Comma-separated subset of cells, provenance, provenance.nested, audit. provenance.nested adds one entry per scalar leaf of a structured (array/object) field." },
39466
39467
  { name: "limit", type: "integer", default: "25", description: "Maximum records per page (max 100)." },
39467
39468
  { name: "cursor", type: "string", description: "Pagination cursor from a previous response's pagination.next_cursor." }
39468
39469
  ]
@@ -39490,7 +39491,7 @@ curl -s -X POST "https://api.talonic.com/v1/pipelines/$PIPELINE_ID/data-product"
39490
39491
  { name: "data", type: "array", description: "The result records for this page." },
39491
39492
  { name: "data[].fields", type: "object", description: "field_key -> clean value. Held fields are null; demoted fields and __ diagnostics are absent." },
39492
39493
  { name: "data[].cells", type: "object", description: "Present only with include=cells. field_key -> { value, status, confidence, source, document_id, filename }." },
39493
- { name: "data[].provenance", type: "object", description: "Present only with include=provenance. field_key -> { kind, text?, derived_reason?, source_document_id?, page_index? }." },
39494
+ { name: "data[].provenance", type: "object", description: "Present only with include=provenance. field_key -> { path, kind, match, text?, derived_reason?, source_document_id?, char_start?, char_end?, page_index?, confidence } \u2014 the same entry shape the pipeline.capture webhook sidecar carries. match (exact | approximate | none) grades the quote against GET /v1/documents/{id}/markdown; char_start/char_end are UTF-16 offsets into that markdown. Held fields project kind-only with match none." },
39494
39495
  { name: "data[].audit", type: "object", description: "Present only with include=audit. field_key -> the cell-version trail, held-redacted whole-trail if the latest version is held." },
39495
39496
  { name: "pagination", type: "object", description: "{ total, limit, has_more, next_cursor } \u2014 cursor keyed on record_id." },
39496
39497
  { name: "pending_review_count", type: "integer", description: "Held cells in this page's records only." },
@@ -39850,7 +39851,8 @@ curl -s https://api.talonic.com/v1/pipelines/a1b2c3d4-e5f6-7890-abcd-ef123456789
39850
39851
  related: [
39851
39852
  { label: "Get Pipeline", slug: "get-pipeline" },
39852
39853
  { label: "List Pipelines", slug: "list-pipelines" },
39853
- { label: "Run Pipeline", slug: "run-pipeline" }
39854
+ { label: "Run Pipeline", slug: "run-pipeline" },
39855
+ { label: "Cancel Pipeline", slug: "cancel-pipeline" }
39854
39856
  ],
39855
39857
  faq: [
39856
39858
  { question: "Does deleting a run delete its source documents?", answer: "No. Deletion removes the run's owned data (value cells, record sets, documents, field states), but the Spec's seed record set and the underlying source documents are untouched." },
@@ -39860,6 +39862,93 @@ curl -s https://api.talonic.com/v1/pipelines/a1b2c3d4-e5f6-7890-abcd-ef123456789
39860
39862
  { question: "What do reads of the run return after the delete?", answer: "GET /v1/pipelines/{id}, /progress, and /results all return 404 not_found once the delete commits, and the run no longer appears in GET /v1/pipelines. Treat that 404 as terminal in polling loops: stop polling and drop any cached poll URLs, since the id will never resolve again." }
39861
39863
  ],
39862
39864
  mentions: ["delete pipeline run", "value cells", "record sets", "tenant isolation", "irreversible deletion", "retention hold", "reconciliation case"]
39865
+ },
39866
+ {
39867
+ slug: "cancel-pipeline",
39868
+ parentSlug: "pipelines",
39869
+ title: "Cancel Pipeline",
39870
+ seoTitle: "Cancel a Running Pipeline \u2014 POST /v1/pipelines/:id/cancel \u2014 Talonic Docs",
39871
+ description: "Stop a running document processing pipeline: no new work starts, documents still in flight are marked cancelled, finished documents keep their results, and the run stays available for new submissions.",
39872
+ content: [
39873
+ { type: "paragraph", text: "`POST /v1/pipelines/{id}/cancel` **stops a running pipeline**. From the moment the call returns, no new phase starts for any of its documents; documents that were still mid-phase finish their current step and are then marked cancelled; documents that had already completed keep their results and stay readable through `GET /v1/pipelines/{id}/results`. The run's status becomes `cancelled`, and every live `POST /v1/run` request attached to the pipeline is cancelled with it (each receives its own `run.cancelled` webhook)." },
39874
+ { type: "paragraph", text: "A cancel is not a delete. Nothing is removed, and the pipeline keeps accepting work afterwards: a new `/v1/run` submission in append mode, `POST /v1/pipelines/{id}/rerun`, or adding documents reopens it exactly like a completed run. Cancelling stops further spend; it does not refund calls that were already made." },
39875
+ { type: "paragraph", text: "The call is idempotent. Cancelling a run that is already `completed`, `cancelled`, or `archived` returns `200` with `already: true` and changes nothing, so a retrying client never fails on its own success. Requires an API key with the `write` scope." },
39876
+ { type: "callout", variant: "info", text: "Documents that were in flight at the moment of the cancel finish their current phase before stopping (a single model call at most). The response's `documents.cancelled` count is final once `status` reads `cancelled`; poll `GET /v1/pipelines/{id}/progress` to watch the last documents drain." },
39877
+ {
39878
+ type: "endpoint",
39879
+ method: "POST",
39880
+ path: "/v1/pipelines/{id}/cancel",
39881
+ summary: "Stop a running pipeline.",
39882
+ blocks: [
39883
+ {
39884
+ type: "param-table",
39885
+ title: "Body parameters",
39886
+ params: [
39887
+ { name: "reason", type: "string", required: false, description: "Optional free text (up to 500 characters) recorded on the run and carried by the run.cancelled webhook." }
39888
+ ]
39889
+ }
39890
+ ]
39891
+ },
39892
+ {
39893
+ type: "code",
39894
+ language: "bash",
39895
+ title: "Request",
39896
+ code: `curl -X POST https://api.talonic.com/v1/pipelines/a1b2c3d4-e5f6-7890-abcd-ef1234567890/cancel \\
39897
+ -H "Authorization: Bearer $TALONIC_API_KEY" \\
39898
+ -H "Content-Type: application/json" \\
39899
+ -d '{"reason": "wrong Spec version"}'`
39900
+ },
39901
+ { type: "heading", level: 2, id: "cancel-pipeline-response", text: "Response" },
39902
+ {
39903
+ type: "param-table",
39904
+ title: "Response fields",
39905
+ params: [
39906
+ { name: "id", type: "string", description: "UUID of the pipeline run." },
39907
+ { name: "status", type: "string", description: "The run's status after the call: cancelled, or the terminal state it already had." },
39908
+ { name: "already", type: "boolean", description: "True when the run was already terminal and nothing changed." },
39909
+ { name: "cancelled_at", type: "string | null", description: "ISO-8601 timestamp of the cancellation." },
39910
+ { name: "documents", type: "object", description: "{ total, completed, cancelled, errored } \u2014 completed documents keep their results; cancelled are the ones this call stopped." },
39911
+ { name: "run_requests", type: "string[]", description: "run_ids of the /v1/run requests cancelled along with the pipeline." },
39912
+ { name: "jobs", type: "object", description: "{ removed, failed, scanned, scan_capped, timed_out } \u2014 best-effort removal of the run's queued jobs; a survivor stops at its next checkpoint." }
39913
+ ]
39914
+ },
39915
+ {
39916
+ type: "code",
39917
+ title: "Response",
39918
+ code: `{
39919
+ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
39920
+ "status": "cancelled",
39921
+ "already": false,
39922
+ "cancelled_at": "2026-08-28T10:15:00.000Z",
39923
+ "documents": { "total": 120, "completed": 83, "cancelled": 37, "errored": 0 },
39924
+ "run_requests": ["9f3c1e2a-0b7d-4c8e-9a1f-2d3e4f5a6b7c"],
39925
+ "jobs": { "removed": 37, "failed": 0, "scanned": 412, "scan_capped": false, "timed_out": false }
39926
+ }`
39927
+ },
39928
+ { type: "heading", level: 2, id: "cancel-pipeline-errors", text: "Errors" },
39929
+ {
39930
+ type: "param-table",
39931
+ title: "Error responses",
39932
+ params: [
39933
+ { name: "400", type: "bad_request", description: "Invalid pipeline ID format, or an active organization is required (the master view cannot cancel)." },
39934
+ { name: "401", type: "unauthorized", description: "Missing or invalid API key." },
39935
+ { name: "404", type: "not_found", description: "No pipeline with this ID exists for your organization." },
39936
+ { name: "429", type: "rate_limited", description: "Too many requests. Retry after the period indicated in the Retry-After header." }
39937
+ ]
39938
+ }
39939
+ ],
39940
+ related: [
39941
+ { label: "Get Pipeline", slug: "get-pipeline" },
39942
+ { label: "Pipeline Progress", slug: "get-pipeline-progress" },
39943
+ { label: "Delete Pipeline", slug: "delete-pipeline" }
39944
+ ],
39945
+ faq: [
39946
+ { question: "What happens to documents that were being processed?", answer: "They finish the phase they are in (at most one model call) and are then marked cancelled. Documents that had already finished keep their results." },
39947
+ { question: "Can I resume a cancelled run?", answer: "Yes. Rerun it, add documents, or submit to it again in append mode: the run reopens exactly like a completed one. Cancelled documents are retried with the rerun / retry endpoints." },
39948
+ { question: "Does cancelling refund credits?", answer: "No. Cancelling stops further model calls; calls already made are billed as usual." },
39949
+ { question: "I submitted through /v1/run \u2014 which endpoint do I use?", answer: "POST /v1/run/{id}/cancel resolves the run to its pipeline and cancels the whole pipeline, including any other requests appended to it; each affected request receives its own run.cancelled webhook." }
39950
+ ],
39951
+ mentions: ["cancel pipeline run", "stop processing", "run.cancelled webhook", "idempotent cancel", "append mode"]
39863
39952
  }
39864
39953
  ];
39865
39954