@talonic/docs 0.21.11 → 0.21.15
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 +535 -15
- package/dist/index.js +480 -8
- package/dist/index.js.map +1 -1
- package/dist/seo.js +1340 -32
- package/openapi.json +1337 -31
- package/package.json +1 -1
package/openapi.json
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
"name": "Delivery",
|
|
62
|
-
"description": "Outbound delivery. Configure destinations (six live connectors: webhook, sftp,\ns3, azure_blob, google_drive, onedrive), create bindings that join signal filters\nto deliverable types + destinations + serializers, and inspect the\nhistory/DLQ/events log. Every delivery is at-least-once with an idempotency key\non the wire.\n\n## Webhook Contract\n\n**Event payload:**\n```json\n{\n \"event\": {\n \"event_type\": \"document.extracted\",\n \"event_id\": \"42\",\n \"binding_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"idempotency_key\": \"c9f3a7e1b2d4f6a8e0c2d4f6a8e0c2d4\",\n \"attempt\": 1,\n \"delivered_at\": \"2026-04-25T14:30:00.000Z\"\n },\n \"payload\": { \"document_id\": \"...\", \"data\": { \"...extracted fields...\" } }\n}\n```\n\n**Event types:** `document.extracted` (deliver with the `document.capture`\ndeliverable for the raw field map; its payload gains optional `metadata`/\n`batch_id` read from the document's own `client_metadata`/`client_batch_id`\ncolumns — document-scoped, not request-scoped, since this deliverable has\nno run-request context; present only when set),\n`document.extraction_failed`,\n`document.structured` (per-document structured fields from a Spec pipeline / `/v1/run`; deliver with the `pipeline.capture` deliverable — its payload carries `run_id` (null outside `/v1/run`), `document_id`, `pipeline_id`, `fields` for submission correlation, and optional `metadata`/`batch_id`; for a `/v1/run`-attributed document these read the ATTRIBUTED REQUEST's per-input merged bag first — correct under byte-identical dedup and append, where the canonical documents row can carry a different submission's tags — falling back to the documents row when no request is attributed; present only when set),\n`run.completed` (a `POST /v1/run` pipeline finished; payload adds `records` —\nan array of `{ document_id, filename, data, metadata?, batch_id? }`, one entry\nper output row, ALWAYS an array even for a single document; `metadata`/\n`batch_id` are the submitting request's per-input merged bag (echo-sourced,\nso dedup/append never leaks another request's tags onto this one's records),\npresent only when set; assembled runs attribute each\ncomposed row to its anchor document; `document_id` and `filename` are\nnullable — null when a row's document identity cannot be resolved —\nalongside the legacy `structured_data`,\nstill emitted but considered legacy in favor of `records`),\n`run.failed` (a `POST /v1/run` pipeline failed — every document errored\nduring ingest or extraction; the `error` object's shape varies by failure\nstage and may include `document_ids`, a best-effort array of the input\ndocument ids),\n`run.dataspace.completed`, `run.dataspace.failed`, `result.dataspace.completed`,\n`result.dataspace.failed`, `run.structuring.completed`, `run.structuring.failed`,\n`run.resolution.completed`, `run.resolution.failed`, `run.extraction.completed`,\n`run.extraction.failed`, `result.flagged`, `result.approved`, `result.rejected`,\n`delivery.item.completed`, `delivery.item.failed`.\n\n**Signature verification (HMAC-SHA256):**\n\nHeader: `X-Talonic-Signature: t=1714060200000,v1=abc123...`\n\n```javascript\nconst crypto = require('crypto');\nconst [tPart, vPart] = signature.split(',');\nconst timestamp = tPart.split('=')[1];\nconst received = vPart.split('=')[1];\nconst expected = crypto.createHmac('sha256', signingSecret)\n .update(timestamp + '.' + rawBody).digest('hex');\nconst valid = crypto.timingSafeEqual(\n Buffer.from(received), Buffer.from(expected));\n```\n\n**Retry policy:** Up to 7 attempts — 0s, 30s, 2m, 8m, 30m, 2h, 8h (~10.5h total).\nHTTP 429/5xx are retryable. HTTP 4xx (except 408) goes to DLQ immediately.\n\n**Dead-letter queue recovery:** When all retries are exhausted, the delivery\nlands in the DLQ. List failed deliveries with `GET /v1/delivery/dlq`\n(filterable by `binding_id` and `error_code`). Inspect a single entry with\n`GET /v1/delivery/dlq/{id}`. Replay with `POST /v1/delivery/dlq/{id}/replay`\n— this deletes the DLQ entry, re-signs the payload with the current\nsigning secret, resets the retry counter to attempt 1, and re-enqueues\nthe delivery through the full backoff ladder.\n"
|
|
62
|
+
"description": "Outbound delivery. Configure destinations (six live connectors: webhook, sftp,\ns3, azure_blob, google_drive, onedrive), create bindings that join signal filters\nto deliverable types + destinations + serializers, and inspect the\nhistory/DLQ/events log. Every delivery is at-least-once with an idempotency key\non the wire.\n\n## Webhook Contract\n\n**Event payload:**\n```json\n{\n \"event\": {\n \"event_type\": \"document.extracted\",\n \"event_id\": \"42\",\n \"binding_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"idempotency_key\": \"c9f3a7e1b2d4f6a8e0c2d4f6a8e0c2d4\",\n \"attempt\": 1,\n \"delivered_at\": \"2026-04-25T14:30:00.000Z\"\n },\n \"payload\": { \"document_id\": \"...\", \"data\": { \"...extracted fields...\" } }\n}\n```\n\n**Event types:** `document.extracted` (deliver with the `document.capture`\ndeliverable for the raw field map; its payload gains optional `metadata`/\n`batch_id` read from the document's own `client_metadata`/`client_batch_id`\ncolumns — document-scoped, not request-scoped, since this deliverable has\nno run-request context; present only when set),\n`document.extraction_failed`,\n`document.structured` (per-document structured fields from a Spec pipeline / `/v1/run`; deliver with the `pipeline.capture` deliverable — its payload carries `run_id` (null outside `/v1/run`), `document_id`, `pipeline_id`, `fields` for submission correlation, and optional `metadata`/`batch_id`; for a `/v1/run`-attributed document these read the ATTRIBUTED REQUEST's per-input merged bag first — correct under byte-identical dedup and append, where the canonical documents row can carry a different submission's tags — falling back to the documents row when no request is attributed; present only when set),\n`run.completed` (a `POST /v1/run` pipeline finished; payload adds `records` —\nan array of `{ document_id, filename, data, metadata?, batch_id? }`, one entry\nper output row, ALWAYS an array even for a single document; `metadata`/\n`batch_id` are the submitting request's per-input merged bag (echo-sourced,\nso dedup/append never leaks another request's tags onto this one's records),\npresent only when set; assembled runs attribute each\ncomposed row to its anchor document; `document_id` and `filename` are\nnullable — null when a row's document identity cannot be resolved —\nalongside the legacy `structured_data`,\nstill emitted but considered legacy in favor of `records`),\n`run.failed` (a `POST /v1/run` pipeline failed — every document errored\nduring ingest or extraction; the `error` object's shape varies by failure\nstage and may include `document_ids`, a best-effort array of the input\ndocument ids),\n`run.dataspace.completed`, `run.dataspace.failed`, `result.dataspace.completed`,\n`result.dataspace.failed`, `run.structuring.completed`, `run.structuring.failed`,\n`run.resolution.completed`, `run.resolution.failed`, `run.extraction.completed`,\n`run.extraction.failed`, `result.flagged`, `result.approved`, `result.rejected`,\n`delivery.item.completed`, `delivery.item.failed`.\n\n**Typed structured values:** `run.completed` and `document.structured`\nemit typed field values natively — a field backed by a structured\nsubschema arrives as an array of objects (e.g.\n`[{\"label\":\"BoL\",\"value\":\"123\"}]`), not a stringified scalar, and each\nobject's subfields are typed per their declared subfield `data_type`. A\nconsumer that assumes every field value is a scalar breaks silently on\nsuch a field; that is the consumer's contract violation, not a payload\nchange. `document.extracted` is unaffected — its arrays are pre-flattened\nat the capture layer.\n\n\nThe same subfield typing applies on `json`/`ndjson` delivery and on the\n`/v1` poll — `GET /v1/run/{id}/results` and `GET /v1/pipelines/{id}/results`,\nboth the `fields` map and the `?include=cells` `cells[].value` — so the\npoll and the webhook agree. Per-subfield miss behavior follows the wire\nform of the declared type: a `number` or `boolean` subfield value that\nfails to parse emits `null` (these types have no string wire form, so the\nwire stays strictly number-or-null / boolean-or-null); an `enum` or `date`\nsubfield value that is out-of-vocabulary or unparseable passes through as\nits raw string (these types ARE string-typed on the wire, so a present\nvalue is never dropped). A nested array or object subfield value passes\nthrough raw. The `audit[].value` view is the deliberate raw history view\nand is never type-projected. Every extraction WIRE leaf remains\nstring-typed — subfield typing is derived at this outbound edge, not\ncarried on the extraction wire.\n\n**Signature verification (HMAC-SHA256):**\n\nHeader: `X-Talonic-Signature: t=1714060200000,v1=abc123...`\n\n```javascript\nconst crypto = require('crypto');\nconst [tPart, vPart] = signature.split(',');\nconst timestamp = tPart.split('=')[1];\nconst received = vPart.split('=')[1];\nconst expected = crypto.createHmac('sha256', signingSecret)\n .update(timestamp + '.' + rawBody).digest('hex');\nconst valid = crypto.timingSafeEqual(\n Buffer.from(received), Buffer.from(expected));\n```\n\n**Retry policy:** Up to 7 attempts — 0s, 30s, 2m, 8m, 30m, 2h, 8h (~10.5h total).\nHTTP 429/5xx are retryable. HTTP 4xx (except 408) goes to DLQ immediately.\n\n**Dead-letter queue recovery:** When all retries are exhausted, the delivery\nlands in the DLQ. List failed deliveries with `GET /v1/delivery/dlq`\n(filterable by `binding_id` and `error_code`). Inspect a single entry with\n`GET /v1/delivery/dlq/{id}`. Replay with `POST /v1/delivery/dlq/{id}/replay`\n— this deletes the DLQ entry, re-signs the payload with the current\nsigning secret, resets the retry counter to attempt 1, and re-enqueues\nthe delivery through the full backoff ladder.\n"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"name": "Filter",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
"name": "Usage",
|
|
102
|
-
"description": "Aggregate and per-
|
|
102
|
+
"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."
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
"name": "Resolutions",
|
|
@@ -6304,7 +6304,7 @@
|
|
|
6304
6304
|
"get": {
|
|
6305
6305
|
"operationId": "getUsage",
|
|
6306
6306
|
"summary": "Aggregate API usage stats",
|
|
6307
|
-
"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",
|
|
6307
|
+
"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 —\nevery tenant, not just consumers of the per-document route.\n",
|
|
6308
6308
|
"tags": [
|
|
6309
6309
|
"Usage"
|
|
6310
6310
|
],
|
|
@@ -6352,7 +6352,7 @@
|
|
|
6352
6352
|
"get": {
|
|
6353
6353
|
"operationId": "getDocumentUsage",
|
|
6354
6354
|
"summary": "Per-document API usage",
|
|
6355
|
-
"description": "Returns per-document API usage entries and totals. 404 if no usage
|
|
6355
|
+
"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",
|
|
6356
6356
|
"tags": [
|
|
6357
6357
|
"Usage"
|
|
6358
6358
|
],
|
|
@@ -6384,6 +6384,144 @@
|
|
|
6384
6384
|
}
|
|
6385
6385
|
}
|
|
6386
6386
|
},
|
|
6387
|
+
"/v1/usage/pipelines/{id}": {
|
|
6388
|
+
"get": {
|
|
6389
|
+
"operationId": "getPipelineUsage",
|
|
6390
|
+
"summary": "Per-pipeline API usage",
|
|
6391
|
+
"description": "Returns AI usage for one pipeline: totals, a breakdown by\n`operation_type` × `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 — 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) — unapproved organizations get a plain `404` (the\nroute's existence is not advertised) — 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× 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 — the two do not\nreconcile against each other.\n",
|
|
6392
|
+
"tags": [
|
|
6393
|
+
"Usage"
|
|
6394
|
+
],
|
|
6395
|
+
"security": [
|
|
6396
|
+
{
|
|
6397
|
+
"ApiKeyAuth": []
|
|
6398
|
+
}
|
|
6399
|
+
],
|
|
6400
|
+
"parameters": [
|
|
6401
|
+
{
|
|
6402
|
+
"$ref": "#/components/parameters/ResourceId"
|
|
6403
|
+
},
|
|
6404
|
+
{
|
|
6405
|
+
"name": "from",
|
|
6406
|
+
"in": "query",
|
|
6407
|
+
"schema": {
|
|
6408
|
+
"type": "string",
|
|
6409
|
+
"format": "date-time"
|
|
6410
|
+
},
|
|
6411
|
+
"description": "Start of the reporting window (ISO 8601). Default 90 days ago."
|
|
6412
|
+
},
|
|
6413
|
+
{
|
|
6414
|
+
"name": "to",
|
|
6415
|
+
"in": "query",
|
|
6416
|
+
"schema": {
|
|
6417
|
+
"type": "string",
|
|
6418
|
+
"format": "date-time"
|
|
6419
|
+
},
|
|
6420
|
+
"description": "End of the reporting window (ISO 8601). Default now."
|
|
6421
|
+
}
|
|
6422
|
+
],
|
|
6423
|
+
"responses": {
|
|
6424
|
+
"200": {
|
|
6425
|
+
"description": "Per-pipeline usage breakdown.",
|
|
6426
|
+
"content": {
|
|
6427
|
+
"application/json": {
|
|
6428
|
+
"schema": {
|
|
6429
|
+
"$ref": "#/components/schemas/PipelineUsageResponse"
|
|
6430
|
+
}
|
|
6431
|
+
}
|
|
6432
|
+
}
|
|
6433
|
+
},
|
|
6434
|
+
"401": {
|
|
6435
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
6436
|
+
},
|
|
6437
|
+
"403": {
|
|
6438
|
+
"$ref": "#/components/responses/Forbidden"
|
|
6439
|
+
},
|
|
6440
|
+
"404": {
|
|
6441
|
+
"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 — see description above).",
|
|
6442
|
+
"content": {
|
|
6443
|
+
"application/json": {
|
|
6444
|
+
"schema": {
|
|
6445
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
6446
|
+
}
|
|
6447
|
+
}
|
|
6448
|
+
}
|
|
6449
|
+
},
|
|
6450
|
+
"429": {
|
|
6451
|
+
"$ref": "#/components/responses/RateLimitExceeded"
|
|
6452
|
+
}
|
|
6453
|
+
}
|
|
6454
|
+
}
|
|
6455
|
+
},
|
|
6456
|
+
"/v1/usage/runs/{id}": {
|
|
6457
|
+
"get": {
|
|
6458
|
+
"operationId": "getRunUsage",
|
|
6459
|
+
"summary": "Per-run API usage",
|
|
6460
|
+
"description": "Returns AI usage for one `/v1/run` request: totals, a breakdown by\n`operation_type` × `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 — never `404` — 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 — the two do not reconcile against each other.\n",
|
|
6461
|
+
"tags": [
|
|
6462
|
+
"Usage"
|
|
6463
|
+
],
|
|
6464
|
+
"security": [
|
|
6465
|
+
{
|
|
6466
|
+
"ApiKeyAuth": []
|
|
6467
|
+
}
|
|
6468
|
+
],
|
|
6469
|
+
"parameters": [
|
|
6470
|
+
{
|
|
6471
|
+
"$ref": "#/components/parameters/ResourceId"
|
|
6472
|
+
},
|
|
6473
|
+
{
|
|
6474
|
+
"name": "from",
|
|
6475
|
+
"in": "query",
|
|
6476
|
+
"schema": {
|
|
6477
|
+
"type": "string",
|
|
6478
|
+
"format": "date-time"
|
|
6479
|
+
},
|
|
6480
|
+
"description": "Start of the reporting window (ISO 8601). Default 90 days ago."
|
|
6481
|
+
},
|
|
6482
|
+
{
|
|
6483
|
+
"name": "to",
|
|
6484
|
+
"in": "query",
|
|
6485
|
+
"schema": {
|
|
6486
|
+
"type": "string",
|
|
6487
|
+
"format": "date-time"
|
|
6488
|
+
},
|
|
6489
|
+
"description": "End of the reporting window (ISO 8601). Default now."
|
|
6490
|
+
}
|
|
6491
|
+
],
|
|
6492
|
+
"responses": {
|
|
6493
|
+
"200": {
|
|
6494
|
+
"description": "Per-run usage breakdown (zero totals if still ingesting or failed pre-pipeline).",
|
|
6495
|
+
"content": {
|
|
6496
|
+
"application/json": {
|
|
6497
|
+
"schema": {
|
|
6498
|
+
"$ref": "#/components/schemas/RunUsageResponse"
|
|
6499
|
+
}
|
|
6500
|
+
}
|
|
6501
|
+
}
|
|
6502
|
+
},
|
|
6503
|
+
"401": {
|
|
6504
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
6505
|
+
},
|
|
6506
|
+
"403": {
|
|
6507
|
+
"$ref": "#/components/responses/Forbidden"
|
|
6508
|
+
},
|
|
6509
|
+
"404": {
|
|
6510
|
+
"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).",
|
|
6511
|
+
"content": {
|
|
6512
|
+
"application/json": {
|
|
6513
|
+
"schema": {
|
|
6514
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
6515
|
+
}
|
|
6516
|
+
}
|
|
6517
|
+
}
|
|
6518
|
+
},
|
|
6519
|
+
"429": {
|
|
6520
|
+
"$ref": "#/components/responses/RateLimitExceeded"
|
|
6521
|
+
}
|
|
6522
|
+
}
|
|
6523
|
+
}
|
|
6524
|
+
},
|
|
6387
6525
|
"/v1/usage/credits": {
|
|
6388
6526
|
"get": {
|
|
6389
6527
|
"operationId": "getCreditUsageByFunction",
|
|
@@ -9418,7 +9556,7 @@
|
|
|
9418
9556
|
},
|
|
9419
9557
|
"scopes": {
|
|
9420
9558
|
"type": "array",
|
|
9421
|
-
"description": "Subset of: extract, read, write, operations, billing, delivery. Defaults to extract/read/write/operations.",
|
|
9559
|
+
"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` — 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.",
|
|
9422
9560
|
"items": {
|
|
9423
9561
|
"type": "string",
|
|
9424
9562
|
"enum": [
|
|
@@ -9427,7 +9565,8 @@
|
|
|
9427
9565
|
"write",
|
|
9428
9566
|
"operations",
|
|
9429
9567
|
"billing",
|
|
9430
|
-
"delivery"
|
|
9568
|
+
"delivery",
|
|
9569
|
+
"usage"
|
|
9431
9570
|
]
|
|
9432
9571
|
}
|
|
9433
9572
|
}
|
|
@@ -17584,7 +17723,7 @@
|
|
|
17584
17723
|
},
|
|
17585
17724
|
"responses": {
|
|
17586
17725
|
"201": {
|
|
17587
|
-
"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)."
|
|
17726
|
+
"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 — usable as the `run_id` filter on the results/documents reads."
|
|
17588
17727
|
},
|
|
17589
17728
|
"400": {
|
|
17590
17729
|
"description": "The Spec has no composed rail, or the body failed validation."
|
|
@@ -17795,6 +17934,152 @@
|
|
|
17795
17934
|
}
|
|
17796
17935
|
}
|
|
17797
17936
|
},
|
|
17937
|
+
"/v1/pipelines/{id}/results": {
|
|
17938
|
+
"get": {
|
|
17939
|
+
"tags": [
|
|
17940
|
+
"Pipelines"
|
|
17941
|
+
],
|
|
17942
|
+
"summary": "Get a pipeline's structured results (poll-able)",
|
|
17943
|
+
"description": "The pipeline run's structured rows, poll-able as JSON — 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 — `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 — `view=composed` degrades to it rather than erroring. An **anchor-less composed row** (the product record's anchor could not be resolved — 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\nA field backed by a structured subschema is projected to its declared subfield types on this poll — in both the `fields` map and the `?include=cells` `cells[].value` — matching the `run.completed` webhook; a `number`/`boolean` subfield parse-miss serializes `null` and an `enum`/`date` miss passes through raw (see the `ResultsCell`/`ResultsRecord` schemas and the Webhooks event catalog for the full per-type contract). The `include=audit` trail is the raw history view and is NOT type-projected.\n\n`include=cells,provenance,audit` (comma-separated) add shape beyond `fields`. `cells` adds per-field `{ value, status, confidence, source, document_id, filename }` — `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 — 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 — 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 — `complete`, `partial`, and `error` pass through, everything else (queue/phase states, `awaiting_ocr`, …) 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",
|
|
17944
|
+
"operationId": "getPipelineResults",
|
|
17945
|
+
"security": [
|
|
17946
|
+
{
|
|
17947
|
+
"BearerAuth": []
|
|
17948
|
+
}
|
|
17949
|
+
],
|
|
17950
|
+
"parameters": [
|
|
17951
|
+
{
|
|
17952
|
+
"name": "id",
|
|
17953
|
+
"in": "path",
|
|
17954
|
+
"required": true,
|
|
17955
|
+
"schema": {
|
|
17956
|
+
"type": "string",
|
|
17957
|
+
"format": "uuid"
|
|
17958
|
+
}
|
|
17959
|
+
},
|
|
17960
|
+
{
|
|
17961
|
+
"name": "document_id",
|
|
17962
|
+
"in": "query",
|
|
17963
|
+
"schema": {
|
|
17964
|
+
"type": "string"
|
|
17965
|
+
},
|
|
17966
|
+
"description": "Comma-separated document UUIDs (1-100). Composed rows match on the anchor document."
|
|
17967
|
+
},
|
|
17968
|
+
{
|
|
17969
|
+
"name": "run_id",
|
|
17970
|
+
"in": "query",
|
|
17971
|
+
"schema": {
|
|
17972
|
+
"type": "string",
|
|
17973
|
+
"format": "uuid"
|
|
17974
|
+
},
|
|
17975
|
+
"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."
|
|
17976
|
+
},
|
|
17977
|
+
{
|
|
17978
|
+
"name": "since",
|
|
17979
|
+
"in": "query",
|
|
17980
|
+
"schema": {
|
|
17981
|
+
"type": "string",
|
|
17982
|
+
"format": "date-time"
|
|
17983
|
+
},
|
|
17984
|
+
"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."
|
|
17985
|
+
},
|
|
17986
|
+
{
|
|
17987
|
+
"name": "until",
|
|
17988
|
+
"in": "query",
|
|
17989
|
+
"schema": {
|
|
17990
|
+
"type": "string",
|
|
17991
|
+
"format": "date-time"
|
|
17992
|
+
},
|
|
17993
|
+
"description": "Only records whose completed_at is at or before this ISO timestamp."
|
|
17994
|
+
},
|
|
17995
|
+
{
|
|
17996
|
+
"name": "status",
|
|
17997
|
+
"in": "query",
|
|
17998
|
+
"schema": {
|
|
17999
|
+
"type": "string"
|
|
18000
|
+
},
|
|
18001
|
+
"description": "Comma-separated subset of complete, partial, error, processing."
|
|
18002
|
+
},
|
|
18003
|
+
{
|
|
18004
|
+
"name": "view",
|
|
18005
|
+
"in": "query",
|
|
18006
|
+
"schema": {
|
|
18007
|
+
"type": "string",
|
|
18008
|
+
"enum": [
|
|
18009
|
+
"composed",
|
|
18010
|
+
"documents"
|
|
18011
|
+
]
|
|
18012
|
+
},
|
|
18013
|
+
"description": "Defaults to composed when the run has an assembly product set, else documents. A non-assembly run ignores view=composed."
|
|
18014
|
+
},
|
|
18015
|
+
{
|
|
18016
|
+
"name": "include",
|
|
18017
|
+
"in": "query",
|
|
18018
|
+
"schema": {
|
|
18019
|
+
"type": "string"
|
|
18020
|
+
},
|
|
18021
|
+
"description": "Comma-separated subset of cells, provenance, audit."
|
|
18022
|
+
},
|
|
18023
|
+
{
|
|
18024
|
+
"name": "limit",
|
|
18025
|
+
"in": "query",
|
|
18026
|
+
"schema": {
|
|
18027
|
+
"type": "integer",
|
|
18028
|
+
"minimum": 1,
|
|
18029
|
+
"maximum": 100,
|
|
18030
|
+
"default": 25
|
|
18031
|
+
},
|
|
18032
|
+
"description": "Maximum records per page (structure_pipeline.results_api — default 25, max 100)."
|
|
18033
|
+
},
|
|
18034
|
+
{
|
|
18035
|
+
"name": "cursor",
|
|
18036
|
+
"in": "query",
|
|
18037
|
+
"schema": {
|
|
18038
|
+
"type": "string"
|
|
18039
|
+
},
|
|
18040
|
+
"description": "Opaque pagination cursor from a previous response's pagination.next_cursor, keyed on record_id."
|
|
18041
|
+
}
|
|
18042
|
+
],
|
|
18043
|
+
"responses": {
|
|
18044
|
+
"200": {
|
|
18045
|
+
"description": "The pipeline's results page.",
|
|
18046
|
+
"content": {
|
|
18047
|
+
"application/json": {
|
|
18048
|
+
"schema": {
|
|
18049
|
+
"$ref": "#/components/schemas/PipelineResultsResponse"
|
|
18050
|
+
}
|
|
18051
|
+
}
|
|
18052
|
+
}
|
|
18053
|
+
},
|
|
18054
|
+
"400": {
|
|
18055
|
+
"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.",
|
|
18056
|
+
"content": {
|
|
18057
|
+
"application/json": {
|
|
18058
|
+
"schema": {
|
|
18059
|
+
"$ref": "#/components/schemas/ResultsBadRequestError"
|
|
18060
|
+
}
|
|
18061
|
+
}
|
|
18062
|
+
}
|
|
18063
|
+
},
|
|
18064
|
+
"401": {
|
|
18065
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
18066
|
+
},
|
|
18067
|
+
"404": {
|
|
18068
|
+
"description": "Pipeline not found, or run_id does not belong to this pipeline/organization.",
|
|
18069
|
+
"content": {
|
|
18070
|
+
"application/json": {
|
|
18071
|
+
"schema": {
|
|
18072
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
18073
|
+
}
|
|
18074
|
+
}
|
|
18075
|
+
}
|
|
18076
|
+
},
|
|
18077
|
+
"429": {
|
|
18078
|
+
"$ref": "#/components/responses/RateLimitExceeded"
|
|
18079
|
+
}
|
|
18080
|
+
}
|
|
18081
|
+
}
|
|
18082
|
+
},
|
|
17798
18083
|
"/v1/run": {
|
|
17799
18084
|
"post": {
|
|
17800
18085
|
"tags": [
|
|
@@ -18162,27 +18447,126 @@
|
|
|
18162
18447
|
}
|
|
18163
18448
|
}
|
|
18164
18449
|
},
|
|
18165
|
-
"/v1/
|
|
18450
|
+
"/v1/run/{id}/results": {
|
|
18166
18451
|
"get": {
|
|
18167
18452
|
"tags": [
|
|
18168
|
-
"
|
|
18453
|
+
"Run"
|
|
18169
18454
|
],
|
|
18170
|
-
"summary": "
|
|
18171
|
-
"
|
|
18455
|
+
"summary": "Get this run's structured results (poll-able, per-document)",
|
|
18456
|
+
"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 — \"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 — including the structured-subfield type projection on `fields`/`cells` and the raw, non-projected `audit` trail — 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 — poll this route for append consumers instead of the pipeline route. Requires read scope.\n",
|
|
18457
|
+
"operationId": "getRunResults",
|
|
18172
18458
|
"security": [
|
|
18173
18459
|
{
|
|
18174
18460
|
"BearerAuth": []
|
|
18175
18461
|
}
|
|
18176
18462
|
],
|
|
18177
|
-
"
|
|
18178
|
-
|
|
18179
|
-
"
|
|
18180
|
-
|
|
18181
|
-
|
|
18182
|
-
|
|
18183
|
-
|
|
18184
|
-
|
|
18185
|
-
|
|
18463
|
+
"parameters": [
|
|
18464
|
+
{
|
|
18465
|
+
"name": "id",
|
|
18466
|
+
"in": "path",
|
|
18467
|
+
"required": true,
|
|
18468
|
+
"schema": {
|
|
18469
|
+
"type": "string",
|
|
18470
|
+
"format": "uuid"
|
|
18471
|
+
}
|
|
18472
|
+
},
|
|
18473
|
+
{
|
|
18474
|
+
"name": "document_id",
|
|
18475
|
+
"in": "query",
|
|
18476
|
+
"schema": {
|
|
18477
|
+
"type": "string"
|
|
18478
|
+
},
|
|
18479
|
+
"description": "Comma-separated document UUIDs (1-100), intersected with the run's own documents echo."
|
|
18480
|
+
},
|
|
18481
|
+
{
|
|
18482
|
+
"name": "include",
|
|
18483
|
+
"in": "query",
|
|
18484
|
+
"schema": {
|
|
18485
|
+
"type": "string"
|
|
18486
|
+
},
|
|
18487
|
+
"description": "Comma-separated subset of cells, provenance, audit."
|
|
18488
|
+
},
|
|
18489
|
+
{
|
|
18490
|
+
"name": "limit",
|
|
18491
|
+
"in": "query",
|
|
18492
|
+
"schema": {
|
|
18493
|
+
"type": "integer",
|
|
18494
|
+
"minimum": 1,
|
|
18495
|
+
"maximum": 100,
|
|
18496
|
+
"default": 25
|
|
18497
|
+
},
|
|
18498
|
+
"description": "Maximum records per page (default 25, max 100)."
|
|
18499
|
+
},
|
|
18500
|
+
{
|
|
18501
|
+
"name": "cursor",
|
|
18502
|
+
"in": "query",
|
|
18503
|
+
"schema": {
|
|
18504
|
+
"type": "string"
|
|
18505
|
+
},
|
|
18506
|
+
"description": "Opaque pagination cursor from a previous response's pagination.next_cursor, keyed on record_id."
|
|
18507
|
+
}
|
|
18508
|
+
],
|
|
18509
|
+
"responses": {
|
|
18510
|
+
"200": {
|
|
18511
|
+
"description": "This run's results page (always the documents view).",
|
|
18512
|
+
"content": {
|
|
18513
|
+
"application/json": {
|
|
18514
|
+
"schema": {
|
|
18515
|
+
"$ref": "#/components/schemas/RunResultsResponse"
|
|
18516
|
+
}
|
|
18517
|
+
}
|
|
18518
|
+
}
|
|
18519
|
+
},
|
|
18520
|
+
"400": {
|
|
18521
|
+
"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.",
|
|
18522
|
+
"content": {
|
|
18523
|
+
"application/json": {
|
|
18524
|
+
"schema": {
|
|
18525
|
+
"$ref": "#/components/schemas/ResultsBadRequestError"
|
|
18526
|
+
}
|
|
18527
|
+
}
|
|
18528
|
+
}
|
|
18529
|
+
},
|
|
18530
|
+
"401": {
|
|
18531
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
18532
|
+
},
|
|
18533
|
+
"404": {
|
|
18534
|
+
"description": "Run request not found.",
|
|
18535
|
+
"content": {
|
|
18536
|
+
"application/json": {
|
|
18537
|
+
"schema": {
|
|
18538
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
18539
|
+
}
|
|
18540
|
+
}
|
|
18541
|
+
}
|
|
18542
|
+
},
|
|
18543
|
+
"429": {
|
|
18544
|
+
"$ref": "#/components/responses/RateLimitExceeded"
|
|
18545
|
+
}
|
|
18546
|
+
}
|
|
18547
|
+
}
|
|
18548
|
+
},
|
|
18549
|
+
"/v1/webhooks": {
|
|
18550
|
+
"get": {
|
|
18551
|
+
"tags": [
|
|
18552
|
+
"Webhooks"
|
|
18553
|
+
],
|
|
18554
|
+
"summary": "List webhook configs",
|
|
18555
|
+
"operationId": "listWebhooks",
|
|
18556
|
+
"security": [
|
|
18557
|
+
{
|
|
18558
|
+
"BearerAuth": []
|
|
18559
|
+
}
|
|
18560
|
+
],
|
|
18561
|
+
"responses": {
|
|
18562
|
+
"200": {
|
|
18563
|
+
"description": "{ data: webhook[] }"
|
|
18564
|
+
}
|
|
18565
|
+
}
|
|
18566
|
+
},
|
|
18567
|
+
"post": {
|
|
18568
|
+
"tags": [
|
|
18569
|
+
"Webhooks"
|
|
18186
18570
|
],
|
|
18187
18571
|
"summary": "Create a webhook",
|
|
18188
18572
|
"operationId": "createWebhook",
|
|
@@ -25022,15 +25406,26 @@
|
|
|
25022
25406
|
"required": [
|
|
25023
25407
|
"input_tokens",
|
|
25024
25408
|
"output_tokens",
|
|
25409
|
+
"cache_read_tokens",
|
|
25410
|
+
"cache_creation_tokens",
|
|
25025
25411
|
"calls"
|
|
25026
25412
|
],
|
|
25027
25413
|
"properties": {
|
|
25028
25414
|
"input_tokens": {
|
|
25029
|
-
"type": "integer"
|
|
25415
|
+
"type": "integer",
|
|
25416
|
+
"description": "Uncached input tokens (cached tokens are reported separately)."
|
|
25030
25417
|
},
|
|
25031
25418
|
"output_tokens": {
|
|
25032
25419
|
"type": "integer"
|
|
25033
25420
|
},
|
|
25421
|
+
"cache_read_tokens": {
|
|
25422
|
+
"type": "integer",
|
|
25423
|
+
"description": "Tokens served from the provider's prompt cache."
|
|
25424
|
+
},
|
|
25425
|
+
"cache_creation_tokens": {
|
|
25426
|
+
"type": "integer",
|
|
25427
|
+
"description": "Tokens written to the provider's prompt cache (Anthropic only; 0 for other providers)."
|
|
25428
|
+
},
|
|
25034
25429
|
"calls": {
|
|
25035
25430
|
"type": "integer"
|
|
25036
25431
|
}
|
|
@@ -25042,9 +25437,10 @@
|
|
|
25042
25437
|
"type": "object",
|
|
25043
25438
|
"required": [
|
|
25044
25439
|
"operation_type",
|
|
25045
|
-
"model",
|
|
25046
25440
|
"input_tokens",
|
|
25047
25441
|
"output_tokens",
|
|
25442
|
+
"cache_read_tokens",
|
|
25443
|
+
"cache_creation_tokens",
|
|
25048
25444
|
"calls"
|
|
25049
25445
|
],
|
|
25050
25446
|
"properties": {
|
|
@@ -25052,20 +25448,37 @@
|
|
|
25052
25448
|
"type": "string"
|
|
25053
25449
|
},
|
|
25054
25450
|
"model": {
|
|
25055
|
-
"type": "string"
|
|
25451
|
+
"type": "string",
|
|
25452
|
+
"description": "Omitted for organizations without the \"Cost control endpoints\" approval (see `cost_fields` on the parent response)."
|
|
25056
25453
|
},
|
|
25057
25454
|
"input_tokens": {
|
|
25058
|
-
"type": "integer"
|
|
25455
|
+
"type": "integer",
|
|
25456
|
+
"description": "Uncached input tokens (cached tokens are reported separately)."
|
|
25059
25457
|
},
|
|
25060
25458
|
"output_tokens": {
|
|
25061
25459
|
"type": "integer"
|
|
25062
25460
|
},
|
|
25461
|
+
"cache_read_tokens": {
|
|
25462
|
+
"type": "integer",
|
|
25463
|
+
"description": "Tokens served from the provider's prompt cache."
|
|
25464
|
+
},
|
|
25465
|
+
"cache_creation_tokens": {
|
|
25466
|
+
"type": "integer",
|
|
25467
|
+
"description": "Tokens written to the provider's prompt cache (Anthropic only; 0 for other providers)."
|
|
25468
|
+
},
|
|
25063
25469
|
"calls": {
|
|
25064
25470
|
"type": "integer"
|
|
25065
25471
|
}
|
|
25066
25472
|
}
|
|
25067
25473
|
}
|
|
25068
25474
|
},
|
|
25475
|
+
"cost_fields": {
|
|
25476
|
+
"type": "string",
|
|
25477
|
+
"enum": [
|
|
25478
|
+
"redacted"
|
|
25479
|
+
],
|
|
25480
|
+
"description": "Present and set to `\"redacted\"` only for organizations without the \"Cost control endpoints\" approval — signals that `breakdown[].model` has been omitted. Absent for approved organizations."
|
|
25481
|
+
},
|
|
25069
25482
|
"links": {
|
|
25070
25483
|
"type": "object",
|
|
25071
25484
|
"properties": {
|
|
@@ -25095,19 +25508,30 @@
|
|
|
25095
25508
|
"required": [
|
|
25096
25509
|
"input_tokens",
|
|
25097
25510
|
"output_tokens",
|
|
25098
|
-
"
|
|
25511
|
+
"cache_read_tokens",
|
|
25512
|
+
"cache_creation_tokens",
|
|
25099
25513
|
"calls"
|
|
25100
25514
|
],
|
|
25101
25515
|
"properties": {
|
|
25102
25516
|
"input_tokens": {
|
|
25103
|
-
"type": "integer"
|
|
25517
|
+
"type": "integer",
|
|
25518
|
+
"description": "Uncached input tokens (cached tokens are reported separately)."
|
|
25104
25519
|
},
|
|
25105
25520
|
"output_tokens": {
|
|
25106
25521
|
"type": "integer"
|
|
25107
25522
|
},
|
|
25523
|
+
"cache_read_tokens": {
|
|
25524
|
+
"type": "integer",
|
|
25525
|
+
"description": "Tokens served from the provider's prompt cache."
|
|
25526
|
+
},
|
|
25527
|
+
"cache_creation_tokens": {
|
|
25528
|
+
"type": "integer",
|
|
25529
|
+
"description": "Tokens written to the provider's prompt cache (Anthropic only; 0 for other providers)."
|
|
25530
|
+
},
|
|
25108
25531
|
"cost_estimate_usd": {
|
|
25109
25532
|
"type": "number",
|
|
25110
|
-
"format": "float"
|
|
25533
|
+
"format": "float",
|
|
25534
|
+
"description": "Omitted for organizations without the \"Cost control endpoints\" approval (see `cost_fields` on the parent response)."
|
|
25111
25535
|
},
|
|
25112
25536
|
"calls": {
|
|
25113
25537
|
"type": "integer"
|
|
@@ -25121,9 +25545,10 @@
|
|
|
25121
25545
|
"required": [
|
|
25122
25546
|
"id",
|
|
25123
25547
|
"operation_type",
|
|
25124
|
-
"model",
|
|
25125
25548
|
"input_tokens",
|
|
25126
25549
|
"output_tokens",
|
|
25550
|
+
"cache_read_tokens",
|
|
25551
|
+
"cache_creation_tokens",
|
|
25127
25552
|
"created_at"
|
|
25128
25553
|
],
|
|
25129
25554
|
"properties": {
|
|
@@ -25134,7 +25559,8 @@
|
|
|
25134
25559
|
"type": "string"
|
|
25135
25560
|
},
|
|
25136
25561
|
"model": {
|
|
25137
|
-
"type": "string"
|
|
25562
|
+
"type": "string",
|
|
25563
|
+
"description": "Omitted for organizations without the \"Cost control endpoints\" approval."
|
|
25138
25564
|
},
|
|
25139
25565
|
"input_tokens": {
|
|
25140
25566
|
"type": "integer"
|
|
@@ -25146,11 +25572,17 @@
|
|
|
25146
25572
|
"type": [
|
|
25147
25573
|
"integer",
|
|
25148
25574
|
"null"
|
|
25149
|
-
]
|
|
25575
|
+
],
|
|
25576
|
+
"description": "Tokens served from the provider's prompt cache."
|
|
25577
|
+
},
|
|
25578
|
+
"cache_creation_tokens": {
|
|
25579
|
+
"type": "integer",
|
|
25580
|
+
"description": "Tokens written to the provider's prompt cache (Anthropic only; 0 for other providers)."
|
|
25150
25581
|
},
|
|
25151
25582
|
"cost_estimate_usd": {
|
|
25152
25583
|
"type": "number",
|
|
25153
|
-
"format": "float"
|
|
25584
|
+
"format": "float",
|
|
25585
|
+
"description": "Omitted for organizations without the \"Cost control endpoints\" approval."
|
|
25154
25586
|
},
|
|
25155
25587
|
"created_at": {
|
|
25156
25588
|
"type": "string",
|
|
@@ -25160,6 +25592,13 @@
|
|
|
25160
25592
|
}
|
|
25161
25593
|
}
|
|
25162
25594
|
},
|
|
25595
|
+
"cost_fields": {
|
|
25596
|
+
"type": "string",
|
|
25597
|
+
"enum": [
|
|
25598
|
+
"redacted"
|
|
25599
|
+
],
|
|
25600
|
+
"description": "Present and set to `\"redacted\"` only for organizations without the \"Cost control endpoints\" approval — signals that `model` and all `cost_estimate_usd` fields have been omitted. Absent for approved organizations."
|
|
25601
|
+
},
|
|
25163
25602
|
"links": {
|
|
25164
25603
|
"type": "object",
|
|
25165
25604
|
"properties": {
|
|
@@ -25173,6 +25612,873 @@
|
|
|
25173
25612
|
}
|
|
25174
25613
|
}
|
|
25175
25614
|
},
|
|
25615
|
+
"PipelineUsageResponse": {
|
|
25616
|
+
"type": "object",
|
|
25617
|
+
"required": [
|
|
25618
|
+
"pipeline_id",
|
|
25619
|
+
"period",
|
|
25620
|
+
"scope",
|
|
25621
|
+
"scope_note",
|
|
25622
|
+
"totals",
|
|
25623
|
+
"breakdown",
|
|
25624
|
+
"documents",
|
|
25625
|
+
"links"
|
|
25626
|
+
],
|
|
25627
|
+
"properties": {
|
|
25628
|
+
"pipeline_id": {
|
|
25629
|
+
"type": "string",
|
|
25630
|
+
"format": "uuid",
|
|
25631
|
+
"example": "b3c4d5e6-f7a8-9012-bcde-f34567890123"
|
|
25632
|
+
},
|
|
25633
|
+
"period": {
|
|
25634
|
+
"type": "object",
|
|
25635
|
+
"required": [
|
|
25636
|
+
"from",
|
|
25637
|
+
"to"
|
|
25638
|
+
],
|
|
25639
|
+
"properties": {
|
|
25640
|
+
"from": {
|
|
25641
|
+
"type": "string",
|
|
25642
|
+
"format": "date-time",
|
|
25643
|
+
"example": "2026-04-25T14:30:00.000Z"
|
|
25644
|
+
},
|
|
25645
|
+
"to": {
|
|
25646
|
+
"type": "string",
|
|
25647
|
+
"format": "date-time",
|
|
25648
|
+
"example": "2026-04-25T14:30:00.000Z"
|
|
25649
|
+
}
|
|
25650
|
+
}
|
|
25651
|
+
},
|
|
25652
|
+
"scope": {
|
|
25653
|
+
"type": "string",
|
|
25654
|
+
"enum": [
|
|
25655
|
+
"pipeline_calls_only"
|
|
25656
|
+
],
|
|
25657
|
+
"description": "Fixed code identifying the attribution rule applied to this response."
|
|
25658
|
+
},
|
|
25659
|
+
"scope_note": {
|
|
25660
|
+
"type": "string",
|
|
25661
|
+
"description": "Human-readable statement of what this response covers — pipeline-stamped calls only. The ingest OCR leg (shared across runs) is excluded by design.",
|
|
25662
|
+
"example": "Calls stamped with this pipeline id in call metadata. The shared ingest OCR leg is excluded."
|
|
25663
|
+
},
|
|
25664
|
+
"totals": {
|
|
25665
|
+
"type": "object",
|
|
25666
|
+
"required": [
|
|
25667
|
+
"input_tokens",
|
|
25668
|
+
"output_tokens",
|
|
25669
|
+
"cache_read_tokens",
|
|
25670
|
+
"cache_creation_tokens",
|
|
25671
|
+
"calls",
|
|
25672
|
+
"cost_estimate_usd"
|
|
25673
|
+
],
|
|
25674
|
+
"properties": {
|
|
25675
|
+
"input_tokens": {
|
|
25676
|
+
"type": "integer"
|
|
25677
|
+
},
|
|
25678
|
+
"output_tokens": {
|
|
25679
|
+
"type": "integer"
|
|
25680
|
+
},
|
|
25681
|
+
"cache_read_tokens": {
|
|
25682
|
+
"type": "integer"
|
|
25683
|
+
},
|
|
25684
|
+
"cache_creation_tokens": {
|
|
25685
|
+
"type": "integer",
|
|
25686
|
+
"description": "Cache-write tokens, billed at 1.25× the fresh input rate."
|
|
25687
|
+
},
|
|
25688
|
+
"calls": {
|
|
25689
|
+
"type": "integer"
|
|
25690
|
+
},
|
|
25691
|
+
"cost_estimate_usd": {
|
|
25692
|
+
"type": "number",
|
|
25693
|
+
"format": "float"
|
|
25694
|
+
}
|
|
25695
|
+
}
|
|
25696
|
+
},
|
|
25697
|
+
"breakdown": {
|
|
25698
|
+
"type": "array",
|
|
25699
|
+
"items": {
|
|
25700
|
+
"type": "object",
|
|
25701
|
+
"required": [
|
|
25702
|
+
"operation_type",
|
|
25703
|
+
"model",
|
|
25704
|
+
"input_tokens",
|
|
25705
|
+
"output_tokens",
|
|
25706
|
+
"cache_read_tokens",
|
|
25707
|
+
"cache_creation_tokens",
|
|
25708
|
+
"calls",
|
|
25709
|
+
"cost_estimate_usd"
|
|
25710
|
+
],
|
|
25711
|
+
"properties": {
|
|
25712
|
+
"operation_type": {
|
|
25713
|
+
"type": "string"
|
|
25714
|
+
},
|
|
25715
|
+
"model": {
|
|
25716
|
+
"type": "string"
|
|
25717
|
+
},
|
|
25718
|
+
"input_tokens": {
|
|
25719
|
+
"type": "integer"
|
|
25720
|
+
},
|
|
25721
|
+
"output_tokens": {
|
|
25722
|
+
"type": "integer"
|
|
25723
|
+
},
|
|
25724
|
+
"cache_read_tokens": {
|
|
25725
|
+
"type": "integer"
|
|
25726
|
+
},
|
|
25727
|
+
"cache_creation_tokens": {
|
|
25728
|
+
"type": "integer"
|
|
25729
|
+
},
|
|
25730
|
+
"calls": {
|
|
25731
|
+
"type": "integer"
|
|
25732
|
+
},
|
|
25733
|
+
"cost_estimate_usd": {
|
|
25734
|
+
"type": "number",
|
|
25735
|
+
"format": "float"
|
|
25736
|
+
}
|
|
25737
|
+
}
|
|
25738
|
+
}
|
|
25739
|
+
},
|
|
25740
|
+
"documents": {
|
|
25741
|
+
"type": "array",
|
|
25742
|
+
"description": "Per-document rollup of the same pipeline-stamped calls.",
|
|
25743
|
+
"items": {
|
|
25744
|
+
"type": "object",
|
|
25745
|
+
"required": [
|
|
25746
|
+
"document_id",
|
|
25747
|
+
"filename",
|
|
25748
|
+
"input_tokens",
|
|
25749
|
+
"output_tokens",
|
|
25750
|
+
"calls",
|
|
25751
|
+
"cost_estimate_usd"
|
|
25752
|
+
],
|
|
25753
|
+
"properties": {
|
|
25754
|
+
"document_id": {
|
|
25755
|
+
"type": "string",
|
|
25756
|
+
"format": "uuid"
|
|
25757
|
+
},
|
|
25758
|
+
"filename": {
|
|
25759
|
+
"type": [
|
|
25760
|
+
"string",
|
|
25761
|
+
"null"
|
|
25762
|
+
],
|
|
25763
|
+
"description": "The document's filename, or null if it could not be resolved."
|
|
25764
|
+
},
|
|
25765
|
+
"input_tokens": {
|
|
25766
|
+
"type": "integer"
|
|
25767
|
+
},
|
|
25768
|
+
"output_tokens": {
|
|
25769
|
+
"type": "integer"
|
|
25770
|
+
},
|
|
25771
|
+
"calls": {
|
|
25772
|
+
"type": "integer"
|
|
25773
|
+
},
|
|
25774
|
+
"cost_estimate_usd": {
|
|
25775
|
+
"type": "number",
|
|
25776
|
+
"format": "float"
|
|
25777
|
+
}
|
|
25778
|
+
}
|
|
25779
|
+
}
|
|
25780
|
+
},
|
|
25781
|
+
"links": {
|
|
25782
|
+
"type": "object",
|
|
25783
|
+
"properties": {
|
|
25784
|
+
"self": {
|
|
25785
|
+
"type": "string"
|
|
25786
|
+
},
|
|
25787
|
+
"pipeline": {
|
|
25788
|
+
"type": "string"
|
|
25789
|
+
}
|
|
25790
|
+
}
|
|
25791
|
+
}
|
|
25792
|
+
}
|
|
25793
|
+
},
|
|
25794
|
+
"RunUsageResponse": {
|
|
25795
|
+
"type": "object",
|
|
25796
|
+
"required": [
|
|
25797
|
+
"run_id",
|
|
25798
|
+
"pipeline_id",
|
|
25799
|
+
"period",
|
|
25800
|
+
"scope",
|
|
25801
|
+
"scope_note",
|
|
25802
|
+
"totals",
|
|
25803
|
+
"breakdown",
|
|
25804
|
+
"documents",
|
|
25805
|
+
"links"
|
|
25806
|
+
],
|
|
25807
|
+
"properties": {
|
|
25808
|
+
"run_id": {
|
|
25809
|
+
"type": "string",
|
|
25810
|
+
"format": "uuid",
|
|
25811
|
+
"example": "c4d5e6f7-a8b9-0123-cdef-456789012345"
|
|
25812
|
+
},
|
|
25813
|
+
"pipeline_id": {
|
|
25814
|
+
"type": [
|
|
25815
|
+
"string",
|
|
25816
|
+
"null"
|
|
25817
|
+
],
|
|
25818
|
+
"format": "uuid",
|
|
25819
|
+
"description": "Null while the run is still ingesting or if it failed before a pipeline was created — the response still returns `200` with zero totals in that case, never `404`."
|
|
25820
|
+
},
|
|
25821
|
+
"period": {
|
|
25822
|
+
"type": "object",
|
|
25823
|
+
"required": [
|
|
25824
|
+
"from",
|
|
25825
|
+
"to"
|
|
25826
|
+
],
|
|
25827
|
+
"properties": {
|
|
25828
|
+
"from": {
|
|
25829
|
+
"type": "string",
|
|
25830
|
+
"format": "date-time",
|
|
25831
|
+
"example": "2026-04-25T14:30:00.000Z"
|
|
25832
|
+
},
|
|
25833
|
+
"to": {
|
|
25834
|
+
"type": "string",
|
|
25835
|
+
"format": "date-time",
|
|
25836
|
+
"example": "2026-04-25T14:30:00.000Z"
|
|
25837
|
+
}
|
|
25838
|
+
}
|
|
25839
|
+
},
|
|
25840
|
+
"scope": {
|
|
25841
|
+
"type": "string",
|
|
25842
|
+
"enum": [
|
|
25843
|
+
"run_attributed_calls"
|
|
25844
|
+
],
|
|
25845
|
+
"description": "Fixed code identifying the attribution rule applied to this response."
|
|
25846
|
+
},
|
|
25847
|
+
"scope_note": {
|
|
25848
|
+
"type": "string",
|
|
25849
|
+
"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.",
|
|
25850
|
+
"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."
|
|
25851
|
+
},
|
|
25852
|
+
"totals": {
|
|
25853
|
+
"type": "object",
|
|
25854
|
+
"required": [
|
|
25855
|
+
"input_tokens",
|
|
25856
|
+
"output_tokens",
|
|
25857
|
+
"cache_read_tokens",
|
|
25858
|
+
"cache_creation_tokens",
|
|
25859
|
+
"calls",
|
|
25860
|
+
"cost_estimate_usd"
|
|
25861
|
+
],
|
|
25862
|
+
"properties": {
|
|
25863
|
+
"input_tokens": {
|
|
25864
|
+
"type": "integer"
|
|
25865
|
+
},
|
|
25866
|
+
"output_tokens": {
|
|
25867
|
+
"type": "integer"
|
|
25868
|
+
},
|
|
25869
|
+
"cache_read_tokens": {
|
|
25870
|
+
"type": "integer"
|
|
25871
|
+
},
|
|
25872
|
+
"cache_creation_tokens": {
|
|
25873
|
+
"type": "integer",
|
|
25874
|
+
"description": "Cache-write tokens, billed at 1.25× the fresh input rate."
|
|
25875
|
+
},
|
|
25876
|
+
"calls": {
|
|
25877
|
+
"type": "integer"
|
|
25878
|
+
},
|
|
25879
|
+
"cost_estimate_usd": {
|
|
25880
|
+
"type": "number",
|
|
25881
|
+
"format": "float"
|
|
25882
|
+
}
|
|
25883
|
+
}
|
|
25884
|
+
},
|
|
25885
|
+
"breakdown": {
|
|
25886
|
+
"type": "array",
|
|
25887
|
+
"items": {
|
|
25888
|
+
"type": "object",
|
|
25889
|
+
"required": [
|
|
25890
|
+
"operation_type",
|
|
25891
|
+
"model",
|
|
25892
|
+
"input_tokens",
|
|
25893
|
+
"output_tokens",
|
|
25894
|
+
"cache_read_tokens",
|
|
25895
|
+
"cache_creation_tokens",
|
|
25896
|
+
"calls",
|
|
25897
|
+
"cost_estimate_usd"
|
|
25898
|
+
],
|
|
25899
|
+
"properties": {
|
|
25900
|
+
"operation_type": {
|
|
25901
|
+
"type": "string"
|
|
25902
|
+
},
|
|
25903
|
+
"model": {
|
|
25904
|
+
"type": "string"
|
|
25905
|
+
},
|
|
25906
|
+
"input_tokens": {
|
|
25907
|
+
"type": "integer"
|
|
25908
|
+
},
|
|
25909
|
+
"output_tokens": {
|
|
25910
|
+
"type": "integer"
|
|
25911
|
+
},
|
|
25912
|
+
"cache_read_tokens": {
|
|
25913
|
+
"type": "integer"
|
|
25914
|
+
},
|
|
25915
|
+
"cache_creation_tokens": {
|
|
25916
|
+
"type": "integer"
|
|
25917
|
+
},
|
|
25918
|
+
"calls": {
|
|
25919
|
+
"type": "integer"
|
|
25920
|
+
},
|
|
25921
|
+
"cost_estimate_usd": {
|
|
25922
|
+
"type": "number",
|
|
25923
|
+
"format": "float"
|
|
25924
|
+
}
|
|
25925
|
+
}
|
|
25926
|
+
}
|
|
25927
|
+
},
|
|
25928
|
+
"documents": {
|
|
25929
|
+
"type": "array",
|
|
25930
|
+
"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.",
|
|
25931
|
+
"items": {
|
|
25932
|
+
"type": "object",
|
|
25933
|
+
"required": [
|
|
25934
|
+
"document_id",
|
|
25935
|
+
"input_tokens",
|
|
25936
|
+
"output_tokens",
|
|
25937
|
+
"calls",
|
|
25938
|
+
"cost_estimate_usd"
|
|
25939
|
+
],
|
|
25940
|
+
"properties": {
|
|
25941
|
+
"document_id": {
|
|
25942
|
+
"type": "string",
|
|
25943
|
+
"format": "uuid"
|
|
25944
|
+
},
|
|
25945
|
+
"filename": {
|
|
25946
|
+
"type": [
|
|
25947
|
+
"string",
|
|
25948
|
+
"null"
|
|
25949
|
+
],
|
|
25950
|
+
"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."
|
|
25951
|
+
},
|
|
25952
|
+
"input_tokens": {
|
|
25953
|
+
"type": "integer"
|
|
25954
|
+
},
|
|
25955
|
+
"output_tokens": {
|
|
25956
|
+
"type": "integer"
|
|
25957
|
+
},
|
|
25958
|
+
"calls": {
|
|
25959
|
+
"type": "integer"
|
|
25960
|
+
},
|
|
25961
|
+
"cost_estimate_usd": {
|
|
25962
|
+
"type": "number",
|
|
25963
|
+
"format": "float"
|
|
25964
|
+
}
|
|
25965
|
+
}
|
|
25966
|
+
}
|
|
25967
|
+
},
|
|
25968
|
+
"links": {
|
|
25969
|
+
"type": "object",
|
|
25970
|
+
"properties": {
|
|
25971
|
+
"self": {
|
|
25972
|
+
"type": "string"
|
|
25973
|
+
},
|
|
25974
|
+
"run": {
|
|
25975
|
+
"type": "string"
|
|
25976
|
+
}
|
|
25977
|
+
}
|
|
25978
|
+
}
|
|
25979
|
+
}
|
|
25980
|
+
},
|
|
25981
|
+
"ResultsColumn": {
|
|
25982
|
+
"type": "object",
|
|
25983
|
+
"required": [
|
|
25984
|
+
"field_key",
|
|
25985
|
+
"data_type"
|
|
25986
|
+
],
|
|
25987
|
+
"properties": {
|
|
25988
|
+
"field_key": {
|
|
25989
|
+
"type": "string"
|
|
25990
|
+
},
|
|
25991
|
+
"display_name": {
|
|
25992
|
+
"type": [
|
|
25993
|
+
"string",
|
|
25994
|
+
"null"
|
|
25995
|
+
]
|
|
25996
|
+
},
|
|
25997
|
+
"data_type": {
|
|
25998
|
+
"type": "string"
|
|
25999
|
+
}
|
|
26000
|
+
}
|
|
26001
|
+
},
|
|
26002
|
+
"ResultsCell": {
|
|
26003
|
+
"type": "object",
|
|
26004
|
+
"required": [
|
|
26005
|
+
"value",
|
|
26006
|
+
"status",
|
|
26007
|
+
"confidence",
|
|
26008
|
+
"source",
|
|
26009
|
+
"document_id",
|
|
26010
|
+
"filename"
|
|
26011
|
+
],
|
|
26012
|
+
"properties": {
|
|
26013
|
+
"value": {
|
|
26014
|
+
"nullable": true,
|
|
26015
|
+
"description": "The cell's coalesced value; null for a held (pending_approval) cell. A structured-subschema cell is emitted TYPED — each object's subfields projected to their declared subfield data_type, matching json/ndjson delivery and the run.completed webhook. A number/boolean subfield parse-miss serializes null (no string wire form); an enum/date miss and any nested array/object subfield value pass through raw."
|
|
26016
|
+
},
|
|
26017
|
+
"status": {
|
|
26018
|
+
"type": "string",
|
|
26019
|
+
"example": "filled"
|
|
26020
|
+
},
|
|
26021
|
+
"confidence": {
|
|
26022
|
+
"type": [
|
|
26023
|
+
"number",
|
|
26024
|
+
"null"
|
|
26025
|
+
],
|
|
26026
|
+
"format": "float"
|
|
26027
|
+
},
|
|
26028
|
+
"source": {
|
|
26029
|
+
"type": [
|
|
26030
|
+
"string",
|
|
26031
|
+
"null"
|
|
26032
|
+
],
|
|
26033
|
+
"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."
|
|
26034
|
+
},
|
|
26035
|
+
"document_id": {
|
|
26036
|
+
"type": [
|
|
26037
|
+
"string",
|
|
26038
|
+
"null"
|
|
26039
|
+
],
|
|
26040
|
+
"format": "uuid",
|
|
26041
|
+
"description": "On a composed row, the cell's real source document — may differ from the record's anchor document_id."
|
|
26042
|
+
},
|
|
26043
|
+
"filename": {
|
|
26044
|
+
"type": [
|
|
26045
|
+
"string",
|
|
26046
|
+
"null"
|
|
26047
|
+
]
|
|
26048
|
+
}
|
|
26049
|
+
}
|
|
26050
|
+
},
|
|
26051
|
+
"ResultsProvenance": {
|
|
26052
|
+
"type": "object",
|
|
26053
|
+
"required": [
|
|
26054
|
+
"kind"
|
|
26055
|
+
],
|
|
26056
|
+
"properties": {
|
|
26057
|
+
"kind": {
|
|
26058
|
+
"type": "string",
|
|
26059
|
+
"enum": [
|
|
26060
|
+
"span",
|
|
26061
|
+
"assembly_override",
|
|
26062
|
+
"auto_adjudication",
|
|
26063
|
+
"human",
|
|
26064
|
+
"derived",
|
|
26065
|
+
"legacy"
|
|
26066
|
+
],
|
|
26067
|
+
"description": "legacy covers the internal legacy_unvalidated kind plus any unparseable/unknown envelope."
|
|
26068
|
+
},
|
|
26069
|
+
"text": {
|
|
26070
|
+
"type": [
|
|
26071
|
+
"string",
|
|
26072
|
+
"null"
|
|
26073
|
+
],
|
|
26074
|
+
"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."
|
|
26075
|
+
},
|
|
26076
|
+
"derived_reason": {
|
|
26077
|
+
"type": "string",
|
|
26078
|
+
"description": "Open enum; documented values today include inferred_no_span, source_text_unlocated, inferred_absence, customer_injected, resolved_default. Consumers must tolerate new values."
|
|
26079
|
+
},
|
|
26080
|
+
"source_document_id": {
|
|
26081
|
+
"type": [
|
|
26082
|
+
"string",
|
|
26083
|
+
"null"
|
|
26084
|
+
],
|
|
26085
|
+
"format": "uuid"
|
|
26086
|
+
},
|
|
26087
|
+
"page_index": {
|
|
26088
|
+
"type": [
|
|
26089
|
+
"integer",
|
|
26090
|
+
"null"
|
|
26091
|
+
]
|
|
26092
|
+
}
|
|
26093
|
+
}
|
|
26094
|
+
},
|
|
26095
|
+
"ResultsAuditVersion": {
|
|
26096
|
+
"type": "object",
|
|
26097
|
+
"required": [
|
|
26098
|
+
"version",
|
|
26099
|
+
"value",
|
|
26100
|
+
"status",
|
|
26101
|
+
"source",
|
|
26102
|
+
"confidence",
|
|
26103
|
+
"created_at"
|
|
26104
|
+
],
|
|
26105
|
+
"properties": {
|
|
26106
|
+
"version": {
|
|
26107
|
+
"type": [
|
|
26108
|
+
"integer",
|
|
26109
|
+
"null"
|
|
26110
|
+
]
|
|
26111
|
+
},
|
|
26112
|
+
"value": {
|
|
26113
|
+
"nullable": true,
|
|
26114
|
+
"description": "Redacted (null) for EVERY version in a field's trail when that field's LATEST version is held — the hold mechanism copies the held value forward, making the prior version an equal leak. Serializes normally once the hold resolves. This audit trail is the deliberate RAW history view — structured-subschema subfields are NOT type-projected here (unlike fields and cells[].value)."
|
|
26115
|
+
},
|
|
26116
|
+
"status": {
|
|
26117
|
+
"type": [
|
|
26118
|
+
"string",
|
|
26119
|
+
"null"
|
|
26120
|
+
]
|
|
26121
|
+
},
|
|
26122
|
+
"source": {
|
|
26123
|
+
"type": [
|
|
26124
|
+
"string",
|
|
26125
|
+
"null"
|
|
26126
|
+
]
|
|
26127
|
+
},
|
|
26128
|
+
"confidence": {
|
|
26129
|
+
"type": [
|
|
26130
|
+
"number",
|
|
26131
|
+
"null"
|
|
26132
|
+
],
|
|
26133
|
+
"format": "float"
|
|
26134
|
+
},
|
|
26135
|
+
"created_at": {
|
|
26136
|
+
"type": [
|
|
26137
|
+
"string",
|
|
26138
|
+
"null"
|
|
26139
|
+
],
|
|
26140
|
+
"format": "date-time"
|
|
26141
|
+
}
|
|
26142
|
+
}
|
|
26143
|
+
},
|
|
26144
|
+
"ResultsRecord": {
|
|
26145
|
+
"type": "object",
|
|
26146
|
+
"required": [
|
|
26147
|
+
"document_id",
|
|
26148
|
+
"filename",
|
|
26149
|
+
"run_id",
|
|
26150
|
+
"pipeline_id",
|
|
26151
|
+
"record_id",
|
|
26152
|
+
"status",
|
|
26153
|
+
"completed_at",
|
|
26154
|
+
"fields"
|
|
26155
|
+
],
|
|
26156
|
+
"properties": {
|
|
26157
|
+
"document_id": {
|
|
26158
|
+
"type": [
|
|
26159
|
+
"string",
|
|
26160
|
+
"null"
|
|
26161
|
+
],
|
|
26162
|
+
"format": "uuid",
|
|
26163
|
+
"description": "Null only for an anchor-less composed row (the product record's anchor could not be resolved)."
|
|
26164
|
+
},
|
|
26165
|
+
"filename": {
|
|
26166
|
+
"type": [
|
|
26167
|
+
"string",
|
|
26168
|
+
"null"
|
|
26169
|
+
]
|
|
26170
|
+
},
|
|
26171
|
+
"run_id": {
|
|
26172
|
+
"type": [
|
|
26173
|
+
"string",
|
|
26174
|
+
"null"
|
|
26175
|
+
],
|
|
26176
|
+
"format": "uuid",
|
|
26177
|
+
"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."
|
|
26178
|
+
},
|
|
26179
|
+
"pipeline_id": {
|
|
26180
|
+
"type": "string",
|
|
26181
|
+
"format": "uuid"
|
|
26182
|
+
},
|
|
26183
|
+
"record_id": {
|
|
26184
|
+
"type": "string",
|
|
26185
|
+
"description": "The row's record identity — the pipeline_document id on the main set, the product record id on the composed set."
|
|
26186
|
+
},
|
|
26187
|
+
"status": {
|
|
26188
|
+
"type": "string",
|
|
26189
|
+
"enum": [
|
|
26190
|
+
"complete",
|
|
26191
|
+
"partial",
|
|
26192
|
+
"error",
|
|
26193
|
+
"processing"
|
|
26194
|
+
],
|
|
26195
|
+
"description": "Folded from ~10 internal pipeline_documents states. Deliberately keeps partial (unlike GET /v1/run/{id}'s documents[].status, which folds partial into completed)."
|
|
26196
|
+
},
|
|
26197
|
+
"completed_at": {
|
|
26198
|
+
"type": [
|
|
26199
|
+
"string",
|
|
26200
|
+
"null"
|
|
26201
|
+
],
|
|
26202
|
+
"format": "date-time",
|
|
26203
|
+
"description": "COALESCE of the last per-phase completion stamp. Tracks document PROCESSING completion, not value change — a review promotion or assembly recompose never advances it, and a phase rerun nulls it until the document re-processes."
|
|
26204
|
+
},
|
|
26205
|
+
"metadata": {
|
|
26206
|
+
"type": "object",
|
|
26207
|
+
"additionalProperties": true,
|
|
26208
|
+
"description": "Caller tags; present only when set."
|
|
26209
|
+
},
|
|
26210
|
+
"batch_id": {
|
|
26211
|
+
"type": "string",
|
|
26212
|
+
"description": "Present only when set."
|
|
26213
|
+
},
|
|
26214
|
+
"fields": {
|
|
26215
|
+
"type": "object",
|
|
26216
|
+
"additionalProperties": true,
|
|
26217
|
+
"description": "field_key -> clean value. Held (pending_approval) fields serialize null; demoted fields and __ diagnostics are absent. A structured-subschema field is emitted TYPED (subfields projected to their declared data_type; number/boolean parse-miss -> null, enum/date miss and nested values -> raw), matching the cells[].value projection and the run.completed webhook."
|
|
26218
|
+
},
|
|
26219
|
+
"cells": {
|
|
26220
|
+
"type": "object",
|
|
26221
|
+
"additionalProperties": {
|
|
26222
|
+
"$ref": "#/components/schemas/ResultsCell"
|
|
26223
|
+
},
|
|
26224
|
+
"description": "Present only when include=cells. Keyed by field_key."
|
|
26225
|
+
},
|
|
26226
|
+
"provenance": {
|
|
26227
|
+
"type": "object",
|
|
26228
|
+
"additionalProperties": {
|
|
26229
|
+
"$ref": "#/components/schemas/ResultsProvenance"
|
|
26230
|
+
},
|
|
26231
|
+
"description": "Present only when include=provenance. Keyed by field_key."
|
|
26232
|
+
},
|
|
26233
|
+
"audit": {
|
|
26234
|
+
"type": "object",
|
|
26235
|
+
"additionalProperties": {
|
|
26236
|
+
"type": "array",
|
|
26237
|
+
"items": {
|
|
26238
|
+
"$ref": "#/components/schemas/ResultsAuditVersion"
|
|
26239
|
+
}
|
|
26240
|
+
},
|
|
26241
|
+
"description": "Present only when include=audit. Keyed by field_key; the cell-version trail."
|
|
26242
|
+
}
|
|
26243
|
+
}
|
|
26244
|
+
},
|
|
26245
|
+
"ResultsPagination": {
|
|
26246
|
+
"type": "object",
|
|
26247
|
+
"required": [
|
|
26248
|
+
"total",
|
|
26249
|
+
"limit",
|
|
26250
|
+
"has_more",
|
|
26251
|
+
"next_cursor"
|
|
26252
|
+
],
|
|
26253
|
+
"properties": {
|
|
26254
|
+
"total": {
|
|
26255
|
+
"type": "integer"
|
|
26256
|
+
},
|
|
26257
|
+
"limit": {
|
|
26258
|
+
"type": "integer"
|
|
26259
|
+
},
|
|
26260
|
+
"has_more": {
|
|
26261
|
+
"type": "boolean"
|
|
26262
|
+
},
|
|
26263
|
+
"next_cursor": {
|
|
26264
|
+
"type": [
|
|
26265
|
+
"string",
|
|
26266
|
+
"null"
|
|
26267
|
+
],
|
|
26268
|
+
"description": "Opaque cursor keyed on record_id. Stable under concurrent appends."
|
|
26269
|
+
}
|
|
26270
|
+
}
|
|
26271
|
+
},
|
|
26272
|
+
"PipelineResultsResponse": {
|
|
26273
|
+
"type": "object",
|
|
26274
|
+
"required": [
|
|
26275
|
+
"pipeline_id",
|
|
26276
|
+
"spec_id",
|
|
26277
|
+
"status",
|
|
26278
|
+
"view",
|
|
26279
|
+
"generated_at",
|
|
26280
|
+
"columns",
|
|
26281
|
+
"data",
|
|
26282
|
+
"pagination",
|
|
26283
|
+
"pending_review_count",
|
|
26284
|
+
"links"
|
|
26285
|
+
],
|
|
26286
|
+
"properties": {
|
|
26287
|
+
"pipeline_id": {
|
|
26288
|
+
"type": "string",
|
|
26289
|
+
"format": "uuid"
|
|
26290
|
+
},
|
|
26291
|
+
"spec_id": {
|
|
26292
|
+
"type": "string",
|
|
26293
|
+
"format": "uuid",
|
|
26294
|
+
"description": "pipeline.schema_id — the Spec this run compiled from."
|
|
26295
|
+
},
|
|
26296
|
+
"status": {
|
|
26297
|
+
"type": "string",
|
|
26298
|
+
"description": "The pipeline's own lifecycle status. Never settles for an append pipeline that keeps receiving requests."
|
|
26299
|
+
},
|
|
26300
|
+
"view": {
|
|
26301
|
+
"type": "string",
|
|
26302
|
+
"enum": [
|
|
26303
|
+
"composed",
|
|
26304
|
+
"documents"
|
|
26305
|
+
]
|
|
26306
|
+
},
|
|
26307
|
+
"generated_at": {
|
|
26308
|
+
"type": "string",
|
|
26309
|
+
"format": "date-time"
|
|
26310
|
+
},
|
|
26311
|
+
"columns": {
|
|
26312
|
+
"type": "array",
|
|
26313
|
+
"items": {
|
|
26314
|
+
"$ref": "#/components/schemas/ResultsColumn"
|
|
26315
|
+
}
|
|
26316
|
+
},
|
|
26317
|
+
"data": {
|
|
26318
|
+
"type": "array",
|
|
26319
|
+
"items": {
|
|
26320
|
+
"$ref": "#/components/schemas/ResultsRecord"
|
|
26321
|
+
}
|
|
26322
|
+
},
|
|
26323
|
+
"pagination": {
|
|
26324
|
+
"$ref": "#/components/schemas/ResultsPagination"
|
|
26325
|
+
},
|
|
26326
|
+
"pending_review_count": {
|
|
26327
|
+
"type": "integer",
|
|
26328
|
+
"description": "Held cells in the current page's records only."
|
|
26329
|
+
},
|
|
26330
|
+
"scope_note": {
|
|
26331
|
+
"type": "string",
|
|
26332
|
+
"description": "Present only for the echo-less legacy run_id zero-state — a 200 empty page, never a guess."
|
|
26333
|
+
},
|
|
26334
|
+
"links": {
|
|
26335
|
+
"type": "object",
|
|
26336
|
+
"required": [
|
|
26337
|
+
"self",
|
|
26338
|
+
"pipeline",
|
|
26339
|
+
"progress"
|
|
26340
|
+
],
|
|
26341
|
+
"properties": {
|
|
26342
|
+
"self": {
|
|
26343
|
+
"type": "string"
|
|
26344
|
+
},
|
|
26345
|
+
"pipeline": {
|
|
26346
|
+
"type": "string"
|
|
26347
|
+
},
|
|
26348
|
+
"progress": {
|
|
26349
|
+
"type": "string"
|
|
26350
|
+
}
|
|
26351
|
+
}
|
|
26352
|
+
}
|
|
26353
|
+
}
|
|
26354
|
+
},
|
|
26355
|
+
"RunResultsResponse": {
|
|
26356
|
+
"type": "object",
|
|
26357
|
+
"required": [
|
|
26358
|
+
"run_id",
|
|
26359
|
+
"pipeline_id",
|
|
26360
|
+
"spec_id",
|
|
26361
|
+
"status",
|
|
26362
|
+
"view",
|
|
26363
|
+
"generated_at",
|
|
26364
|
+
"columns",
|
|
26365
|
+
"data",
|
|
26366
|
+
"pagination",
|
|
26367
|
+
"pending_review_count",
|
|
26368
|
+
"links"
|
|
26369
|
+
],
|
|
26370
|
+
"properties": {
|
|
26371
|
+
"run_id": {
|
|
26372
|
+
"type": "string",
|
|
26373
|
+
"format": "uuid"
|
|
26374
|
+
},
|
|
26375
|
+
"pipeline_id": {
|
|
26376
|
+
"type": [
|
|
26377
|
+
"string",
|
|
26378
|
+
"null"
|
|
26379
|
+
],
|
|
26380
|
+
"format": "uuid",
|
|
26381
|
+
"description": "Null while the run has no compiled pipeline yet."
|
|
26382
|
+
},
|
|
26383
|
+
"spec_id": {
|
|
26384
|
+
"type": "string",
|
|
26385
|
+
"format": "uuid"
|
|
26386
|
+
},
|
|
26387
|
+
"status": {
|
|
26388
|
+
"type": "string",
|
|
26389
|
+
"enum": [
|
|
26390
|
+
"processing",
|
|
26391
|
+
"completed",
|
|
26392
|
+
"failed"
|
|
26393
|
+
],
|
|
26394
|
+
"description": "The folded public run status (same vocabulary as GET /v1/run/{id}) — settles even for an append pipeline that never settles at the pipeline level."
|
|
26395
|
+
},
|
|
26396
|
+
"view": {
|
|
26397
|
+
"type": "string",
|
|
26398
|
+
"enum": [
|
|
26399
|
+
"documents"
|
|
26400
|
+
],
|
|
26401
|
+
"description": "Always documents on this route."
|
|
26402
|
+
},
|
|
26403
|
+
"generated_at": {
|
|
26404
|
+
"type": "string",
|
|
26405
|
+
"format": "date-time"
|
|
26406
|
+
},
|
|
26407
|
+
"columns": {
|
|
26408
|
+
"type": "array",
|
|
26409
|
+
"items": {
|
|
26410
|
+
"$ref": "#/components/schemas/ResultsColumn"
|
|
26411
|
+
}
|
|
26412
|
+
},
|
|
26413
|
+
"data": {
|
|
26414
|
+
"type": "array",
|
|
26415
|
+
"items": {
|
|
26416
|
+
"$ref": "#/components/schemas/ResultsRecord"
|
|
26417
|
+
}
|
|
26418
|
+
},
|
|
26419
|
+
"pagination": {
|
|
26420
|
+
"$ref": "#/components/schemas/ResultsPagination"
|
|
26421
|
+
},
|
|
26422
|
+
"pending_review_count": {
|
|
26423
|
+
"type": "integer"
|
|
26424
|
+
},
|
|
26425
|
+
"scope_note": {
|
|
26426
|
+
"type": "string",
|
|
26427
|
+
"description": "Present only for the two zero-states — no pipeline yet, or an echo-less legacy run."
|
|
26428
|
+
},
|
|
26429
|
+
"links": {
|
|
26430
|
+
"type": "object",
|
|
26431
|
+
"required": [
|
|
26432
|
+
"self",
|
|
26433
|
+
"run"
|
|
26434
|
+
],
|
|
26435
|
+
"properties": {
|
|
26436
|
+
"self": {
|
|
26437
|
+
"type": "string"
|
|
26438
|
+
},
|
|
26439
|
+
"run": {
|
|
26440
|
+
"type": "string"
|
|
26441
|
+
},
|
|
26442
|
+
"composed_results": {
|
|
26443
|
+
"type": "string",
|
|
26444
|
+
"description": "Present only when a pipeline exists — GET /v1/pipelines/{id}/results, where an assembly run's composed rows actually live."
|
|
26445
|
+
}
|
|
26446
|
+
}
|
|
26447
|
+
}
|
|
26448
|
+
}
|
|
26449
|
+
},
|
|
26450
|
+
"ResultsBadRequestError": {
|
|
26451
|
+
"type": "object",
|
|
26452
|
+
"required": [
|
|
26453
|
+
"error",
|
|
26454
|
+
"code",
|
|
26455
|
+
"message"
|
|
26456
|
+
],
|
|
26457
|
+
"properties": {
|
|
26458
|
+
"error": {
|
|
26459
|
+
"type": "string",
|
|
26460
|
+
"enum": [
|
|
26461
|
+
"bad_request"
|
|
26462
|
+
]
|
|
26463
|
+
},
|
|
26464
|
+
"code": {
|
|
26465
|
+
"type": "string",
|
|
26466
|
+
"enum": [
|
|
26467
|
+
"invalid_view",
|
|
26468
|
+
"invalid_document_ids",
|
|
26469
|
+
"invalid_run_id",
|
|
26470
|
+
"invalid_time_range",
|
|
26471
|
+
"invalid_status",
|
|
26472
|
+
"invalid_include",
|
|
26473
|
+
"unsupported_filter",
|
|
26474
|
+
"audit_include_too_broad"
|
|
26475
|
+
]
|
|
26476
|
+
},
|
|
26477
|
+
"message": {
|
|
26478
|
+
"type": "string"
|
|
26479
|
+
}
|
|
26480
|
+
}
|
|
26481
|
+
},
|
|
25176
26482
|
"ResolutionResponse": {
|
|
25177
26483
|
"type": "object",
|
|
25178
26484
|
"required": [
|