@talonic/docs 0.21.11 → 0.21.14

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/seo.js CHANGED
@@ -100,7 +100,7 @@ var openapi_default = {
100
100
  },
101
101
  {
102
102
  name: "Usage",
103
- description: "Aggregate and per-document API usage accounting (tokens, costs, operation types)."
103
+ description: 'Aggregate, per-document, per-pipeline, and per-run API usage accounting (tokens, costs, operation types). Model and cost fields on the aggregate and per-document routes are redacted for organizations without the "Cost control endpoints" approval; the pipeline and run routes are hidden entirely (404) for such organizations and additionally require an API key carrying the `usage` scope.'
104
104
  },
105
105
  {
106
106
  name: "Resolutions",
@@ -6324,7 +6324,7 @@ var openapi_default = {
6324
6324
  get: {
6325
6325
  operationId: "getUsage",
6326
6326
  summary: "Aggregate API usage stats",
6327
- description: "Returns token and call counts aggregated by `operation_type` and\n`model` over the requested date range. Default range is the last 30\ndays.\n",
6327
+ description: 'Returns token and call counts aggregated by `operation_type` and\n`model` over the requested date range. Default range is the last 30\ndays.\n\nFor organizations without the "Cost control endpoints" approval,\n`breakdown[].model` is redacted (omitted) and the response carries\n`"cost_fields": "redacted"`. Approved organizations see the field\nunredacted and no `cost_fields` marker. This applies uniformly \u2014\nevery tenant, not just consumers of the per-document route.\n',
6328
6328
  tags: [
6329
6329
  "Usage"
6330
6330
  ],
@@ -6372,7 +6372,7 @@ var openapi_default = {
6372
6372
  get: {
6373
6373
  operationId: "getDocumentUsage",
6374
6374
  summary: "Per-document API usage",
6375
- description: "Returns per-document API usage entries and totals. 404 if no usage records exist for the document.",
6375
+ description: 'Returns per-document API usage entries and totals. 404 if no usage\nrecords exist for the document.\n\nFor organizations without the "Cost control endpoints" approval,\n`model` and all cost fields (`cost_estimate_usd` on both `totals` and\neach `entries[]` row) are redacted (omitted), and the response\ncarries `"cost_fields": "redacted"`. Approved organizations see these\nfields unredacted and no `cost_fields` marker.\n',
6376
6376
  tags: [
6377
6377
  "Usage"
6378
6378
  ],
@@ -6404,6 +6404,144 @@ var openapi_default = {
6404
6404
  }
6405
6405
  }
6406
6406
  },
6407
+ "/v1/usage/pipelines/{id}": {
6408
+ get: {
6409
+ operationId: "getPipelineUsage",
6410
+ summary: "Per-pipeline API usage",
6411
+ description: "Returns AI usage for one pipeline: totals, a breakdown by\n`operation_type` \xD7 `model`, and a per-document rollup. `scope` is a\nfixed code (`pipeline_calls_only`) and `scope_note` is the\nhuman-readable statement of what this covers \u2014 pipeline-stamped\ncalls only. The ingest OCR leg (shared across runs, unstamped by\ndesign) is excluded.\n\nRequires the org's \"Cost control endpoints\" approval (superadmin-set;\norganizations are approved by default, shared individual workspaces\nare not) \u2014 unapproved organizations get a plain `404` (the\nroute's existence is not advertised) \u2014 AND an API key carrying the\n`usage` scope (`403` otherwise, approved organizations only). The\ntoggle check runs before the scope check, so an unapproved org's\nread-scoped key gets `404`, never a `403` that names the `usage`\nscope.\n\n`cost_estimate_usd` is Talonic's own estimate of the underlying AI\nprovider's charge for the tokens billed (cache-creation tokens price\nat 1.25\xD7 fresh input, so the token math reconciles to the estimate).\nIt is a different currency than `GET /v1/usage/credits`, which\nreports the tenant's own credit-ledger spend \u2014 the two do not\nreconcile against each other.\n",
6412
+ tags: [
6413
+ "Usage"
6414
+ ],
6415
+ security: [
6416
+ {
6417
+ ApiKeyAuth: []
6418
+ }
6419
+ ],
6420
+ parameters: [
6421
+ {
6422
+ $ref: "#/components/parameters/ResourceId"
6423
+ },
6424
+ {
6425
+ name: "from",
6426
+ in: "query",
6427
+ schema: {
6428
+ type: "string",
6429
+ format: "date-time"
6430
+ },
6431
+ description: "Start of the reporting window (ISO 8601). Default 90 days ago."
6432
+ },
6433
+ {
6434
+ name: "to",
6435
+ in: "query",
6436
+ schema: {
6437
+ type: "string",
6438
+ format: "date-time"
6439
+ },
6440
+ description: "End of the reporting window (ISO 8601). Default now."
6441
+ }
6442
+ ],
6443
+ responses: {
6444
+ "200": {
6445
+ description: "Per-pipeline usage breakdown.",
6446
+ content: {
6447
+ "application/json": {
6448
+ schema: {
6449
+ $ref: "#/components/schemas/PipelineUsageResponse"
6450
+ }
6451
+ }
6452
+ }
6453
+ },
6454
+ "401": {
6455
+ $ref: "#/components/responses/Unauthorized"
6456
+ },
6457
+ "403": {
6458
+ $ref: "#/components/responses/Forbidden"
6459
+ },
6460
+ "404": {
6461
+ description: `Either the pipeline is not owned by the caller's organization, or the organization lacks the "Cost control endpoints" approval (the route is hidden, not merely forbidden \u2014 see description above).`,
6462
+ content: {
6463
+ "application/json": {
6464
+ schema: {
6465
+ $ref: "#/components/schemas/ErrorResponse"
6466
+ }
6467
+ }
6468
+ }
6469
+ },
6470
+ "429": {
6471
+ $ref: "#/components/responses/RateLimitExceeded"
6472
+ }
6473
+ }
6474
+ }
6475
+ },
6476
+ "/v1/usage/runs/{id}": {
6477
+ get: {
6478
+ operationId: "getRunUsage",
6479
+ summary: "Per-run API usage",
6480
+ description: "Returns AI usage for one `/v1/run` request: totals, a breakdown by\n`operation_type` \xD7 `model`, and a per-document rollup. `id` is the\n`/v1/run` request id (the `run_id` from `POST /v1/run` / `GET\n/v1/run/:id`), not a pipeline id.\n\n`scope` is a fixed code (`run_attributed_calls`) and `scope_note` is\nthe human-readable statement of what this covers.\n\nA run that is still ingesting, or that failed before a pipeline was\ncreated (`pipeline_id IS NULL`), returns `200` with zero totals and\n`scope_note` explaining why \u2014 never `404` \u2014 since pollers hit this\nwindow constantly. A legacy run request that predates per-request\ndocument tracking (no `documents[]` echo) returns the same zero-total\nshape with its own `scope_note`, even when `pipeline_id` is set.\n\nAttribution is the intersection of: calls stamped with the run's\npipeline, limited to the run's own `documents[]` echo, and inside the\nrun's active time window (open-ended while the run is live; bounded\nat `updated_at` + a short margin once terminal, so completion-adjacent\ncalls are still captured without a later rerun or append on the same\nshared pipeline bleeding in). This is documented as approximate under\nshared-pipeline concurrency (append mode, or several runs targeting\nthe same pipeline). A document skipped by dedup or extraction-reuse\nlegitimately shows zeros for that document.\n\nSame gating as the pipeline route: requires the org's \"Cost control\nendpoints\" approval (`404` otherwise) AND an API key carrying the\n`usage` scope (`403` otherwise, approved organizations only).\n\n`cost_estimate_usd` is Talonic's own estimate of the underlying AI\nprovider's charge for the tokens billed. It is a different currency\nthan `GET /v1/usage/credits`, which reports the tenant's own\ncredit-ledger spend \u2014 the two do not reconcile against each other.\n",
6481
+ tags: [
6482
+ "Usage"
6483
+ ],
6484
+ security: [
6485
+ {
6486
+ ApiKeyAuth: []
6487
+ }
6488
+ ],
6489
+ parameters: [
6490
+ {
6491
+ $ref: "#/components/parameters/ResourceId"
6492
+ },
6493
+ {
6494
+ name: "from",
6495
+ in: "query",
6496
+ schema: {
6497
+ type: "string",
6498
+ format: "date-time"
6499
+ },
6500
+ description: "Start of the reporting window (ISO 8601). Default 90 days ago."
6501
+ },
6502
+ {
6503
+ name: "to",
6504
+ in: "query",
6505
+ schema: {
6506
+ type: "string",
6507
+ format: "date-time"
6508
+ },
6509
+ description: "End of the reporting window (ISO 8601). Default now."
6510
+ }
6511
+ ],
6512
+ responses: {
6513
+ "200": {
6514
+ description: "Per-run usage breakdown (zero totals if still ingesting or failed pre-pipeline).",
6515
+ content: {
6516
+ "application/json": {
6517
+ schema: {
6518
+ $ref: "#/components/schemas/RunUsageResponse"
6519
+ }
6520
+ }
6521
+ }
6522
+ },
6523
+ "401": {
6524
+ $ref: "#/components/responses/Unauthorized"
6525
+ },
6526
+ "403": {
6527
+ $ref: "#/components/responses/Forbidden"
6528
+ },
6529
+ "404": {
6530
+ description: `Either the run request is not owned by the caller's organization, or the organization lacks the "Cost control endpoints" approval (the route is hidden, not merely forbidden).`,
6531
+ content: {
6532
+ "application/json": {
6533
+ schema: {
6534
+ $ref: "#/components/schemas/ErrorResponse"
6535
+ }
6536
+ }
6537
+ }
6538
+ },
6539
+ "429": {
6540
+ $ref: "#/components/responses/RateLimitExceeded"
6541
+ }
6542
+ }
6543
+ }
6544
+ },
6407
6545
  "/v1/usage/credits": {
6408
6546
  get: {
6409
6547
  operationId: "getCreditUsageByFunction",
@@ -9438,7 +9576,7 @@ var openapi_default = {
9438
9576
  },
9439
9577
  scopes: {
9440
9578
  type: "array",
9441
- description: "Subset of: extract, read, write, operations, billing, delivery. Defaults to extract/read/write/operations.",
9579
+ description: "Subset of: extract, read, write, operations, billing, delivery, usage. Defaults to extract/read/write/operations. `usage` (grants access to the cost-visibility routes `GET /v1/usage/pipelines/:id` and `GET /v1/usage/runs/:id`) is scope-attenuated: requesting it is rejected with `403` (`scope_not_grantable`) unless the calling key itself already carries `usage` \u2014 a key can only ever narrow its own privilege on a newly minted key, never widen it. De-novo `usage` grants happen only through owner+ key management, never through self-serve key creation.",
9442
9580
  items: {
9443
9581
  type: "string",
9444
9582
  enum: [
@@ -9447,7 +9585,8 @@ var openapi_default = {
9447
9585
  "write",
9448
9586
  "operations",
9449
9587
  "billing",
9450
- "delivery"
9588
+ "delivery",
9589
+ "usage"
9451
9590
  ]
9452
9591
  }
9453
9592
  }
@@ -17604,7 +17743,7 @@ var openapi_default = {
17604
17743
  },
17605
17744
  responses: {
17606
17745
  "201": {
17607
- description: "Created pipeline run with links to progress + data-product. `appended: true` marks an append-mode reuse of an existing pipeline (its id is returned)."
17746
+ description: "Created pipeline run with links to progress + data-product. `appended: true` marks an append-mode reuse of an existing pipeline (its id is returned). `run_id` is the submission-group identifier stamped on this call's documents \u2014 usable as the `run_id` filter on the results/documents reads."
17608
17747
  },
17609
17748
  "400": {
17610
17749
  description: "The Spec has no composed rail, or the body failed validation."
@@ -17815,6 +17954,152 @@ var openapi_default = {
17815
17954
  }
17816
17955
  }
17817
17956
  },
17957
+ "/v1/pipelines/{id}/results": {
17958
+ get: {
17959
+ tags: [
17960
+ "Pipelines"
17961
+ ],
17962
+ summary: "Get a pipeline's structured results (poll-able)",
17963
+ description: "The pipeline run's structured rows, poll-able as JSON \u2014 the same governed read (review holdback, demoted-field projection, `__` diagnostics filtering, assembly awareness) that previously existed only as the `run.completed` webhook or a data-product CSV export. The default record shape mirrors the `pipeline.capture` webhook envelope: `document_id`, `filename`, `run_id`, `pipeline_id`, `record_id`, `status`, `completed_at`, optional `metadata`/`batch_id`, and clean `fields`. Held (`pending_approval`) values never leave this surface \u2014 `fields` serializes `null` for them.\n\n`view=composed` (the default when the run has an assembly product set) returns one row per assembled group, the same rows the data product and CSV exports serve; `view=documents` returns one row per pipeline document from the main record set. A non-assembly run only has the documents view \u2014 `view=composed` degrades to it rather than erroring. An **anchor-less composed row** (the product record's anchor could not be resolved \u2014 a known `per_group_jobs` identity-stamp gap) serializes `document_id`/`filename`/`run_id: null`, `status: \"complete\"`, and `completed_at: null`; such rows are excluded by any `document_id`, `status`, `since`, or `until` filter and appear only in unbounded reads.\n\n`since`/`until` filter on `completed_at`, which tracks DOCUMENT PROCESSING completion, not value change: a later review promotion or assembly recompose never advances it, and a phase rerun NULLS the completion stamps for every affected document until it re-processes. Poll unbounded (or by `document_id`) to pick up review outcomes; `pending_review_count` on the page is the signal that held values are outstanding.\n\n`include=cells,provenance,audit` (comma-separated) add shape beyond `fields`. `cells` adds per-field `{ value, status, confidence, source, document_id, filename }` \u2014 `source` is an opaque-but-stable vocabulary; new values may appear over time. `provenance` adds a stable projection of the cell's audit trail (`kind` one of `span`, `assembly_override`, `auto_adjudication`, `human`, `derived`, `legacy`, with an open `derived_reason` enum); a held cell's projection is kind-only \u2014 no displaced/previous values. `audit` adds the full cell-version trail, bounded to `structure_pipeline.results_api.audit_max_records` (default 20) records per page \u2014 a broader page 400s with `audit_include_too_broad`. For any field whose LATEST version is held, every version in its audit trail serializes `value: null` (the hold mechanism copies the value forward, so the prior version is an equal leak).\n\nPagination is house cursor pagination (`pagination.next_cursor`, keyed on `record_id`), never an invented `page` param. Per-record `status` folds ~10 internal states to four public values \u2014 `complete`, `partial`, and `error` pass through, everything else (queue/phase states, `awaiting_ocr`, \u2026) folds to `processing`. This deliberately KEEPS `partial`, unlike `GET /v1/run/{id}`'s 3-state `documents[]` fold, because a partial row's held fields are the reason to keep polling. Poll this envelope's `status` until `completed` for a single-request pipeline; an append pipeline never settles at the pipeline level, so append consumers should loop on per-record `status`/`completed_at` or poll `GET /v1/run/{id}/results` instead, whose run-scoped status does settle. Preview pipelines are served. Requires read scope.\n",
17964
+ operationId: "getPipelineResults",
17965
+ security: [
17966
+ {
17967
+ BearerAuth: []
17968
+ }
17969
+ ],
17970
+ parameters: [
17971
+ {
17972
+ name: "id",
17973
+ in: "path",
17974
+ required: true,
17975
+ schema: {
17976
+ type: "string",
17977
+ format: "uuid"
17978
+ }
17979
+ },
17980
+ {
17981
+ name: "document_id",
17982
+ in: "query",
17983
+ schema: {
17984
+ type: "string"
17985
+ },
17986
+ description: "Comma-separated document UUIDs (1-100). Composed rows match on the anchor document."
17987
+ },
17988
+ {
17989
+ name: "run_id",
17990
+ in: "query",
17991
+ schema: {
17992
+ type: "string",
17993
+ format: "uuid"
17994
+ },
17995
+ description: "Scope to one /v1/run request's own documents (implies view=documents). 404 when the run does not belong to this pipeline/organization; a 200 empty page with scope_note for a legacy run that predates per-request document tracking."
17996
+ },
17997
+ {
17998
+ name: "since",
17999
+ in: "query",
18000
+ schema: {
18001
+ type: "string",
18002
+ format: "date-time"
18003
+ },
18004
+ description: "Only records whose completed_at is at or after this ISO timestamp. Records with a null completed_at (still processing, or anchor-less composed rows) are excluded once either bound is set."
18005
+ },
18006
+ {
18007
+ name: "until",
18008
+ in: "query",
18009
+ schema: {
18010
+ type: "string",
18011
+ format: "date-time"
18012
+ },
18013
+ description: "Only records whose completed_at is at or before this ISO timestamp."
18014
+ },
18015
+ {
18016
+ name: "status",
18017
+ in: "query",
18018
+ schema: {
18019
+ type: "string"
18020
+ },
18021
+ description: "Comma-separated subset of complete, partial, error, processing."
18022
+ },
18023
+ {
18024
+ name: "view",
18025
+ in: "query",
18026
+ schema: {
18027
+ type: "string",
18028
+ enum: [
18029
+ "composed",
18030
+ "documents"
18031
+ ]
18032
+ },
18033
+ description: "Defaults to composed when the run has an assembly product set, else documents. A non-assembly run ignores view=composed."
18034
+ },
18035
+ {
18036
+ name: "include",
18037
+ in: "query",
18038
+ schema: {
18039
+ type: "string"
18040
+ },
18041
+ description: "Comma-separated subset of cells, provenance, audit."
18042
+ },
18043
+ {
18044
+ name: "limit",
18045
+ in: "query",
18046
+ schema: {
18047
+ type: "integer",
18048
+ minimum: 1,
18049
+ maximum: 100,
18050
+ default: 25
18051
+ },
18052
+ description: "Maximum records per page (structure_pipeline.results_api \u2014 default 25, max 100)."
18053
+ },
18054
+ {
18055
+ name: "cursor",
18056
+ in: "query",
18057
+ schema: {
18058
+ type: "string"
18059
+ },
18060
+ description: "Opaque pagination cursor from a previous response's pagination.next_cursor, keyed on record_id."
18061
+ }
18062
+ ],
18063
+ responses: {
18064
+ "200": {
18065
+ description: "The pipeline's results page.",
18066
+ content: {
18067
+ "application/json": {
18068
+ schema: {
18069
+ $ref: "#/components/schemas/PipelineResultsResponse"
18070
+ }
18071
+ }
18072
+ }
18073
+ },
18074
+ "400": {
18075
+ description: "Invalid query parameters. code is one of invalid_view, invalid_document_ids, invalid_run_id, invalid_time_range, invalid_status, invalid_include, audit_include_too_broad.",
18076
+ content: {
18077
+ "application/json": {
18078
+ schema: {
18079
+ $ref: "#/components/schemas/ResultsBadRequestError"
18080
+ }
18081
+ }
18082
+ }
18083
+ },
18084
+ "401": {
18085
+ $ref: "#/components/responses/Unauthorized"
18086
+ },
18087
+ "404": {
18088
+ description: "Pipeline not found, or run_id does not belong to this pipeline/organization.",
18089
+ content: {
18090
+ "application/json": {
18091
+ schema: {
18092
+ $ref: "#/components/schemas/ErrorResponse"
18093
+ }
18094
+ }
18095
+ }
18096
+ },
18097
+ "429": {
18098
+ $ref: "#/components/responses/RateLimitExceeded"
18099
+ }
18100
+ }
18101
+ }
18102
+ },
17818
18103
  "/v1/run": {
17819
18104
  post: {
17820
18105
  tags: [
@@ -18182,27 +18467,126 @@ var openapi_default = {
18182
18467
  }
18183
18468
  }
18184
18469
  },
18185
- "/v1/webhooks": {
18470
+ "/v1/run/{id}/results": {
18186
18471
  get: {
18187
18472
  tags: [
18188
- "Webhooks"
18473
+ "Run"
18189
18474
  ],
18190
- summary: "List webhook configs",
18191
- operationId: "listWebhooks",
18475
+ summary: "Get this run's structured results (poll-able, per-document)",
18476
+ description: "The same governed results read as `GET /v1/pipelines/{id}/results` (review holdback, demoted-field projection, assembly awareness), scoped ALWAYS to this `/v1/run` request's own `documents[]` echo and ALWAYS the per-document view \u2014 \"what did MY submitted documents produce,\" uniform across new/append pipeline modes. This is a deliberate DIVERGENCE from the per-run `run.completed` webhook, which for an unscoped non-append assembly run delivers COMPOSED rows: composed output for an assembly run is `GET /v1/pipelines/{id}/results?view=composed`, surfaced here at `links.composed_results` when a pipeline exists.\n\nOnly `document_id` and `include` filter the rows; `run_id`, `view`, `since`, `until`, and `status` are pipeline-route-only and 400 with `unsupported_filter` here, since the run IS the scope and its window is already bounded. `include=cells,provenance,audit` behave identically to the pipeline route \u2014 see `GET /v1/pipelines/{id}/results` for the full shape and held-value redaction rules.\n\nTwo zero-states return `200` with an empty page and a `scope_note`, never `404`: no compiled pipeline exists yet for this run (still ingesting, or it failed before pipeline creation), or the run predates per-request document tracking (an echo-less legacy row, whose membership is unknowable). The envelope's `status` folds the same three-state vocabulary as `GET /v1/run/{id}` (`processing`/`completed`/`failed`) and DOES settle even for an append pipeline that never settles at the pipeline level \u2014 poll this route for append consumers instead of the pipeline route. Requires read scope.\n",
18477
+ operationId: "getRunResults",
18192
18478
  security: [
18193
18479
  {
18194
18480
  BearerAuth: []
18195
18481
  }
18196
18482
  ],
18197
- responses: {
18198
- "200": {
18199
- description: "{ data: webhook[] }"
18200
- }
18201
- }
18202
- },
18203
- post: {
18204
- tags: [
18205
- "Webhooks"
18483
+ parameters: [
18484
+ {
18485
+ name: "id",
18486
+ in: "path",
18487
+ required: true,
18488
+ schema: {
18489
+ type: "string",
18490
+ format: "uuid"
18491
+ }
18492
+ },
18493
+ {
18494
+ name: "document_id",
18495
+ in: "query",
18496
+ schema: {
18497
+ type: "string"
18498
+ },
18499
+ description: "Comma-separated document UUIDs (1-100), intersected with the run's own documents echo."
18500
+ },
18501
+ {
18502
+ name: "include",
18503
+ in: "query",
18504
+ schema: {
18505
+ type: "string"
18506
+ },
18507
+ description: "Comma-separated subset of cells, provenance, audit."
18508
+ },
18509
+ {
18510
+ name: "limit",
18511
+ in: "query",
18512
+ schema: {
18513
+ type: "integer",
18514
+ minimum: 1,
18515
+ maximum: 100,
18516
+ default: 25
18517
+ },
18518
+ description: "Maximum records per page (default 25, max 100)."
18519
+ },
18520
+ {
18521
+ name: "cursor",
18522
+ in: "query",
18523
+ schema: {
18524
+ type: "string"
18525
+ },
18526
+ description: "Opaque pagination cursor from a previous response's pagination.next_cursor, keyed on record_id."
18527
+ }
18528
+ ],
18529
+ responses: {
18530
+ "200": {
18531
+ description: "This run's results page (always the documents view).",
18532
+ content: {
18533
+ "application/json": {
18534
+ schema: {
18535
+ $ref: "#/components/schemas/RunResultsResponse"
18536
+ }
18537
+ }
18538
+ }
18539
+ },
18540
+ "400": {
18541
+ description: "Invalid query parameters, or a pipeline-route-only filter (run_id, view, since, until, status) was supplied. code is one of invalid_document_ids, invalid_include, unsupported_filter, audit_include_too_broad.",
18542
+ content: {
18543
+ "application/json": {
18544
+ schema: {
18545
+ $ref: "#/components/schemas/ResultsBadRequestError"
18546
+ }
18547
+ }
18548
+ }
18549
+ },
18550
+ "401": {
18551
+ $ref: "#/components/responses/Unauthorized"
18552
+ },
18553
+ "404": {
18554
+ description: "Run request not found.",
18555
+ content: {
18556
+ "application/json": {
18557
+ schema: {
18558
+ $ref: "#/components/schemas/ErrorResponse"
18559
+ }
18560
+ }
18561
+ }
18562
+ },
18563
+ "429": {
18564
+ $ref: "#/components/responses/RateLimitExceeded"
18565
+ }
18566
+ }
18567
+ }
18568
+ },
18569
+ "/v1/webhooks": {
18570
+ get: {
18571
+ tags: [
18572
+ "Webhooks"
18573
+ ],
18574
+ summary: "List webhook configs",
18575
+ operationId: "listWebhooks",
18576
+ security: [
18577
+ {
18578
+ BearerAuth: []
18579
+ }
18580
+ ],
18581
+ responses: {
18582
+ "200": {
18583
+ description: "{ data: webhook[] }"
18584
+ }
18585
+ }
18586
+ },
18587
+ post: {
18588
+ tags: [
18589
+ "Webhooks"
18206
18590
  ],
18207
18591
  summary: "Create a webhook",
18208
18592
  operationId: "createWebhook",
@@ -25042,15 +25426,26 @@ var openapi_default = {
25042
25426
  required: [
25043
25427
  "input_tokens",
25044
25428
  "output_tokens",
25429
+ "cache_read_tokens",
25430
+ "cache_creation_tokens",
25045
25431
  "calls"
25046
25432
  ],
25047
25433
  properties: {
25048
25434
  input_tokens: {
25049
- type: "integer"
25435
+ type: "integer",
25436
+ description: "Uncached input tokens (cached tokens are reported separately)."
25050
25437
  },
25051
25438
  output_tokens: {
25052
25439
  type: "integer"
25053
25440
  },
25441
+ cache_read_tokens: {
25442
+ type: "integer",
25443
+ description: "Tokens served from the provider's prompt cache."
25444
+ },
25445
+ cache_creation_tokens: {
25446
+ type: "integer",
25447
+ description: "Tokens written to the provider's prompt cache (Anthropic only; 0 for other providers)."
25448
+ },
25054
25449
  calls: {
25055
25450
  type: "integer"
25056
25451
  }
@@ -25062,9 +25457,10 @@ var openapi_default = {
25062
25457
  type: "object",
25063
25458
  required: [
25064
25459
  "operation_type",
25065
- "model",
25066
25460
  "input_tokens",
25067
25461
  "output_tokens",
25462
+ "cache_read_tokens",
25463
+ "cache_creation_tokens",
25068
25464
  "calls"
25069
25465
  ],
25070
25466
  properties: {
@@ -25072,20 +25468,37 @@ var openapi_default = {
25072
25468
  type: "string"
25073
25469
  },
25074
25470
  model: {
25075
- type: "string"
25471
+ type: "string",
25472
+ description: 'Omitted for organizations without the "Cost control endpoints" approval (see `cost_fields` on the parent response).'
25076
25473
  },
25077
25474
  input_tokens: {
25078
- type: "integer"
25475
+ type: "integer",
25476
+ description: "Uncached input tokens (cached tokens are reported separately)."
25079
25477
  },
25080
25478
  output_tokens: {
25081
25479
  type: "integer"
25082
25480
  },
25481
+ cache_read_tokens: {
25482
+ type: "integer",
25483
+ description: "Tokens served from the provider's prompt cache."
25484
+ },
25485
+ cache_creation_tokens: {
25486
+ type: "integer",
25487
+ description: "Tokens written to the provider's prompt cache (Anthropic only; 0 for other providers)."
25488
+ },
25083
25489
  calls: {
25084
25490
  type: "integer"
25085
25491
  }
25086
25492
  }
25087
25493
  }
25088
25494
  },
25495
+ cost_fields: {
25496
+ type: "string",
25497
+ enum: [
25498
+ "redacted"
25499
+ ],
25500
+ description: 'Present and set to `"redacted"` only for organizations without the "Cost control endpoints" approval \u2014 signals that `breakdown[].model` has been omitted. Absent for approved organizations.'
25501
+ },
25089
25502
  links: {
25090
25503
  type: "object",
25091
25504
  properties: {
@@ -25115,19 +25528,30 @@ var openapi_default = {
25115
25528
  required: [
25116
25529
  "input_tokens",
25117
25530
  "output_tokens",
25118
- "cost_estimate_usd",
25531
+ "cache_read_tokens",
25532
+ "cache_creation_tokens",
25119
25533
  "calls"
25120
25534
  ],
25121
25535
  properties: {
25122
25536
  input_tokens: {
25123
- type: "integer"
25537
+ type: "integer",
25538
+ description: "Uncached input tokens (cached tokens are reported separately)."
25124
25539
  },
25125
25540
  output_tokens: {
25126
25541
  type: "integer"
25127
25542
  },
25543
+ cache_read_tokens: {
25544
+ type: "integer",
25545
+ description: "Tokens served from the provider's prompt cache."
25546
+ },
25547
+ cache_creation_tokens: {
25548
+ type: "integer",
25549
+ description: "Tokens written to the provider's prompt cache (Anthropic only; 0 for other providers)."
25550
+ },
25128
25551
  cost_estimate_usd: {
25129
25552
  type: "number",
25130
- format: "float"
25553
+ format: "float",
25554
+ description: 'Omitted for organizations without the "Cost control endpoints" approval (see `cost_fields` on the parent response).'
25131
25555
  },
25132
25556
  calls: {
25133
25557
  type: "integer"
@@ -25141,9 +25565,10 @@ var openapi_default = {
25141
25565
  required: [
25142
25566
  "id",
25143
25567
  "operation_type",
25144
- "model",
25145
25568
  "input_tokens",
25146
25569
  "output_tokens",
25570
+ "cache_read_tokens",
25571
+ "cache_creation_tokens",
25147
25572
  "created_at"
25148
25573
  ],
25149
25574
  properties: {
@@ -25154,7 +25579,8 @@ var openapi_default = {
25154
25579
  type: "string"
25155
25580
  },
25156
25581
  model: {
25157
- type: "string"
25582
+ type: "string",
25583
+ description: 'Omitted for organizations without the "Cost control endpoints" approval.'
25158
25584
  },
25159
25585
  input_tokens: {
25160
25586
  type: "integer"
@@ -25166,11 +25592,17 @@ var openapi_default = {
25166
25592
  type: [
25167
25593
  "integer",
25168
25594
  "null"
25169
- ]
25595
+ ],
25596
+ description: "Tokens served from the provider's prompt cache."
25597
+ },
25598
+ cache_creation_tokens: {
25599
+ type: "integer",
25600
+ description: "Tokens written to the provider's prompt cache (Anthropic only; 0 for other providers)."
25170
25601
  },
25171
25602
  cost_estimate_usd: {
25172
25603
  type: "number",
25173
- format: "float"
25604
+ format: "float",
25605
+ description: 'Omitted for organizations without the "Cost control endpoints" approval.'
25174
25606
  },
25175
25607
  created_at: {
25176
25608
  type: "string",
@@ -25180,6 +25612,13 @@ var openapi_default = {
25180
25612
  }
25181
25613
  }
25182
25614
  },
25615
+ cost_fields: {
25616
+ type: "string",
25617
+ enum: [
25618
+ "redacted"
25619
+ ],
25620
+ description: 'Present and set to `"redacted"` only for organizations without the "Cost control endpoints" approval \u2014 signals that `model` and all `cost_estimate_usd` fields have been omitted. Absent for approved organizations.'
25621
+ },
25183
25622
  links: {
25184
25623
  type: "object",
25185
25624
  properties: {
@@ -25193,6 +25632,873 @@ var openapi_default = {
25193
25632
  }
25194
25633
  }
25195
25634
  },
25635
+ PipelineUsageResponse: {
25636
+ type: "object",
25637
+ required: [
25638
+ "pipeline_id",
25639
+ "period",
25640
+ "scope",
25641
+ "scope_note",
25642
+ "totals",
25643
+ "breakdown",
25644
+ "documents",
25645
+ "links"
25646
+ ],
25647
+ properties: {
25648
+ pipeline_id: {
25649
+ type: "string",
25650
+ format: "uuid",
25651
+ example: "b3c4d5e6-f7a8-9012-bcde-f34567890123"
25652
+ },
25653
+ period: {
25654
+ type: "object",
25655
+ required: [
25656
+ "from",
25657
+ "to"
25658
+ ],
25659
+ properties: {
25660
+ from: {
25661
+ type: "string",
25662
+ format: "date-time",
25663
+ example: "2026-04-25T14:30:00.000Z"
25664
+ },
25665
+ to: {
25666
+ type: "string",
25667
+ format: "date-time",
25668
+ example: "2026-04-25T14:30:00.000Z"
25669
+ }
25670
+ }
25671
+ },
25672
+ scope: {
25673
+ type: "string",
25674
+ enum: [
25675
+ "pipeline_calls_only"
25676
+ ],
25677
+ description: "Fixed code identifying the attribution rule applied to this response."
25678
+ },
25679
+ scope_note: {
25680
+ type: "string",
25681
+ description: "Human-readable statement of what this response covers \u2014 pipeline-stamped calls only. The ingest OCR leg (shared across runs) is excluded by design.",
25682
+ example: "Calls stamped with this pipeline id in call metadata. The shared ingest OCR leg is excluded."
25683
+ },
25684
+ totals: {
25685
+ type: "object",
25686
+ required: [
25687
+ "input_tokens",
25688
+ "output_tokens",
25689
+ "cache_read_tokens",
25690
+ "cache_creation_tokens",
25691
+ "calls",
25692
+ "cost_estimate_usd"
25693
+ ],
25694
+ properties: {
25695
+ input_tokens: {
25696
+ type: "integer"
25697
+ },
25698
+ output_tokens: {
25699
+ type: "integer"
25700
+ },
25701
+ cache_read_tokens: {
25702
+ type: "integer"
25703
+ },
25704
+ cache_creation_tokens: {
25705
+ type: "integer",
25706
+ description: "Cache-write tokens, billed at 1.25\xD7 the fresh input rate."
25707
+ },
25708
+ calls: {
25709
+ type: "integer"
25710
+ },
25711
+ cost_estimate_usd: {
25712
+ type: "number",
25713
+ format: "float"
25714
+ }
25715
+ }
25716
+ },
25717
+ breakdown: {
25718
+ type: "array",
25719
+ items: {
25720
+ type: "object",
25721
+ required: [
25722
+ "operation_type",
25723
+ "model",
25724
+ "input_tokens",
25725
+ "output_tokens",
25726
+ "cache_read_tokens",
25727
+ "cache_creation_tokens",
25728
+ "calls",
25729
+ "cost_estimate_usd"
25730
+ ],
25731
+ properties: {
25732
+ operation_type: {
25733
+ type: "string"
25734
+ },
25735
+ model: {
25736
+ type: "string"
25737
+ },
25738
+ input_tokens: {
25739
+ type: "integer"
25740
+ },
25741
+ output_tokens: {
25742
+ type: "integer"
25743
+ },
25744
+ cache_read_tokens: {
25745
+ type: "integer"
25746
+ },
25747
+ cache_creation_tokens: {
25748
+ type: "integer"
25749
+ },
25750
+ calls: {
25751
+ type: "integer"
25752
+ },
25753
+ cost_estimate_usd: {
25754
+ type: "number",
25755
+ format: "float"
25756
+ }
25757
+ }
25758
+ }
25759
+ },
25760
+ documents: {
25761
+ type: "array",
25762
+ description: "Per-document rollup of the same pipeline-stamped calls.",
25763
+ items: {
25764
+ type: "object",
25765
+ required: [
25766
+ "document_id",
25767
+ "filename",
25768
+ "input_tokens",
25769
+ "output_tokens",
25770
+ "calls",
25771
+ "cost_estimate_usd"
25772
+ ],
25773
+ properties: {
25774
+ document_id: {
25775
+ type: "string",
25776
+ format: "uuid"
25777
+ },
25778
+ filename: {
25779
+ type: [
25780
+ "string",
25781
+ "null"
25782
+ ],
25783
+ description: "The document's filename, or null if it could not be resolved."
25784
+ },
25785
+ input_tokens: {
25786
+ type: "integer"
25787
+ },
25788
+ output_tokens: {
25789
+ type: "integer"
25790
+ },
25791
+ calls: {
25792
+ type: "integer"
25793
+ },
25794
+ cost_estimate_usd: {
25795
+ type: "number",
25796
+ format: "float"
25797
+ }
25798
+ }
25799
+ }
25800
+ },
25801
+ links: {
25802
+ type: "object",
25803
+ properties: {
25804
+ self: {
25805
+ type: "string"
25806
+ },
25807
+ pipeline: {
25808
+ type: "string"
25809
+ }
25810
+ }
25811
+ }
25812
+ }
25813
+ },
25814
+ RunUsageResponse: {
25815
+ type: "object",
25816
+ required: [
25817
+ "run_id",
25818
+ "pipeline_id",
25819
+ "period",
25820
+ "scope",
25821
+ "scope_note",
25822
+ "totals",
25823
+ "breakdown",
25824
+ "documents",
25825
+ "links"
25826
+ ],
25827
+ properties: {
25828
+ run_id: {
25829
+ type: "string",
25830
+ format: "uuid",
25831
+ example: "c4d5e6f7-a8b9-0123-cdef-456789012345"
25832
+ },
25833
+ pipeline_id: {
25834
+ type: [
25835
+ "string",
25836
+ "null"
25837
+ ],
25838
+ format: "uuid",
25839
+ description: "Null while the run is still ingesting or if it failed before a pipeline was created \u2014 the response still returns `200` with zero totals in that case, never `404`."
25840
+ },
25841
+ period: {
25842
+ type: "object",
25843
+ required: [
25844
+ "from",
25845
+ "to"
25846
+ ],
25847
+ properties: {
25848
+ from: {
25849
+ type: "string",
25850
+ format: "date-time",
25851
+ example: "2026-04-25T14:30:00.000Z"
25852
+ },
25853
+ to: {
25854
+ type: "string",
25855
+ format: "date-time",
25856
+ example: "2026-04-25T14:30:00.000Z"
25857
+ }
25858
+ }
25859
+ },
25860
+ scope: {
25861
+ type: "string",
25862
+ enum: [
25863
+ "run_attributed_calls"
25864
+ ],
25865
+ description: "Fixed code identifying the attribution rule applied to this response."
25866
+ },
25867
+ scope_note: {
25868
+ type: "string",
25869
+ description: "Human-readable statement of attribution: pipeline-stamped calls, limited to the run's own documents and active time window. Documented as approximate under shared-pipeline concurrency (append mode / several runs on one pipeline); a document skipped by dedup or extraction-reuse legitimately reports zeros. Explains the zero-totals case (still-ingesting/pre-pipeline run, or a legacy run predating per-request document tracking) when applicable.",
25870
+ example: "Calls stamped with the run's pipeline id, restricted to the run's own documents and lifetime. Approximate under shared-pipeline concurrency (append mode); the shared ingest OCR leg is excluded."
25871
+ },
25872
+ totals: {
25873
+ type: "object",
25874
+ required: [
25875
+ "input_tokens",
25876
+ "output_tokens",
25877
+ "cache_read_tokens",
25878
+ "cache_creation_tokens",
25879
+ "calls",
25880
+ "cost_estimate_usd"
25881
+ ],
25882
+ properties: {
25883
+ input_tokens: {
25884
+ type: "integer"
25885
+ },
25886
+ output_tokens: {
25887
+ type: "integer"
25888
+ },
25889
+ cache_read_tokens: {
25890
+ type: "integer"
25891
+ },
25892
+ cache_creation_tokens: {
25893
+ type: "integer",
25894
+ description: "Cache-write tokens, billed at 1.25\xD7 the fresh input rate."
25895
+ },
25896
+ calls: {
25897
+ type: "integer"
25898
+ },
25899
+ cost_estimate_usd: {
25900
+ type: "number",
25901
+ format: "float"
25902
+ }
25903
+ }
25904
+ },
25905
+ breakdown: {
25906
+ type: "array",
25907
+ items: {
25908
+ type: "object",
25909
+ required: [
25910
+ "operation_type",
25911
+ "model",
25912
+ "input_tokens",
25913
+ "output_tokens",
25914
+ "cache_read_tokens",
25915
+ "cache_creation_tokens",
25916
+ "calls",
25917
+ "cost_estimate_usd"
25918
+ ],
25919
+ properties: {
25920
+ operation_type: {
25921
+ type: "string"
25922
+ },
25923
+ model: {
25924
+ type: "string"
25925
+ },
25926
+ input_tokens: {
25927
+ type: "integer"
25928
+ },
25929
+ output_tokens: {
25930
+ type: "integer"
25931
+ },
25932
+ cache_read_tokens: {
25933
+ type: "integer"
25934
+ },
25935
+ cache_creation_tokens: {
25936
+ type: "integer"
25937
+ },
25938
+ calls: {
25939
+ type: "integer"
25940
+ },
25941
+ cost_estimate_usd: {
25942
+ type: "number",
25943
+ format: "float"
25944
+ }
25945
+ }
25946
+ }
25947
+ },
25948
+ documents: {
25949
+ type: "array",
25950
+ description: "Per-document rollup, one row per entry in the run's own `documents[]` echo. A document skipped by dedup or extraction-reuse legitimately appears with all-zero counts.",
25951
+ items: {
25952
+ type: "object",
25953
+ required: [
25954
+ "document_id",
25955
+ "input_tokens",
25956
+ "output_tokens",
25957
+ "calls",
25958
+ "cost_estimate_usd"
25959
+ ],
25960
+ properties: {
25961
+ document_id: {
25962
+ type: "string",
25963
+ format: "uuid"
25964
+ },
25965
+ filename: {
25966
+ type: [
25967
+ "string",
25968
+ "null"
25969
+ ],
25970
+ description: "The document's filename. Omitted entirely (not merely null) on the zero-totals placeholder rows returned for a still-ingesting/pre-pipeline or legacy echo-less run."
25971
+ },
25972
+ input_tokens: {
25973
+ type: "integer"
25974
+ },
25975
+ output_tokens: {
25976
+ type: "integer"
25977
+ },
25978
+ calls: {
25979
+ type: "integer"
25980
+ },
25981
+ cost_estimate_usd: {
25982
+ type: "number",
25983
+ format: "float"
25984
+ }
25985
+ }
25986
+ }
25987
+ },
25988
+ links: {
25989
+ type: "object",
25990
+ properties: {
25991
+ self: {
25992
+ type: "string"
25993
+ },
25994
+ run: {
25995
+ type: "string"
25996
+ }
25997
+ }
25998
+ }
25999
+ }
26000
+ },
26001
+ ResultsColumn: {
26002
+ type: "object",
26003
+ required: [
26004
+ "field_key",
26005
+ "data_type"
26006
+ ],
26007
+ properties: {
26008
+ field_key: {
26009
+ type: "string"
26010
+ },
26011
+ display_name: {
26012
+ type: [
26013
+ "string",
26014
+ "null"
26015
+ ]
26016
+ },
26017
+ data_type: {
26018
+ type: "string"
26019
+ }
26020
+ }
26021
+ },
26022
+ ResultsCell: {
26023
+ type: "object",
26024
+ required: [
26025
+ "value",
26026
+ "status",
26027
+ "confidence",
26028
+ "source",
26029
+ "document_id",
26030
+ "filename"
26031
+ ],
26032
+ properties: {
26033
+ value: {
26034
+ nullable: true,
26035
+ description: "The cell's coalesced value; null for a held (pending_approval) cell."
26036
+ },
26037
+ status: {
26038
+ type: "string",
26039
+ example: "filled"
26040
+ },
26041
+ confidence: {
26042
+ type: [
26043
+ "number",
26044
+ "null"
26045
+ ],
26046
+ format: "float"
26047
+ },
26048
+ source: {
26049
+ type: [
26050
+ "string",
26051
+ "null"
26052
+ ],
26053
+ description: "Opaque-but-stable cell-source vocabulary (e.g. llm_extraction, field_registry, pipeline_resolution, pipeline_assembly, pipeline_assembly_anchor, human_review, auto_adjudication, review_gate). New values may appear over time; existing values do not rename."
26054
+ },
26055
+ document_id: {
26056
+ type: [
26057
+ "string",
26058
+ "null"
26059
+ ],
26060
+ format: "uuid",
26061
+ description: "On a composed row, the cell's real source document \u2014 may differ from the record's anchor document_id."
26062
+ },
26063
+ filename: {
26064
+ type: [
26065
+ "string",
26066
+ "null"
26067
+ ]
26068
+ }
26069
+ }
26070
+ },
26071
+ ResultsProvenance: {
26072
+ type: "object",
26073
+ required: [
26074
+ "kind"
26075
+ ],
26076
+ properties: {
26077
+ kind: {
26078
+ type: "string",
26079
+ enum: [
26080
+ "span",
26081
+ "assembly_override",
26082
+ "auto_adjudication",
26083
+ "human",
26084
+ "derived",
26085
+ "legacy"
26086
+ ],
26087
+ description: "legacy covers the internal legacy_unvalidated kind plus any unparseable/unknown envelope."
26088
+ },
26089
+ text: {
26090
+ type: [
26091
+ "string",
26092
+ "null"
26093
+ ],
26094
+ description: "The winning value's genesis span text. Absent for a held cell (kind-only redaction) and never a displaced/previous value even when unheld."
26095
+ },
26096
+ derived_reason: {
26097
+ type: "string",
26098
+ description: "Open enum; documented values today include inferred_no_span, source_text_unlocated, inferred_absence, customer_injected, resolved_default. Consumers must tolerate new values."
26099
+ },
26100
+ source_document_id: {
26101
+ type: [
26102
+ "string",
26103
+ "null"
26104
+ ],
26105
+ format: "uuid"
26106
+ },
26107
+ page_index: {
26108
+ type: [
26109
+ "integer",
26110
+ "null"
26111
+ ]
26112
+ }
26113
+ }
26114
+ },
26115
+ ResultsAuditVersion: {
26116
+ type: "object",
26117
+ required: [
26118
+ "version",
26119
+ "value",
26120
+ "status",
26121
+ "source",
26122
+ "confidence",
26123
+ "created_at"
26124
+ ],
26125
+ properties: {
26126
+ version: {
26127
+ type: [
26128
+ "integer",
26129
+ "null"
26130
+ ]
26131
+ },
26132
+ value: {
26133
+ nullable: true,
26134
+ description: "Redacted (null) for EVERY version in a field's trail when that field's LATEST version is held \u2014 the hold mechanism copies the held value forward, making the prior version an equal leak. Serializes normally once the hold resolves."
26135
+ },
26136
+ status: {
26137
+ type: [
26138
+ "string",
26139
+ "null"
26140
+ ]
26141
+ },
26142
+ source: {
26143
+ type: [
26144
+ "string",
26145
+ "null"
26146
+ ]
26147
+ },
26148
+ confidence: {
26149
+ type: [
26150
+ "number",
26151
+ "null"
26152
+ ],
26153
+ format: "float"
26154
+ },
26155
+ created_at: {
26156
+ type: [
26157
+ "string",
26158
+ "null"
26159
+ ],
26160
+ format: "date-time"
26161
+ }
26162
+ }
26163
+ },
26164
+ ResultsRecord: {
26165
+ type: "object",
26166
+ required: [
26167
+ "document_id",
26168
+ "filename",
26169
+ "run_id",
26170
+ "pipeline_id",
26171
+ "record_id",
26172
+ "status",
26173
+ "completed_at",
26174
+ "fields"
26175
+ ],
26176
+ properties: {
26177
+ document_id: {
26178
+ type: [
26179
+ "string",
26180
+ "null"
26181
+ ],
26182
+ format: "uuid",
26183
+ description: "Null only for an anchor-less composed row (the product record's anchor could not be resolved)."
26184
+ },
26185
+ filename: {
26186
+ type: [
26187
+ "string",
26188
+ "null"
26189
+ ]
26190
+ },
26191
+ run_id: {
26192
+ type: [
26193
+ "string",
26194
+ "null"
26195
+ ],
26196
+ format: "uuid",
26197
+ description: "The attributed /v1/run request id (echo containment, newest-for-pipeline fallback restricted to echo-less legacy rows); null for a UI or POST /v1/pipelines run."
26198
+ },
26199
+ pipeline_id: {
26200
+ type: "string",
26201
+ format: "uuid"
26202
+ },
26203
+ record_id: {
26204
+ type: "string",
26205
+ description: "The row's record identity \u2014 the pipeline_document id on the main set, the product record id on the composed set."
26206
+ },
26207
+ status: {
26208
+ type: "string",
26209
+ enum: [
26210
+ "complete",
26211
+ "partial",
26212
+ "error",
26213
+ "processing"
26214
+ ],
26215
+ description: "Folded from ~10 internal pipeline_documents states. Deliberately keeps partial (unlike GET /v1/run/{id}'s documents[].status, which folds partial into completed)."
26216
+ },
26217
+ completed_at: {
26218
+ type: [
26219
+ "string",
26220
+ "null"
26221
+ ],
26222
+ format: "date-time",
26223
+ description: "COALESCE of the last per-phase completion stamp. Tracks document PROCESSING completion, not value change \u2014 a review promotion or assembly recompose never advances it, and a phase rerun nulls it until the document re-processes."
26224
+ },
26225
+ metadata: {
26226
+ type: "object",
26227
+ additionalProperties: true,
26228
+ description: "Caller tags; present only when set."
26229
+ },
26230
+ batch_id: {
26231
+ type: "string",
26232
+ description: "Present only when set."
26233
+ },
26234
+ fields: {
26235
+ type: "object",
26236
+ additionalProperties: true,
26237
+ description: "field_key -> clean value. Held (pending_approval) fields serialize null; demoted fields and __ diagnostics are absent."
26238
+ },
26239
+ cells: {
26240
+ type: "object",
26241
+ additionalProperties: {
26242
+ $ref: "#/components/schemas/ResultsCell"
26243
+ },
26244
+ description: "Present only when include=cells. Keyed by field_key."
26245
+ },
26246
+ provenance: {
26247
+ type: "object",
26248
+ additionalProperties: {
26249
+ $ref: "#/components/schemas/ResultsProvenance"
26250
+ },
26251
+ description: "Present only when include=provenance. Keyed by field_key."
26252
+ },
26253
+ audit: {
26254
+ type: "object",
26255
+ additionalProperties: {
26256
+ type: "array",
26257
+ items: {
26258
+ $ref: "#/components/schemas/ResultsAuditVersion"
26259
+ }
26260
+ },
26261
+ description: "Present only when include=audit. Keyed by field_key; the cell-version trail."
26262
+ }
26263
+ }
26264
+ },
26265
+ ResultsPagination: {
26266
+ type: "object",
26267
+ required: [
26268
+ "total",
26269
+ "limit",
26270
+ "has_more",
26271
+ "next_cursor"
26272
+ ],
26273
+ properties: {
26274
+ total: {
26275
+ type: "integer"
26276
+ },
26277
+ limit: {
26278
+ type: "integer"
26279
+ },
26280
+ has_more: {
26281
+ type: "boolean"
26282
+ },
26283
+ next_cursor: {
26284
+ type: [
26285
+ "string",
26286
+ "null"
26287
+ ],
26288
+ description: "Opaque cursor keyed on record_id. Stable under concurrent appends."
26289
+ }
26290
+ }
26291
+ },
26292
+ PipelineResultsResponse: {
26293
+ type: "object",
26294
+ required: [
26295
+ "pipeline_id",
26296
+ "spec_id",
26297
+ "status",
26298
+ "view",
26299
+ "generated_at",
26300
+ "columns",
26301
+ "data",
26302
+ "pagination",
26303
+ "pending_review_count",
26304
+ "links"
26305
+ ],
26306
+ properties: {
26307
+ pipeline_id: {
26308
+ type: "string",
26309
+ format: "uuid"
26310
+ },
26311
+ spec_id: {
26312
+ type: "string",
26313
+ format: "uuid",
26314
+ description: "pipeline.schema_id \u2014 the Spec this run compiled from."
26315
+ },
26316
+ status: {
26317
+ type: "string",
26318
+ description: "The pipeline's own lifecycle status. Never settles for an append pipeline that keeps receiving requests."
26319
+ },
26320
+ view: {
26321
+ type: "string",
26322
+ enum: [
26323
+ "composed",
26324
+ "documents"
26325
+ ]
26326
+ },
26327
+ generated_at: {
26328
+ type: "string",
26329
+ format: "date-time"
26330
+ },
26331
+ columns: {
26332
+ type: "array",
26333
+ items: {
26334
+ $ref: "#/components/schemas/ResultsColumn"
26335
+ }
26336
+ },
26337
+ data: {
26338
+ type: "array",
26339
+ items: {
26340
+ $ref: "#/components/schemas/ResultsRecord"
26341
+ }
26342
+ },
26343
+ pagination: {
26344
+ $ref: "#/components/schemas/ResultsPagination"
26345
+ },
26346
+ pending_review_count: {
26347
+ type: "integer",
26348
+ description: "Held cells in the current page's records only."
26349
+ },
26350
+ scope_note: {
26351
+ type: "string",
26352
+ description: "Present only for the echo-less legacy run_id zero-state \u2014 a 200 empty page, never a guess."
26353
+ },
26354
+ links: {
26355
+ type: "object",
26356
+ required: [
26357
+ "self",
26358
+ "pipeline",
26359
+ "progress"
26360
+ ],
26361
+ properties: {
26362
+ self: {
26363
+ type: "string"
26364
+ },
26365
+ pipeline: {
26366
+ type: "string"
26367
+ },
26368
+ progress: {
26369
+ type: "string"
26370
+ }
26371
+ }
26372
+ }
26373
+ }
26374
+ },
26375
+ RunResultsResponse: {
26376
+ type: "object",
26377
+ required: [
26378
+ "run_id",
26379
+ "pipeline_id",
26380
+ "spec_id",
26381
+ "status",
26382
+ "view",
26383
+ "generated_at",
26384
+ "columns",
26385
+ "data",
26386
+ "pagination",
26387
+ "pending_review_count",
26388
+ "links"
26389
+ ],
26390
+ properties: {
26391
+ run_id: {
26392
+ type: "string",
26393
+ format: "uuid"
26394
+ },
26395
+ pipeline_id: {
26396
+ type: [
26397
+ "string",
26398
+ "null"
26399
+ ],
26400
+ format: "uuid",
26401
+ description: "Null while the run has no compiled pipeline yet."
26402
+ },
26403
+ spec_id: {
26404
+ type: "string",
26405
+ format: "uuid"
26406
+ },
26407
+ status: {
26408
+ type: "string",
26409
+ enum: [
26410
+ "processing",
26411
+ "completed",
26412
+ "failed"
26413
+ ],
26414
+ description: "The folded public run status (same vocabulary as GET /v1/run/{id}) \u2014 settles even for an append pipeline that never settles at the pipeline level."
26415
+ },
26416
+ view: {
26417
+ type: "string",
26418
+ enum: [
26419
+ "documents"
26420
+ ],
26421
+ description: "Always documents on this route."
26422
+ },
26423
+ generated_at: {
26424
+ type: "string",
26425
+ format: "date-time"
26426
+ },
26427
+ columns: {
26428
+ type: "array",
26429
+ items: {
26430
+ $ref: "#/components/schemas/ResultsColumn"
26431
+ }
26432
+ },
26433
+ data: {
26434
+ type: "array",
26435
+ items: {
26436
+ $ref: "#/components/schemas/ResultsRecord"
26437
+ }
26438
+ },
26439
+ pagination: {
26440
+ $ref: "#/components/schemas/ResultsPagination"
26441
+ },
26442
+ pending_review_count: {
26443
+ type: "integer"
26444
+ },
26445
+ scope_note: {
26446
+ type: "string",
26447
+ description: "Present only for the two zero-states \u2014 no pipeline yet, or an echo-less legacy run."
26448
+ },
26449
+ links: {
26450
+ type: "object",
26451
+ required: [
26452
+ "self",
26453
+ "run"
26454
+ ],
26455
+ properties: {
26456
+ self: {
26457
+ type: "string"
26458
+ },
26459
+ run: {
26460
+ type: "string"
26461
+ },
26462
+ composed_results: {
26463
+ type: "string",
26464
+ description: "Present only when a pipeline exists \u2014 GET /v1/pipelines/{id}/results, where an assembly run's composed rows actually live."
26465
+ }
26466
+ }
26467
+ }
26468
+ }
26469
+ },
26470
+ ResultsBadRequestError: {
26471
+ type: "object",
26472
+ required: [
26473
+ "error",
26474
+ "code",
26475
+ "message"
26476
+ ],
26477
+ properties: {
26478
+ error: {
26479
+ type: "string",
26480
+ enum: [
26481
+ "bad_request"
26482
+ ]
26483
+ },
26484
+ code: {
26485
+ type: "string",
26486
+ enum: [
26487
+ "invalid_view",
26488
+ "invalid_document_ids",
26489
+ "invalid_run_id",
26490
+ "invalid_time_range",
26491
+ "invalid_status",
26492
+ "invalid_include",
26493
+ "unsupported_filter",
26494
+ "audit_include_too_broad"
26495
+ ]
26496
+ },
26497
+ message: {
26498
+ type: "string"
26499
+ }
26500
+ }
26501
+ },
25196
26502
  ResolutionResponse: {
25197
26503
  type: "object",
25198
26504
  required: [
@@ -26232,13 +27538,15 @@ var API_NAV_SECTIONS = [
26232
27538
  ] },
26233
27539
  { id: "run", label: "Run", children: [
26234
27540
  { id: "run-spec", label: "Run a Spec" },
26235
- { id: "poll-spec-run", label: "Poll a Run" }
27541
+ { id: "poll-spec-run", label: "Poll a Run" },
27542
+ { id: "get-run-results", label: "Run Results" }
26236
27543
  ] },
26237
27544
  { id: "pipelines", label: "Pipelines", children: [
26238
27545
  { id: "run-pipeline", label: "Run Pipeline" },
26239
27546
  { id: "list-pipelines", label: "List Pipelines" },
26240
27547
  { id: "get-pipeline", label: "Get Pipeline" },
26241
27548
  { id: "get-pipeline-progress", label: "Pipeline Progress" },
27549
+ { id: "get-pipeline-results", label: "Pipeline Results" },
26242
27550
  { id: "rerun-pipeline", label: "Rerun Pipeline" },
26243
27551
  { id: "create-pipeline-data-product", label: "Create Data Product" },
26244
27552
  { id: "delete-pipeline", label: "Delete Pipeline" }