@talonic/docs 0.21.65 → 0.21.67

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/openapi.json CHANGED
@@ -105,6 +105,10 @@
105
105
  "name": "DB Snapshots",
106
106
  "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 — 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) — 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"
107
107
  },
108
+ {
109
+ "name": "Aggregate",
110
+ "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."
111
+ },
108
112
  {
109
113
  "name": "Usage",
110
114
  "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."
@@ -7778,6 +7782,593 @@
7778
7782
  }
7779
7783
  }
7780
7784
  },
7785
+ "/v1/aggregate": {
7786
+ "post": {
7787
+ "operationId": "aggregate",
7788
+ "summary": "Several workspace metrics in one request",
7789
+ "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`–`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",
7790
+ "tags": [
7791
+ "Aggregate"
7792
+ ],
7793
+ "requestBody": {
7794
+ "required": true,
7795
+ "content": {
7796
+ "application/json": {
7797
+ "schema": {
7798
+ "type": "object",
7799
+ "required": [
7800
+ "from",
7801
+ "to",
7802
+ "queries"
7803
+ ],
7804
+ "properties": {
7805
+ "from": {
7806
+ "type": "string",
7807
+ "format": "date-time"
7808
+ },
7809
+ "to": {
7810
+ "type": "string",
7811
+ "format": "date-time",
7812
+ "description": "Exclusive."
7813
+ },
7814
+ "scope": {
7815
+ "type": "object",
7816
+ "properties": {
7817
+ "document_ids": {
7818
+ "type": "array",
7819
+ "items": {
7820
+ "type": "string",
7821
+ "format": "uuid"
7822
+ },
7823
+ "maxItems": 1000
7824
+ },
7825
+ "tags": {
7826
+ "type": "object",
7827
+ "properties": {
7828
+ "any": {
7829
+ "type": "array",
7830
+ "items": {
7831
+ "type": "string"
7832
+ }
7833
+ },
7834
+ "all": {
7835
+ "type": "array",
7836
+ "items": {
7837
+ "type": "string"
7838
+ }
7839
+ }
7840
+ }
7841
+ },
7842
+ "system_tags": {
7843
+ "type": "object",
7844
+ "properties": {
7845
+ "any": {
7846
+ "type": "array",
7847
+ "items": {
7848
+ "type": "string"
7849
+ }
7850
+ },
7851
+ "all": {
7852
+ "type": "array",
7853
+ "items": {
7854
+ "type": "string"
7855
+ }
7856
+ }
7857
+ }
7858
+ },
7859
+ "source_connection_ids": {
7860
+ "type": "array",
7861
+ "items": {
7862
+ "type": "string",
7863
+ "format": "uuid"
7864
+ }
7865
+ },
7866
+ "document_types": {
7867
+ "type": "array",
7868
+ "items": {
7869
+ "type": "string"
7870
+ },
7871
+ "description": "Document type ids or exact names."
7872
+ },
7873
+ "client_batch_ids": {
7874
+ "type": "array",
7875
+ "items": {
7876
+ "type": "string"
7877
+ }
7878
+ },
7879
+ "roots_only": {
7880
+ "type": "boolean"
7881
+ },
7882
+ "attachments_only": {
7883
+ "type": "boolean"
7884
+ }
7885
+ }
7886
+ },
7887
+ "queries": {
7888
+ "type": "array",
7889
+ "minItems": 1,
7890
+ "maxItems": 20,
7891
+ "items": {
7892
+ "type": "object",
7893
+ "required": [
7894
+ "id",
7895
+ "dataset",
7896
+ "measure"
7897
+ ],
7898
+ "properties": {
7899
+ "id": {
7900
+ "type": "string",
7901
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
7902
+ },
7903
+ "dataset": {
7904
+ "type": "string",
7905
+ "enum": [
7906
+ "documents",
7907
+ "document_cost",
7908
+ "pipeline_documents",
7909
+ "app_verdicts",
7910
+ "app_runs",
7911
+ "deliveries",
7912
+ "llm_calls",
7913
+ "compliance_evaluations",
7914
+ "money_found_reviews",
7915
+ "contract_check_decisions",
7916
+ "doc_gen_jobs",
7917
+ "doc_gen_documents",
7918
+ "price_invoice_checks"
7919
+ ]
7920
+ },
7921
+ "measure": {
7922
+ "oneOf": [
7923
+ {
7924
+ "type": "string"
7925
+ },
7926
+ {
7927
+ "type": "array",
7928
+ "items": {
7929
+ "type": "string"
7930
+ }
7931
+ }
7932
+ ]
7933
+ },
7934
+ "of": {
7935
+ "type": "string"
7936
+ },
7937
+ "where": {
7938
+ "type": "array",
7939
+ "items": {
7940
+ "type": "object",
7941
+ "required": [
7942
+ "field",
7943
+ "op"
7944
+ ],
7945
+ "properties": {
7946
+ "field": {
7947
+ "type": "string"
7948
+ },
7949
+ "op": {
7950
+ "type": "string",
7951
+ "enum": [
7952
+ "eq",
7953
+ "neq",
7954
+ "in",
7955
+ "not_in",
7956
+ "is_null",
7957
+ "not_null",
7958
+ "gt",
7959
+ "gte",
7960
+ "lt",
7961
+ "lte",
7962
+ "contains_any",
7963
+ "contains_all"
7964
+ ]
7965
+ },
7966
+ "value": {}
7967
+ }
7968
+ }
7969
+ },
7970
+ "group_by": {
7971
+ "type": "array",
7972
+ "items": {
7973
+ "type": "string"
7974
+ },
7975
+ "maxItems": 3
7976
+ }
7977
+ }
7978
+ }
7979
+ }
7980
+ }
7981
+ },
7982
+ "example": {
7983
+ "from": "2026-11-05T12:00:00Z",
7984
+ "to": "2026-11-06T00:00:00Z",
7985
+ "queries": [
7986
+ {
7987
+ "id": "received",
7988
+ "dataset": "documents",
7989
+ "measure": "count",
7990
+ "where": [
7991
+ {
7992
+ "field": "duplicate",
7993
+ "op": "eq",
7994
+ "value": false
7995
+ }
7996
+ ]
7997
+ },
7998
+ {
7999
+ "id": "failed",
8000
+ "dataset": "documents",
8001
+ "measure": "count",
8002
+ "where": [
8003
+ {
8004
+ "field": "failed",
8005
+ "op": "eq",
8006
+ "value": true
8007
+ }
8008
+ ]
8009
+ },
8010
+ {
8011
+ "id": "by_type",
8012
+ "dataset": "documents",
8013
+ "measure": "count",
8014
+ "group_by": [
8015
+ "document_type"
8016
+ ]
8017
+ },
8018
+ {
8019
+ "id": "cost",
8020
+ "dataset": "document_cost",
8021
+ "measure": [
8022
+ "avg",
8023
+ "median"
8024
+ ],
8025
+ "of": "cost_usd"
8026
+ }
8027
+ ]
8028
+ }
8029
+ }
8030
+ }
8031
+ },
8032
+ "responses": {
8033
+ "200": {
8034
+ "description": "One result per query id.",
8035
+ "content": {
8036
+ "application/json": {
8037
+ "schema": {
8038
+ "type": "object",
8039
+ "properties": {
8040
+ "window": {
8041
+ "type": "object",
8042
+ "properties": {
8043
+ "from": {
8044
+ "type": "string",
8045
+ "format": "date-time"
8046
+ },
8047
+ "to": {
8048
+ "type": "string",
8049
+ "format": "date-time"
8050
+ }
8051
+ }
8052
+ },
8053
+ "as_of": {
8054
+ "type": "string",
8055
+ "format": "date-time"
8056
+ },
8057
+ "results": {
8058
+ "type": "object",
8059
+ "additionalProperties": {
8060
+ "type": "object",
8061
+ "properties": {
8062
+ "dataset": {
8063
+ "type": "string"
8064
+ },
8065
+ "kind": {
8066
+ "type": "string",
8067
+ "enum": [
8068
+ "event",
8069
+ "entity"
8070
+ ]
8071
+ },
8072
+ "value": {
8073
+ "type": "number",
8074
+ "nullable": true
8075
+ },
8076
+ "values": {
8077
+ "type": "object",
8078
+ "additionalProperties": {
8079
+ "type": "number",
8080
+ "nullable": true
8081
+ }
8082
+ },
8083
+ "groups": {
8084
+ "type": "array",
8085
+ "items": {
8086
+ "type": "object",
8087
+ "properties": {
8088
+ "key": {
8089
+ "type": "object",
8090
+ "description": "Dimension values; null is a row without one."
8091
+ },
8092
+ "value": {
8093
+ "type": "number",
8094
+ "nullable": true
8095
+ },
8096
+ "values": {
8097
+ "type": "object",
8098
+ "additionalProperties": {
8099
+ "type": "number",
8100
+ "nullable": true
8101
+ }
8102
+ }
8103
+ }
8104
+ }
8105
+ },
8106
+ "groups_total": {
8107
+ "type": "integer",
8108
+ "description": "Groups that existed; more than groups.length when the 200-group cap applied."
8109
+ }
8110
+ }
8111
+ }
8112
+ }
8113
+ }
8114
+ },
8115
+ "example": {
8116
+ "window": {
8117
+ "from": "2026-11-05T12:00:00.000Z",
8118
+ "to": "2026-11-06T00:00:00.000Z"
8119
+ },
8120
+ "as_of": "2026-11-06T00:00:03.120Z",
8121
+ "results": {
8122
+ "received": {
8123
+ "dataset": "documents",
8124
+ "kind": "entity",
8125
+ "value": 412
8126
+ },
8127
+ "failed": {
8128
+ "dataset": "documents",
8129
+ "kind": "entity",
8130
+ "value": 3
8131
+ },
8132
+ "by_type": {
8133
+ "dataset": "documents",
8134
+ "kind": "entity",
8135
+ "groups": [
8136
+ {
8137
+ "key": {
8138
+ "document_type": "Invoice"
8139
+ },
8140
+ "value": 301
8141
+ },
8142
+ {
8143
+ "key": {
8144
+ "document_type": "Delivery Note"
8145
+ },
8146
+ "value": 97
8147
+ },
8148
+ {
8149
+ "key": {
8150
+ "document_type": null
8151
+ },
8152
+ "value": 14
8153
+ }
8154
+ ],
8155
+ "groups_total": 3
8156
+ },
8157
+ "cost": {
8158
+ "dataset": "document_cost",
8159
+ "kind": "entity",
8160
+ "values": {
8161
+ "avg": 0.0108,
8162
+ "median": 0.0104,
8163
+ "n": 412
8164
+ }
8165
+ }
8166
+ }
8167
+ }
8168
+ }
8169
+ }
8170
+ },
8171
+ "400": {
8172
+ "$ref": "#/components/responses/BadRequest"
8173
+ },
8174
+ "401": {
8175
+ "$ref": "#/components/responses/Unauthorized"
8176
+ },
8177
+ "403": {
8178
+ "$ref": "#/components/responses/Forbidden"
8179
+ },
8180
+ "422": {
8181
+ "description": "A statement ran past the timeout (`aggregate_timeout`); `details.dataset` names it."
8182
+ },
8183
+ "429": {
8184
+ "$ref": "#/components/responses/RateLimitExceeded"
8185
+ }
8186
+ }
8187
+ }
8188
+ },
8189
+ "/v1/aggregate/catalog": {
8190
+ "get": {
8191
+ "operationId": "getAggregateCatalog",
8192
+ "summary": "What you can ask /v1/aggregate",
8193
+ "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",
8194
+ "tags": [
8195
+ "Aggregate"
8196
+ ],
8197
+ "responses": {
8198
+ "200": {
8199
+ "description": "The catalog.",
8200
+ "content": {
8201
+ "application/json": {
8202
+ "schema": {
8203
+ "type": "object",
8204
+ "properties": {
8205
+ "datasets": {
8206
+ "type": "array",
8207
+ "items": {
8208
+ "type": "object",
8209
+ "properties": {
8210
+ "name": {
8211
+ "type": "string"
8212
+ },
8213
+ "description": {
8214
+ "type": "string"
8215
+ },
8216
+ "kind": {
8217
+ "type": "string",
8218
+ "enum": [
8219
+ "entity",
8220
+ "event"
8221
+ ],
8222
+ "description": "`entity`: created in the window, status now. `event`: written in the window."
8223
+ },
8224
+ "document_scope": {
8225
+ "type": "boolean"
8226
+ },
8227
+ "defaults": {
8228
+ "type": "array",
8229
+ "items": {
8230
+ "type": "object",
8231
+ "properties": {
8232
+ "field": {
8233
+ "type": "string"
8234
+ },
8235
+ "op": {
8236
+ "type": "string"
8237
+ },
8238
+ "value": {}
8239
+ }
8240
+ }
8241
+ },
8242
+ "fields": {
8243
+ "type": "array",
8244
+ "items": {
8245
+ "type": "object",
8246
+ "properties": {
8247
+ "name": {
8248
+ "type": "string"
8249
+ },
8250
+ "description": {
8251
+ "type": "string"
8252
+ },
8253
+ "type": {
8254
+ "type": "string",
8255
+ "enum": [
8256
+ "text",
8257
+ "uuid",
8258
+ "bool",
8259
+ "number",
8260
+ "text[]"
8261
+ ]
8262
+ },
8263
+ "groupable": {
8264
+ "type": "boolean"
8265
+ },
8266
+ "cost": {
8267
+ "type": "boolean"
8268
+ },
8269
+ "ops": {
8270
+ "type": "array",
8271
+ "items": {
8272
+ "type": "string"
8273
+ }
8274
+ }
8275
+ }
8276
+ }
8277
+ }
8278
+ }
8279
+ }
8280
+ },
8281
+ "measures": {
8282
+ "type": "array",
8283
+ "items": {
8284
+ "type": "object",
8285
+ "properties": {
8286
+ "name": {
8287
+ "type": "string"
8288
+ },
8289
+ "description": {
8290
+ "type": "string"
8291
+ },
8292
+ "needs_of": {
8293
+ "type": "boolean"
8294
+ }
8295
+ }
8296
+ }
8297
+ },
8298
+ "group_by": {
8299
+ "type": "object",
8300
+ "properties": {
8301
+ "time": {
8302
+ "type": "array",
8303
+ "items": {
8304
+ "type": "string"
8305
+ }
8306
+ },
8307
+ "max": {
8308
+ "type": "integer"
8309
+ },
8310
+ "max_buckets": {
8311
+ "type": "integer"
8312
+ }
8313
+ }
8314
+ },
8315
+ "scope_keys": {
8316
+ "type": "array",
8317
+ "items": {
8318
+ "type": "string"
8319
+ }
8320
+ },
8321
+ "limits": {
8322
+ "type": "object",
8323
+ "properties": {
8324
+ "max_window_days": {
8325
+ "type": "integer"
8326
+ },
8327
+ "max_queries": {
8328
+ "type": "integer"
8329
+ },
8330
+ "max_list_values": {
8331
+ "type": "integer"
8332
+ },
8333
+ "statement_timeout_ms": {
8334
+ "type": "integer",
8335
+ "description": "How long one statement may run; a request runs one per dataset plus one per grouped query."
8336
+ },
8337
+ "concurrency": {
8338
+ "type": "object",
8339
+ "properties": {
8340
+ "requests": {
8341
+ "type": "integer"
8342
+ },
8343
+ "per": {
8344
+ "type": "string",
8345
+ "enum": [
8346
+ "workspace",
8347
+ "api_process"
8348
+ ],
8349
+ "description": "`api_process` where the deployment does not share the limiter across API processes."
8350
+ }
8351
+ }
8352
+ }
8353
+ }
8354
+ },
8355
+ "cost_visible": {
8356
+ "type": "boolean"
8357
+ }
8358
+ }
8359
+ }
8360
+ }
8361
+ }
8362
+ },
8363
+ "401": {
8364
+ "$ref": "#/components/responses/Unauthorized"
8365
+ },
8366
+ "429": {
8367
+ "$ref": "#/components/responses/RateLimitExceeded"
8368
+ }
8369
+ }
8370
+ }
8371
+ },
7781
8372
  "/v1/usage/documents/{id}": {
7782
8373
  "get": {
7783
8374
  "operationId": "getDocumentUsage",
@@ -11440,7 +12031,7 @@
11440
12031
  "get": {
11441
12032
  "operationId": "getCreditsUsage",
11442
12033
  "summary": "Get usage statistics",
11443
- "description": "Returns aggregated API usage stats grouped by operation type and model over the given period.",
12034
+ "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`.",
11444
12035
  "tags": [
11445
12036
  "Credits"
11446
12037
  ],
@@ -11506,6 +12097,13 @@
11506
12097
  "period_days": {
11507
12098
  "type": "integer",
11508
12099
  "example": 30
12100
+ },
12101
+ "cost_fields": {
12102
+ "type": "string",
12103
+ "enum": [
12104
+ "redacted"
12105
+ ],
12106
+ "description": "Present only when model and cost fields are redacted."
11509
12107
  }
11510
12108
  }
11511
12109
  }
@@ -11525,7 +12123,7 @@
11525
12123
  "get": {
11526
12124
  "operationId": "getCreditsUsageDaily",
11527
12125
  "summary": "Get daily usage breakdown",
11528
- "description": "Returns per-day API usage for the specified period (default last 30 days) as a JSON array.",
12126
+ "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`.",
11529
12127
  "tags": [
11530
12128
  "Credits"
11531
12129
  ],
@@ -11591,7 +12189,7 @@
11591
12189
  "get": {
11592
12190
  "operationId": "getCreditsUsageLog",
11593
12191
  "summary": "Get credit usage log",
11594
- "description": "Returns a detailed per-request usage log with model, tokens, and cost, most recent first, with page/limit pagination.",
12192
+ "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`.",
11595
12193
  "tags": [
11596
12194
  "Credits"
11597
12195
  ],
@@ -11691,6 +12289,13 @@
11691
12289
  },
11692
12290
  "limit": {
11693
12291
  "type": "integer"
12292
+ },
12293
+ "cost_fields": {
12294
+ "type": "string",
12295
+ "enum": [
12296
+ "redacted"
12297
+ ],
12298
+ "description": "Present only when model and cost fields are redacted."
11694
12299
  }
11695
12300
  }
11696
12301
  }
@@ -32255,7 +32860,7 @@
32255
32860
  "get": {
32256
32861
  "operationId": "listContracts",
32257
32862
  "summary": "The contract register, filtered",
32258
- "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.",
32863
+ "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`.",
32259
32864
  "tags": [
32260
32865
  "Contracts"
32261
32866
  ],
@@ -32290,11 +32895,86 @@
32290
32895
  "type": "string"
32291
32896
  },
32292
32897
  "description": "Exact contract key."
32898
+ },
32899
+ {
32900
+ "name": "view",
32901
+ "in": "query",
32902
+ "schema": {
32903
+ "type": "string"
32904
+ },
32905
+ "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."
32906
+ },
32907
+ {
32908
+ "name": "sort",
32909
+ "in": "query",
32910
+ "schema": {
32911
+ "type": "string"
32912
+ },
32913
+ "description": "Paged only: contract, counterparty, status, ends, next, value or money. An unknown sort is a 400."
32914
+ },
32915
+ {
32916
+ "name": "dir",
32917
+ "in": "query",
32918
+ "schema": {
32919
+ "type": "string",
32920
+ "enum": [
32921
+ "asc",
32922
+ "desc"
32923
+ ]
32924
+ }
32925
+ },
32926
+ {
32927
+ "name": "due",
32928
+ "in": "query",
32929
+ "schema": {
32930
+ "type": "string",
32931
+ "format": "date"
32932
+ },
32933
+ "description": "Paged only: contracts whose exit falls in the week starting on this calendar day. Not a real day is a 400."
32934
+ },
32935
+ {
32936
+ "name": "page",
32937
+ "in": "query",
32938
+ "schema": {
32939
+ "type": "integer",
32940
+ "minimum": 1
32941
+ },
32942
+ "description": "The page to return (1-based)."
32943
+ },
32944
+ {
32945
+ "name": "limit",
32946
+ "in": "query",
32947
+ "schema": {
32948
+ "type": "integer",
32949
+ "minimum": 1
32950
+ },
32951
+ "description": "Rows per page; capped at the configured most (500 by default)."
32952
+ },
32953
+ {
32954
+ "name": "offset",
32955
+ "in": "query",
32956
+ "schema": {
32957
+ "type": "integer",
32958
+ "minimum": 0
32959
+ },
32960
+ "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."
32961
+ },
32962
+ {
32963
+ "name": "issues",
32964
+ "in": "query",
32965
+ "schema": {
32966
+ "type": "string",
32967
+ "enum": [
32968
+ "0",
32969
+ "1"
32970
+ ]
32971
+ },
32972
+ "description": "Paged only: `1` attaches each row's open issues in any view (the review view always carries them)."
32293
32973
  }
32294
32974
  ],
32295
32975
  "responses": {
32296
32976
  "200": {
32297
- "description": "The matching contracts.",
32977
+ "description": "The matching contracts; one page with `total` when paged.",
32298
32978
  "content": {
32299
32979
  "application/json": {
32300
32980
  "schema": {
@@ -32305,11 +32985,24 @@
32305
32985
  "items": {
32306
32986
  "$ref": "#/components/schemas/ContractsListItem"
32307
32987
  }
32988
+ },
32989
+ "total": {
32990
+ "type": "integer",
32991
+ "description": "Paged only: rows of the view after the filters."
32992
+ },
32993
+ "page": {
32994
+ "type": "integer"
32995
+ },
32996
+ "limit": {
32997
+ "type": "integer"
32308
32998
  }
32309
32999
  }
32310
33000
  }
32311
33001
  }
32312
33002
  }
33003
+ },
33004
+ "400": {
33005
+ "$ref": "#/components/responses/BadRequest"
32313
33006
  }
32314
33007
  }
32315
33008
  }
@@ -34303,7 +34996,27 @@
34303
34996
  "minimum": 1,
34304
34997
  "maximum": 5000,
34305
34998
  "default": 200
34306
- }
34999
+ },
35000
+ "description": "Rows per page."
35001
+ },
35002
+ {
35003
+ "name": "offset",
35004
+ "in": "query",
35005
+ "schema": {
35006
+ "type": "integer",
35007
+ "minimum": 0,
35008
+ "default": 0
35009
+ },
35010
+ "description": "The first row of the page (0-based). Wins over `page` when both are given."
35011
+ },
35012
+ {
35013
+ "name": "page",
35014
+ "in": "query",
35015
+ "schema": {
35016
+ "type": "integer",
35017
+ "minimum": 1
35018
+ },
35019
+ "description": "The page to return (1-based, `limit` rows each); an alternative to `offset`."
34307
35020
  },
34308
35021
  {
34309
35022
  "name": "scope",
@@ -34316,11 +35029,29 @@
34316
35029
  ],
34317
35030
  "default": "partners"
34318
35031
  }
35032
+ },
35033
+ {
35034
+ "name": "document_id",
35035
+ "in": "query",
35036
+ "schema": {
35037
+ "type": "string",
35038
+ "format": "uuid"
35039
+ },
35040
+ "description": "Only the parties of the row(s) this document belongs to."
35041
+ },
35042
+ {
35043
+ "name": "contract_id",
35044
+ "in": "query",
35045
+ "schema": {
35046
+ "type": "string",
35047
+ "format": "uuid"
35048
+ },
35049
+ "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."
34319
35050
  }
34320
35051
  ],
34321
35052
  "responses": {
34322
35053
  "200": {
34323
- "description": "The parties.",
35054
+ "description": "One page of the parties.",
34324
35055
  "content": {
34325
35056
  "application/json": {
34326
35057
  "schema": {
@@ -34328,12 +35059,20 @@
34328
35059
  "properties": {
34329
35060
  "total": {
34330
35061
  "type": "integer",
34331
- "description": "Parties matching the filters, before `limit`."
35062
+ "description": "Parties matching the filters, before paging."
34332
35063
  },
34333
35064
  "needs_attention": {
34334
35065
  "type": "integer",
34335
35066
  "description": "Parties in scope (before the other filters) that need a person."
34336
35067
  },
35068
+ "offset": {
35069
+ "type": "integer",
35070
+ "description": "The first row of this page."
35071
+ },
35072
+ "limit": {
35073
+ "type": "integer",
35074
+ "description": "Rows per page."
35075
+ },
34337
35076
  "data": {
34338
35077
  "type": "array",
34339
35078
  "items": {
@@ -35886,7 +36625,7 @@
35886
36625
  "get": {
35887
36626
  "operationId": "listCustomsDeclarationIssues",
35888
36627
  "summary": "Worklist of orders with a failing check",
35889
- "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`.",
36628
+ "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.",
35890
36629
  "tags": [
35891
36630
  "Customs Declaration"
35892
36631
  ],
@@ -59371,6 +60110,18 @@
59371
60110
  }
59372
60111
  }
59373
60112
  },
60113
+ "read": {
60114
+ "type": "integer",
60115
+ "description": "Orders read and checked."
60116
+ },
60117
+ "available": {
60118
+ "type": "integer",
60119
+ "description": "Orders the pipeline holds for the key; more than `read` only past the cap."
60120
+ },
60121
+ "truncated": {
60122
+ "type": "boolean",
60123
+ "description": "True when `read` < `available`: orders past the cap are not in the worklist."
60124
+ },
59374
60125
  "data": {
59375
60126
  "type": "array",
59376
60127
  "items": {
@@ -59614,6 +60365,10 @@
59614
60365
  "type": "string",
59615
60366
  "nullable": true,
59616
60367
  "description": "The title from the chart's latest reading; absent or null for a chart never read."
60368
+ },
60369
+ "reason": {
60370
+ "type": "string",
60371
+ "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."
59617
60372
  }
59618
60373
  }
59619
60374
  },
@@ -59787,6 +60542,30 @@
59787
60542
  "$ref": "#/components/schemas/ChartToDataFoundChart"
59788
60543
  }
59789
60544
  },
60545
+ "pictures": {
60546
+ "type": "array",
60547
+ "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.",
60548
+ "items": {
60549
+ "type": "object",
60550
+ "required": [
60551
+ "page_number",
60552
+ "reasons"
60553
+ ],
60554
+ "properties": {
60555
+ "page_number": {
60556
+ "type": "integer",
60557
+ "minimum": 1
60558
+ },
60559
+ "reasons": {
60560
+ "type": "array",
60561
+ "items": {
60562
+ "type": "string"
60563
+ },
60564
+ "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."
60565
+ }
60566
+ }
60567
+ }
60568
+ },
59790
60569
  "diagrams": {
59791
60570
  "type": "array",
59792
60571
  "items": {