@talonic/docs 0.21.66 → 0.21.68

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
@@ -106,6 +106,10 @@ var openapi_default = {
106
106
  name: "DB Snapshots",
107
107
  description: "Periodic point-in-time captures of a connected database (or a folder of CSV exports) and the row-level deltas between consecutive captures: what was added, modified and removed, with before/after values and per-record history. Read-only \u2014 captures are scheduled from the app.\n\nTwo fields carry meaning that the counts alone cannot, and reading past them produces confident wrong answers. A delta's `status` is `partial` while the capture writing it is still running, so its counts are a floor (a partial delta commonly reads all-zero while hundreds of thousands of rows are in fact changing) \u2014 follow `last_complete_delta_id` for a final number. And within a delta, a table that was examined and found clean is ABSENT from `tables`, whereas a table present with `examined: false` was deferred by the scan cadence and not looked at at all.\n"
108
108
  },
109
+ {
110
+ name: "Aggregate",
111
+ description: "Counts and statistics about your workspace in one request: documents received and failed, pipeline errors, app decisions, deliveries, model calls, what processing cost, and the work of the standard apps. Numbers only, never document contents. Start with `GET /v1/aggregate/catalog`, which lists every dataset and field you can ask for."
112
+ },
109
113
  {
110
114
  name: "Usage",
111
115
  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.'
@@ -1169,7 +1173,7 @@ var openapi_default = {
1169
1173
  get: {
1170
1174
  operationId: "getDocumentMarkdown",
1171
1175
  summary: "Get the OCR-converted markdown of a document",
1172
- description: "Returns the full markdown representation produced by OCR for the document.\nEquivalent to passing `include_markdown=true` on `/v1/extract`, but callable\nat any time after OCR has completed. Useful for PDF-to-markdown conversion\nwithout requiring a schema or re-running extraction.\n\nReturns 404 if the document does not exist, is still being processed, or is\nan image that did not produce OCR output.\n",
1176
+ description: "Returns the full markdown representation produced by OCR for the document.\nEquivalent to passing `include_markdown=true` on `/v1/extract`, but callable\nat any time after OCR has completed. Useful for PDF-to-markdown conversion\nwithout requiring a schema or re-running extraction.\n\nReturns 404 if the document does not exist, is still being processed, or is\nan image that did not produce OCR output.\n\nA document ingested by `/v1/run` under a Spec whose Source stage sets\n`markdown_policy: on_demand` is stored without OCR. The first call to this\nendpoint starts its OCR and waits a short, bounded time for it: 200 with the\nmarkdown when it finishes in time, otherwise 202 with a `Retry-After` header\n(seconds); call again after that delay.\n",
1173
1177
  tags: [
1174
1178
  "Documents"
1175
1179
  ],
@@ -1206,6 +1210,50 @@ var openapi_default = {
1206
1210
  }
1207
1211
  }
1208
1212
  },
1213
+ "202": {
1214
+ description: "OCR for this document was deferred and is running now (OCR on demand).\nRetry after the number of seconds in the `Retry-After` header.\n",
1215
+ headers: {
1216
+ "Retry-After": {
1217
+ description: "Seconds to wait before calling again.",
1218
+ schema: {
1219
+ type: "integer",
1220
+ example: 10
1221
+ }
1222
+ }
1223
+ },
1224
+ content: {
1225
+ "application/json": {
1226
+ schema: {
1227
+ type: "object",
1228
+ required: [
1229
+ "document_id",
1230
+ "status",
1231
+ "retry_after_seconds"
1232
+ ],
1233
+ properties: {
1234
+ document_id: {
1235
+ type: "string",
1236
+ format: "uuid",
1237
+ example: "f0e1d2c3-b4a5-9687-8765-432109876543",
1238
+ description: "ID of the document whose OCR is running."
1239
+ },
1240
+ status: {
1241
+ type: "string",
1242
+ enum: [
1243
+ "processing"
1244
+ ],
1245
+ description: "Always `processing`."
1246
+ },
1247
+ retry_after_seconds: {
1248
+ type: "integer",
1249
+ example: 10,
1250
+ description: "Same value as the `Retry-After` header."
1251
+ }
1252
+ }
1253
+ }
1254
+ }
1255
+ }
1256
+ },
1209
1257
  "401": {
1210
1258
  $ref: "#/components/responses/Unauthorized"
1211
1259
  },
@@ -7798,6 +7846,593 @@ var openapi_default = {
7798
7846
  }
7799
7847
  }
7800
7848
  },
7849
+ "/v1/aggregate": {
7850
+ post: {
7851
+ operationId: "aggregate",
7852
+ summary: "Several workspace metrics in one request",
7853
+ description: 'Ask several questions about your workspace in one request and get\nnumbers back, never rows. For example: how many documents arrived in\nthe last 12 hours, how many failed, and what a document cost on\naverage.\n\n**The window.** `from` and `to` are ISO-8601 timestamps with an offset\n(`2026-11-05T12:00:00Z`). The window includes `from` and excludes\n`to`, and is at most 31 days long.\n\n**The queries.** Up to 20, each with an `id` of your choice (the\nanswer is keyed by it), a `dataset` and a `measure`:\n- `count`: what the dataset counts (its description says whether\n that is rows or documents); `rows`: the number of rows.\n- `count_distinct`, `sum`, `avg`, `min`, `max`, `median`, `p1`\u2013`p99`:\n over the field named in `of` (a number field, except for\n `count_distinct`).\n- A list of measures (`["avg", "median"]`) answers `values` plus `n`,\n the number of rows they were computed over.\n\n`where` filters rows (`{ "field": "failed", "op": "eq", "value": true }`);\nwhich operators a field takes depends on its type. `group_by` splits\nthe answer by up to three fields, or by `hour` / `day` (UTC); it\nreturns at most 200 groups (largest first, or in time order when\ngrouped by `hour` / `day`), and `groups_total` says how many there\nwere. `sum`, `avg` and the other computed measures are `null` when\nthere were no rows; counts are 0.\n\n**Which datasets and fields exist:** `GET /v1/aggregate/catalog`\nlists every dataset with what one row is, its fields (type, whether\nit can be grouped, which operators it takes) and its default\nfilters. Most datasets count things *created* in the window and\nreport their status *now* (a document received yesterday that\nfailed today counts as failed). Accounts Payable bills and the Money\nFound ledger are not datasets; read them from `/v1/ap/overview` and\n`/v1/money-found/levers`.\n\n**Narrowing to documents.** `scope` restricts every query to some\ndocuments: `document_ids`, `tags` (`any` / `all`), `system_tags`,\n`source_connection_ids`, `document_types` (ids or names),\n`client_batch_ids`, `roots_only`, `attachments_only`. A dataset\nthat is not about documents refuses a scope (400). Rows tied to a\ndocument the key\'s owner may not see are left out; rows tied to no\ndocument (a model call outside any document, a check of a document\nset) still count unless a scope is set.\n\n**Limits.** One request runs at a time per workspace (per API process\nwhere the deployment does not share the limiter; the catalog\'s\n`limits.concurrency.per` says which). A second one gets 429 with\n`Retry-After: 5`: retry after that many seconds. The daily rate limit\nalso answers 429; it sends `X-RateLimit-Reset` instead. Each\nstatement may run `limits.statement_timeout_ms`; a request runs one\nstatement per dataset (plus one per grouped query), so a whole\nrequest can take longer. A statement that runs too long stops the\nrequest with 422 `aggregate_timeout`, naming the dataset; ask for a\nshorter window or fewer groups. Cost\nfields and the `model` dimension answer 403 `cost_not_visible` when\ncost visibility is off for your organization. A wrong name answers\n400 `invalid_aggregate` listing the names allowed there.\n',
7854
+ tags: [
7855
+ "Aggregate"
7856
+ ],
7857
+ requestBody: {
7858
+ required: true,
7859
+ content: {
7860
+ "application/json": {
7861
+ schema: {
7862
+ type: "object",
7863
+ required: [
7864
+ "from",
7865
+ "to",
7866
+ "queries"
7867
+ ],
7868
+ properties: {
7869
+ from: {
7870
+ type: "string",
7871
+ format: "date-time"
7872
+ },
7873
+ to: {
7874
+ type: "string",
7875
+ format: "date-time",
7876
+ description: "Exclusive."
7877
+ },
7878
+ scope: {
7879
+ type: "object",
7880
+ properties: {
7881
+ document_ids: {
7882
+ type: "array",
7883
+ items: {
7884
+ type: "string",
7885
+ format: "uuid"
7886
+ },
7887
+ maxItems: 1e3
7888
+ },
7889
+ tags: {
7890
+ type: "object",
7891
+ properties: {
7892
+ any: {
7893
+ type: "array",
7894
+ items: {
7895
+ type: "string"
7896
+ }
7897
+ },
7898
+ all: {
7899
+ type: "array",
7900
+ items: {
7901
+ type: "string"
7902
+ }
7903
+ }
7904
+ }
7905
+ },
7906
+ system_tags: {
7907
+ type: "object",
7908
+ properties: {
7909
+ any: {
7910
+ type: "array",
7911
+ items: {
7912
+ type: "string"
7913
+ }
7914
+ },
7915
+ all: {
7916
+ type: "array",
7917
+ items: {
7918
+ type: "string"
7919
+ }
7920
+ }
7921
+ }
7922
+ },
7923
+ source_connection_ids: {
7924
+ type: "array",
7925
+ items: {
7926
+ type: "string",
7927
+ format: "uuid"
7928
+ }
7929
+ },
7930
+ document_types: {
7931
+ type: "array",
7932
+ items: {
7933
+ type: "string"
7934
+ },
7935
+ description: "Document type ids or exact names."
7936
+ },
7937
+ client_batch_ids: {
7938
+ type: "array",
7939
+ items: {
7940
+ type: "string"
7941
+ }
7942
+ },
7943
+ roots_only: {
7944
+ type: "boolean"
7945
+ },
7946
+ attachments_only: {
7947
+ type: "boolean"
7948
+ }
7949
+ }
7950
+ },
7951
+ queries: {
7952
+ type: "array",
7953
+ minItems: 1,
7954
+ maxItems: 20,
7955
+ items: {
7956
+ type: "object",
7957
+ required: [
7958
+ "id",
7959
+ "dataset",
7960
+ "measure"
7961
+ ],
7962
+ properties: {
7963
+ id: {
7964
+ type: "string",
7965
+ pattern: "^[a-z][a-z0-9_]{0,63}$"
7966
+ },
7967
+ dataset: {
7968
+ type: "string",
7969
+ enum: [
7970
+ "documents",
7971
+ "document_cost",
7972
+ "pipeline_documents",
7973
+ "app_verdicts",
7974
+ "app_runs",
7975
+ "deliveries",
7976
+ "llm_calls",
7977
+ "compliance_evaluations",
7978
+ "money_found_reviews",
7979
+ "contract_check_decisions",
7980
+ "doc_gen_jobs",
7981
+ "doc_gen_documents",
7982
+ "price_invoice_checks"
7983
+ ]
7984
+ },
7985
+ measure: {
7986
+ oneOf: [
7987
+ {
7988
+ type: "string"
7989
+ },
7990
+ {
7991
+ type: "array",
7992
+ items: {
7993
+ type: "string"
7994
+ }
7995
+ }
7996
+ ]
7997
+ },
7998
+ of: {
7999
+ type: "string"
8000
+ },
8001
+ where: {
8002
+ type: "array",
8003
+ items: {
8004
+ type: "object",
8005
+ required: [
8006
+ "field",
8007
+ "op"
8008
+ ],
8009
+ properties: {
8010
+ field: {
8011
+ type: "string"
8012
+ },
8013
+ op: {
8014
+ type: "string",
8015
+ enum: [
8016
+ "eq",
8017
+ "neq",
8018
+ "in",
8019
+ "not_in",
8020
+ "is_null",
8021
+ "not_null",
8022
+ "gt",
8023
+ "gte",
8024
+ "lt",
8025
+ "lte",
8026
+ "contains_any",
8027
+ "contains_all"
8028
+ ]
8029
+ },
8030
+ value: {}
8031
+ }
8032
+ }
8033
+ },
8034
+ group_by: {
8035
+ type: "array",
8036
+ items: {
8037
+ type: "string"
8038
+ },
8039
+ maxItems: 3
8040
+ }
8041
+ }
8042
+ }
8043
+ }
8044
+ }
8045
+ },
8046
+ example: {
8047
+ from: "2026-11-05T12:00:00Z",
8048
+ to: "2026-11-06T00:00:00Z",
8049
+ queries: [
8050
+ {
8051
+ id: "received",
8052
+ dataset: "documents",
8053
+ measure: "count",
8054
+ where: [
8055
+ {
8056
+ field: "duplicate",
8057
+ op: "eq",
8058
+ value: false
8059
+ }
8060
+ ]
8061
+ },
8062
+ {
8063
+ id: "failed",
8064
+ dataset: "documents",
8065
+ measure: "count",
8066
+ where: [
8067
+ {
8068
+ field: "failed",
8069
+ op: "eq",
8070
+ value: true
8071
+ }
8072
+ ]
8073
+ },
8074
+ {
8075
+ id: "by_type",
8076
+ dataset: "documents",
8077
+ measure: "count",
8078
+ group_by: [
8079
+ "document_type"
8080
+ ]
8081
+ },
8082
+ {
8083
+ id: "cost",
8084
+ dataset: "document_cost",
8085
+ measure: [
8086
+ "avg",
8087
+ "median"
8088
+ ],
8089
+ of: "cost_usd"
8090
+ }
8091
+ ]
8092
+ }
8093
+ }
8094
+ }
8095
+ },
8096
+ responses: {
8097
+ "200": {
8098
+ description: "One result per query id.",
8099
+ content: {
8100
+ "application/json": {
8101
+ schema: {
8102
+ type: "object",
8103
+ properties: {
8104
+ window: {
8105
+ type: "object",
8106
+ properties: {
8107
+ from: {
8108
+ type: "string",
8109
+ format: "date-time"
8110
+ },
8111
+ to: {
8112
+ type: "string",
8113
+ format: "date-time"
8114
+ }
8115
+ }
8116
+ },
8117
+ as_of: {
8118
+ type: "string",
8119
+ format: "date-time"
8120
+ },
8121
+ results: {
8122
+ type: "object",
8123
+ additionalProperties: {
8124
+ type: "object",
8125
+ properties: {
8126
+ dataset: {
8127
+ type: "string"
8128
+ },
8129
+ kind: {
8130
+ type: "string",
8131
+ enum: [
8132
+ "event",
8133
+ "entity"
8134
+ ]
8135
+ },
8136
+ value: {
8137
+ type: "number",
8138
+ nullable: true
8139
+ },
8140
+ values: {
8141
+ type: "object",
8142
+ additionalProperties: {
8143
+ type: "number",
8144
+ nullable: true
8145
+ }
8146
+ },
8147
+ groups: {
8148
+ type: "array",
8149
+ items: {
8150
+ type: "object",
8151
+ properties: {
8152
+ key: {
8153
+ type: "object",
8154
+ description: "Dimension values; null is a row without one."
8155
+ },
8156
+ value: {
8157
+ type: "number",
8158
+ nullable: true
8159
+ },
8160
+ values: {
8161
+ type: "object",
8162
+ additionalProperties: {
8163
+ type: "number",
8164
+ nullable: true
8165
+ }
8166
+ }
8167
+ }
8168
+ }
8169
+ },
8170
+ groups_total: {
8171
+ type: "integer",
8172
+ description: "Groups that existed; more than groups.length when the 200-group cap applied."
8173
+ }
8174
+ }
8175
+ }
8176
+ }
8177
+ }
8178
+ },
8179
+ example: {
8180
+ window: {
8181
+ from: "2026-11-05T12:00:00.000Z",
8182
+ to: "2026-11-06T00:00:00.000Z"
8183
+ },
8184
+ as_of: "2026-11-06T00:00:03.120Z",
8185
+ results: {
8186
+ received: {
8187
+ dataset: "documents",
8188
+ kind: "entity",
8189
+ value: 412
8190
+ },
8191
+ failed: {
8192
+ dataset: "documents",
8193
+ kind: "entity",
8194
+ value: 3
8195
+ },
8196
+ by_type: {
8197
+ dataset: "documents",
8198
+ kind: "entity",
8199
+ groups: [
8200
+ {
8201
+ key: {
8202
+ document_type: "Invoice"
8203
+ },
8204
+ value: 301
8205
+ },
8206
+ {
8207
+ key: {
8208
+ document_type: "Delivery Note"
8209
+ },
8210
+ value: 97
8211
+ },
8212
+ {
8213
+ key: {
8214
+ document_type: null
8215
+ },
8216
+ value: 14
8217
+ }
8218
+ ],
8219
+ groups_total: 3
8220
+ },
8221
+ cost: {
8222
+ dataset: "document_cost",
8223
+ kind: "entity",
8224
+ values: {
8225
+ avg: 0.0108,
8226
+ median: 0.0104,
8227
+ n: 412
8228
+ }
8229
+ }
8230
+ }
8231
+ }
8232
+ }
8233
+ }
8234
+ },
8235
+ "400": {
8236
+ $ref: "#/components/responses/BadRequest"
8237
+ },
8238
+ "401": {
8239
+ $ref: "#/components/responses/Unauthorized"
8240
+ },
8241
+ "403": {
8242
+ $ref: "#/components/responses/Forbidden"
8243
+ },
8244
+ "422": {
8245
+ description: "A statement ran past the timeout (`aggregate_timeout`); `details.dataset` names it."
8246
+ },
8247
+ "429": {
8248
+ $ref: "#/components/responses/RateLimitExceeded"
8249
+ }
8250
+ }
8251
+ }
8252
+ },
8253
+ "/v1/aggregate/catalog": {
8254
+ get: {
8255
+ operationId: "getAggregateCatalog",
8256
+ summary: "What you can ask /v1/aggregate",
8257
+ description: "Every dataset, field, measure and limit `POST /v1/aggregate` accepts,\nfrom the same definitions it checks requests against. Each dataset\nsays what one row is, whether a document `scope` applies, and the\nfilters it applies by default; each field its type, whether it can\nbe grouped, which `where` operators it takes and whether it needs\ncost visibility (`cost`). `cost_visible` says whether this workspace\nmay read those. Reads no workspace data.\n",
8258
+ tags: [
8259
+ "Aggregate"
8260
+ ],
8261
+ responses: {
8262
+ "200": {
8263
+ description: "The catalog.",
8264
+ content: {
8265
+ "application/json": {
8266
+ schema: {
8267
+ type: "object",
8268
+ properties: {
8269
+ datasets: {
8270
+ type: "array",
8271
+ items: {
8272
+ type: "object",
8273
+ properties: {
8274
+ name: {
8275
+ type: "string"
8276
+ },
8277
+ description: {
8278
+ type: "string"
8279
+ },
8280
+ kind: {
8281
+ type: "string",
8282
+ enum: [
8283
+ "entity",
8284
+ "event"
8285
+ ],
8286
+ description: "`entity`: created in the window, status now. `event`: written in the window."
8287
+ },
8288
+ document_scope: {
8289
+ type: "boolean"
8290
+ },
8291
+ defaults: {
8292
+ type: "array",
8293
+ items: {
8294
+ type: "object",
8295
+ properties: {
8296
+ field: {
8297
+ type: "string"
8298
+ },
8299
+ op: {
8300
+ type: "string"
8301
+ },
8302
+ value: {}
8303
+ }
8304
+ }
8305
+ },
8306
+ fields: {
8307
+ type: "array",
8308
+ items: {
8309
+ type: "object",
8310
+ properties: {
8311
+ name: {
8312
+ type: "string"
8313
+ },
8314
+ description: {
8315
+ type: "string"
8316
+ },
8317
+ type: {
8318
+ type: "string",
8319
+ enum: [
8320
+ "text",
8321
+ "uuid",
8322
+ "bool",
8323
+ "number",
8324
+ "text[]"
8325
+ ]
8326
+ },
8327
+ groupable: {
8328
+ type: "boolean"
8329
+ },
8330
+ cost: {
8331
+ type: "boolean"
8332
+ },
8333
+ ops: {
8334
+ type: "array",
8335
+ items: {
8336
+ type: "string"
8337
+ }
8338
+ }
8339
+ }
8340
+ }
8341
+ }
8342
+ }
8343
+ }
8344
+ },
8345
+ measures: {
8346
+ type: "array",
8347
+ items: {
8348
+ type: "object",
8349
+ properties: {
8350
+ name: {
8351
+ type: "string"
8352
+ },
8353
+ description: {
8354
+ type: "string"
8355
+ },
8356
+ needs_of: {
8357
+ type: "boolean"
8358
+ }
8359
+ }
8360
+ }
8361
+ },
8362
+ group_by: {
8363
+ type: "object",
8364
+ properties: {
8365
+ time: {
8366
+ type: "array",
8367
+ items: {
8368
+ type: "string"
8369
+ }
8370
+ },
8371
+ max: {
8372
+ type: "integer"
8373
+ },
8374
+ max_buckets: {
8375
+ type: "integer"
8376
+ }
8377
+ }
8378
+ },
8379
+ scope_keys: {
8380
+ type: "array",
8381
+ items: {
8382
+ type: "string"
8383
+ }
8384
+ },
8385
+ limits: {
8386
+ type: "object",
8387
+ properties: {
8388
+ max_window_days: {
8389
+ type: "integer"
8390
+ },
8391
+ max_queries: {
8392
+ type: "integer"
8393
+ },
8394
+ max_list_values: {
8395
+ type: "integer"
8396
+ },
8397
+ statement_timeout_ms: {
8398
+ type: "integer",
8399
+ description: "How long one statement may run; a request runs one per dataset plus one per grouped query."
8400
+ },
8401
+ concurrency: {
8402
+ type: "object",
8403
+ properties: {
8404
+ requests: {
8405
+ type: "integer"
8406
+ },
8407
+ per: {
8408
+ type: "string",
8409
+ enum: [
8410
+ "workspace",
8411
+ "api_process"
8412
+ ],
8413
+ description: "`api_process` where the deployment does not share the limiter across API processes."
8414
+ }
8415
+ }
8416
+ }
8417
+ }
8418
+ },
8419
+ cost_visible: {
8420
+ type: "boolean"
8421
+ }
8422
+ }
8423
+ }
8424
+ }
8425
+ }
8426
+ },
8427
+ "401": {
8428
+ $ref: "#/components/responses/Unauthorized"
8429
+ },
8430
+ "429": {
8431
+ $ref: "#/components/responses/RateLimitExceeded"
8432
+ }
8433
+ }
8434
+ }
8435
+ },
7801
8436
  "/v1/usage/documents/{id}": {
7802
8437
  get: {
7803
8438
  operationId: "getDocumentUsage",
@@ -11460,7 +12095,7 @@ var openapi_default = {
11460
12095
  get: {
11461
12096
  operationId: "getCreditsUsage",
11462
12097
  summary: "Get usage statistics",
11463
- description: "Returns aggregated API usage stats grouped by operation type and model over the given period.",
12098
+ description: 'Returns aggregated API usage stats grouped by operation type and model over the given period. For organizations without the "Cost control endpoints" approval, `model` and `total_cost_usd` are omitted, rows are grouped by operation type only and ordered by `call_count`, and the response carries `"cost_fields": "redacted"`. The same gate as `GET /v1/usage`.',
11464
12099
  tags: [
11465
12100
  "Credits"
11466
12101
  ],
@@ -11526,6 +12161,13 @@ var openapi_default = {
11526
12161
  period_days: {
11527
12162
  type: "integer",
11528
12163
  example: 30
12164
+ },
12165
+ cost_fields: {
12166
+ type: "string",
12167
+ enum: [
12168
+ "redacted"
12169
+ ],
12170
+ description: "Present only when model and cost fields are redacted."
11529
12171
  }
11530
12172
  }
11531
12173
  }
@@ -11545,7 +12187,7 @@ var openapi_default = {
11545
12187
  get: {
11546
12188
  operationId: "getCreditsUsageDaily",
11547
12189
  summary: "Get daily usage breakdown",
11548
- description: "Returns per-day API usage for the specified period (default last 30 days) as a JSON array.",
12190
+ description: 'Returns per-day API usage for the specified period (default last 30 days) as a JSON array. For organizations without the "Cost control endpoints" approval, `cost_usd` is omitted from every entry (the array carries no `cost_fields` marker). The same gate as `GET /v1/usage`.',
11549
12191
  tags: [
11550
12192
  "Credits"
11551
12193
  ],
@@ -11611,7 +12253,7 @@ var openapi_default = {
11611
12253
  get: {
11612
12254
  operationId: "getCreditsUsageLog",
11613
12255
  summary: "Get credit usage log",
11614
- description: "Returns a detailed per-request usage log with model, tokens, and cost, most recent first, with page/limit pagination.",
12256
+ description: 'Returns a detailed per-request usage log with model, tokens, and cost, most recent first, with page/limit pagination. For organizations without the "Cost control endpoints" approval, `model` and `cost_estimate_usd` are omitted from every item and the response carries `"cost_fields": "redacted"`. The same gate as `GET /v1/usage`.',
11615
12257
  tags: [
11616
12258
  "Credits"
11617
12259
  ],
@@ -11711,6 +12353,13 @@ var openapi_default = {
11711
12353
  },
11712
12354
  limit: {
11713
12355
  type: "integer"
12356
+ },
12357
+ cost_fields: {
12358
+ type: "string",
12359
+ enum: [
12360
+ "redacted"
12361
+ ],
12362
+ description: "Present only when model and cost fields are redacted."
11714
12363
  }
11715
12364
  }
11716
12365
  }
@@ -32275,7 +32924,7 @@ var openapi_default = {
32275
32924
  get: {
32276
32925
  operationId: "listContracts",
32277
32926
  summary: "The contract register, filtered",
32278
- description: "Every contract of the workspace with its status, dates, annual value, direction (sell, buy or internal, derived on read from the parties the documents name against the workspace's own company names), document count, next open key date, open process summary and the Price Baseline and Money Found links. The response is not paginated. Ordered by counterparty, then contract key.",
32927
+ description: "Every contract of the workspace with its status, dates, annual value, direction (sell, buy or internal, derived on read from the parties the documents name against the workspace's own company names), document count, next open key date, open process summary and the Price Baseline and Money Found links. Without `page`, `limit` or `offset` the whole register is returned in one array, ordered by counterparty, then contract key. With any of them the answer is one page of one view, with `total`, `page` and `limit`.",
32279
32928
  tags: [
32280
32929
  "Contracts"
32281
32930
  ],
@@ -32310,11 +32959,86 @@ var openapi_default = {
32310
32959
  type: "string"
32311
32960
  },
32312
32961
  description: "Exact contract key."
32962
+ },
32963
+ {
32964
+ name: "view",
32965
+ in: "query",
32966
+ schema: {
32967
+ type: "string"
32968
+ },
32969
+ description: "Paged only: one register view (all, active, notice_soon, customer_exit, auto_renewal, open_ended, ended, review, money). An unknown view is a 400."
32970
+ },
32971
+ {
32972
+ name: "sort",
32973
+ in: "query",
32974
+ schema: {
32975
+ type: "string"
32976
+ },
32977
+ description: "Paged only: contract, counterparty, status, ends, next, value or money. An unknown sort is a 400."
32978
+ },
32979
+ {
32980
+ name: "dir",
32981
+ in: "query",
32982
+ schema: {
32983
+ type: "string",
32984
+ enum: [
32985
+ "asc",
32986
+ "desc"
32987
+ ]
32988
+ }
32989
+ },
32990
+ {
32991
+ name: "due",
32992
+ in: "query",
32993
+ schema: {
32994
+ type: "string",
32995
+ format: "date"
32996
+ },
32997
+ description: "Paged only: contracts whose exit falls in the week starting on this calendar day. Not a real day is a 400."
32998
+ },
32999
+ {
33000
+ name: "page",
33001
+ in: "query",
33002
+ schema: {
33003
+ type: "integer",
33004
+ minimum: 1
33005
+ },
33006
+ description: "The page to return (1-based)."
33007
+ },
33008
+ {
33009
+ name: "limit",
33010
+ in: "query",
33011
+ schema: {
33012
+ type: "integer",
33013
+ minimum: 1
33014
+ },
33015
+ description: "Rows per page; capped at the configured most (500 by default)."
33016
+ },
33017
+ {
33018
+ name: "offset",
33019
+ in: "query",
33020
+ schema: {
33021
+ type: "integer",
33022
+ minimum: 0
33023
+ },
33024
+ description: "The first row of the page (0-based); wins over `page`. Ask from the rows already held so a row that moved meanwhile is not skipped."
33025
+ },
33026
+ {
33027
+ name: "issues",
33028
+ in: "query",
33029
+ schema: {
33030
+ type: "string",
33031
+ enum: [
33032
+ "0",
33033
+ "1"
33034
+ ]
33035
+ },
33036
+ description: "Paged only: `1` attaches each row's open issues in any view (the review view always carries them)."
32313
33037
  }
32314
33038
  ],
32315
33039
  responses: {
32316
33040
  "200": {
32317
- description: "The matching contracts.",
33041
+ description: "The matching contracts; one page with `total` when paged.",
32318
33042
  content: {
32319
33043
  "application/json": {
32320
33044
  schema: {
@@ -32325,11 +33049,24 @@ var openapi_default = {
32325
33049
  items: {
32326
33050
  $ref: "#/components/schemas/ContractsListItem"
32327
33051
  }
33052
+ },
33053
+ total: {
33054
+ type: "integer",
33055
+ description: "Paged only: rows of the view after the filters."
33056
+ },
33057
+ page: {
33058
+ type: "integer"
33059
+ },
33060
+ limit: {
33061
+ type: "integer"
32328
33062
  }
32329
33063
  }
32330
33064
  }
32331
33065
  }
32332
33066
  }
33067
+ },
33068
+ "400": {
33069
+ $ref: "#/components/responses/BadRequest"
32333
33070
  }
32334
33071
  }
32335
33072
  }
@@ -34323,7 +35060,27 @@ var openapi_default = {
34323
35060
  minimum: 1,
34324
35061
  maximum: 5e3,
34325
35062
  default: 200
34326
- }
35063
+ },
35064
+ description: "Rows per page."
35065
+ },
35066
+ {
35067
+ name: "offset",
35068
+ in: "query",
35069
+ schema: {
35070
+ type: "integer",
35071
+ minimum: 0,
35072
+ default: 0
35073
+ },
35074
+ description: "The first row of the page (0-based). Wins over `page` when both are given."
35075
+ },
35076
+ {
35077
+ name: "page",
35078
+ in: "query",
35079
+ schema: {
35080
+ type: "integer",
35081
+ minimum: 1
35082
+ },
35083
+ description: "The page to return (1-based, `limit` rows each); an alternative to `offset`."
34327
35084
  },
34328
35085
  {
34329
35086
  name: "scope",
@@ -34336,11 +35093,29 @@ var openapi_default = {
34336
35093
  ],
34337
35094
  default: "partners"
34338
35095
  }
35096
+ },
35097
+ {
35098
+ name: "document_id",
35099
+ in: "query",
35100
+ schema: {
35101
+ type: "string",
35102
+ format: "uuid"
35103
+ },
35104
+ description: "Only the parties of the row(s) this document belongs to."
35105
+ },
35106
+ {
35107
+ name: "contract_id",
35108
+ in: "query",
35109
+ schema: {
35110
+ type: "string",
35111
+ format: "uuid"
35112
+ },
35113
+ description: "Only the parties of this contract: the row(s) sharing the most of its documents (a framework document shared with other contracts does not pull in their parties). Not a UUID is a 400."
34339
35114
  }
34340
35115
  ],
34341
35116
  responses: {
34342
35117
  "200": {
34343
- description: "The parties.",
35118
+ description: "One page of the parties.",
34344
35119
  content: {
34345
35120
  "application/json": {
34346
35121
  schema: {
@@ -34348,12 +35123,20 @@ var openapi_default = {
34348
35123
  properties: {
34349
35124
  total: {
34350
35125
  type: "integer",
34351
- description: "Parties matching the filters, before `limit`."
35126
+ description: "Parties matching the filters, before paging."
34352
35127
  },
34353
35128
  needs_attention: {
34354
35129
  type: "integer",
34355
35130
  description: "Parties in scope (before the other filters) that need a person."
34356
35131
  },
35132
+ offset: {
35133
+ type: "integer",
35134
+ description: "The first row of this page."
35135
+ },
35136
+ limit: {
35137
+ type: "integer",
35138
+ description: "Rows per page."
35139
+ },
34357
35140
  data: {
34358
35141
  type: "array",
34359
35142
  items: {
@@ -35906,7 +36689,7 @@ var openapi_default = {
35906
36689
  get: {
35907
36690
  operationId: "listCustomsDeclarationIssues",
35908
36691
  summary: "Worklist of orders with a failing check",
35909
- description: "The orders of a pipeline that are not ready, each with the checks that failed and the fields concerned, and the scored fields whose extracted value differs from the filed declaration or is missing. When `pipeline_id` is omitted, the pipeline is chosen as for `GET /v1/customs-declaration/declarations`.",
36692
+ description: "The orders of a pipeline that are not ready, each with the checks that failed and the fields concerned, and the scored fields whose extracted value differs from the filed declaration or is missing. When `pipeline_id` is omitted, the pipeline is chosen as for `GET /v1/customs-declaration/declarations`. The worklist is built from at most `customs_declaration.max_records` orders: `read` says how many were read, `available` how many the pipeline holds for the key, and `truncated` is true when orders past the cap were not checked.",
35910
36693
  tags: [
35911
36694
  "Customs Declaration"
35912
36695
  ],
@@ -59391,6 +60174,18 @@ var openapi_default = {
59391
60174
  }
59392
60175
  }
59393
60176
  },
60177
+ read: {
60178
+ type: "integer",
60179
+ description: "Orders read and checked."
60180
+ },
60181
+ available: {
60182
+ type: "integer",
60183
+ description: "Orders the pipeline holds for the key; more than `read` only past the cap."
60184
+ },
60185
+ truncated: {
60186
+ type: "boolean",
60187
+ description: "True when `read` < `available`: orders past the cap are not in the worklist."
60188
+ },
59394
60189
  data: {
59395
60190
  type: "array",
59396
60191
  items: {
@@ -59634,6 +60429,10 @@ var openapi_default = {
59634
60429
  type: "string",
59635
60430
  nullable: true,
59636
60431
  description: "The title from the chart's latest reading; absent or null for a chart never read."
60432
+ },
60433
+ reason: {
60434
+ type: "string",
60435
+ description: "Optional engineering text explaining why a found chart is not ready, from its scan or latest reading that returned no values. Absent for ready charts and when no reason was stored. Clients map recognized codes to localized sentences and use a generic fallback for unknown codes; raw text is not display copy."
59637
60436
  }
59638
60437
  }
59639
60438
  },
@@ -59807,6 +60606,30 @@ var openapi_default = {
59807
60606
  $ref: "#/components/schemas/ChartToDataFoundChart"
59808
60607
  }
59809
60608
  },
60609
+ pictures: {
60610
+ type: "array",
60611
+ description: "Optional unread figure-sized picture diagnostics, grouped by page. Omitted when the scan has none or an older scan stored no picture diagnostics. These are not chart assets or claims.",
60612
+ items: {
60613
+ type: "object",
60614
+ required: [
60615
+ "page_number",
60616
+ "reasons"
60617
+ ],
60618
+ properties: {
60619
+ page_number: {
60620
+ type: "integer",
60621
+ minimum: 1
60622
+ },
60623
+ reasons: {
60624
+ type: "array",
60625
+ items: {
60626
+ type: "string"
60627
+ },
60628
+ description: "One engineering reason per unread picture, including the refusal code and explanation when available. Clients map recognized codes to localized sentences and fall back generically for unknown codes."
60629
+ }
60630
+ }
60631
+ }
60632
+ },
59810
60633
  diagrams: {
59811
60634
  type: "array",
59812
60635
  items: {
@@ -68873,6 +69696,10 @@ var API_NAV_SECTIONS = [
68873
69696
  { id: "usage-overview", label: "Overview" },
68874
69697
  { id: "usage-credits", label: "Credit Usage" }
68875
69698
  ] },
69699
+ { id: "aggregate", label: "Aggregate", children: [
69700
+ { id: "aggregate-overview", label: "Overview" },
69701
+ { id: "aggregate-catalog", label: "Catalog" }
69702
+ ] },
68876
69703
  { id: "account", label: "Account", children: [
68877
69704
  { id: "get-account", label: "Account Snapshot" },
68878
69705
  { id: "account-keys", label: "Manage API Keys" },
@@ -69247,6 +70074,7 @@ var API_SECTION_META = [
69247
70074
  { id: "routing-rules", title: "Routing Rules API", description: "Document routing rules \u2014 create, manage, and reorder priority-based rules for automatic document workflow assignment." },
69248
70075
  { id: "reference-data", title: "Reference Data API", description: "Upload, list, and manage reference data tables used as lookup targets for matching configurations. Supports JSON upload, paginated row access, and CSV export." },
69249
70076
  { id: "fields", title: "Fields API", description: "Read-only access to the field registry \u2014 list fields with filters, cross-schema harmonization analysis, field detail with occurrences, and embedding-based similarity search." },
70077
+ { id: "aggregate", title: "Aggregate API", description: "Workspace metrics in one request \u2014 counts, sums, averages, medians and percentiles over documents, pipelines, app decisions, deliveries, model calls and the standard apps, filtered and grouped." },
69250
70078
  { id: "usage", title: "Usage API", description: "AI token usage tracking \u2014 aggregate stats by operation type and model, per-document usage breakdown with cost estimates, and per-function credit consumption." },
69251
70079
  { id: "pricing", title: "Pricing API", description: "Public machine-readable credit pricing catalog \u2014 fixed per-unit credit rates, EUR equivalents, the credits-per-EUR conversion, and processing-mode multipliers, so an agent can predict spend before running." },
69252
70080
  { id: "document-types", title: "Document Types API", description: "Document type classification \u2014 list workspace document types by frequency and retrieve the 529-type ontology taxonomy." },