@talonic/docs 0.21.15 → 0.21.17

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
@@ -180,6 +180,10 @@
180
180
  {
181
181
  "name": "Provenance",
182
182
  "description": "Document-level provenance — deterministic (subject, predicate, object) claims synthesized from captured fields and spans, each carrying its evidence quote and grounded flag."
183
+ },
184
+ {
185
+ "name": "AI Policy",
186
+ "description": "Tenant AI policy and model routing. Read the effective policy, replace or patch it, list every model and model class with reachability, inspect the operation catalog, dry-run a routing decision, and read the policy's own version history. The mandatory constraints (region pin, provider allowlist, model denylist) are enforced at routing time for every call; a policy that leaves an operation without a compliant route makes that operation fail closed rather than reach a provider the policy forbids. All routes require a workspace-scoped API key.\n"
183
187
  }
184
188
  ],
185
189
  "paths": {
@@ -1009,6 +1013,192 @@
1009
1013
  }
1010
1014
  }
1011
1015
  },
1016
+ "/v1/documents/upload-session": {
1017
+ "post": {
1018
+ "operationId": "createUploadSession",
1019
+ "summary": "Create a browser-handoff upload session",
1020
+ "description": "Creates a pending document row plus a short-lived upload token and\nreturns a browser `upload_url` for it. This is the first half of the\nbrowser-handoff upload pair used by the hosted MCP connector: an\nagent creates the session, the user opens `upload_url` in a browser\nand picks the file, and the browser posts it to\n`POST /v1/upload/{token}`.\n\n**Auth is asymmetric across the pair.** This route requires an\nOAuth 2.1 bearer token (the connector OAuth session) and REJECTS\n`tlnc_` API keys with `401`. The upload route is unauthenticated\nbecause the short-lived token IS the credential. The token expires\nafter 15 minutes by default and is single-use.\n\nThe created document is targeted at extraction only\n(`ingestion_target: extract`): once uploaded, call `POST /v1/extract`\nwith the returned `document_id`.\n",
1021
+ "tags": [
1022
+ "Documents"
1023
+ ],
1024
+ "security": [
1025
+ {
1026
+ "OAuthBearerAuth": []
1027
+ }
1028
+ ],
1029
+ "requestBody": {
1030
+ "required": true,
1031
+ "content": {
1032
+ "application/json": {
1033
+ "schema": {
1034
+ "type": "object",
1035
+ "required": [
1036
+ "filename"
1037
+ ],
1038
+ "properties": {
1039
+ "filename": {
1040
+ "type": "string",
1041
+ "maxLength": 512,
1042
+ "description": "Filename of the file the user will upload.",
1043
+ "example": "invoice-2026-04.pdf"
1044
+ }
1045
+ }
1046
+ }
1047
+ }
1048
+ }
1049
+ },
1050
+ "responses": {
1051
+ "201": {
1052
+ "description": "Upload session created.",
1053
+ "content": {
1054
+ "application/json": {
1055
+ "schema": {
1056
+ "type": "object",
1057
+ "required": [
1058
+ "document_id",
1059
+ "upload_url",
1060
+ "expires_at"
1061
+ ],
1062
+ "properties": {
1063
+ "document_id": {
1064
+ "type": "string",
1065
+ "format": "uuid",
1066
+ "description": "Pending document row awaiting the upload.",
1067
+ "example": "f0e1d2c3-b4a5-9687-8765-432109876543"
1068
+ },
1069
+ "upload_url": {
1070
+ "type": "string",
1071
+ "description": "Browser URL the user opens to pick and upload the file.",
1072
+ "example": "https://app.talonic.com/u/1f2e3d4c-5b6a-7980-abcd-ef0123456789"
1073
+ },
1074
+ "expires_at": {
1075
+ "type": "string",
1076
+ "format": "date-time",
1077
+ "description": "Token expiry (15 minutes from creation by default)."
1078
+ }
1079
+ }
1080
+ }
1081
+ }
1082
+ }
1083
+ },
1084
+ "400": {
1085
+ "$ref": "#/components/responses/BadRequest"
1086
+ },
1087
+ "401": {
1088
+ "description": "Missing or invalid OAuth bearer token, or a `tlnc_` API key was used (not accepted on this route).",
1089
+ "content": {
1090
+ "application/json": {
1091
+ "schema": {
1092
+ "$ref": "#/components/schemas/ErrorResponse"
1093
+ }
1094
+ }
1095
+ }
1096
+ },
1097
+ "429": {
1098
+ "$ref": "#/components/responses/RateLimitExceeded"
1099
+ }
1100
+ }
1101
+ }
1102
+ },
1103
+ "/v1/upload/{token}": {
1104
+ "post": {
1105
+ "operationId": "uploadWithToken",
1106
+ "summary": "Upload a file against an upload-session token",
1107
+ "description": "Accepts the file for an upload session. This route is public: no\n`Authorization` header is required or read, because the single-use,\nshort-lived session token in the path IS the credential. The token is\nclaimed atomically, so a second request with the same token gets\n`404` even if it races the first.\n\nSend the file as `multipart/form-data` in the `file` field. The\ndefault size cap is 500 MB. On success the document is stored and\nextraction is enqueued; the returned `status` is normally `queued`\n(`uploaded` when the queue is temporarily unavailable, in which case\n`POST /v1/extract` still processes the document inline).\n",
1108
+ "tags": [
1109
+ "Documents"
1110
+ ],
1111
+ "security": [],
1112
+ "parameters": [
1113
+ {
1114
+ "name": "token",
1115
+ "in": "path",
1116
+ "required": true,
1117
+ "schema": {
1118
+ "type": "string",
1119
+ "format": "uuid"
1120
+ },
1121
+ "description": "Single-use upload token minted by `POST /v1/documents/upload-session`."
1122
+ }
1123
+ ],
1124
+ "requestBody": {
1125
+ "required": true,
1126
+ "content": {
1127
+ "multipart/form-data": {
1128
+ "schema": {
1129
+ "type": "object",
1130
+ "required": [
1131
+ "file"
1132
+ ],
1133
+ "properties": {
1134
+ "file": {
1135
+ "type": "string",
1136
+ "format": "binary",
1137
+ "description": "The file to upload (500 MB default cap)."
1138
+ }
1139
+ }
1140
+ }
1141
+ }
1142
+ }
1143
+ },
1144
+ "responses": {
1145
+ "201": {
1146
+ "description": "File accepted and extraction enqueued.",
1147
+ "content": {
1148
+ "application/json": {
1149
+ "schema": {
1150
+ "type": "object",
1151
+ "required": [
1152
+ "document_id",
1153
+ "status",
1154
+ "filename"
1155
+ ],
1156
+ "properties": {
1157
+ "document_id": {
1158
+ "type": "string",
1159
+ "format": "uuid",
1160
+ "example": "f0e1d2c3-b4a5-9687-8765-432109876543"
1161
+ },
1162
+ "status": {
1163
+ "type": "string",
1164
+ "description": "Document status after upload, normally `queued`.",
1165
+ "example": "queued"
1166
+ },
1167
+ "filename": {
1168
+ "type": "string",
1169
+ "example": "invoice-2026-04.pdf"
1170
+ }
1171
+ }
1172
+ }
1173
+ }
1174
+ }
1175
+ },
1176
+ "400": {
1177
+ "description": "No file was included in the multipart body.",
1178
+ "content": {
1179
+ "application/json": {
1180
+ "schema": {
1181
+ "$ref": "#/components/schemas/ErrorResponse"
1182
+ }
1183
+ }
1184
+ }
1185
+ },
1186
+ "404": {
1187
+ "description": "Upload token not found, expired, or already used.",
1188
+ "content": {
1189
+ "application/json": {
1190
+ "schema": {
1191
+ "$ref": "#/components/schemas/ErrorResponse"
1192
+ }
1193
+ }
1194
+ }
1195
+ },
1196
+ "429": {
1197
+ "$ref": "#/components/responses/RateLimitExceeded"
1198
+ }
1199
+ }
1200
+ }
1201
+ },
1012
1202
  "/v1/inject-customer-metadata": {
1013
1203
  "post": {
1014
1204
  "operationId": "injectCustomerMetadata",
@@ -1729,6 +1919,59 @@
1729
1919
  }
1730
1920
  }
1731
1921
  },
1922
+ "patch": {
1923
+ "operationId": "patchSchema",
1924
+ "x-required-scopes": [
1925
+ "write"
1926
+ ],
1927
+ "summary": "Update a schema",
1928
+ "description": "Partially update a schema. `name` and `description` are patched\nindependently; omitted keys are left unchanged. If `definition.properties`\nor a non-empty `fields` array is provided, all existing fields are\nreplaced with the new set. `PUT` on this path delegates to the same\nhandler, so both methods accept the same body and behave identically.\nSchemas managed by a Spec document are read-only through the public API\nand return `409 Conflict`.\n",
1929
+ "tags": [
1930
+ "Schemas"
1931
+ ],
1932
+ "parameters": [
1933
+ {
1934
+ "$ref": "#/components/parameters/ResourceId"
1935
+ }
1936
+ ],
1937
+ "requestBody": {
1938
+ "required": true,
1939
+ "content": {
1940
+ "application/json": {
1941
+ "schema": {
1942
+ "$ref": "#/components/schemas/SchemaUpdateRequest"
1943
+ }
1944
+ }
1945
+ }
1946
+ },
1947
+ "responses": {
1948
+ "200": {
1949
+ "description": "Schema updated.",
1950
+ "content": {
1951
+ "application/json": {
1952
+ "schema": {
1953
+ "$ref": "#/components/schemas/SchemaResponse"
1954
+ }
1955
+ }
1956
+ }
1957
+ },
1958
+ "400": {
1959
+ "$ref": "#/components/responses/BadRequest"
1960
+ },
1961
+ "401": {
1962
+ "$ref": "#/components/responses/Unauthorized"
1963
+ },
1964
+ "404": {
1965
+ "$ref": "#/components/responses/NotFound"
1966
+ },
1967
+ "409": {
1968
+ "$ref": "#/components/responses/Conflict"
1969
+ },
1970
+ "429": {
1971
+ "$ref": "#/components/responses/RateLimitExceeded"
1972
+ }
1973
+ }
1974
+ },
1732
1975
  "delete": {
1733
1976
  "operationId": "deleteSchema",
1734
1977
  "summary": "Delete a schema",
@@ -3964,47 +4207,154 @@
3964
4207
  "$ref": "#/components/responses/RateLimitExceeded"
3965
4208
  }
3966
4209
  }
3967
- }
3968
- },
3969
- "/v1/delivery/items/{id}": {
3970
- "get": {
3971
- "operationId": "getDeliveryItem",
3972
- "summary": "Get a delivery attempt record",
4210
+ },
4211
+ "delete": {
4212
+ "operationId": "clearDeliveryItems",
4213
+ "x-required-scopes": [
4214
+ "write"
4215
+ ],
4216
+ "summary": "Bulk-clear the delivery log",
4217
+ "description": "Deletes every delivery attempt record for the tenant matching the\noptional `binding_id` / `destination_id` / `status` filters, the\nsame filters as the list route (no filters clears the whole log).\nThis is a deliberate admin cleanup: dead-letter rows referencing a\ndeleted item are de-linked, not removed. Requires an\norganization-scoped API key.\n",
3973
4218
  "tags": [
3974
4219
  "Delivery"
3975
4220
  ],
3976
4221
  "parameters": [
3977
4222
  {
3978
- "$ref": "#/components/parameters/ResourceId"
4223
+ "in": "query",
4224
+ "name": "binding_id",
4225
+ "schema": {
4226
+ "type": "string",
4227
+ "format": "uuid"
4228
+ }
4229
+ },
4230
+ {
4231
+ "in": "query",
4232
+ "name": "destination_id",
4233
+ "schema": {
4234
+ "type": "string",
4235
+ "format": "uuid"
4236
+ }
4237
+ },
4238
+ {
4239
+ "in": "query",
4240
+ "name": "status",
4241
+ "schema": {
4242
+ "type": "string",
4243
+ "enum": [
4244
+ "in_flight",
4245
+ "succeeded",
4246
+ "failed"
4247
+ ]
4248
+ }
3979
4249
  }
3980
4250
  ],
3981
4251
  "responses": {
3982
4252
  "200": {
3983
- "description": "Delivery item detail including request/response bodies.",
4253
+ "description": "Rows removed.",
3984
4254
  "content": {
3985
4255
  "application/json": {
3986
4256
  "schema": {
3987
- "$ref": "#/components/schemas/DeliveryItem"
4257
+ "type": "object",
4258
+ "properties": {
4259
+ "deleted": {
4260
+ "type": "integer"
4261
+ }
4262
+ }
3988
4263
  }
3989
4264
  }
3990
4265
  }
3991
4266
  },
4267
+ "400": {
4268
+ "$ref": "#/components/responses/BadRequest"
4269
+ },
3992
4270
  "401": {
3993
4271
  "$ref": "#/components/responses/Unauthorized"
3994
4272
  },
3995
- "404": {
3996
- "$ref": "#/components/responses/NotFound"
3997
- },
3998
4273
  "429": {
3999
4274
  "$ref": "#/components/responses/RateLimitExceeded"
4000
4275
  }
4001
4276
  }
4002
4277
  }
4003
4278
  },
4004
- "/v1/delivery/items/{id}/replay": {
4005
- "post": {
4006
- "operationId": "replayDeliveryItem",
4007
- "summary": "Re-enqueue a delivery attempt",
4279
+ "/v1/delivery/items/{id}": {
4280
+ "get": {
4281
+ "operationId": "getDeliveryItem",
4282
+ "summary": "Get a delivery attempt record",
4283
+ "tags": [
4284
+ "Delivery"
4285
+ ],
4286
+ "parameters": [
4287
+ {
4288
+ "$ref": "#/components/parameters/ResourceId"
4289
+ }
4290
+ ],
4291
+ "responses": {
4292
+ "200": {
4293
+ "description": "Delivery item detail including request/response bodies.",
4294
+ "content": {
4295
+ "application/json": {
4296
+ "schema": {
4297
+ "$ref": "#/components/schemas/DeliveryItem"
4298
+ }
4299
+ }
4300
+ }
4301
+ },
4302
+ "401": {
4303
+ "$ref": "#/components/responses/Unauthorized"
4304
+ },
4305
+ "404": {
4306
+ "$ref": "#/components/responses/NotFound"
4307
+ },
4308
+ "429": {
4309
+ "$ref": "#/components/responses/RateLimitExceeded"
4310
+ }
4311
+ }
4312
+ },
4313
+ "delete": {
4314
+ "operationId": "deleteDeliveryItem",
4315
+ "x-required-scopes": [
4316
+ "write"
4317
+ ],
4318
+ "summary": "Delete a delivery attempt record",
4319
+ "description": "Deletes one delivery attempt record. A dead-letter row referencing\nthe deleted item is de-linked rather than removed. Requires an\norganization-scoped API key.\n",
4320
+ "tags": [
4321
+ "Delivery"
4322
+ ],
4323
+ "parameters": [
4324
+ {
4325
+ "$ref": "#/components/parameters/ResourceId"
4326
+ }
4327
+ ],
4328
+ "responses": {
4329
+ "200": {
4330
+ "description": "Item deleted.",
4331
+ "content": {
4332
+ "application/json": {
4333
+ "schema": {
4334
+ "$ref": "#/components/schemas/DeletedResponse"
4335
+ }
4336
+ }
4337
+ }
4338
+ },
4339
+ "400": {
4340
+ "$ref": "#/components/responses/BadRequest"
4341
+ },
4342
+ "401": {
4343
+ "$ref": "#/components/responses/Unauthorized"
4344
+ },
4345
+ "404": {
4346
+ "$ref": "#/components/responses/NotFound"
4347
+ },
4348
+ "429": {
4349
+ "$ref": "#/components/responses/RateLimitExceeded"
4350
+ }
4351
+ }
4352
+ }
4353
+ },
4354
+ "/v1/delivery/items/{id}/replay": {
4355
+ "post": {
4356
+ "operationId": "replayDeliveryItem",
4357
+ "summary": "Re-enqueue a delivery attempt",
4008
4358
  "description": "Enqueues a new attempt for the binding/event pair. Generates a new\nidempotency key — replays are new attempts, never mutations.\n",
4009
4359
  "tags": [
4010
4360
  "Delivery"
@@ -5467,6 +5817,74 @@
5467
5817
  "$ref": "#/components/responses/RateLimitExceeded"
5468
5818
  }
5469
5819
  }
5820
+ },
5821
+ "post": {
5822
+ "operationId": "startBenchmarkRun",
5823
+ "x-required-scopes": [
5824
+ "write"
5825
+ ],
5826
+ "summary": "Start a benchmark run",
5827
+ "description": "Start an asynchronous benchmark run that evaluates extraction output\nagainst a ground truth dataset. The run is created with status\n`queued`; `documents_total` is set to the dataset's entry count and\naccuracy fields stay null until the run completes. Poll\n`GET /v1/quality/benchmarks/{id}` for progress and read per-document\noutcomes from `GET /v1/quality/benchmarks/{id}/results`.\n",
5828
+ "tags": [
5829
+ "Benchmarks"
5830
+ ],
5831
+ "requestBody": {
5832
+ "required": true,
5833
+ "content": {
5834
+ "application/json": {
5835
+ "schema": {
5836
+ "type": "object",
5837
+ "required": [
5838
+ "dataset_id",
5839
+ "user_schema_id"
5840
+ ],
5841
+ "properties": {
5842
+ "dataset_id": {
5843
+ "type": "string",
5844
+ "format": "uuid",
5845
+ "description": "Ground truth dataset to benchmark against.",
5846
+ "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
5847
+ },
5848
+ "user_schema_id": {
5849
+ "type": "string",
5850
+ "format": "uuid",
5851
+ "description": "User schema that defines the fields to evaluate.",
5852
+ "example": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
5853
+ },
5854
+ "name": {
5855
+ "type": "string",
5856
+ "description": "Human-readable name for this run. Defaults to \"Benchmark YYYY-MM-DD\".",
5857
+ "example": "Post-prompt-tune run"
5858
+ }
5859
+ }
5860
+ }
5861
+ }
5862
+ }
5863
+ },
5864
+ "responses": {
5865
+ "201": {
5866
+ "description": "Benchmark run created with status `queued`.",
5867
+ "content": {
5868
+ "application/json": {
5869
+ "schema": {
5870
+ "$ref": "#/components/schemas/BenchmarkResponse"
5871
+ }
5872
+ }
5873
+ }
5874
+ },
5875
+ "400": {
5876
+ "$ref": "#/components/responses/BadRequest"
5877
+ },
5878
+ "401": {
5879
+ "$ref": "#/components/responses/Unauthorized"
5880
+ },
5881
+ "404": {
5882
+ "$ref": "#/components/responses/NotFound"
5883
+ },
5884
+ "429": {
5885
+ "$ref": "#/components/responses/RateLimitExceeded"
5886
+ }
5887
+ }
5470
5888
  }
5471
5889
  },
5472
5890
  "/v1/quality/benchmarks/{id}": {
@@ -8126,39 +8544,6 @@
8126
8544
  }
8127
8545
  },
8128
8546
  "/v1/structuring/checks/{id}": {
8129
- "get": {
8130
- "operationId": "getStructuringCheck",
8131
- "summary": "Get a structuring check",
8132
- "tags": [
8133
- "Structuring"
8134
- ],
8135
- "parameters": [
8136
- {
8137
- "$ref": "#/components/parameters/ResourceId"
8138
- }
8139
- ],
8140
- "responses": {
8141
- "200": {
8142
- "description": "Structuring check detail.",
8143
- "content": {
8144
- "application/json": {
8145
- "schema": {
8146
- "$ref": "#/components/schemas/StructuringCheckResponse"
8147
- }
8148
- }
8149
- }
8150
- },
8151
- "401": {
8152
- "$ref": "#/components/responses/Unauthorized"
8153
- },
8154
- "404": {
8155
- "$ref": "#/components/responses/NotFound"
8156
- },
8157
- "429": {
8158
- "$ref": "#/components/responses/RateLimitExceeded"
8159
- }
8160
- }
8161
- },
8162
8547
  "put": {
8163
8548
  "operationId": "updateStructuringCheck",
8164
8549
  "summary": "Update a structuring check",
@@ -10292,7 +10677,7 @@
10292
10677
  "post": {
10293
10678
  "operationId": "ask",
10294
10679
  "summary": "Ask a question over your documents",
10295
- "description": "Ask a natural-language question over the workspace corpus and get back a cited,\nverified answer. This is the \"replace your RAG stack\" endpoint: instead of\nchunk-embed-retrieve, the Talonic agent plans over the structured field plane\n(three-plane retrieval: semantic field match, lexical value match, and document\ntext search), runs read-only SQL over extracted cells, extracts-and-persists\nmissing fields at query time, and grounds every load-bearing claim in an exact\nsource span.\n\nThe turn runs detached and typically takes 10-60 seconds, so the endpoint is\nasynchronous: it returns `202` with an `ask_id` immediately — poll\n`GET /v1/ask/{id}` (about every 2 seconds) for the answer.\n\nEach accepted ask charges one flat `agent_ask` credit unit (see `GET /v1/pricing`).\nThe turn is pinned to the least-privilege viewer role: only read tools run, every\nmutation is denied before it executes.\n",
10680
+ "description": "Ask a natural-language question over the workspace corpus and get back a cited,\nverified answer. This is the \"replace your RAG stack\" endpoint: instead of\nchunk-embed-retrieve, the Talonic agent plans over the structured field plane\n(three-plane retrieval: semantic field match, lexical value match, and document\ntext search), runs read-only SQL over extracted cells, extracts-and-persists\nmissing fields at query time, and grounds every load-bearing claim in an exact\nsource span.\n\nOnly `question` is required. The optional fields narrow, route, shape, or\nthread the turn:\n\n- `scope` restricts the turn to a slice of the workspace. The scope is compiled\n into a parameterized SQL predicate applied to every retrieval plane and every\n virtual table the agent can query, so it bounds what the agent CAN read rather\n than suggesting where it should look. `document_ids` is capped at 1000 entries\n and `tags` at 100. An explicit `\"document_ids\": []` is an active scope that\n matches nothing; it never means \"unscoped\".\n- `conversation_id` continues an existing conversation, so the agent answers\n with the prior turns in view. Absent, every ask starts a fresh conversation\n whose id comes back on the response.\n- `model` runs the turn on a named model, and `model_class` selects a class when\n `model` is absent. Resolution order: explicit `model`, then `model_class`,\n then the workspace AI policy binding, then the platform default. A model the\n workspace AI policy denies fails loudly; it is never silently substituted.\n- `output_format` shapes the final answer with a response-format instruction, a\n markdown template, or both. It constrains form only, never grounding.\n- `on_behalf_of` opts this single request into compartment-correct retrieval as\n a named workspace user. Without it the key reads workspace-wide, across every\n compartment and classification.\n\nThe turn runs detached and typically takes 10-60 seconds, so the endpoint is\nasynchronous: it returns `202` with an `ask_id` immediately. Poll\n`GET /v1/ask/{id}` (about every 2 seconds) or stream `GET /v1/ask/{id}/stream`\nfor the answer.\n\nEach accepted ask charges one flat `agent_ask` credit unit at submission, keyed\nto the turn, so streaming, polling, and retrying the same turn never bill twice\n(see `GET /v1/pricing`). The turn is pinned to the least-privilege viewer role:\nonly read tools run, every mutation is denied before it executes.\n",
10296
10681
  "tags": [
10297
10682
  "Agent"
10298
10683
  ],
@@ -10311,15 +10696,120 @@
10311
10696
  "maxLength": 20000,
10312
10697
  "description": "The natural-language question to answer over the workspace corpus.",
10313
10698
  "example": "What is the payment term in the Globex contract, and where does it say so?"
10699
+ },
10700
+ "scope": {
10701
+ "type": "object",
10702
+ "description": "Restrict the turn to a slice of the workspace. Present fields are ANDed, and the whole object is enforced as a bound SQL predicate on every retrieval plane. An empty `document_ids` array matches nothing.",
10703
+ "properties": {
10704
+ "document_ids": {
10705
+ "type": "array",
10706
+ "maxItems": 1000,
10707
+ "items": {
10708
+ "type": "string",
10709
+ "format": "uuid"
10710
+ },
10711
+ "description": "Restrict to these documents. An empty array matches nothing."
10712
+ },
10713
+ "schema_id": {
10714
+ "type": "string",
10715
+ "format": "uuid",
10716
+ "description": "Restrict to documents processed by a pipeline of this Spec."
10717
+ },
10718
+ "pipeline_id": {
10719
+ "type": "string",
10720
+ "format": "uuid",
10721
+ "description": "Restrict to documents attached to this pipeline run."
10722
+ },
10723
+ "data_product_id": {
10724
+ "type": "string",
10725
+ "format": "uuid",
10726
+ "description": "Restrict to documents behind this data product's pipeline run."
10727
+ },
10728
+ "document_type": {
10729
+ "type": "string",
10730
+ "maxLength": 200,
10731
+ "description": "Restrict to documents of this classification (a document type name)."
10732
+ },
10733
+ "source_id": {
10734
+ "type": "string",
10735
+ "format": "uuid",
10736
+ "description": "Restrict to documents ingested through this source connection."
10737
+ },
10738
+ "tags": {
10739
+ "type": "array",
10740
+ "maxItems": 100,
10741
+ "items": {
10742
+ "type": "string",
10743
+ "maxLength": 200
10744
+ },
10745
+ "description": "Restrict to documents carrying ANY of these user tags."
10746
+ },
10747
+ "ingested_after": {
10748
+ "type": "string",
10749
+ "format": "date-time",
10750
+ "description": "Restrict to documents ingested at or after this ISO timestamp."
10751
+ },
10752
+ "ingested_before": {
10753
+ "type": "string",
10754
+ "format": "date-time",
10755
+ "description": "Restrict to documents ingested at or before this ISO timestamp."
10756
+ }
10757
+ }
10758
+ },
10759
+ "conversation_id": {
10760
+ "type": "string",
10761
+ "format": "uuid",
10762
+ "description": "Continue this conversation; the agent sees its prior turns."
10763
+ },
10764
+ "model": {
10765
+ "type": "string",
10766
+ "maxLength": 120,
10767
+ "description": "Run the turn on a specific model (e.g. `claude-opus`). A model the workspace AI policy denies fails loudly; it is never substituted."
10768
+ },
10769
+ "model_class": {
10770
+ "type": "string",
10771
+ "maxLength": 120,
10772
+ "description": "Run the turn on a model class (e.g. `complex`); used when `model` is absent."
10773
+ },
10774
+ "output_format": {
10775
+ "type": "object",
10776
+ "description": "Shape the final answer. Constrains form only, never grounding or citation.",
10777
+ "properties": {
10778
+ "instruction": {
10779
+ "type": "string",
10780
+ "maxLength": 4000,
10781
+ "description": "Free-text response-format instruction, e.g. \"answer as a two-column table\"."
10782
+ },
10783
+ "template": {
10784
+ "type": "string",
10785
+ "maxLength": 20000,
10786
+ "description": "A markdown skeleton whose headings and order the answer keeps."
10787
+ }
10788
+ }
10789
+ },
10790
+ "on_behalf_of": {
10791
+ "type": "string",
10792
+ "format": "uuid",
10793
+ "description": "Answer as this workspace user would see it, applying that user's compartment and classification visibility. Opt-in per request; the user must be an active member of the calling workspace."
10314
10794
  }
10315
10795
  }
10796
+ },
10797
+ "example": {
10798
+ "question": "Which invoices in this pipeline are overdue, and by how much?",
10799
+ "scope": {
10800
+ "pipeline_id": "9e107d9d-372b-4c81-90c3-9dfe9f2c4b6a"
10801
+ },
10802
+ "model_class": "complex",
10803
+ "output_format": {
10804
+ "instruction": "Answer as a markdown table with columns invoice, due date, days overdue."
10805
+ }
10316
10806
  }
10317
10807
  }
10318
10808
  }
10319
10809
  },
10320
10810
  "responses": {
10321
10811
  "202": {
10322
- "description": "Ask accepted; poll `poll_url` for the answer.",
10812
+ "description": "Ask accepted; poll `poll_url` or stream `stream_url` for the answer.",
10323
10813
  "content": {
10324
10814
  "application/json": {
10325
10815
  "schema": {
@@ -10338,8 +10828,24 @@
10338
10828
  "poll_url": {
10339
10829
  "type": "string",
10340
10830
  "example": "/v1/ask/3fa85f64-5717-4562-b3fc-2c963f66afa6"
10831
+ },
10832
+ "stream_url": {
10833
+ "type": "string",
10834
+ "example": "/v1/ask/3fa85f64-5717-4562-b3fc-2c963f66afa6/stream"
10835
+ },
10836
+ "conversation_id": {
10837
+ "type": "string",
10838
+ "format": "uuid",
10839
+ "description": "The conversation this ask threads into (created when none was given)."
10341
10840
  }
10342
10841
  }
10842
+ },
10843
+ "example": {
10844
+ "ask_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
10845
+ "status": "processing",
10846
+ "poll_url": "/v1/ask/3fa85f64-5717-4562-b3fc-2c963f66afa6",
10847
+ "stream_url": "/v1/ask/3fa85f64-5717-4562-b3fc-2c963f66afa6/stream",
10848
+ "conversation_id": "8c4f2a1e-0b6d-4e2f-9a3c-5d7e1f2a3b4c"
10343
10849
  }
10344
10850
  }
10345
10851
  }
@@ -10363,7 +10869,7 @@
10363
10869
  "get": {
10364
10870
  "operationId": "getAsk",
10365
10871
  "summary": "Poll an ask for its answer",
10366
- "description": "Poll a previously-started ask. Tenant-isolated: an ask that belongs to a different\nworkspace reads as not found. While the turn runs the response is\n`{ \"status\": \"processing\" }`; once completed it carries:\n\n- `answer` — the full answer in markdown, citations inline as links.\n- `citations[]` — the same citations structured: source `document_id`, the cited\n `quote`, whether it grounds a captured `field` or a verbatim `quote`, and a deep\n `app_url` that opens the document with the span highlighted.\n- `verification` — the post-answer verification verdict: a fast model re-checks the\n answer's claims against the turn's own tool evidence (`supported` | `issues` |\n `unverifiable`, with check counts and an optional correction). Treat `issues` as a\n review pointer, not ground truth.\n- `usage` — token count and the flat `credits_charged`.\n",
10872
+ "description": "Poll a previously-started ask. Tenant-isolated: an ask that belongs to a different\nworkspace reads as not found. While the turn runs the response is\n`{ \"status\": \"processing\" }` plus `conversation_id`; once completed it carries:\n\n- `answer`: the full answer in markdown, citations inline as links.\n- `citations[]`: the same citations structured: source `document_id`, the cited\n `quote`, whether it grounds a captured `field` or a verbatim `quote`, the source\n `filename` when resolved, and a deep `app_url` that opens the document with the\n span highlighted.\n- `cards[]` and `artifacts[]`: the generative UI cards and artifacts the turn\n produced, when any.\n- `tool_calls`: how many tool invocations the turn ran, an audit-trail count.\n- `verification`: the post-answer verification verdict: a fast model re-checks the\n answer's claims against the turn's own tool evidence (`supported` | `issues` |\n `unverifiable`, with check counts and an optional correction). Treat `issues` as a\n review pointer, not ground truth.\n- `usage`: token count and the flat `credits_charged`.\n",
10367
10873
  "tags": [
10368
10874
  "Agent"
10369
10875
  ],
@@ -10401,6 +10907,11 @@
10401
10907
  "poll_url": {
10402
10908
  "type": "string"
10403
10909
  },
10910
+ "conversation_id": {
10911
+ "type": "string",
10912
+ "format": "uuid",
10913
+ "nullable": true
10914
+ },
10404
10915
  "answer": {
10405
10916
  "type": "string",
10406
10917
  "description": "Markdown answer (present when completed)."
@@ -10427,12 +10938,47 @@
10427
10938
  "reference": {
10428
10939
  "type": "string"
10429
10940
  },
10941
+ "filename": {
10942
+ "type": "string",
10943
+ "nullable": true
10944
+ },
10430
10945
  "app_url": {
10431
10946
  "type": "string"
10432
10947
  }
10433
10948
  }
10434
10949
  }
10435
10950
  },
10951
+ "cards": {
10952
+ "type": "array",
10953
+ "items": {
10954
+ "type": "object"
10955
+ },
10956
+ "description": "Generative UI cards the turn produced (present when completed)."
10957
+ },
10958
+ "artifacts": {
10959
+ "type": "array",
10960
+ "items": {
10961
+ "type": "object",
10962
+ "properties": {
10963
+ "type": {
10964
+ "type": "string"
10965
+ },
10966
+ "id": {
10967
+ "type": "string"
10968
+ },
10969
+ "label": {
10970
+ "type": "string"
10971
+ },
10972
+ "link": {
10973
+ "type": "string"
10974
+ }
10975
+ }
10976
+ }
10977
+ },
10978
+ "tool_calls": {
10979
+ "type": "integer",
10980
+ "description": "Number of tool invocations the turn ran."
10981
+ },
10436
10982
  "verification": {
10437
10983
  "type": "object",
10438
10984
  "nullable": true,
@@ -10469,6 +11015,35 @@
10469
11015
  }
10470
11016
  }
10471
11017
  }
11018
+ },
11019
+ "example": {
11020
+ "ask_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
11021
+ "status": "completed",
11022
+ "poll_url": "/v1/ask/3fa85f64-5717-4562-b3fc-2c963f66afa6",
11023
+ "conversation_id": "8c4f2a1e-0b6d-4e2f-9a3c-5d7e1f2a3b4c",
11024
+ "answer": "Two invoices are overdue: [INV-1041](https://app.talonic.com/documents/1b6f2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d?cite=due_date) by 12 days and INV-1055 by 3 days.",
11025
+ "citations": [
11026
+ {
11027
+ "quote": "INV-1041",
11028
+ "document_id": "1b6f2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
11029
+ "kind": "field",
11030
+ "reference": "due_date",
11031
+ "filename": "invoice-1041.pdf",
11032
+ "app_url": "https://app.talonic.com/documents/1b6f2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d?cite=due_date"
11033
+ }
11034
+ ],
11035
+ "cards": [],
11036
+ "artifacts": [],
11037
+ "tool_calls": 4,
11038
+ "verification": {
11039
+ "verdict": "supported",
11040
+ "checks_total": 3,
11041
+ "checks_unsupported": 0
11042
+ },
11043
+ "usage": {
11044
+ "tokens": 18432,
11045
+ "credits_charged": 100
11046
+ }
10472
11047
  }
10473
11048
  }
10474
11049
  }
@@ -10485,8 +11060,52 @@
10485
11060
  }
10486
11061
  }
10487
11062
  },
10488
- "/v1/agent/query": {
10489
- "post": {
11063
+ "/v1/ask/{id}/stream": {
11064
+ "get": {
11065
+ "operationId": "streamAsk",
11066
+ "summary": "Stream an ask over server-sent events",
11067
+ "description": "Stream a turn's events as they happen instead of polling. The response is\n`text/event-stream`: every frame is a `data: {json}` line followed by a blank\nline, and a `: keep-alive` comment line goes out every 25 seconds so proxies\nkeep an idle turn's socket open.\n\nThe stream first replays every event the turn has already persisted, then\nfollows with live events, and closes when the turn's `status` reaches\n`completed`, `failed`, or `awaiting_confirmation`. A reconnect therefore loses\nnothing: reopen the stream and the replay delivers the whole turn again.\n\nEach frame is a JSON object discriminated by `kind`: `status`, `stage`, `text`,\n`text.delta`, `tool.call`, `tool.progress`, `tool.result`,\n`confirmation.required`, `card`, `artifact`, and `done`. The model's raw\nreasoning (`thinking.delta`) is deliberately withheld from the public stream.\n\nStreaming is additive: the turn is started (and charged) by `POST /v1/ask`, so\nopening, dropping, and reopening a stream never bills, and the poll contract is\nunchanged. A missing or cross-tenant turn is a real `404` issued before any SSE\nheader goes out, never a `200` stream carrying an error frame. Connects are\nmetered in the `ask_stream` rate-limit namespace, and a workspace can hold at\nmost 20 concurrent streams; the 21st connect is refused with `429`.\n",
11068
+ "tags": [
11069
+ "Agent"
11070
+ ],
11071
+ "parameters": [
11072
+ {
11073
+ "name": "id",
11074
+ "in": "path",
11075
+ "required": true,
11076
+ "schema": {
11077
+ "type": "string",
11078
+ "format": "uuid"
11079
+ }
11080
+ }
11081
+ ],
11082
+ "responses": {
11083
+ "200": {
11084
+ "description": "Server-sent event stream of the turn's frames, closed on terminal status.",
11085
+ "content": {
11086
+ "text/event-stream": {
11087
+ "schema": {
11088
+ "type": "string",
11089
+ "description": "SSE frames, one JSON object per `data:` line, discriminated by `kind`."
11090
+ },
11091
+ "example": "data: {\"kind\":\"status\",\"status\":\"running\"}\n\ndata: {\"kind\":\"stage\",\"stage\":\"retrieve\",\"state\":\"started\"}\n\ndata: {\"kind\":\"tool.call\",\"id\":\"t1\",\"name\":\"query_data\",\"impact\":\"read\",\"title\":\"Query overdue invoices\",\"args\":{}}\n\ndata: {\"kind\":\"tool.result\",\"id\":\"t1\",\"name\":\"query_data\",\"ok\":true,\"summary\":\"2 rows\",\"durationMs\":412}\n\n: keep-alive\n\ndata: {\"kind\":\"text.delta\",\"text\":\"Two invoices are overdue\"}\n\ndata: {\"kind\":\"done\",\"headline\":\"2 overdue invoices found\"}\n\ndata: {\"kind\":\"status\",\"status\":\"completed\"}\n"
11092
+ }
11093
+ }
11094
+ },
11095
+ "401": {
11096
+ "$ref": "#/components/responses/Unauthorized"
11097
+ },
11098
+ "404": {
11099
+ "$ref": "#/components/responses/NotFound"
11100
+ },
11101
+ "429": {
11102
+ "$ref": "#/components/responses/RateLimitExceeded"
11103
+ }
11104
+ }
11105
+ }
11106
+ },
11107
+ "/v1/agent/query": {
11108
+ "post": {
10490
11109
  "operationId": "startAgentQuery",
10491
11110
  "summary": "Ask the agent (legacy alias of /v1/ask)",
10492
11111
  "description": "Legacy alias of `POST /v1/ask` with a minimal response shape. Starts a read-only\nagent turn (202) to poll via `GET /v1/agent/query/{id}`, which returns only\n`status` and the plain `answer` text. New integrations should use `/v1/ask`,\nwhich adds structured citations, the verification verdict, and usage. Charges the\nsame flat `agent_ask` unit.\n",
@@ -10748,7 +11367,7 @@
10748
11367
  "get": {
10749
11368
  "operationId": "listAgentTools",
10750
11369
  "summary": "List agent tools",
10751
- "description": "Returns the catalogue of tools available to the embedded agent. Each tool entry\ncarries a stable name, a short description, and an impact level (`read`,\n`draft_mutation`, `live_mutation`, `irreversible`) so callers can decide\nwhether to require human confirmation before invocation.\n",
11370
+ "description": "Returns the catalogue of tools available to the embedded agent, read live from\nthe loop's registry. Each tool entry carries a stable name, a short description,\nan impact level (`read`, `draft_mutation`, `live_mutation`, `irreversible`), the\ncapability the tool requires, its JSON Schema argument shape (`input_schema`),\nand `can_invoke`: whether THIS key can run it via\n`POST /v1/agent/tools/{name}/invoke`. An API key runs as the least-privilege\nviewer role, so the invocable set is the read subset; the rest are listed so a\ncaller can see the full surface the in-product agent operates.\n",
10752
11371
  "tags": [
10753
11372
  "Agent"
10754
11373
  ],
@@ -10784,14 +11403,66 @@
10784
11403
  "live_mutation",
10785
11404
  "irreversible"
10786
11405
  ]
11406
+ },
11407
+ "capability": {
11408
+ "type": "string",
11409
+ "description": "The permission the tool requires (e.g. `data.read`)."
11410
+ },
11411
+ "can_invoke": {
11412
+ "type": "boolean",
11413
+ "description": "Whether this key can run the tool via `POST /v1/agent/tools/{name}/invoke`."
11414
+ },
11415
+ "input_schema": {
11416
+ "type": "object",
11417
+ "description": "JSON Schema for the tool's `args`."
10787
11418
  }
10788
11419
  }
10789
11420
  }
10790
11421
  },
10791
11422
  "totalCount": {
10792
11423
  "type": "integer"
11424
+ },
11425
+ "invocable_count": {
11426
+ "type": "integer",
11427
+ "description": "How many listed tools this key can invoke."
10793
11428
  }
10794
11429
  }
11430
+ },
11431
+ "example": {
11432
+ "tools": [
11433
+ {
11434
+ "name": "query_data",
11435
+ "impact": "read",
11436
+ "capability": "data.read",
11437
+ "description": "Runs a read-only SQL query over the structured cell plane.",
11438
+ "can_invoke": true,
11439
+ "input_schema": {
11440
+ "type": "object",
11441
+ "properties": {
11442
+ "sql": {
11443
+ "type": "string"
11444
+ }
11445
+ }
11446
+ }
11447
+ },
11448
+ {
11449
+ "name": "promote_field",
11450
+ "impact": "draft_mutation",
11451
+ "capability": "data.promote",
11452
+ "description": "Makes an already-captured field queryable.",
11453
+ "can_invoke": false,
11454
+ "input_schema": {
11455
+ "type": "object",
11456
+ "properties": {
11457
+ "field_id": {
11458
+ "type": "string"
11459
+ }
11460
+ }
11461
+ }
11462
+ }
11463
+ ],
11464
+ "totalCount": 61,
11465
+ "invocable_count": 32
10795
11466
  }
10796
11467
  }
10797
11468
  }
@@ -10805,163 +11476,243 @@
10805
11476
  }
10806
11477
  }
10807
11478
  },
10808
- "/v1/exports/{path}": {
10809
- "get": {
10810
- "operationId": "deprecatedExportsGet",
10811
- "summary": "Deprecated exports endpoint (any verb)",
10812
- "deprecated": true,
10813
- "description": "The `/v1/exports/*` namespace was retired on 2026-04-21 in favour of the unified\n`/v1/delivery/*` surface. All requests against any verb of this path return\n`410 Gone` with a pointer to the replacement endpoint. This entry exists so SDK\ngenerators see the deprecation flag; do not call.\n",
11479
+ "/v1/agent/tools/{name}/invoke": {
11480
+ "post": {
11481
+ "operationId": "invokeAgentTool",
11482
+ "summary": "Invoke one agent tool directly",
11483
+ "description": "Run ONE named tool directly, with no model in the loop: the caller supplies the\narguments the agent would otherwise choose. This is the seam for building your\nown agent on top of Talonic's retrieval and provenance while driving control\nflow yourself.\n\nThe same capability matrix the agent loop applies governs this route, so a key\ncan only run the tools whose `can_invoke` is `true` on `GET /v1/agent/tools`;\na denied tool answers `403` naming the capability it needs. `scope` and\n`on_behalf_of` behave exactly as on `POST /v1/ask`: the scope is a bound SQL\npredicate, and `on_behalf_of` applies that user's compartment visibility.\n\nDirect invocation charges no credits: every tool this key can reach does no\nmodel work, so there is no model call to meter. The route is bounded by the\n`agent_tools` rate-limit namespace instead. A tool that runs but fails answers\n`422` with the tool's own failure summary.\n",
10814
11484
  "tags": [
10815
- "Delivery"
11485
+ "Agent"
10816
11486
  ],
10817
11487
  "parameters": [
10818
11488
  {
10819
- "name": "path",
11489
+ "name": "name",
10820
11490
  "in": "path",
10821
11491
  "required": true,
10822
11492
  "schema": {
10823
11493
  "type": "string"
10824
11494
  },
10825
- "description": "Any sub-path under `/v1/exports/`."
10826
- }
10827
- ],
10828
- "x-sunset": "2026-04-21",
10829
- "responses": {
10830
- "410": {
10831
- "description": "Gone — use `/v1/delivery/*` instead.",
10832
- "content": {
10833
- "application/json": {
10834
- "schema": {
10835
- "$ref": "#/components/schemas/ErrorResponse"
10836
- }
10837
- }
10838
- }
10839
- }
10840
- }
10841
- }
10842
- },
10843
- "/v1/cases/{key}/status": {
10844
- "patch": {
10845
- "operationId": "updateCaseStatus",
10846
- "summary": "Update case status",
10847
- "tags": [
10848
- "Cases"
10849
- ],
10850
- "parameters": [
10851
- {
10852
- "name": "key",
10853
- "in": "path",
10854
- "required": true,
10855
- "schema": {
10856
- "type": "string",
10857
- "format": "uuid"
10858
- },
10859
- "description": "Case UUID (the stable resource id)."
11495
+ "description": "The tool name as listed by `GET /v1/agent/tools`."
10860
11496
  }
10861
11497
  ],
10862
11498
  "requestBody": {
10863
- "required": true,
11499
+ "required": false,
10864
11500
  "content": {
10865
11501
  "application/json": {
10866
11502
  "schema": {
10867
11503
  "type": "object",
10868
- "required": [
10869
- "status"
10870
- ],
10871
11504
  "properties": {
10872
- "status": {
11505
+ "args": {
11506
+ "type": "object",
11507
+ "description": "Arguments matching the tool's `input_schema` from `GET /v1/agent/tools`."
11508
+ },
11509
+ "scope": {
11510
+ "type": "object",
11511
+ "description": "Restrict the invocation to a slice of the workspace, exactly as on `POST /v1/ask`."
11512
+ },
11513
+ "on_behalf_of": {
10873
11514
  "type": "string",
10874
- "example": "completed",
10875
- "description": "New status (e.g. open, in_review, resolved, archived)."
11515
+ "format": "uuid",
11516
+ "description": "Apply this workspace user's compartment visibility to the invocation."
10876
11517
  }
10877
11518
  }
11519
+ },
11520
+ "example": {
11521
+ "args": {
11522
+ "query": "termination notice period"
11523
+ },
11524
+ "scope": {
11525
+ "document_type": "Master Services Agreement"
11526
+ }
10878
11527
  }
10879
11528
  }
10880
11529
  }
10881
11530
  },
10882
11531
  "responses": {
10883
11532
  "200": {
10884
- "description": "Case status updated.",
11533
+ "description": "The tool ran; its raw output plus any cards, artifacts, and citations.",
10885
11534
  "content": {
10886
11535
  "application/json": {
10887
11536
  "schema": {
10888
- "$ref": "#/components/schemas/CaseDetailResponse"
11537
+ "type": "object",
11538
+ "properties": {
11539
+ "tool": {
11540
+ "type": "string"
11541
+ },
11542
+ "ok": {
11543
+ "type": "boolean"
11544
+ },
11545
+ "content": {
11546
+ "type": "string",
11547
+ "description": "The tool's raw output, usually JSON serialized as a string."
11548
+ },
11549
+ "cards": {
11550
+ "type": "array",
11551
+ "items": {
11552
+ "type": "object"
11553
+ }
11554
+ },
11555
+ "artifacts": {
11556
+ "type": "array",
11557
+ "items": {
11558
+ "type": "object"
11559
+ }
11560
+ },
11561
+ "citations": {
11562
+ "type": "array",
11563
+ "items": {
11564
+ "type": "object",
11565
+ "properties": {
11566
+ "quote": {
11567
+ "type": "string"
11568
+ },
11569
+ "document_id": {
11570
+ "type": "string",
11571
+ "format": "uuid"
11572
+ },
11573
+ "kind": {
11574
+ "type": "string",
11575
+ "enum": [
11576
+ "field",
11577
+ "quote"
11578
+ ]
11579
+ },
11580
+ "reference": {
11581
+ "type": "string"
11582
+ },
11583
+ "filename": {
11584
+ "type": "string",
11585
+ "nullable": true
11586
+ },
11587
+ "app_url": {
11588
+ "type": "string"
11589
+ }
11590
+ }
11591
+ }
11592
+ }
11593
+ }
11594
+ },
11595
+ "example": {
11596
+ "tool": "query_data",
11597
+ "ok": true,
11598
+ "content": "[{\"invoice\":\"INV-1041\",\"days_overdue\":12}]",
11599
+ "cards": [],
11600
+ "artifacts": [],
11601
+ "citations": []
10889
11602
  }
10890
11603
  }
10891
11604
  }
10892
11605
  },
10893
- "400": {
10894
- "$ref": "#/components/responses/BadRequest"
10895
- },
10896
11606
  "401": {
10897
11607
  "$ref": "#/components/responses/Unauthorized"
10898
11608
  },
11609
+ "403": {
11610
+ "description": "The tool requires a capability this key's role does not grant; the message names it."
11611
+ },
10899
11612
  "404": {
10900
11613
  "$ref": "#/components/responses/NotFound"
10901
11614
  },
11615
+ "422": {
11616
+ "description": "The tool itself failed; the message is the tool's failure summary."
11617
+ },
10902
11618
  "429": {
10903
11619
  "$ref": "#/components/responses/RateLimitExceeded"
10904
11620
  }
10905
11621
  }
10906
11622
  }
10907
11623
  },
10908
- "/v1/cases/{key}/edges": {
11624
+ "/v1/agent/conversations": {
10909
11625
  "get": {
10910
- "operationId": "getCaseEdges",
10911
- "summary": "Get case edges",
10912
- "description": "Returns the entity edges (evidence chain) connecting documents within the case.",
11626
+ "operationId": "listAgentConversations",
11627
+ "summary": "List agent conversations",
11628
+ "description": "List the conversations asks have threaded into, newest activity first,\nkeyset-paginated: pass the previous page's `next_cursor` as `cursor` to\ncontinue, until `next_cursor` is null.\n\nConversations belong to the workspace's API principal, not to a platform user:\na key sees the asks made through the API and never a colleague's in-product\nagent chat. `on_behalf_of` selects the separate partition of conversations run\nfor that user, so per-user threads never mix.\n",
10913
11629
  "tags": [
10914
- "Cases"
11630
+ "Agent"
10915
11631
  ],
10916
11632
  "parameters": [
10917
11633
  {
10918
- "name": "key",
10919
- "in": "path",
10920
- "required": true,
11634
+ "name": "limit",
11635
+ "in": "query",
11636
+ "schema": {
11637
+ "type": "integer",
11638
+ "minimum": 1,
11639
+ "maximum": 100,
11640
+ "default": 30
11641
+ },
11642
+ "description": "Page size (1-100)."
11643
+ },
11644
+ {
11645
+ "name": "cursor",
11646
+ "in": "query",
11647
+ "schema": {
11648
+ "type": "string",
11649
+ "format": "date-time"
11650
+ },
11651
+ "description": "The previous page's `next_cursor`."
11652
+ },
11653
+ {
11654
+ "name": "on_behalf_of",
11655
+ "in": "query",
10921
11656
  "schema": {
10922
11657
  "type": "string",
10923
11658
  "format": "uuid"
10924
11659
  },
10925
- "description": "Case UUID (the stable resource id)."
11660
+ "description": "List the conversation partition of this workspace user."
10926
11661
  }
10927
11662
  ],
10928
11663
  "responses": {
10929
11664
  "200": {
10930
- "description": "Case edges.",
11665
+ "description": "One page of conversations, newest activity first.",
10931
11666
  "content": {
10932
11667
  "application/json": {
10933
11668
  "schema": {
10934
11669
  "type": "object",
10935
11670
  "properties": {
10936
- "data": {
11671
+ "conversations": {
10937
11672
  "type": "array",
10938
11673
  "items": {
10939
11674
  "type": "object",
10940
11675
  "properties": {
10941
- "source_document_id": {
10942
- "type": "string",
10943
- "format": "uuid",
10944
- "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
10945
- },
10946
- "target_document_id": {
11676
+ "conversation_id": {
10947
11677
  "type": "string",
10948
- "format": "uuid",
10949
- "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
11678
+ "format": "uuid"
10950
11679
  },
10951
- "entity_value": {
11680
+ "title": {
10952
11681
  "type": "string"
10953
11682
  },
10954
- "entity_type": {
10955
- "type": "string"
11683
+ "turn_count": {
11684
+ "type": "integer"
10956
11685
  },
10957
- "confidence": {
10958
- "type": "number",
10959
- "format": "float"
11686
+ "created_at": {
11687
+ "type": "string",
11688
+ "format": "date-time"
11689
+ },
11690
+ "last_activity_at": {
11691
+ "type": "string",
11692
+ "format": "date-time"
10960
11693
  }
10961
11694
  }
10962
11695
  }
11696
+ },
11697
+ "next_cursor": {
11698
+ "type": "string",
11699
+ "format": "date-time",
11700
+ "nullable": true,
11701
+ "description": "Pass as `cursor` for the next page; null when this is the last page."
10963
11702
  }
10964
11703
  }
11704
+ },
11705
+ "example": {
11706
+ "conversations": [
11707
+ {
11708
+ "conversation_id": "8c4f2a1e-0b6d-4e2f-9a3c-5d7e1f2a3b4c",
11709
+ "title": "Overdue invoices in Q3",
11710
+ "turn_count": 3,
11711
+ "created_at": "2026-07-30T09:12:00.000Z",
11712
+ "last_activity_at": "2026-07-30T09:41:00.000Z"
11713
+ }
11714
+ ],
11715
+ "next_cursor": null
10965
11716
  }
10966
11717
  }
10967
11718
  }
@@ -10969,64 +11720,109 @@
10969
11720
  "401": {
10970
11721
  "$ref": "#/components/responses/Unauthorized"
10971
11722
  },
10972
- "404": {
10973
- "$ref": "#/components/responses/NotFound"
10974
- },
10975
11723
  "429": {
10976
11724
  "$ref": "#/components/responses/RateLimitExceeded"
10977
11725
  }
10978
11726
  }
10979
11727
  }
10980
11728
  },
10981
- "/v1/cases/{key}/edges/{edgeId}/confirm": {
10982
- "post": {
10983
- "operationId": "confirmCaseEdge",
10984
- "summary": "Confirm a case edge",
10985
- "description": "Confirm a proposed entity edge between documents in this case.",
11729
+ "/v1/agent/conversations/{id}": {
11730
+ "get": {
11731
+ "operationId": "getAgentConversation",
11732
+ "summary": "Get one conversation with its asks",
11733
+ "description": "One conversation with its asks in order, oldest first. Each turn carries the\nquestion, its lifecycle status (`processing` | `completed` | `error`), and the\nanswer text once settled. Tenant-isolated and partition-scoped: a conversation\nof another workspace, or of another `on_behalf_of` partition, reads as not\nfound.\n",
10986
11734
  "tags": [
10987
- "Cases"
11735
+ "Agent"
10988
11736
  ],
10989
11737
  "parameters": [
10990
11738
  {
10991
- "name": "key",
11739
+ "name": "id",
10992
11740
  "in": "path",
10993
11741
  "required": true,
10994
11742
  "schema": {
10995
11743
  "type": "string",
10996
11744
  "format": "uuid"
10997
- },
10998
- "description": "Case UUID (the stable resource id)."
11745
+ }
10999
11746
  },
11000
11747
  {
11001
- "name": "edgeId",
11002
- "in": "path",
11003
- "required": true,
11748
+ "name": "on_behalf_of",
11749
+ "in": "query",
11004
11750
  "schema": {
11005
11751
  "type": "string",
11006
11752
  "format": "uuid"
11007
11753
  },
11008
- "description": "Edge identifier from the case edges list."
11754
+ "description": "Read from the conversation partition of this workspace user."
11009
11755
  }
11010
11756
  ],
11011
11757
  "responses": {
11012
11758
  "200": {
11013
- "description": "Edge confirmed.",
11759
+ "description": "The conversation and its turns.",
11014
11760
  "content": {
11015
11761
  "application/json": {
11016
11762
  "schema": {
11017
11763
  "type": "object",
11018
11764
  "properties": {
11019
- "success": {
11020
- "type": "boolean"
11765
+ "conversation_id": {
11766
+ "type": "string",
11767
+ "format": "uuid"
11768
+ },
11769
+ "title": {
11770
+ "type": "string"
11771
+ },
11772
+ "created_at": {
11773
+ "type": "string",
11774
+ "format": "date-time"
11775
+ },
11776
+ "turns": {
11777
+ "type": "array",
11778
+ "items": {
11779
+ "type": "object",
11780
+ "properties": {
11781
+ "ask_id": {
11782
+ "type": "string",
11783
+ "format": "uuid"
11784
+ },
11785
+ "question": {
11786
+ "type": "string"
11787
+ },
11788
+ "status": {
11789
+ "type": "string",
11790
+ "enum": [
11791
+ "processing",
11792
+ "completed",
11793
+ "error"
11794
+ ]
11795
+ },
11796
+ "answer": {
11797
+ "type": "string",
11798
+ "description": "The answer markdown; empty until the turn completes."
11799
+ },
11800
+ "created_at": {
11801
+ "type": "string",
11802
+ "format": "date-time"
11803
+ }
11804
+ }
11805
+ }
11021
11806
  }
11022
11807
  }
11808
+ },
11809
+ "example": {
11810
+ "conversation_id": "8c4f2a1e-0b6d-4e2f-9a3c-5d7e1f2a3b4c",
11811
+ "title": "Overdue invoices in Q3",
11812
+ "created_at": "2026-07-30T09:12:00.000Z",
11813
+ "turns": [
11814
+ {
11815
+ "ask_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
11816
+ "question": "Which invoices in this pipeline are overdue, and by how much?",
11817
+ "status": "completed",
11818
+ "answer": "Two invoices are overdue: INV-1041 by 12 days and INV-1055 by 3 days.",
11819
+ "created_at": "2026-07-30T09:12:00.000Z"
11820
+ }
11821
+ ]
11023
11822
  }
11024
11823
  }
11025
11824
  }
11026
11825
  },
11027
- "400": {
11028
- "$ref": "#/components/responses/BadRequest"
11029
- },
11030
11826
  "401": {
11031
11827
  "$ref": "#/components/responses/Unauthorized"
11032
11828
  },
@@ -11037,57 +11833,80 @@
11037
11833
  "$ref": "#/components/responses/RateLimitExceeded"
11038
11834
  }
11039
11835
  }
11040
- }
11041
- },
11042
- "/v1/cases/{key}/edges/{edgeId}/reject": {
11043
- "post": {
11044
- "operationId": "rejectCaseEdge",
11045
- "summary": "Reject a case edge",
11046
- "description": "Reject a proposed entity edge between documents in this case.",
11836
+ },
11837
+ "patch": {
11838
+ "operationId": "renameAgentConversation",
11839
+ "summary": "Rename a conversation",
11840
+ "description": "Rename a conversation. The title is trimmed server-side and capped at 300\ncharacters. Requires the `write` scope.\n",
11047
11841
  "tags": [
11048
- "Cases"
11842
+ "Agent"
11049
11843
  ],
11050
11844
  "parameters": [
11051
11845
  {
11052
- "name": "key",
11846
+ "name": "id",
11053
11847
  "in": "path",
11054
11848
  "required": true,
11055
11849
  "schema": {
11056
11850
  "type": "string",
11057
11851
  "format": "uuid"
11058
- },
11059
- "description": "Case UUID (the stable resource id)."
11852
+ }
11060
11853
  },
11061
11854
  {
11062
- "name": "edgeId",
11063
- "in": "path",
11064
- "required": true,
11855
+ "name": "on_behalf_of",
11856
+ "in": "query",
11065
11857
  "schema": {
11066
11858
  "type": "string",
11067
11859
  "format": "uuid"
11068
11860
  },
11069
- "description": "Edge identifier from the case edges list."
11861
+ "description": "Rename within the conversation partition of this workspace user."
11070
11862
  }
11071
11863
  ],
11864
+ "requestBody": {
11865
+ "required": true,
11866
+ "content": {
11867
+ "application/json": {
11868
+ "schema": {
11869
+ "type": "object",
11870
+ "required": [
11871
+ "title"
11872
+ ],
11873
+ "properties": {
11874
+ "title": {
11875
+ "type": "string",
11876
+ "maxLength": 300
11877
+ }
11878
+ }
11879
+ },
11880
+ "example": {
11881
+ "title": "Q3 collections review"
11882
+ }
11883
+ }
11884
+ }
11885
+ },
11072
11886
  "responses": {
11073
11887
  "200": {
11074
- "description": "Edge rejected.",
11888
+ "description": "The conversation's new title.",
11075
11889
  "content": {
11076
11890
  "application/json": {
11077
11891
  "schema": {
11078
11892
  "type": "object",
11079
11893
  "properties": {
11080
- "success": {
11081
- "type": "boolean"
11894
+ "conversation_id": {
11895
+ "type": "string",
11896
+ "format": "uuid"
11897
+ },
11898
+ "title": {
11899
+ "type": "string"
11082
11900
  }
11083
11901
  }
11902
+ },
11903
+ "example": {
11904
+ "conversation_id": "8c4f2a1e-0b6d-4e2f-9a3c-5d7e1f2a3b4c",
11905
+ "title": "Q3 collections review"
11084
11906
  }
11085
11907
  }
11086
11908
  }
11087
11909
  },
11088
- "400": {
11089
- "$ref": "#/components/responses/BadRequest"
11090
- },
11091
11910
  "401": {
11092
11911
  "$ref": "#/components/responses/Unauthorized"
11093
11912
  },
@@ -11098,124 +11917,111 @@
11098
11917
  "$ref": "#/components/responses/RateLimitExceeded"
11099
11918
  }
11100
11919
  }
11101
- }
11102
- },
11103
- "/v1/cases/{key}/anomalies": {
11104
- "get": {
11105
- "operationId": "getCaseAnomalies",
11106
- "summary": "Get case anomalies",
11107
- "description": "Detector anomalies for the case (the risk surface) — field conflicts, divergent shared keys, suspicious value reuse, missing-document-type signals — plus open dangling-reference findings and the matched workflow template. Computed on-read from the case's field occurrences; no LLM, nothing persisted.\n",
11920
+ },
11921
+ "delete": {
11922
+ "operationId": "deleteAgentConversation",
11923
+ "summary": "Delete a conversation",
11924
+ "description": "Delete a conversation. It disappears from the list and can no longer be\ncontinued; the asks themselves stay readable by id via `GET /v1/ask/{id}`,\nbecause they are the caller's own answer history. Requires the `write` scope.\n",
11108
11925
  "tags": [
11109
- "Cases"
11110
- ],
11111
- "security": [
11112
- {
11113
- "BearerAuth": []
11114
- }
11926
+ "Agent"
11115
11927
  ],
11116
11928
  "parameters": [
11117
11929
  {
11118
- "name": "key",
11930
+ "name": "id",
11119
11931
  "in": "path",
11120
11932
  "required": true,
11933
+ "schema": {
11934
+ "type": "string",
11935
+ "format": "uuid"
11936
+ }
11937
+ },
11938
+ {
11939
+ "name": "on_behalf_of",
11940
+ "in": "query",
11121
11941
  "schema": {
11122
11942
  "type": "string",
11123
11943
  "format": "uuid"
11124
11944
  },
11125
- "description": "Case UUID (the stable resource id)."
11945
+ "description": "Delete within the conversation partition of this workspace user."
11126
11946
  }
11127
11947
  ],
11128
11948
  "responses": {
11129
11949
  "200": {
11130
- "description": "Anomalies, findings, and matched template.",
11950
+ "description": "The conversation was deleted.",
11131
11951
  "content": {
11132
11952
  "application/json": {
11133
11953
  "schema": {
11134
11954
  "type": "object",
11135
11955
  "properties": {
11136
- "data": {
11137
- "type": "array",
11138
- "items": {
11139
- "type": "object",
11140
- "properties": {
11141
- "type": {
11142
- "type": "string"
11143
- },
11144
- "severity": {
11145
- "type": "string",
11146
- "enum": [
11147
- "critical",
11148
- "warning",
11149
- "info"
11150
- ]
11151
- },
11152
- "title": {
11153
- "type": "string"
11154
- },
11155
- "description": {
11156
- "type": "string"
11157
- },
11158
- "document_ids": {
11159
- "type": "array",
11160
- "items": {
11161
- "type": "string",
11162
- "format": "uuid"
11163
- }
11164
- },
11165
- "targets": {
11166
- "type": "array",
11167
- "items": {
11168
- "type": "object",
11169
- "properties": {
11170
- "document_id": {
11171
- "type": "string",
11172
- "format": "uuid"
11173
- },
11174
- "field": {
11175
- "type": "string"
11176
- },
11177
- "value": {
11178
- "type": "string"
11179
- }
11180
- }
11181
- }
11182
- }
11183
- }
11184
- }
11185
- },
11186
- "findings": {
11187
- "type": "array",
11188
- "items": {
11189
- "type": "object"
11190
- }
11956
+ "conversation_id": {
11957
+ "type": "string",
11958
+ "format": "uuid"
11191
11959
  },
11192
- "template": {
11193
- "type": "object",
11194
- "nullable": true
11960
+ "deleted": {
11961
+ "type": "boolean"
11195
11962
  }
11196
11963
  }
11964
+ },
11965
+ "example": {
11966
+ "conversation_id": "8c4f2a1e-0b6d-4e2f-9a3c-5d7e1f2a3b4c",
11967
+ "deleted": true
11197
11968
  }
11198
11969
  }
11199
11970
  }
11200
11971
  },
11972
+ "401": {
11973
+ "$ref": "#/components/responses/Unauthorized"
11974
+ },
11201
11975
  "404": {
11202
11976
  "$ref": "#/components/responses/NotFound"
11977
+ },
11978
+ "429": {
11979
+ "$ref": "#/components/responses/RateLimitExceeded"
11203
11980
  }
11204
11981
  }
11205
11982
  }
11206
11983
  },
11207
- "/v1/cases/{key}/evidence": {
11984
+ "/v1/exports/{path}": {
11208
11985
  "get": {
11209
- "operationId": "getCaseEvidence",
11210
- "summary": "Get case evidence",
11211
- "description": "The case's connective evidence: the shared-reference `connections` that join its documents (each with the via-field, value, kind, confidence, and any curator verdict), the open `gaps` (dangling references / missing documents), and the member documents. The synth case evidence model — why these documents form one case and what is still missing.\n",
11986
+ "operationId": "deprecatedExportsGet",
11987
+ "summary": "Deprecated exports endpoint (any verb)",
11988
+ "deprecated": true,
11989
+ "description": "The `/v1/exports/*` namespace was retired on 2026-04-21 in favour of the unified\n`/v1/delivery/*` surface. All requests against any verb of this path return\n`410 Gone` with a pointer to the replacement endpoint. This entry exists so SDK\ngenerators see the deprecation flag; do not call.\n",
11212
11990
  "tags": [
11213
- "Cases"
11991
+ "Delivery"
11214
11992
  ],
11215
- "security": [
11993
+ "parameters": [
11216
11994
  {
11217
- "BearerAuth": []
11995
+ "name": "path",
11996
+ "in": "path",
11997
+ "required": true,
11998
+ "schema": {
11999
+ "type": "string"
12000
+ },
12001
+ "description": "Any sub-path under `/v1/exports/`."
12002
+ }
12003
+ ],
12004
+ "x-sunset": "2026-04-21",
12005
+ "responses": {
12006
+ "410": {
12007
+ "description": "Gone — use `/v1/delivery/*` instead.",
12008
+ "content": {
12009
+ "application/json": {
12010
+ "schema": {
12011
+ "$ref": "#/components/schemas/ErrorResponse"
12012
+ }
12013
+ }
12014
+ }
11218
12015
  }
12016
+ }
12017
+ }
12018
+ },
12019
+ "/v1/cases/{key}/status": {
12020
+ "patch": {
12021
+ "operationId": "updateCaseStatus",
12022
+ "summary": "Update case status",
12023
+ "tags": [
12024
+ "Cases"
11219
12025
  ],
11220
12026
  "parameters": [
11221
12027
  {
@@ -11229,76 +12035,130 @@
11229
12035
  "description": "Case UUID (the stable resource id)."
11230
12036
  }
11231
12037
  ],
11232
- "responses": {
12038
+ "requestBody": {
12039
+ "required": true,
12040
+ "content": {
12041
+ "application/json": {
12042
+ "schema": {
12043
+ "type": "object",
12044
+ "required": [
12045
+ "status"
12046
+ ],
12047
+ "properties": {
12048
+ "status": {
12049
+ "type": "string",
12050
+ "example": "completed",
12051
+ "description": "New status (e.g. open, in_review, resolved, archived)."
12052
+ }
12053
+ }
12054
+ }
12055
+ }
12056
+ }
12057
+ },
12058
+ "responses": {
11233
12059
  "200": {
11234
- "description": "Connections, gaps, and documents.",
12060
+ "description": "Case status updated.",
12061
+ "content": {
12062
+ "application/json": {
12063
+ "schema": {
12064
+ "$ref": "#/components/schemas/CaseDetailResponse"
12065
+ }
12066
+ }
12067
+ }
12068
+ },
12069
+ "400": {
12070
+ "$ref": "#/components/responses/BadRequest"
12071
+ },
12072
+ "401": {
12073
+ "$ref": "#/components/responses/Unauthorized"
12074
+ },
12075
+ "404": {
12076
+ "$ref": "#/components/responses/NotFound"
12077
+ },
12078
+ "429": {
12079
+ "$ref": "#/components/responses/RateLimitExceeded"
12080
+ }
12081
+ }
12082
+ }
12083
+ },
12084
+ "/v1/cases/{key}/edges": {
12085
+ "get": {
12086
+ "operationId": "getCaseEdges",
12087
+ "summary": "Get case edges",
12088
+ "description": "Returns the entity edges (evidence chain) connecting documents within the case.",
12089
+ "tags": [
12090
+ "Cases"
12091
+ ],
12092
+ "parameters": [
12093
+ {
12094
+ "name": "key",
12095
+ "in": "path",
12096
+ "required": true,
12097
+ "schema": {
12098
+ "type": "string",
12099
+ "format": "uuid"
12100
+ },
12101
+ "description": "Case UUID (the stable resource id)."
12102
+ }
12103
+ ],
12104
+ "responses": {
12105
+ "200": {
12106
+ "description": "Case edges.",
11235
12107
  "content": {
11236
12108
  "application/json": {
11237
12109
  "schema": {
11238
12110
  "type": "object",
11239
12111
  "properties": {
11240
- "connections": {
12112
+ "data": {
11241
12113
  "type": "array",
11242
12114
  "items": {
11243
12115
  "type": "object",
11244
12116
  "properties": {
11245
- "document_a": {
12117
+ "source_document_id": {
11246
12118
  "type": "string",
11247
- "format": "uuid"
12119
+ "format": "uuid",
12120
+ "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
11248
12121
  },
11249
- "document_b": {
12122
+ "target_document_id": {
11250
12123
  "type": "string",
11251
12124
  "format": "uuid",
11252
- "nullable": true
11253
- },
11254
- "via_field": {
11255
- "type": "string"
12125
+ "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
11256
12126
  },
11257
- "value": {
12127
+ "entity_value": {
11258
12128
  "type": "string"
11259
12129
  },
11260
- "kind": {
12130
+ "entity_type": {
11261
12131
  "type": "string"
11262
12132
  },
11263
12133
  "confidence": {
11264
12134
  "type": "number",
11265
- "nullable": true
11266
- },
11267
- "verdict": {
11268
- "type": "string",
11269
- "nullable": true
12135
+ "format": "float"
11270
12136
  }
11271
12137
  }
11272
12138
  }
11273
- },
11274
- "gaps": {
11275
- "type": "array",
11276
- "items": {
11277
- "type": "object"
11278
- }
11279
- },
11280
- "documents": {
11281
- "type": "array",
11282
- "items": {
11283
- "type": "object"
11284
- }
11285
12139
  }
11286
12140
  }
11287
12141
  }
11288
12142
  }
11289
12143
  }
11290
12144
  },
12145
+ "401": {
12146
+ "$ref": "#/components/responses/Unauthorized"
12147
+ },
11291
12148
  "404": {
11292
12149
  "$ref": "#/components/responses/NotFound"
12150
+ },
12151
+ "429": {
12152
+ "$ref": "#/components/responses/RateLimitExceeded"
11293
12153
  }
11294
12154
  }
11295
12155
  }
11296
12156
  },
11297
- "/v1/cases/{key}/split": {
12157
+ "/v1/cases/{key}/edges/{edgeId}/confirm": {
11298
12158
  "post": {
11299
- "operationId": "splitCase",
11300
- "summary": "Split a case",
11301
- "description": "Split a case into two separate cases by partitioning its documents into two groups.",
12159
+ "operationId": "confirmCaseEdge",
12160
+ "summary": "Confirm a case edge",
12161
+ "description": "Confirm a proposed entity edge between documents in this case.",
11302
12162
  "tags": [
11303
12163
  "Cases"
11304
12164
  ],
@@ -11312,67 +12172,28 @@
11312
12172
  "format": "uuid"
11313
12173
  },
11314
12174
  "description": "Case UUID (the stable resource id)."
12175
+ },
12176
+ {
12177
+ "name": "edgeId",
12178
+ "in": "path",
12179
+ "required": true,
12180
+ "schema": {
12181
+ "type": "string",
12182
+ "format": "uuid"
12183
+ },
12184
+ "description": "Edge identifier from the case edges list."
11315
12185
  }
11316
12186
  ],
11317
- "requestBody": {
11318
- "required": true,
11319
- "content": {
11320
- "application/json": {
11321
- "schema": {
11322
- "type": "object",
11323
- "required": [
11324
- "partition_b"
11325
- ],
11326
- "properties": {
11327
- "partition_b": {
11328
- "type": "array",
11329
- "items": {
11330
- "type": "string",
11331
- "format": "uuid",
11332
- "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
11333
- },
11334
- "description": "Document IDs that move out into the newly-created case (non-empty strict subset). Everything not listed stays on the existing case."
11335
- },
11336
- "partition_a": {
11337
- "type": "array",
11338
- "items": {
11339
- "type": "string",
11340
- "format": "uuid",
11341
- "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
11342
- },
11343
- "description": "Informational only — the kept documents are derived as the complement of partition_b."
11344
- }
11345
- }
11346
- }
11347
- }
11348
- }
11349
- },
11350
12187
  "responses": {
11351
12188
  "200": {
11352
- "description": "Case split.",
12189
+ "description": "Edge confirmed.",
11353
12190
  "content": {
11354
12191
  "application/json": {
11355
12192
  "schema": {
11356
12193
  "type": "object",
11357
- "required": [
11358
- "source_id",
11359
- "new_case_id",
11360
- "moved"
11361
- ],
11362
12194
  "properties": {
11363
- "source_id": {
11364
- "type": "string",
11365
- "format": "uuid",
11366
- "description": "UUID of the existing case (retains the documents not listed in partition_b)."
11367
- },
11368
- "new_case_id": {
11369
- "type": "string",
11370
- "format": "uuid",
11371
- "description": "UUID of the newly created case holding the partition_b documents."
11372
- },
11373
- "moved": {
11374
- "type": "integer",
11375
- "description": "Count of documents moved into the new case."
12195
+ "success": {
12196
+ "type": "boolean"
11376
12197
  }
11377
12198
  }
11378
12199
  }
@@ -11394,73 +12215,48 @@
11394
12215
  }
11395
12216
  }
11396
12217
  },
11397
- "/v1/cases/merge": {
12218
+ "/v1/cases/{key}/edges/{edgeId}/reject": {
11398
12219
  "post": {
11399
- "operationId": "mergeCases",
11400
- "summary": "Merge two cases",
11401
- "description": "Absorb case B into case A by passing both case UUIDs in the request\nbody. A's documents/links/findings are kept and B's are reparented onto\nA; B is tombstoned (excluded from future rebuilds, never deleted).\n",
12220
+ "operationId": "rejectCaseEdge",
12221
+ "summary": "Reject a case edge",
12222
+ "description": "Reject a proposed entity edge between documents in this case.",
11402
12223
  "tags": [
11403
12224
  "Cases"
11404
12225
  ],
11405
- "requestBody": {
11406
- "required": true,
11407
- "content": {
11408
- "application/json": {
11409
- "schema": {
11410
- "type": "object",
11411
- "required": [
11412
- "case_key_a",
11413
- "case_key_b"
11414
- ],
11415
- "properties": {
11416
- "case_key_a": {
11417
- "type": "string",
11418
- "format": "uuid",
11419
- "description": "UUID of the surviving target case — receives the merged documents."
11420
- },
11421
- "case_key_b": {
11422
- "type": "string",
11423
- "format": "uuid",
11424
- "description": "UUID of the absorbed case — its documents are folded into case A."
11425
- }
11426
- }
11427
- }
11428
- }
12226
+ "parameters": [
12227
+ {
12228
+ "name": "key",
12229
+ "in": "path",
12230
+ "required": true,
12231
+ "schema": {
12232
+ "type": "string",
12233
+ "format": "uuid"
12234
+ },
12235
+ "description": "Case UUID (the stable resource id)."
12236
+ },
12237
+ {
12238
+ "name": "edgeId",
12239
+ "in": "path",
12240
+ "required": true,
12241
+ "schema": {
12242
+ "type": "string",
12243
+ "format": "uuid"
12244
+ },
12245
+ "description": "Edge identifier from the case edges list."
11429
12246
  }
11430
- },
12247
+ ],
11431
12248
  "responses": {
11432
12249
  "200": {
11433
- "description": "Cases merged. Returns the surviving (target) case row — an object\ncarrying at least `id`, `case_key`, `status`, `display_name`,\n`assignee`, `resolution_notes`, `title`, `blurb`, `summary`,\n`source`, `stale`, and build timestamps.\n",
12250
+ "description": "Edge rejected.",
11434
12251
  "content": {
11435
12252
  "application/json": {
11436
12253
  "schema": {
11437
12254
  "type": "object",
11438
- "description": "The surviving target case row.",
11439
12255
  "properties": {
11440
- "id": {
11441
- "type": "string",
11442
- "format": "uuid"
11443
- },
11444
- "case_key": {
11445
- "type": "string"
11446
- },
11447
- "status": {
11448
- "type": "string",
11449
- "enum": [
11450
- "discovered",
11451
- "confirmed",
11452
- "active",
11453
- "resolved"
11454
- ]
11455
- },
11456
- "display_name": {
11457
- "type": [
11458
- "string",
11459
- "null"
11460
- ]
12256
+ "success": {
12257
+ "type": "boolean"
11461
12258
  }
11462
- },
11463
- "additionalProperties": true
12259
+ }
11464
12260
  }
11465
12261
  }
11466
12262
  }
@@ -11480,14 +12276,19 @@
11480
12276
  }
11481
12277
  }
11482
12278
  },
11483
- "/v1/cases/{key}/completeness": {
12279
+ "/v1/cases/{key}/anomalies": {
11484
12280
  "get": {
11485
- "operationId": "getCaseCompleteness",
11486
- "summary": "Get case completeness",
11487
- "description": "Returns a completeness assessment for the case (expected vs. present document types, missing fields).",
12281
+ "operationId": "getCaseAnomalies",
12282
+ "summary": "Get case anomalies",
12283
+ "description": "Detector anomalies for the case (the risk surface) — field conflicts, divergent shared keys, suspicious value reuse, missing-document-type signals — plus open dangling-reference findings and the matched workflow template. Computed on-read from the case's field occurrences; no LLM, nothing persisted.\n",
11488
12284
  "tags": [
11489
12285
  "Cases"
11490
12286
  ],
12287
+ "security": [
12288
+ {
12289
+ "BearerAuth": []
12290
+ }
12291
+ ],
11491
12292
  "parameters": [
11492
12293
  {
11493
12294
  "name": "key",
@@ -11502,59 +12303,96 @@
11502
12303
  ],
11503
12304
  "responses": {
11504
12305
  "200": {
11505
- "description": "Completeness assessment.",
12306
+ "description": "Anomalies, findings, and matched template.",
11506
12307
  "content": {
11507
12308
  "application/json": {
11508
12309
  "schema": {
11509
12310
  "type": "object",
11510
12311
  "properties": {
11511
- "completeness_score": {
11512
- "type": "number",
11513
- "format": "float"
11514
- },
11515
- "expected_document_types": {
12312
+ "data": {
11516
12313
  "type": "array",
11517
12314
  "items": {
11518
- "type": "string"
12315
+ "type": "object",
12316
+ "properties": {
12317
+ "type": {
12318
+ "type": "string"
12319
+ },
12320
+ "severity": {
12321
+ "type": "string",
12322
+ "enum": [
12323
+ "critical",
12324
+ "warning",
12325
+ "info"
12326
+ ]
12327
+ },
12328
+ "title": {
12329
+ "type": "string"
12330
+ },
12331
+ "description": {
12332
+ "type": "string"
12333
+ },
12334
+ "document_ids": {
12335
+ "type": "array",
12336
+ "items": {
12337
+ "type": "string",
12338
+ "format": "uuid"
12339
+ }
12340
+ },
12341
+ "targets": {
12342
+ "type": "array",
12343
+ "items": {
12344
+ "type": "object",
12345
+ "properties": {
12346
+ "document_id": {
12347
+ "type": "string",
12348
+ "format": "uuid"
12349
+ },
12350
+ "field": {
12351
+ "type": "string"
12352
+ },
12353
+ "value": {
12354
+ "type": "string"
12355
+ }
12356
+ }
12357
+ }
12358
+ }
12359
+ }
11519
12360
  }
11520
12361
  },
11521
- "present_document_types": {
12362
+ "findings": {
11522
12363
  "type": "array",
11523
12364
  "items": {
11524
- "type": "string"
12365
+ "type": "object"
11525
12366
  }
11526
12367
  },
11527
- "missing_document_types": {
11528
- "type": "array",
11529
- "items": {
11530
- "type": "string"
11531
- }
12368
+ "template": {
12369
+ "type": "object",
12370
+ "nullable": true
11532
12371
  }
11533
12372
  }
11534
12373
  }
11535
12374
  }
11536
12375
  }
11537
12376
  },
11538
- "401": {
11539
- "$ref": "#/components/responses/Unauthorized"
11540
- },
11541
12377
  "404": {
11542
12378
  "$ref": "#/components/responses/NotFound"
11543
- },
11544
- "429": {
11545
- "$ref": "#/components/responses/RateLimitExceeded"
11546
12379
  }
11547
12380
  }
11548
12381
  }
11549
12382
  },
11550
- "/v1/cases/{key}/documents/{docId}/pin": {
11551
- "post": {
11552
- "operationId": "pinCaseDocument",
11553
- "summary": "Pin a document to a case",
11554
- "description": "Manually pin a document to a case so it persists across re-clustering.",
12383
+ "/v1/cases/{key}/evidence": {
12384
+ "get": {
12385
+ "operationId": "getCaseEvidence",
12386
+ "summary": "Get case evidence",
12387
+ "description": "The case's connective evidence: the shared-reference `connections` that join its documents (each with the via-field, value, kind, confidence, and any curator verdict), the open `gaps` (dangling references / missing documents), and the member documents. The synth case evidence model — why these documents form one case and what is still missing.\n",
11555
12388
  "tags": [
11556
12389
  "Cases"
11557
12390
  ],
12391
+ "security": [
12392
+ {
12393
+ "BearerAuth": []
12394
+ }
12395
+ ],
11558
12396
  "parameters": [
11559
12397
  {
11560
12398
  "name": "key",
@@ -11565,49 +12403,78 @@
11565
12403
  "format": "uuid"
11566
12404
  },
11567
12405
  "description": "Case UUID (the stable resource id)."
11568
- },
11569
- {
11570
- "name": "docId",
11571
- "in": "path",
11572
- "required": true,
11573
- "schema": {
11574
- "type": "string",
11575
- "format": "uuid"
11576
- },
11577
- "description": "Document identifier to pin."
11578
12406
  }
11579
12407
  ],
11580
12408
  "responses": {
11581
12409
  "200": {
11582
- "description": "Document pinned.",
12410
+ "description": "Connections, gaps, and documents.",
11583
12411
  "content": {
11584
12412
  "application/json": {
11585
12413
  "schema": {
11586
- "$ref": "#/components/schemas/CaseDetailResponse"
12414
+ "type": "object",
12415
+ "properties": {
12416
+ "connections": {
12417
+ "type": "array",
12418
+ "items": {
12419
+ "type": "object",
12420
+ "properties": {
12421
+ "document_a": {
12422
+ "type": "string",
12423
+ "format": "uuid"
12424
+ },
12425
+ "document_b": {
12426
+ "type": "string",
12427
+ "format": "uuid",
12428
+ "nullable": true
12429
+ },
12430
+ "via_field": {
12431
+ "type": "string"
12432
+ },
12433
+ "value": {
12434
+ "type": "string"
12435
+ },
12436
+ "kind": {
12437
+ "type": "string"
12438
+ },
12439
+ "confidence": {
12440
+ "type": "number",
12441
+ "nullable": true
12442
+ },
12443
+ "verdict": {
12444
+ "type": "string",
12445
+ "nullable": true
12446
+ }
12447
+ }
12448
+ }
12449
+ },
12450
+ "gaps": {
12451
+ "type": "array",
12452
+ "items": {
12453
+ "type": "object"
12454
+ }
12455
+ },
12456
+ "documents": {
12457
+ "type": "array",
12458
+ "items": {
12459
+ "type": "object"
12460
+ }
12461
+ }
12462
+ }
11587
12463
  }
11588
12464
  }
11589
12465
  }
11590
12466
  },
11591
- "400": {
11592
- "$ref": "#/components/responses/BadRequest"
11593
- },
11594
- "401": {
11595
- "$ref": "#/components/responses/Unauthorized"
11596
- },
11597
12467
  "404": {
11598
12468
  "$ref": "#/components/responses/NotFound"
11599
- },
11600
- "429": {
11601
- "$ref": "#/components/responses/RateLimitExceeded"
11602
12469
  }
11603
12470
  }
11604
12471
  }
11605
12472
  },
11606
- "/v1/cases/{key}/documents/{docId}": {
11607
- "delete": {
11608
- "operationId": "removeCaseDocument",
11609
- "summary": "Remove a document from a case",
11610
- "description": "Remove a manually-pinned document from a case.",
12473
+ "/v1/cases/{key}/split": {
12474
+ "post": {
12475
+ "operationId": "splitCase",
12476
+ "summary": "Split a case",
12477
+ "description": "Split a case into two separate cases by partitioning its documents into two groups.",
11611
12478
  "tags": [
11612
12479
  "Cases"
11613
12480
  ],
@@ -11621,68 +12488,76 @@
11621
12488
  "format": "uuid"
11622
12489
  },
11623
12490
  "description": "Case UUID (the stable resource id)."
11624
- },
11625
- {
11626
- "name": "docId",
11627
- "in": "path",
11628
- "required": true,
11629
- "schema": {
11630
- "type": "string",
11631
- "format": "uuid"
11632
- },
11633
- "description": "Document identifier to remove."
11634
12491
  }
11635
12492
  ],
12493
+ "requestBody": {
12494
+ "required": true,
12495
+ "content": {
12496
+ "application/json": {
12497
+ "schema": {
12498
+ "type": "object",
12499
+ "required": [
12500
+ "partition_b"
12501
+ ],
12502
+ "properties": {
12503
+ "partition_b": {
12504
+ "type": "array",
12505
+ "items": {
12506
+ "type": "string",
12507
+ "format": "uuid",
12508
+ "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
12509
+ },
12510
+ "description": "Document IDs that move out into the newly-created case (non-empty strict subset). Everything not listed stays on the existing case."
12511
+ },
12512
+ "partition_a": {
12513
+ "type": "array",
12514
+ "items": {
12515
+ "type": "string",
12516
+ "format": "uuid",
12517
+ "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
12518
+ },
12519
+ "description": "Informational only — the kept documents are derived as the complement of partition_b."
12520
+ }
12521
+ }
12522
+ }
12523
+ }
12524
+ }
12525
+ },
11636
12526
  "responses": {
11637
12527
  "200": {
11638
- "description": "Document removed.",
12528
+ "description": "Case split.",
11639
12529
  "content": {
11640
12530
  "application/json": {
11641
12531
  "schema": {
11642
- "$ref": "#/components/schemas/CaseDetailResponse"
11643
- }
11644
- }
11645
- }
11646
- },
11647
- "400": {
11648
- "$ref": "#/components/responses/BadRequest"
11649
- },
11650
- "401": {
11651
- "$ref": "#/components/responses/Unauthorized"
11652
- },
11653
- "404": {
11654
- "$ref": "#/components/responses/NotFound"
11655
- },
11656
- "429": {
11657
- "$ref": "#/components/responses/RateLimitExceeded"
11658
- }
11659
- }
11660
- }
11661
- },
11662
- "/v1/batches/{id}/sync": {
11663
- "post": {
11664
- "operationId": "syncBatch",
11665
- "summary": "Sync batch status with provider",
11666
- "description": "Force a status sync with the batch inference provider (Anthropic or Bedrock).",
11667
- "tags": [
11668
- "Jobs & Batches"
11669
- ],
11670
- "parameters": [
11671
- {
11672
- "$ref": "#/components/parameters/ResourceId"
11673
- }
11674
- ],
11675
- "responses": {
11676
- "200": {
11677
- "description": "Batch synced.",
11678
- "content": {
11679
- "application/json": {
11680
- "schema": {
11681
- "$ref": "#/components/schemas/BatchResponse"
12532
+ "type": "object",
12533
+ "required": [
12534
+ "source_id",
12535
+ "new_case_id",
12536
+ "moved"
12537
+ ],
12538
+ "properties": {
12539
+ "source_id": {
12540
+ "type": "string",
12541
+ "format": "uuid",
12542
+ "description": "UUID of the existing case (retains the documents not listed in partition_b)."
12543
+ },
12544
+ "new_case_id": {
12545
+ "type": "string",
12546
+ "format": "uuid",
12547
+ "description": "UUID of the newly created case holding the partition_b documents."
12548
+ },
12549
+ "moved": {
12550
+ "type": "integer",
12551
+ "description": "Count of documents moved into the new case."
12552
+ }
12553
+ }
11682
12554
  }
11683
12555
  }
11684
12556
  }
11685
12557
  },
12558
+ "400": {
12559
+ "$ref": "#/components/responses/BadRequest"
12560
+ },
11686
12561
  "401": {
11687
12562
  "$ref": "#/components/responses/Unauthorized"
11688
12563
  },
@@ -11695,93 +12570,147 @@
11695
12570
  }
11696
12571
  }
11697
12572
  },
11698
- "/v1/batches/{id}/cancel": {
12573
+ "/v1/cases/merge": {
11699
12574
  "post": {
11700
- "operationId": "cancelBatch",
11701
- "summary": "Cancel a batch inference run",
11702
- "description": "Cancel an in-flight batch. Only batches in `accumulating` or `submitted` status can be cancelled.",
12575
+ "operationId": "mergeCases",
12576
+ "summary": "Merge two cases",
12577
+ "description": "Absorb case B into case A by passing both case UUIDs in the request\nbody. A's documents/links/findings are kept and B's are reparented onto\nA; B is tombstoned (excluded from future rebuilds, never deleted).\n",
11703
12578
  "tags": [
11704
- "Jobs & Batches"
12579
+ "Cases"
11705
12580
  ],
11706
- "parameters": [
11707
- {
11708
- "$ref": "#/components/parameters/ResourceId"
12581
+ "requestBody": {
12582
+ "required": true,
12583
+ "content": {
12584
+ "application/json": {
12585
+ "schema": {
12586
+ "type": "object",
12587
+ "required": [
12588
+ "case_key_a",
12589
+ "case_key_b"
12590
+ ],
12591
+ "properties": {
12592
+ "case_key_a": {
12593
+ "type": "string",
12594
+ "format": "uuid",
12595
+ "description": "UUID of the surviving target case — receives the merged documents."
12596
+ },
12597
+ "case_key_b": {
12598
+ "type": "string",
12599
+ "format": "uuid",
12600
+ "description": "UUID of the absorbed case — its documents are folded into case A."
12601
+ }
12602
+ }
12603
+ }
12604
+ }
11709
12605
  }
11710
- ],
12606
+ },
11711
12607
  "responses": {
11712
12608
  "200": {
11713
- "description": "Batch cancelled.",
12609
+ "description": "Cases merged. Returns the surviving (target) case row — an object\ncarrying at least `id`, `case_key`, `status`, `display_name`,\n`assignee`, `resolution_notes`, `title`, `blurb`, `summary`,\n`source`, `stale`, and build timestamps.\n",
11714
12610
  "content": {
11715
12611
  "application/json": {
11716
12612
  "schema": {
11717
- "$ref": "#/components/schemas/BatchResponse"
12613
+ "type": "object",
12614
+ "description": "The surviving target case row.",
12615
+ "properties": {
12616
+ "id": {
12617
+ "type": "string",
12618
+ "format": "uuid"
12619
+ },
12620
+ "case_key": {
12621
+ "type": "string"
12622
+ },
12623
+ "status": {
12624
+ "type": "string",
12625
+ "enum": [
12626
+ "discovered",
12627
+ "confirmed",
12628
+ "active",
12629
+ "resolved"
12630
+ ]
12631
+ },
12632
+ "display_name": {
12633
+ "type": [
12634
+ "string",
12635
+ "null"
12636
+ ]
12637
+ }
12638
+ },
12639
+ "additionalProperties": true
11718
12640
  }
11719
12641
  }
11720
12642
  }
11721
12643
  },
12644
+ "400": {
12645
+ "$ref": "#/components/responses/BadRequest"
12646
+ },
11722
12647
  "401": {
11723
12648
  "$ref": "#/components/responses/Unauthorized"
11724
12649
  },
11725
12650
  "404": {
11726
12651
  "$ref": "#/components/responses/NotFound"
11727
12652
  },
11728
- "409": {
11729
- "$ref": "#/components/responses/Conflict"
11730
- },
11731
12653
  "429": {
11732
12654
  "$ref": "#/components/responses/RateLimitExceeded"
11733
12655
  }
11734
12656
  }
11735
12657
  }
11736
12658
  },
11737
- "/v1/matching/configs/{id}/smart-run": {
11738
- "post": {
11739
- "operationId": "triggerSmartMatchingRun",
11740
- "summary": "Trigger a smart matching run for a config",
11741
- "description": "Run a previously-generated AI matching strategy against the documents scoped by the matching config.",
12659
+ "/v1/cases/{key}/completeness": {
12660
+ "get": {
12661
+ "operationId": "getCaseCompleteness",
12662
+ "summary": "Get case completeness",
12663
+ "description": "Returns a completeness assessment for the case (expected vs. present document types, missing fields).",
11742
12664
  "tags": [
11743
- "Matching"
12665
+ "Cases"
11744
12666
  ],
11745
12667
  "parameters": [
11746
12668
  {
11747
- "$ref": "#/components/parameters/ResourceId"
12669
+ "name": "key",
12670
+ "in": "path",
12671
+ "required": true,
12672
+ "schema": {
12673
+ "type": "string",
12674
+ "format": "uuid"
12675
+ },
12676
+ "description": "Case UUID (the stable resource id)."
11748
12677
  }
11749
12678
  ],
11750
- "requestBody": {
11751
- "required": true,
11752
- "content": {
11753
- "application/json": {
11754
- "schema": {
11755
- "type": "object",
11756
- "required": [
11757
- "strategy_id"
11758
- ],
11759
- "properties": {
11760
- "strategy_id": {
11761
- "type": "string",
11762
- "format": "uuid",
11763
- "example": "c9d0e1f2-a3b4-5678-cdef-789012345678",
11764
- "description": "Strategy generated via POST /v1/matching/strategies/generate to execute against this config."
11765
- }
11766
- }
11767
- }
11768
- }
11769
- }
11770
- },
11771
12679
  "responses": {
11772
- "201": {
11773
- "description": "Smart matching run queued.",
12680
+ "200": {
12681
+ "description": "Completeness assessment.",
11774
12682
  "content": {
11775
12683
  "application/json": {
11776
12684
  "schema": {
11777
- "$ref": "#/components/schemas/MatchingRunResponse"
12685
+ "type": "object",
12686
+ "properties": {
12687
+ "completeness_score": {
12688
+ "type": "number",
12689
+ "format": "float"
12690
+ },
12691
+ "expected_document_types": {
12692
+ "type": "array",
12693
+ "items": {
12694
+ "type": "string"
12695
+ }
12696
+ },
12697
+ "present_document_types": {
12698
+ "type": "array",
12699
+ "items": {
12700
+ "type": "string"
12701
+ }
12702
+ },
12703
+ "missing_document_types": {
12704
+ "type": "array",
12705
+ "items": {
12706
+ "type": "string"
12707
+ }
12708
+ }
12709
+ }
11778
12710
  }
11779
12711
  }
11780
12712
  }
11781
12713
  },
11782
- "400": {
11783
- "$ref": "#/components/responses/BadRequest"
11784
- },
11785
12714
  "401": {
11786
12715
  "$ref": "#/components/responses/Unauthorized"
11787
12716
  },
@@ -11794,38 +12723,43 @@
11794
12723
  }
11795
12724
  }
11796
12725
  },
11797
- "/v1/matching/runs/{id}/ai-resolve": {
12726
+ "/v1/cases/{key}/documents/{docId}/pin": {
11798
12727
  "post": {
11799
- "operationId": "aiResolveMatchingRun",
11800
- "summary": "AI-resolve a matching run's review band",
11801
- "description": "Trigger AI-driven resolution on a completed matching run's review-band candidates. Requires the run to have an associated strategy.",
12728
+ "operationId": "pinCaseDocument",
12729
+ "summary": "Pin a document to a case",
12730
+ "description": "Manually pin a document to a case so it persists across re-clustering.",
11802
12731
  "tags": [
11803
- "Matching"
12732
+ "Cases"
11804
12733
  ],
11805
12734
  "parameters": [
11806
12735
  {
11807
- "$ref": "#/components/parameters/ResourceId"
12736
+ "name": "key",
12737
+ "in": "path",
12738
+ "required": true,
12739
+ "schema": {
12740
+ "type": "string",
12741
+ "format": "uuid"
12742
+ },
12743
+ "description": "Case UUID (the stable resource id)."
12744
+ },
12745
+ {
12746
+ "name": "docId",
12747
+ "in": "path",
12748
+ "required": true,
12749
+ "schema": {
12750
+ "type": "string",
12751
+ "format": "uuid"
12752
+ },
12753
+ "description": "Document identifier to pin."
11808
12754
  }
11809
12755
  ],
11810
12756
  "responses": {
11811
12757
  "200": {
11812
- "description": "AI resolution started.",
12758
+ "description": "Document pinned.",
11813
12759
  "content": {
11814
12760
  "application/json": {
11815
12761
  "schema": {
11816
- "type": "object",
11817
- "properties": {
11818
- "id": {
11819
- "type": "string",
11820
- "format": "uuid"
11821
- },
11822
- "status": {
11823
- "type": "string"
11824
- },
11825
- "message": {
11826
- "type": "string"
11827
- }
11828
- }
12762
+ "$ref": "#/components/schemas/CaseDetailResponse"
11829
12763
  }
11830
12764
  }
11831
12765
  }
@@ -11845,17 +12779,259 @@
11845
12779
  }
11846
12780
  }
11847
12781
  },
11848
- "/v1/matching/strategies/generate": {
11849
- "post": {
11850
- "operationId": "generateMatchingStrategy",
11851
- "summary": "Generate a matching strategy",
11852
- "description": "Synthesize a draft matching strategy by analysing reference data shape and the supplied target descriptor. Returns the generated strategy entity for review and execution via /v1/matching/configs/{id}/smart-run.",
12782
+ "/v1/cases/{key}/documents/{docId}": {
12783
+ "delete": {
12784
+ "operationId": "removeCaseDocument",
12785
+ "summary": "Remove a document from a case",
12786
+ "description": "Remove a manually-pinned document from a case.",
11853
12787
  "tags": [
11854
- "Matching"
12788
+ "Cases"
11855
12789
  ],
11856
- "requestBody": {
11857
- "required": true,
11858
- "content": {
12790
+ "parameters": [
12791
+ {
12792
+ "name": "key",
12793
+ "in": "path",
12794
+ "required": true,
12795
+ "schema": {
12796
+ "type": "string",
12797
+ "format": "uuid"
12798
+ },
12799
+ "description": "Case UUID (the stable resource id)."
12800
+ },
12801
+ {
12802
+ "name": "docId",
12803
+ "in": "path",
12804
+ "required": true,
12805
+ "schema": {
12806
+ "type": "string",
12807
+ "format": "uuid"
12808
+ },
12809
+ "description": "Document identifier to remove."
12810
+ }
12811
+ ],
12812
+ "responses": {
12813
+ "200": {
12814
+ "description": "Document removed.",
12815
+ "content": {
12816
+ "application/json": {
12817
+ "schema": {
12818
+ "$ref": "#/components/schemas/CaseDetailResponse"
12819
+ }
12820
+ }
12821
+ }
12822
+ },
12823
+ "400": {
12824
+ "$ref": "#/components/responses/BadRequest"
12825
+ },
12826
+ "401": {
12827
+ "$ref": "#/components/responses/Unauthorized"
12828
+ },
12829
+ "404": {
12830
+ "$ref": "#/components/responses/NotFound"
12831
+ },
12832
+ "429": {
12833
+ "$ref": "#/components/responses/RateLimitExceeded"
12834
+ }
12835
+ }
12836
+ }
12837
+ },
12838
+ "/v1/batches/{id}/sync": {
12839
+ "post": {
12840
+ "operationId": "syncBatch",
12841
+ "summary": "Sync batch status with provider",
12842
+ "description": "Force a status sync with the batch inference provider (Anthropic or Bedrock).",
12843
+ "tags": [
12844
+ "Jobs & Batches"
12845
+ ],
12846
+ "parameters": [
12847
+ {
12848
+ "$ref": "#/components/parameters/ResourceId"
12849
+ }
12850
+ ],
12851
+ "responses": {
12852
+ "200": {
12853
+ "description": "Batch synced.",
12854
+ "content": {
12855
+ "application/json": {
12856
+ "schema": {
12857
+ "$ref": "#/components/schemas/BatchResponse"
12858
+ }
12859
+ }
12860
+ }
12861
+ },
12862
+ "401": {
12863
+ "$ref": "#/components/responses/Unauthorized"
12864
+ },
12865
+ "404": {
12866
+ "$ref": "#/components/responses/NotFound"
12867
+ },
12868
+ "429": {
12869
+ "$ref": "#/components/responses/RateLimitExceeded"
12870
+ }
12871
+ }
12872
+ }
12873
+ },
12874
+ "/v1/batches/{id}/cancel": {
12875
+ "post": {
12876
+ "operationId": "cancelBatch",
12877
+ "summary": "Cancel a batch inference run",
12878
+ "description": "Cancel an in-flight batch. Only batches in `accumulating` or `submitted` status can be cancelled.",
12879
+ "tags": [
12880
+ "Jobs & Batches"
12881
+ ],
12882
+ "parameters": [
12883
+ {
12884
+ "$ref": "#/components/parameters/ResourceId"
12885
+ }
12886
+ ],
12887
+ "responses": {
12888
+ "200": {
12889
+ "description": "Batch cancelled.",
12890
+ "content": {
12891
+ "application/json": {
12892
+ "schema": {
12893
+ "$ref": "#/components/schemas/BatchResponse"
12894
+ }
12895
+ }
12896
+ }
12897
+ },
12898
+ "401": {
12899
+ "$ref": "#/components/responses/Unauthorized"
12900
+ },
12901
+ "404": {
12902
+ "$ref": "#/components/responses/NotFound"
12903
+ },
12904
+ "409": {
12905
+ "$ref": "#/components/responses/Conflict"
12906
+ },
12907
+ "429": {
12908
+ "$ref": "#/components/responses/RateLimitExceeded"
12909
+ }
12910
+ }
12911
+ }
12912
+ },
12913
+ "/v1/matching/configs/{id}/smart-run": {
12914
+ "post": {
12915
+ "operationId": "triggerSmartMatchingRun",
12916
+ "summary": "Trigger a smart matching run for a config",
12917
+ "description": "Run a previously-generated AI matching strategy against the documents scoped by the matching config.",
12918
+ "tags": [
12919
+ "Matching"
12920
+ ],
12921
+ "parameters": [
12922
+ {
12923
+ "$ref": "#/components/parameters/ResourceId"
12924
+ }
12925
+ ],
12926
+ "requestBody": {
12927
+ "required": true,
12928
+ "content": {
12929
+ "application/json": {
12930
+ "schema": {
12931
+ "type": "object",
12932
+ "required": [
12933
+ "strategy_id"
12934
+ ],
12935
+ "properties": {
12936
+ "strategy_id": {
12937
+ "type": "string",
12938
+ "format": "uuid",
12939
+ "example": "c9d0e1f2-a3b4-5678-cdef-789012345678",
12940
+ "description": "Strategy generated via POST /v1/matching/strategies/generate to execute against this config."
12941
+ }
12942
+ }
12943
+ }
12944
+ }
12945
+ }
12946
+ },
12947
+ "responses": {
12948
+ "201": {
12949
+ "description": "Smart matching run queued.",
12950
+ "content": {
12951
+ "application/json": {
12952
+ "schema": {
12953
+ "$ref": "#/components/schemas/MatchingRunResponse"
12954
+ }
12955
+ }
12956
+ }
12957
+ },
12958
+ "400": {
12959
+ "$ref": "#/components/responses/BadRequest"
12960
+ },
12961
+ "401": {
12962
+ "$ref": "#/components/responses/Unauthorized"
12963
+ },
12964
+ "404": {
12965
+ "$ref": "#/components/responses/NotFound"
12966
+ },
12967
+ "429": {
12968
+ "$ref": "#/components/responses/RateLimitExceeded"
12969
+ }
12970
+ }
12971
+ }
12972
+ },
12973
+ "/v1/matching/runs/{id}/ai-resolve": {
12974
+ "post": {
12975
+ "operationId": "aiResolveMatchingRun",
12976
+ "summary": "AI-resolve a matching run's review band",
12977
+ "description": "Trigger AI-driven resolution on a completed matching run's review-band candidates. Requires the run to have an associated strategy.",
12978
+ "tags": [
12979
+ "Matching"
12980
+ ],
12981
+ "parameters": [
12982
+ {
12983
+ "$ref": "#/components/parameters/ResourceId"
12984
+ }
12985
+ ],
12986
+ "responses": {
12987
+ "200": {
12988
+ "description": "AI resolution started.",
12989
+ "content": {
12990
+ "application/json": {
12991
+ "schema": {
12992
+ "type": "object",
12993
+ "properties": {
12994
+ "id": {
12995
+ "type": "string",
12996
+ "format": "uuid"
12997
+ },
12998
+ "status": {
12999
+ "type": "string"
13000
+ },
13001
+ "message": {
13002
+ "type": "string"
13003
+ }
13004
+ }
13005
+ }
13006
+ }
13007
+ }
13008
+ },
13009
+ "400": {
13010
+ "$ref": "#/components/responses/BadRequest"
13011
+ },
13012
+ "401": {
13013
+ "$ref": "#/components/responses/Unauthorized"
13014
+ },
13015
+ "404": {
13016
+ "$ref": "#/components/responses/NotFound"
13017
+ },
13018
+ "429": {
13019
+ "$ref": "#/components/responses/RateLimitExceeded"
13020
+ }
13021
+ }
13022
+ }
13023
+ },
13024
+ "/v1/matching/strategies/generate": {
13025
+ "post": {
13026
+ "operationId": "generateMatchingStrategy",
13027
+ "summary": "Generate a matching strategy",
13028
+ "description": "Synthesize a draft matching strategy by analysing reference data shape and the supplied target descriptor. Returns the generated strategy entity for review and execution via /v1/matching/configs/{id}/smart-run.",
13029
+ "tags": [
13030
+ "Matching"
13031
+ ],
13032
+ "requestBody": {
13033
+ "required": true,
13034
+ "content": {
11859
13035
  "application/json": {
11860
13036
  "schema": {
11861
13037
  "type": "object",
@@ -12457,73 +13633,9 @@
12457
13633
  }
12458
13634
  },
12459
13635
  "/v1/quality/ground-truth/{id}/entries/{entryId}": {
12460
- "put": {
12461
- "operationId": "updateGroundTruthEntry",
12462
- "summary": "Update a ground truth entry",
12463
- "tags": [
12464
- "Benchmarks"
12465
- ],
12466
- "parameters": [
12467
- {
12468
- "$ref": "#/components/parameters/ResourceId"
12469
- },
12470
- {
12471
- "name": "entryId",
12472
- "in": "path",
12473
- "required": true,
12474
- "schema": {
12475
- "type": "string",
12476
- "format": "uuid",
12477
- "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
12478
- },
12479
- "description": "Entry ID."
12480
- }
12481
- ],
12482
- "requestBody": {
12483
- "required": true,
12484
- "content": {
12485
- "application/json": {
12486
- "schema": {
12487
- "type": "object",
12488
- "properties": {
12489
- "expected_data": {
12490
- "type": "object",
12491
- "additionalProperties": true
12492
- },
12493
- "notes": {
12494
- "type": "string",
12495
- "example": "Reviewed and confirmed."
12496
- }
12497
- }
12498
- }
12499
- }
12500
- }
12501
- },
12502
- "responses": {
12503
- "200": {
12504
- "description": "Entry updated.",
12505
- "content": {
12506
- "application/json": {
12507
- "schema": {
12508
- "$ref": "#/components/schemas/GroundTruthEntryItem"
12509
- }
12510
- }
12511
- }
12512
- },
12513
- "401": {
12514
- "$ref": "#/components/responses/Unauthorized"
12515
- },
12516
- "404": {
12517
- "$ref": "#/components/responses/NotFound"
12518
- },
12519
- "429": {
12520
- "$ref": "#/components/responses/RateLimitExceeded"
12521
- }
12522
- }
12523
- },
12524
- "delete": {
12525
- "operationId": "deleteGroundTruthEntry",
12526
- "summary": "Delete a ground truth entry",
13636
+ "delete": {
13637
+ "operationId": "deleteGroundTruthEntry",
13638
+ "summary": "Delete a ground truth entry",
12527
13639
  "tags": [
12528
13640
  "Benchmarks"
12529
13641
  ],
@@ -18106,7 +19218,7 @@
18106
19218
  "spec_id": {
18107
19219
  "type": "string",
18108
19220
  "format": "uuid",
18109
- "description": "The Spec (user_schema) whose saved rail runs."
19221
+ "description": "The Spec whose saved rail runs. Accepts either a Spec (user_schema) id or a V2 Spec id (the id shown in the /specs editor) — a V2 id resolves to its linked schema's last published/materialized rail."
18110
19222
  },
18111
19223
  "files": {
18112
19224
  "type": "array",
@@ -19784,95 +20896,921 @@
19784
20896
  }
19785
20897
  },
19786
20898
  "400": {
19787
- "$ref": "#/components/responses/BadRequest"
20899
+ "$ref": "#/components/responses/BadRequest"
20900
+ },
20901
+ "401": {
20902
+ "$ref": "#/components/responses/Unauthorized"
20903
+ },
20904
+ "413": {
20905
+ "$ref": "#/components/responses/PayloadTooLarge"
20906
+ }
20907
+ }
20908
+ }
20909
+ },
20910
+ "/v1/billing/settings": {
20911
+ "get": {
20912
+ "tags": [
20913
+ "Billing"
20914
+ ],
20915
+ "summary": "Get billing (auto top-up) settings",
20916
+ "operationId": "getBillingSettings",
20917
+ "security": [
20918
+ {
20919
+ "BearerAuth": []
20920
+ }
20921
+ ],
20922
+ "responses": {
20923
+ "200": {
20924
+ "description": "Auto-topup configuration"
20925
+ }
20926
+ }
20927
+ },
20928
+ "patch": {
20929
+ "tags": [
20930
+ "Billing"
20931
+ ],
20932
+ "summary": "Update billing (auto top-up) settings",
20933
+ "operationId": "updateBillingSettings",
20934
+ "security": [
20935
+ {
20936
+ "BearerAuth": []
20937
+ }
20938
+ ],
20939
+ "requestBody": {
20940
+ "required": true,
20941
+ "content": {
20942
+ "application/json": {
20943
+ "schema": {
20944
+ "type": "object",
20945
+ "properties": {
20946
+ "auto_topup_enabled": {
20947
+ "type": "boolean"
20948
+ },
20949
+ "auto_topup_threshold": {
20950
+ "type": "integer",
20951
+ "minimum": 1000
20952
+ },
20953
+ "auto_topup_amount": {
20954
+ "type": "integer",
20955
+ "minimum": 1000
20956
+ }
20957
+ }
20958
+ }
20959
+ }
20960
+ }
20961
+ },
20962
+ "responses": {
20963
+ "200": {
20964
+ "description": "Updated settings"
20965
+ }
20966
+ }
20967
+ }
20968
+ },
20969
+ "/v1/billing/topup": {
20970
+ "post": {
20971
+ "tags": [
20972
+ "Billing"
20973
+ ],
20974
+ "summary": "Trigger an auto top-up now",
20975
+ "description": "Charges a top-up if auto top-up is enabled. Requires the billing scope.",
20976
+ "operationId": "triggerBillingTopup",
20977
+ "security": [
20978
+ {
20979
+ "BearerAuth": []
20980
+ }
20981
+ ],
20982
+ "responses": {
20983
+ "200": {
20984
+ "description": "{ topped_up, ... }"
20985
+ },
20986
+ "403": {
20987
+ "description": "auto_topup_disabled"
20988
+ }
20989
+ }
20990
+ }
20991
+ },
20992
+ "/v1/ai/policy": {
20993
+ "get": {
20994
+ "operationId": "getAiPolicy",
20995
+ "summary": "Get the effective AI policy",
20996
+ "tags": [
20997
+ "AI Policy"
20998
+ ],
20999
+ "description": "The caller's own AI policy as it is enforced right now: the mandatory\nconstraints applied at routing time, the per-operation class map, the\nresolved defaults, and whether the policy currently leaves every gating\noperation with a compliant route.\n\n`constraints` is the enforced view: it folds the workspace policy\ntogether with the platform provider floor\n(`constraints.platform_provider_floor`), a deployment-level constraint\nthat intersects with the tenant policy and can only narrow it.\n`inherited: true` means the workspace has stored no policy of its own\nand runs on the platform default.\n\nThe workspace is taken from the authenticated key and from nowhere\nelse. A master-view key spans every workspace, has no single policy to\nread, and is rejected with 400 `workspace_scope_required`.\n",
21000
+ "responses": {
21001
+ "200": {
21002
+ "description": "The effective policy, constraints, operation class map, and satisfiability status.",
21003
+ "content": {
21004
+ "application/json": {
21005
+ "example": {
21006
+ "policy": {
21007
+ "version": 4,
21008
+ "status": "active",
21009
+ "region_pin": "eu",
21010
+ "allowed_providers": [
21011
+ "bedrock"
21012
+ ],
21013
+ "denied_models": [
21014
+ "claude-opus"
21015
+ ],
21016
+ "model_substitutions": null,
21017
+ "default_models": null,
21018
+ "max_attempts": null,
21019
+ "model_classes": null,
21020
+ "operation_classes": {
21021
+ "extraction": "complex"
21022
+ },
21023
+ "features": null
21024
+ },
21025
+ "inherited": false,
21026
+ "constraints": {
21027
+ "region_pin": "eu",
21028
+ "allowed_providers": [
21029
+ "bedrock"
21030
+ ],
21031
+ "denied_models": [
21032
+ "claude-opus"
21033
+ ],
21034
+ "platform_provider_floor": [
21035
+ "bedrock"
21036
+ ]
21037
+ },
21038
+ "operation_classes": {
21039
+ "extraction": {
21040
+ "class": "complex",
21041
+ "source": "org",
21042
+ "overridden": true
21043
+ }
21044
+ },
21045
+ "status": {
21046
+ "satisfiable": true,
21047
+ "unroutable_operations": [],
21048
+ "advisory_warnings": [
21049
+ "document_ocr"
21050
+ ]
21051
+ }
21052
+ }
21053
+ }
21054
+ }
21055
+ },
21056
+ "400": {
21057
+ "description": "The API key is not scoped to a single workspace.",
21058
+ "content": {
21059
+ "application/json": {
21060
+ "example": {
21061
+ "error": "workspace_scope_required",
21062
+ "message": "A workspace-scoped API key is required to read or change AI policy."
21063
+ }
21064
+ }
21065
+ }
21066
+ },
21067
+ "401": {
21068
+ "$ref": "#/components/responses/Unauthorized"
21069
+ },
21070
+ "429": {
21071
+ "$ref": "#/components/responses/RateLimitExceeded"
21072
+ }
21073
+ }
21074
+ },
21075
+ "put": {
21076
+ "operationId": "replaceAiPolicy",
21077
+ "summary": "Replace the AI policy",
21078
+ "tags": [
21079
+ "AI Policy"
21080
+ ],
21081
+ "description": "Replace the policy wholesale. Every field is optional in the body, but\nan omitted field is CLEARED, which makes this the route to use when the\npolicy is generated from the customer's own source of truth. To change\none field while keeping the rest, use PATCH instead.\n\nThe write defaults to `status: active`, so the satisfiability gate\nbinds: a policy that would leave a registered operation with no\ncompliant route is refused with 400 `policy_unsatisfiable` and nothing\nis stored. Only `active` policies are enforced at routing time;\n`draft` and `shadow` versions are stored without taking effect.\n\nNaming asymmetry, deliberate: top-level fields are snake_case, but\nvalues INSIDE `model_classes` (`chain`, `requiredCapabilities`,\n`fallback`) and the keys of `features` (`dataCapture`,\n`markdownExtraction`, `assetVision`, `assetAnnotation`,\n`classificationEscalation`, `richSummary`, `documentClassification`)\nstay camelCase because they pass straight to the shared policy\nvalidator.\n",
21082
+ "requestBody": {
21083
+ "required": true,
21084
+ "content": {
21085
+ "application/json": {
21086
+ "schema": {
21087
+ "type": "object",
21088
+ "properties": {
21089
+ "region_pin": {
21090
+ "type": [
21091
+ "string",
21092
+ "null"
21093
+ ],
21094
+ "enum": [
21095
+ "us",
21096
+ "eu",
21097
+ null
21098
+ ],
21099
+ "description": "Hard residency constraint. A deployment in any other region is rejected, including globally-routed ones."
21100
+ },
21101
+ "allowed_providers": {
21102
+ "type": [
21103
+ "array",
21104
+ "null"
21105
+ ],
21106
+ "items": {
21107
+ "type": "string",
21108
+ "enum": [
21109
+ "anthropic",
21110
+ "bedrock",
21111
+ "foundry",
21112
+ "openai",
21113
+ "azure-openai",
21114
+ "google",
21115
+ "mistral",
21116
+ "local"
21117
+ ]
21118
+ },
21119
+ "description": "Providers permitted to process this workspace's data. Null or omitted means every provider the platform permits."
21120
+ },
21121
+ "denied_models": {
21122
+ "type": [
21123
+ "array",
21124
+ "null"
21125
+ ],
21126
+ "items": {
21127
+ "type": "string"
21128
+ },
21129
+ "description": "Models this workspace may never be routed to, whatever else permits them. Applies to explicit requests and every fallback chain step alike."
21130
+ },
21131
+ "model_substitutions": {
21132
+ "type": "object",
21133
+ "additionalProperties": {
21134
+ "type": "string"
21135
+ },
21136
+ "description": "Remap one model onto another wherever the first would be chosen."
21137
+ },
21138
+ "default_models": {
21139
+ "type": "object",
21140
+ "description": "Preferred model per speed tier where no class governs the call. Keys are fast, default, powerful."
21141
+ },
21142
+ "max_attempts": {
21143
+ "type": "integer",
21144
+ "minimum": 1,
21145
+ "maximum": 8,
21146
+ "description": "Ceiling on provider attempts for one logical call."
21147
+ },
21148
+ "model_classes": {
21149
+ "type": "object",
21150
+ "description": "Named model lineage overrides. Values are camelCase: { description, chain: [{ model, deployments: [{ provider, region }] }], requiredCapabilities, fallback: chain | primary_only }."
21151
+ },
21152
+ "operation_classes": {
21153
+ "type": "object",
21154
+ "additionalProperties": {
21155
+ "type": [
21156
+ "string",
21157
+ "null"
21158
+ ]
21159
+ },
21160
+ "description": "Per-operation class overrides, keyed by operation type."
21161
+ },
21162
+ "features": {
21163
+ "type": "object",
21164
+ "additionalProperties": {
21165
+ "type": "boolean"
21166
+ },
21167
+ "description": "Feature toggles, camelCase keys. Absent toggles stay on."
21168
+ },
21169
+ "status": {
21170
+ "type": "string",
21171
+ "enum": [
21172
+ "draft",
21173
+ "shadow",
21174
+ "active"
21175
+ ],
21176
+ "default": "active",
21177
+ "description": "Lifecycle state to save under. Only active is enforced at runtime."
21178
+ },
21179
+ "change_reason": {
21180
+ "type": "string",
21181
+ "maxLength": 200,
21182
+ "description": "Why this change is being made. Recorded on the stored version."
21183
+ }
21184
+ }
21185
+ },
21186
+ "example": {
21187
+ "region_pin": "eu",
21188
+ "allowed_providers": [
21189
+ "bedrock"
21190
+ ],
21191
+ "denied_models": [
21192
+ "claude-opus"
21193
+ ],
21194
+ "operation_classes": {
21195
+ "extraction": "complex"
21196
+ },
21197
+ "change_reason": "Contractual EU residency"
21198
+ }
21199
+ }
21200
+ }
21201
+ },
21202
+ "responses": {
21203
+ "200": {
21204
+ "description": "The saved version plus the resulting effective policy view (the GET response body).",
21205
+ "content": {
21206
+ "application/json": {
21207
+ "example": {
21208
+ "saved": {
21209
+ "version": 7,
21210
+ "status": "active"
21211
+ },
21212
+ "policy": {
21213
+ "version": 7,
21214
+ "status": "active",
21215
+ "region_pin": "eu",
21216
+ "allowed_providers": [
21217
+ "bedrock"
21218
+ ],
21219
+ "denied_models": [
21220
+ "claude-opus"
21221
+ ],
21222
+ "model_substitutions": null,
21223
+ "default_models": null,
21224
+ "max_attempts": null,
21225
+ "model_classes": null,
21226
+ "operation_classes": {
21227
+ "extraction": "complex"
21228
+ },
21229
+ "features": null
21230
+ },
21231
+ "inherited": false,
21232
+ "constraints": {
21233
+ "region_pin": "eu",
21234
+ "allowed_providers": [
21235
+ "bedrock"
21236
+ ],
21237
+ "denied_models": [
21238
+ "claude-opus"
21239
+ ],
21240
+ "platform_provider_floor": [
21241
+ "bedrock"
21242
+ ]
21243
+ },
21244
+ "operation_classes": {
21245
+ "extraction": {
21246
+ "class": "complex",
21247
+ "source": "org",
21248
+ "overridden": true
21249
+ }
21250
+ },
21251
+ "status": {
21252
+ "satisfiable": true,
21253
+ "unroutable_operations": [],
21254
+ "advisory_warnings": [
21255
+ "document_ocr"
21256
+ ]
21257
+ }
21258
+ }
21259
+ }
21260
+ }
21261
+ },
21262
+ "400": {
21263
+ "description": "The policy was refused and nothing was stored.",
21264
+ "content": {
21265
+ "application/json": {
21266
+ "examples": {
21267
+ "policy_unsatisfiable": {
21268
+ "summary": "Activation would strand registered operations",
21269
+ "value": {
21270
+ "error": "policy_unsatisfiable",
21271
+ "message": "This policy leaves 2 operations with no compliant route: extraction, classification. Widen the allowed providers, the region pin, or the denied models, then submit again.",
21272
+ "unroutable_operations": [
21273
+ "extraction",
21274
+ "classification"
21275
+ ],
21276
+ "advisory_warnings": [
21277
+ "document_ocr"
21278
+ ]
21279
+ }
21280
+ },
21281
+ "invalid_policy": {
21282
+ "summary": "The policy shape or a referenced model is invalid",
21283
+ "value": {
21284
+ "error": "invalid_policy",
21285
+ "message": "denied model 'not-a-real-model' is not in the catalog"
21286
+ }
21287
+ },
21288
+ "workspace_scope_required": {
21289
+ "summary": "The key is not scoped to a single workspace",
21290
+ "value": {
21291
+ "error": "workspace_scope_required",
21292
+ "message": "A workspace-scoped API key is required to read or change AI policy."
21293
+ }
21294
+ }
21295
+ }
21296
+ }
21297
+ }
21298
+ },
21299
+ "401": {
21300
+ "$ref": "#/components/responses/Unauthorized"
21301
+ },
21302
+ "403": {
21303
+ "$ref": "#/components/responses/Forbidden"
21304
+ },
21305
+ "429": {
21306
+ "$ref": "#/components/responses/RateLimitExceeded"
21307
+ }
21308
+ }
21309
+ },
21310
+ "patch": {
21311
+ "operationId": "patchAiPolicy",
21312
+ "summary": "Update part of the AI policy",
21313
+ "tags": [
21314
+ "AI Policy"
21315
+ ],
21316
+ "description": "Partial update. Omitted fields keep their current value, and inside the\noverride maps (`model_substitutions`, `default_models`,\n`model_classes`, `operation_classes`, `features`) omitted keys survive\ntoo. Sending `null` as a map value removes that single override and\nrestores the platform default for it.\n\n`status` defaults to the policy's current status (or `active` when\nnone is stored), so patching an active policy keeps it active and the\nsatisfiability gate binds exactly as it does on PUT. The same camelCase\nrule applies to values inside `model_classes` and to `features` keys.\n",
21317
+ "requestBody": {
21318
+ "required": true,
21319
+ "content": {
21320
+ "application/json": {
21321
+ "schema": {
21322
+ "type": "object",
21323
+ "description": "Same fields as PUT /v1/ai/policy; every field optional, omissions preserved."
21324
+ },
21325
+ "example": {
21326
+ "denied_models": [
21327
+ "claude-opus"
21328
+ ],
21329
+ "operation_classes": {
21330
+ "extraction": null
21331
+ },
21332
+ "change_reason": "Remove the extraction override, deny one model"
21333
+ }
21334
+ }
21335
+ }
21336
+ },
21337
+ "responses": {
21338
+ "200": {
21339
+ "description": "The saved version plus the resulting effective policy view (the GET response body).",
21340
+ "content": {
21341
+ "application/json": {
21342
+ "example": {
21343
+ "saved": {
21344
+ "version": 8,
21345
+ "status": "active"
21346
+ },
21347
+ "policy": {
21348
+ "version": 8,
21349
+ "status": "active",
21350
+ "region_pin": "eu",
21351
+ "allowed_providers": [
21352
+ "bedrock"
21353
+ ],
21354
+ "denied_models": [
21355
+ "claude-opus"
21356
+ ],
21357
+ "model_substitutions": null,
21358
+ "default_models": null,
21359
+ "max_attempts": null,
21360
+ "model_classes": null,
21361
+ "operation_classes": null,
21362
+ "features": null
21363
+ },
21364
+ "inherited": false,
21365
+ "constraints": {
21366
+ "region_pin": "eu",
21367
+ "allowed_providers": [
21368
+ "bedrock"
21369
+ ],
21370
+ "denied_models": [
21371
+ "claude-opus"
21372
+ ],
21373
+ "platform_provider_floor": [
21374
+ "bedrock"
21375
+ ]
21376
+ },
21377
+ "operation_classes": {
21378
+ "extraction": {
21379
+ "class": "standard",
21380
+ "source": "builtin",
21381
+ "overridden": false
21382
+ }
21383
+ },
21384
+ "status": {
21385
+ "satisfiable": true,
21386
+ "unroutable_operations": [],
21387
+ "advisory_warnings": []
21388
+ }
21389
+ }
21390
+ }
21391
+ }
21392
+ },
21393
+ "400": {
21394
+ "description": "The policy was refused and nothing was stored. Same error contract as PUT.",
21395
+ "content": {
21396
+ "application/json": {
21397
+ "example": {
21398
+ "error": "policy_unsatisfiable",
21399
+ "message": "This policy leaves 1 operation with no compliant route: extraction. Widen the allowed providers, the region pin, or the denied models, then submit again.",
21400
+ "unroutable_operations": [
21401
+ "extraction"
21402
+ ],
21403
+ "advisory_warnings": []
21404
+ }
21405
+ }
21406
+ }
21407
+ },
21408
+ "401": {
21409
+ "$ref": "#/components/responses/Unauthorized"
21410
+ },
21411
+ "403": {
21412
+ "$ref": "#/components/responses/Forbidden"
21413
+ },
21414
+ "429": {
21415
+ "$ref": "#/components/responses/RateLimitExceeded"
21416
+ }
21417
+ }
21418
+ }
21419
+ },
21420
+ "/v1/ai/models": {
21421
+ "get": {
21422
+ "operationId": "listAiModels",
21423
+ "summary": "List models and model classes with reachability",
21424
+ "tags": [
21425
+ "AI Policy"
21426
+ ],
21427
+ "description": "Every model and model class the platform knows, annotated with\nprovider, region, and why each is or is not reachable for this\nworkspace under the live policy. This is the answer to \"which models\ncan touch our data\", derived from the policy rather than from\ndocumentation that can drift away from it.\n\n`reason` is one of `allowed`, `model_denied`, `provider_floor`,\n`provider_not_allowed`, `region_not_permitted`. A class's `source` is\n`builtin`, `platform`, or `org`. A deployment with\n`custom_endpoint: true` is a self-hosted or customer-operated\ninference endpoint declared at deployment level; no host and no\ncredential detail is ever returned.\n",
21428
+ "responses": {
21429
+ "200": {
21430
+ "description": "The annotated model catalog, class definitions, enforced constraints, and reachability counts.",
21431
+ "content": {
21432
+ "application/json": {
21433
+ "example": {
21434
+ "models": [
21435
+ {
21436
+ "model": "claude-sonnet",
21437
+ "tier": "default",
21438
+ "capabilities": [
21439
+ "generate",
21440
+ "tool_use"
21441
+ ],
21442
+ "reachable": true,
21443
+ "reason": "allowed",
21444
+ "deployments": [
21445
+ {
21446
+ "provider": "bedrock",
21447
+ "region": "eu",
21448
+ "custom_endpoint": false,
21449
+ "reachable": true,
21450
+ "reason": "allowed"
21451
+ }
21452
+ ]
21453
+ },
21454
+ {
21455
+ "model": "claude-opus",
21456
+ "tier": "powerful",
21457
+ "capabilities": [
21458
+ "generate",
21459
+ "tool_use"
21460
+ ],
21461
+ "reachable": false,
21462
+ "reason": "model_denied",
21463
+ "deployments": [
21464
+ {
21465
+ "provider": "bedrock",
21466
+ "region": "eu",
21467
+ "custom_endpoint": false,
21468
+ "reachable": false,
21469
+ "reason": "model_denied"
21470
+ }
21471
+ ]
21472
+ }
21473
+ ],
21474
+ "classes": [
21475
+ {
21476
+ "name": "standard",
21477
+ "description": "General-purpose extraction lineage",
21478
+ "source": "builtin",
21479
+ "required_capabilities": [],
21480
+ "fallback": "chain",
21481
+ "chain": [
21482
+ {
21483
+ "model": "claude-sonnet",
21484
+ "reachable": true,
21485
+ "reason": "allowed"
21486
+ }
21487
+ ],
21488
+ "reachable": true
21489
+ }
21490
+ ],
21491
+ "constraints": {
21492
+ "region_pin": "eu",
21493
+ "allowed_providers": [
21494
+ "bedrock"
21495
+ ],
21496
+ "denied_models": [
21497
+ "claude-opus"
21498
+ ],
21499
+ "platform_provider_floor": [
21500
+ "bedrock"
21501
+ ]
21502
+ },
21503
+ "counts": {
21504
+ "total": 18,
21505
+ "reachable": 9
21506
+ }
21507
+ }
21508
+ }
21509
+ }
21510
+ },
21511
+ "400": {
21512
+ "description": "The API key is not scoped to a single workspace.",
21513
+ "content": {
21514
+ "application/json": {
21515
+ "example": {
21516
+ "error": "workspace_scope_required",
21517
+ "message": "A workspace-scoped API key is required to read or change AI policy."
21518
+ }
21519
+ }
21520
+ }
19788
21521
  },
19789
21522
  "401": {
19790
21523
  "$ref": "#/components/responses/Unauthorized"
19791
21524
  },
19792
- "413": {
19793
- "$ref": "#/components/responses/PayloadTooLarge"
21525
+ "429": {
21526
+ "$ref": "#/components/responses/RateLimitExceeded"
19794
21527
  }
19795
21528
  }
19796
21529
  }
19797
21530
  },
19798
- "/v1/billing/settings": {
21531
+ "/v1/ai/operations": {
19799
21532
  "get": {
21533
+ "operationId": "listAiOperations",
21534
+ "summary": "List the operation catalog",
19800
21535
  "tags": [
19801
- "Billing"
19802
- ],
19803
- "summary": "Get billing (auto top-up) settings",
19804
- "operationId": "getBillingSettings",
19805
- "security": [
19806
- {
19807
- "BearerAuth": []
19808
- }
21536
+ "AI Policy"
19809
21537
  ],
21538
+ "description": "Every operation type the platform runs, the model class it resolves to\nfor this workspace, whether the workspace overrode it, how it gates\npolicy activation, and whether it currently has a compliant route.\n\n`gating` separates operations: `registered` operations block a policy\nfrom activating when they lose their route, `advisory` operations only\nwarn, and `none` operations are not swept at all (`routable` is null\nfor them rather than implying a check that never ran). This\ndistinction is why a region pin can leave document OCR unroutable\nwithout blocking the rest of the workspace.\n",
19810
21539
  "responses": {
19811
21540
  "200": {
19812
- "description": "Auto-topup configuration"
21541
+ "description": "The operation catalog with per-operation class, gating, and routability.",
21542
+ "content": {
21543
+ "application/json": {
21544
+ "example": {
21545
+ "operations": [
21546
+ {
21547
+ "operation_type": "extraction",
21548
+ "class": "standard",
21549
+ "source": "builtin",
21550
+ "overridden": false,
21551
+ "gating": "registered",
21552
+ "routable": true
21553
+ },
21554
+ {
21555
+ "operation_type": "document_ocr",
21556
+ "class": "ocr",
21557
+ "source": "builtin",
21558
+ "overridden": false,
21559
+ "gating": "advisory",
21560
+ "routable": false,
21561
+ "reason": "no_compliant_route"
21562
+ }
21563
+ ],
21564
+ "counts": {
21565
+ "total": 60,
21566
+ "overridden": 1,
21567
+ "registered": 8,
21568
+ "advisory": 1
21569
+ }
21570
+ }
21571
+ }
21572
+ }
21573
+ },
21574
+ "400": {
21575
+ "description": "The API key is not scoped to a single workspace.",
21576
+ "content": {
21577
+ "application/json": {
21578
+ "example": {
21579
+ "error": "workspace_scope_required",
21580
+ "message": "A workspace-scoped API key is required to read or change AI policy."
21581
+ }
21582
+ }
21583
+ }
21584
+ },
21585
+ "401": {
21586
+ "$ref": "#/components/responses/Unauthorized"
21587
+ },
21588
+ "429": {
21589
+ "$ref": "#/components/responses/RateLimitExceeded"
19813
21590
  }
19814
21591
  }
19815
- },
19816
- "patch": {
21592
+ }
21593
+ },
21594
+ "/v1/ai/routes:explain": {
21595
+ "post": {
21596
+ "operationId": "explainAiRoute",
21597
+ "summary": "Dry-run a routing decision",
19817
21598
  "tags": [
19818
- "Billing"
19819
- ],
19820
- "summary": "Update billing (auto top-up) settings",
19821
- "operationId": "updateBillingSettings",
19822
- "security": [
19823
- {
19824
- "BearerAuth": []
19825
- }
21599
+ "AI Policy"
19826
21600
  ],
21601
+ "description": "Answer \"what would this operation route to right now\" without spending\na model call. The question runs through the same resolver that serves\nlive traffic, so the answer is evidence rather than a forecast: the\nordered candidate chain that would serve the operation, and every\ncandidate the policy discarded with the constraint that discarded it.\n\nWhen the policy permits no route, the response is still 201 with\n`routable: false` and a plain-language explanation. A policy that\npermits no route is a valid configuration whose consequence is that\nthe live call fails closed rather than reaching a provider the policy\nforbids.\n\n`model` pins a specific logical model instead of letting the\noperation's class choose; `class` pins a specific model class. Both\nare optional.\n",
19827
21602
  "requestBody": {
19828
21603
  "required": true,
19829
21604
  "content": {
19830
21605
  "application/json": {
19831
21606
  "schema": {
19832
21607
  "type": "object",
21608
+ "required": [
21609
+ "operation_type"
21610
+ ],
19833
21611
  "properties": {
19834
- "auto_topup_enabled": {
19835
- "type": "boolean"
21612
+ "operation_type": {
21613
+ "type": "string",
21614
+ "maxLength": 120,
21615
+ "description": "The operation to route, for example extraction or classification."
19836
21616
  },
19837
- "auto_topup_threshold": {
19838
- "type": "integer",
19839
- "minimum": 1000
21617
+ "model": {
21618
+ "type": "string",
21619
+ "maxLength": 120,
21620
+ "description": "Optional. Pin a specific logical model."
19840
21621
  },
19841
- "auto_topup_amount": {
19842
- "type": "integer",
19843
- "minimum": 1000
21622
+ "class": {
21623
+ "type": "string",
21624
+ "maxLength": 120,
21625
+ "description": "Optional. Pin a specific model class."
19844
21626
  }
19845
21627
  }
21628
+ },
21629
+ "example": {
21630
+ "operation_type": "extraction",
21631
+ "model": "claude-sonnet",
21632
+ "class": "standard"
19846
21633
  }
19847
21634
  }
19848
21635
  }
19849
21636
  },
19850
21637
  "responses": {
19851
- "200": {
19852
- "description": "Updated settings"
21638
+ "201": {
21639
+ "description": "The routing plan, or a fail-closed explanation when nothing is routable.",
21640
+ "content": {
21641
+ "application/json": {
21642
+ "examples": {
21643
+ "routable": {
21644
+ "summary": "An ordered candidate chain exists",
21645
+ "value": {
21646
+ "operation_type": "extraction",
21647
+ "routable": true,
21648
+ "class": "standard",
21649
+ "fallback_scope": "class_chain",
21650
+ "candidates": [
21651
+ {
21652
+ "model": "claude-sonnet",
21653
+ "provider": "bedrock",
21654
+ "region": "eu",
21655
+ "custom_endpoint": false
21656
+ }
21657
+ ],
21658
+ "rejected": [
21659
+ {
21660
+ "model": "gpt-balanced",
21661
+ "provider": "openai",
21662
+ "region": "global",
21663
+ "reason": "provider_not_allowed"
21664
+ }
21665
+ ]
21666
+ }
21667
+ },
21668
+ "fail_closed": {
21669
+ "summary": "The policy permits no route for this operation",
21670
+ "value": {
21671
+ "operation_type": "document_ocr",
21672
+ "routable": false,
21673
+ "reason": "no_compliant_route",
21674
+ "message": "No route satisfies this workspace policy for this operation, so the call fails closed rather than reaching a provider the policy does not permit.",
21675
+ "candidates": [],
21676
+ "rejected": [
21677
+ {
21678
+ "model": "mistral-ocr",
21679
+ "provider": "mistral",
21680
+ "region": "global",
21681
+ "reason": "provider_not_allowed"
21682
+ }
21683
+ ]
21684
+ }
21685
+ }
21686
+ }
21687
+ }
21688
+ }
21689
+ },
21690
+ "400": {
21691
+ "description": "The request body is invalid or the key is not workspace-scoped.",
21692
+ "content": {
21693
+ "application/json": {
21694
+ "example": {
21695
+ "error": "workspace_scope_required",
21696
+ "message": "A workspace-scoped API key is required to read or change AI policy."
21697
+ }
21698
+ }
21699
+ }
21700
+ },
21701
+ "401": {
21702
+ "$ref": "#/components/responses/Unauthorized"
21703
+ },
21704
+ "429": {
21705
+ "$ref": "#/components/responses/RateLimitExceeded"
19853
21706
  }
19854
21707
  }
19855
21708
  }
19856
21709
  },
19857
- "/v1/billing/topup": {
19858
- "post": {
21710
+ "/v1/ai/policy/history": {
21711
+ "get": {
21712
+ "operationId": "getAiPolicyHistory",
21713
+ "summary": "Get the policy version history",
19859
21714
  "tags": [
19860
- "Billing"
21715
+ "AI Policy"
19861
21716
  ],
19862
- "summary": "Trigger an auto top-up now",
19863
- "description": "Charges a top-up if auto top-up is enabled. Requires the billing scope.",
19864
- "operationId": "triggerBillingTopup",
19865
- "security": [
21717
+ "description": "Version history of the caller's own policy, newest first, each version\ncarrying its lifecycle status, the fields it changed relative to the\nprevious version, its attribution (`changed_by`, `change_reason`,\n`changed_at`, each nullable: null means the store did not record it,\nnot that nothing changed), and the full stored policy.\n\nOnly versions this workspace stored appear. A workspace running on the\ninherited platform default has no versions of its own and reads as an\nempty list, which is the honest answer to \"what have we changed\".\n",
21718
+ "parameters": [
19866
21719
  {
19867
- "BearerAuth": []
21720
+ "name": "limit",
21721
+ "in": "query",
21722
+ "schema": {
21723
+ "type": "integer",
21724
+ "minimum": 1,
21725
+ "maximum": 200,
21726
+ "default": 50
21727
+ },
21728
+ "description": "Maximum number of versions to return (1-200)."
19868
21729
  }
19869
21730
  ],
19870
21731
  "responses": {
19871
21732
  "200": {
19872
- "description": "{ topped_up, ... }"
21733
+ "description": "Stored policy versions, newest first.",
21734
+ "content": {
21735
+ "application/json": {
21736
+ "example": {
21737
+ "versions": [
21738
+ {
21739
+ "version": 2,
21740
+ "status": "active",
21741
+ "changed": [
21742
+ "region_pin",
21743
+ "denied_models"
21744
+ ],
21745
+ "changed_by": "api_key:c1a2b3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
21746
+ "change_reason": "Contractual EU residency",
21747
+ "changed_at": "2026-07-28T14:02:11.000Z",
21748
+ "policy": {
21749
+ "version": 2,
21750
+ "status": "active",
21751
+ "region_pin": "eu",
21752
+ "allowed_providers": [
21753
+ "bedrock"
21754
+ ],
21755
+ "denied_models": [
21756
+ "claude-opus"
21757
+ ],
21758
+ "model_substitutions": null,
21759
+ "default_models": null,
21760
+ "max_attempts": null,
21761
+ "model_classes": null,
21762
+ "operation_classes": null,
21763
+ "features": null
21764
+ }
21765
+ },
21766
+ {
21767
+ "version": 1,
21768
+ "status": "active",
21769
+ "changed": [
21770
+ "allowed_providers"
21771
+ ],
21772
+ "changed_by": null,
21773
+ "change_reason": null,
21774
+ "changed_at": null,
21775
+ "policy": {
21776
+ "version": 1,
21777
+ "status": "active",
21778
+ "region_pin": null,
21779
+ "allowed_providers": [
21780
+ "bedrock"
21781
+ ],
21782
+ "denied_models": null,
21783
+ "model_substitutions": null,
21784
+ "default_models": null,
21785
+ "max_attempts": null,
21786
+ "model_classes": null,
21787
+ "operation_classes": null,
21788
+ "features": null
21789
+ }
21790
+ }
21791
+ ],
21792
+ "total": 2,
21793
+ "limit": 50
21794
+ }
21795
+ }
21796
+ }
19873
21797
  },
19874
- "403": {
19875
- "description": "auto_topup_disabled"
21798
+ "400": {
21799
+ "description": "The API key is not scoped to a single workspace.",
21800
+ "content": {
21801
+ "application/json": {
21802
+ "example": {
21803
+ "error": "workspace_scope_required",
21804
+ "message": "A workspace-scoped API key is required to read or change AI policy."
21805
+ }
21806
+ }
21807
+ }
21808
+ },
21809
+ "401": {
21810
+ "$ref": "#/components/responses/Unauthorized"
21811
+ },
21812
+ "429": {
21813
+ "$ref": "#/components/responses/RateLimitExceeded"
19876
21814
  }
19877
21815
  }
19878
21816
  }
@@ -19885,6 +21823,12 @@
19885
21823
  "scheme": "bearer",
19886
21824
  "bearerFormat": "tlnc_*",
19887
21825
  "description": "API key with `tlnc_` prefix. Pass as `Authorization: Bearer tlnc_live_...`.\n"
21826
+ },
21827
+ "OAuthBearerAuth": {
21828
+ "type": "http",
21829
+ "scheme": "bearer",
21830
+ "bearerFormat": "JWT",
21831
+ "description": "OAuth 2.1 access token (JWT) from the connector OAuth flow. Routes\nthat declare this scheme reject `tlnc_` API keys with `401`.\n"
19888
21832
  }
19889
21833
  },
19890
21834
  "parameters": {
@@ -20936,6 +22880,11 @@
20936
22880
  "error"
20937
22881
  ]
20938
22882
  },
22883
+ "error": {
22884
+ "type": "string",
22885
+ "description": "Human-readable failure message. Present ONLY when status is `error`; omitted otherwise.\n",
22886
+ "example": "Extraction failed"
22887
+ },
20939
22888
  "source": {
20940
22889
  "type": "object",
20941
22890
  "properties": {
@@ -20953,6 +22902,89 @@
20953
22902
  }
20954
22903
  }
20955
22904
  },
22905
+ "field_count": {
22906
+ "type": "integer",
22907
+ "description": "Number of fields captured from the document. 0 until extraction completes.",
22908
+ "example": 42
22909
+ },
22910
+ "triage": {
22911
+ "type": [
22912
+ "object",
22913
+ "null"
22914
+ ],
22915
+ "description": "Compliance triage signals for the document. `null` until triage has run.\n",
22916
+ "properties": {
22917
+ "sensitivity": {
22918
+ "type": [
22919
+ "string",
22920
+ "null"
22921
+ ],
22922
+ "enum": [
22923
+ "public",
22924
+ "internal",
22925
+ "restricted",
22926
+ null
22927
+ ],
22928
+ "description": "Sensitivity tier.",
22929
+ "example": "internal"
22930
+ },
22931
+ "department": {
22932
+ "type": [
22933
+ "string",
22934
+ "null"
22935
+ ],
22936
+ "example": "finance"
22937
+ },
22938
+ "jurisdiction": {
22939
+ "type": [
22940
+ "string",
22941
+ "null"
22942
+ ],
22943
+ "description": "Two-letter country code.",
22944
+ "example": "DE"
22945
+ },
22946
+ "pii_detected": {
22947
+ "type": "boolean",
22948
+ "description": "True when at least one PII category was detected.",
22949
+ "example": true
22950
+ },
22951
+ "pii_categories": {
22952
+ "type": [
22953
+ "array",
22954
+ "null"
22955
+ ],
22956
+ "items": {
22957
+ "type": "string"
22958
+ },
22959
+ "description": "Detected PII categories. `null` until the compliance pass has run.",
22960
+ "example": [
22961
+ "name",
22962
+ "email"
22963
+ ]
22964
+ },
22965
+ "regulated_data": {
22966
+ "type": "boolean",
22967
+ "description": "Whether the document likely contains regulated data.",
22968
+ "example": false
22969
+ },
22970
+ "confidentiality_marking": {
22971
+ "type": [
22972
+ "string",
22973
+ "null"
22974
+ ],
22975
+ "description": "Confidentiality marking found in the document, if any.",
22976
+ "example": "Vertraulich"
22977
+ }
22978
+ }
22979
+ },
22980
+ "original_path": {
22981
+ "type": [
22982
+ "string",
22983
+ "null"
22984
+ ],
22985
+ "description": "Folder path of the file at its source, when ingested from a connector.",
22986
+ "example": "/invoices/2026/04"
22987
+ },
20956
22988
  "batch_id": {
20957
22989
  "type": "string",
20958
22990
  "description": "Caller grouping key supplied at ingest (batch_id). Present ONLY when the document was tagged; omitted otherwise (backwards-compatible).\n",
@@ -20986,6 +23018,43 @@
20986
23018
  "format": "uuid",
20987
23019
  "example": "d1a2b3c4-5678-9abc-def0-1234567890ab"
20988
23020
  },
23021
+ "processing_log": {
23022
+ "type": "array",
23023
+ "description": "Per-stage pipeline timing log (OCR, classify, extract). Present ONLY when at least one stage has been recorded; omitted otherwise.\n",
23024
+ "items": {
23025
+ "type": "object",
23026
+ "required": [
23027
+ "step",
23028
+ "status",
23029
+ "started_at"
23030
+ ],
23031
+ "properties": {
23032
+ "step": {
23033
+ "type": "string",
23034
+ "example": "ocr"
23035
+ },
23036
+ "status": {
23037
+ "type": "string",
23038
+ "example": "completed"
23039
+ },
23040
+ "started_at": {
23041
+ "type": "string",
23042
+ "format": "date-time"
23043
+ },
23044
+ "completed_at": {
23045
+ "type": "string",
23046
+ "format": "date-time"
23047
+ },
23048
+ "duration_ms": {
23049
+ "type": "integer",
23050
+ "example": 3120
23051
+ },
23052
+ "detail": {
23053
+ "type": "string"
23054
+ }
23055
+ }
23056
+ }
23057
+ },
20989
23058
  "created_at": {
20990
23059
  "type": "string",
20991
23060
  "format": "date-time",
@@ -21000,6 +23069,12 @@
21000
23069
  "extractions": {
21001
23070
  "type": "string"
21002
23071
  },
23072
+ "fields": {
23073
+ "type": "string"
23074
+ },
23075
+ "lineage": {
23076
+ "type": "string"
23077
+ },
21003
23078
  "dashboard": {
21004
23079
  "type": "string",
21005
23080
  "format": "uri"