@talonic/docs 0.21.83 → 0.21.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/seo.js CHANGED
@@ -11,6 +11,10 @@ var generated_nav_default = {
11
11
  id: "ref-schemas",
12
12
  label: "Schemas"
13
13
  },
14
+ {
15
+ id: "ref-jobs-and-batches",
16
+ label: "Jobs & Batches"
17
+ },
14
18
  {
15
19
  id: "ref-sources",
16
20
  label: "Sources"
@@ -59,6 +63,10 @@ var generated_nav_default = {
59
63
  id: "ref-apps",
60
64
  label: "Apps"
61
65
  },
66
+ {
67
+ id: "ref-provenance",
68
+ label: "Provenance"
69
+ },
62
70
  {
63
71
  id: "ref-compliance",
64
72
  label: "Compliance"
@@ -114,6 +122,10 @@ var generated_nav_default = {
114
122
  {
115
123
  id: "ref-suggestions",
116
124
  label: "Suggestions"
125
+ },
126
+ {
127
+ id: "ref-access-and-sharing",
128
+ label: "Access & sharing"
117
129
  }
118
130
  ]
119
131
  };
@@ -124,7 +136,7 @@ var openapi_default = {
124
136
  info: {
125
137
  title: "Talonic API",
126
138
  version: "1.1.0",
127
- description: 'Structure any document into schema-validated data.\n\nThe Talonic API lets you extract structured data from documents (PDFs, images,\nDOCX, CSV, plain text), manage reusable extraction schemas, track async jobs,\nand organise documents through sources.\n\n## Quick Start\n\n**1. Get your API key**\n\nSign up at [app.talonic.com](https://app.talonic.com) \u2192 Settings \u2192 API Keys \u2192 Create key.\nKeys start with `tlnc_`. All examples below use `tlnc_live_abc123` as a placeholder.\n\n**2. Extract your first document**\n\n```bash\ncurl -X POST https://api.talonic.com/v1/extract \\\n -H "Authorization: Bearer tlnc_live_abc123" \\\n -F "file=@invoice.pdf" \\\n -F \'schema={"properties":{"vendor_name":{"type":"string"},"total_amount":{"type":"number"},"invoice_date":{"type":"string"}}}\'\n```\n\n**Python:**\n```python\nimport requests\nresp = requests.post("https://api.talonic.com/v1/extract",\n headers={"Authorization": "Bearer tlnc_live_abc123"},\n files={"file": open("invoice.pdf", "rb")},\n data={"schema": \'{"properties":{"vendor_name":{"type":"string"},"total_amount":{"type":"number"},"invoice_date":{"type":"string"}}}\'})\nprint(resp.json()["data"])\n```\n\n**TypeScript:**\n```typescript\nconst form = new FormData();\nform.append("file", fs.createReadStream("invoice.pdf"));\nform.append("schema", \'{"properties":{"vendor_name":{"type":"string"},"total_amount":{"type":"number"},"invoice_date":{"type":"string"}}}\');\nconst res = await fetch("https://api.talonic.com/v1/extract", {\n method: "POST",\n headers: { Authorization: "Bearer tlnc_live_abc123" },\n body: form,\n}).then(r => r.json());\nconsole.log(res.data);\n```\n\n**3. What you get back**\n\n```json\n{\n "extraction_id": "d1a2b3c4-5678-9abc-def0-1234567890ab",\n "request_id": "req_x7y8z9a0b1c2d3e4",\n "status": "complete",\n "document": {\n "id": "f0e1d2c3-b4a5-9687-8765-432109876543",\n "filename": "invoice.pdf",\n "pages": 2,\n "size_bytes": 184320,\n "type_detected": "Invoice",\n "language_detected": "en"\n },\n "data": {\n "vendor_name": "Acme GmbH",\n "total_amount": 14250.00,\n "invoice_date": "2025-03-15"\n },\n "confidence": {\n "overall": 0.96,\n "fields": {\n "vendor_name": 0.97,\n "total_amount": 0.94,\n "invoice_date": 0.99\n }\n },\n "processing": {\n "duration_ms": 1840,\n "pages_processed": 2,\n "region": "eu-west"\n },\n "links": {\n "self": "/v1/extractions/d1a2b3c4-5678-9abc-def0-1234567890ab",\n "document": "/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543"\n }\n}\n```\n\n- **`data`** \u2014 extracted fields as key-value pairs matching your schema.\n- **`confidence.fields`** \u2014 per-field score from 0 to 1. Above 0.9 is high confidence; below 0.7 flags for review.\n- **`extraction_id`** \u2014 use this to retrieve, correct, or deliver results later.\n- Full response schema: [ExtractSyncResponse](#/components/schemas/ExtractSyncResponse)\n\n**4. Next steps**\n\n- **50+ pages?** Use async mode \u2014 see [Async Extraction Flow](#section/Async-Extraction-Flow) below.\n- **Reusable schemas** \u2014 save field definitions with `POST /v1/schemas`, then pass `schema_id` on future extractions.\n- **Receive results via webhook** \u2014 configure a delivery destination and listen for `document.extracted` events. See the [Delivery](#tag/Delivery) tag.\n\n---\n\n## Authentication\n\nAll requests require a Bearer token in the `Authorization` header.\nAPI keys are prefixed with `tlnc_` and scoped per customer.\n\n```\nAuthorization: Bearer tlnc_live_abc123...\n```\n\n## Async Extraction Pattern\n\nSmall documents (\u22645 pages) are processed synchronously and return a `200`\nwith the extracted data immediately. Larger documents return a `202 Accepted`\nwith a `poll_url` \u2014 poll `GET /v1/documents/{id}` until `status` transitions\nto `completed`, then fetch results via `GET /v1/documents/{id}/extractions`.\n\nYou can force async processing by passing `options: {"async": true}` on\nany extraction request. Combine with webhooks for a fully event-driven flow:\nconfigure a webhook destination under Delivery and listen for the\n`extraction.complete` event.\n\n**Job status lifecycle:** `pending` \u2192 `processing` \u2192 `complete` | `failed`\n\n## Rate Limits\n\nThe **Free** tier is metered by a recurring **5,000-credit monthly grant**\n(no card required) that refreshes on the 1st of each month (UTC). Free\nrequests run until the monthly credit balance is spent, then return `402`\nuntil the next grant. A generous daily request ceiling is retained purely as\nabuse protection and does not bind a legitimate free user within the monthly\nenvelope. Inspect your balance and reset date via `GET /v1/account`.\n\nPaid tiers are metered per calendar day (UTC):\n\n| Tier | Extract | Platform | Ingest | Operations | Run | Ask |\n|------------|---------|----------|--------|------------|-----|-----|\n| Free | 1,000/day | 2,000/day | 1,000/day | 1,000/day | 1,000/day | 200/day |\n| Pro | 25,000/day | 50,000/day | 25,000/day | 25,000/day | 25,000/day | 5,000/day |\n| Enterprise | Unlimited | Unlimited | Unlimited | Unlimited | Unlimited | Unlimited |\n\nFree workspaces additionally receive 5,000 credits/month; spend is governed\nby credits (402 on exhaustion), with daily ceilings acting as abuse protection.\n\nResponses with a finite limit include rate-limit headers:\n- `X-RateLimit-Limit` \u2014 daily cap for the namespace\n- `X-RateLimit-Remaining` \u2014 requests left today\n- `X-RateLimit-Reset` \u2014 ISO 8601 timestamp when the window resets (midnight UTC)\n\n## Pagination\n\nList endpoints use cursor-based pagination. Pass `limit` (1\u2013100, default 20),\n`cursor` (opaque token from `pagination.next_cursor`), and `order` (`asc` or `desc`, default `desc`).\n\n## Errors\n\nAll errors return a JSON body with `error` (machine-readable code) and `message`\n(human-readable explanation). Additional fields vary by error type.\n\n| Code | Error | Description |\n|------|--------------------|------------------------------------------|\n| 400 | validation_error | Request body is malformed or invalid |\n| 401 | unauthorized | Missing or invalid API key |\n| 403 | insufficient_scope | API key lacks the required scope |\n| 404 | not_found | Resource does not exist |\n| 409 | conflict | Resource state conflict |\n| 413 | payload_too_large | File exceeds 500 MB limit |\n| 422 | extraction_failed | Document could not be processed |\n| 429 | rate_limit_exceeded| Daily rate limit reached |\n| 500 | internal_error | Unexpected server error (retryable) |\n\nEvery error response follows this envelope:\n\n```json\n{\n "statusCode": 400,\n "code": "VALIDATION_ERROR",\n "error": "Bad Request",\n "message": "name is required.",\n "retryable": false,\n "timestamp": "2026-04-25T14:30:00.000Z",\n "path": "/v1/schemas"\n}\n```\n\nThe `code` field is one of: `VALIDATION_ERROR`, `AUTH_REQUIRED`, `TOKEN_EXPIRED`,\n`INSUFFICIENT_PERMISSIONS`, `RESOURCE_NOT_FOUND`, `QUOTA_EXCEEDED`,\n`INSUFFICIENT_CREDITS`, `LLM_RATE_LIMITED`, `LLM_TIMEOUT`, `LLM_UNAVAILABLE`,\n`OCR_FAILED`, `EXTRACTION_FAILED`, `EXTRACTION_TIMEOUT`, `FILE_TOO_LARGE`,\n`DUPLICATE_RESOURCE`, `DATASPACE_RUN_FAILED`, `INTERNAL_ERROR`.\n\n### Refusal reasons\n\nA refusal an integration must branch on also carries `reason`, a stable\ntoken beside `code`. Branch on `reason`, not on `code`, `error` or the\nmessage: `code` says only which HTTP family the refusal belongs to, `error`\nis the HTTP status name on some refusals and a body discriminant on others,\nand messages are prose. The key is present only on refusals; absent means\n"no stable reason, read `message`". Message prefixes (`insufficient_grant:\n\u2026`) are kept for older clients that parse them; where a message carries one it equals `reason`, but not every refusal has a prefix (the Apps-ladder refusals are plain sentences), so branch on `reason`.\n\n| `reason` | Status | What the caller does |\n|---|---|---|\n| `insufficient_grant` | 403 | The app holds no approved grant covering this resource, or the route is not reachable by an app service key at all. Not retryable \u2014 stop and ask the workspace owner to grant it. |\n| `install_pending_approval` | 403 | A newer version of the app awaits owner approval and the install is paused. Poll `GET /v1/apps/{id}/install/status`. |\n| `install_not_ready` | 403 / 409 | The install is not in force (403, no installed binding for this service key) or is parked on an unapproved version / has no bound OAuth client (409). Poll `GET /v1/apps/{id}/install/status`. |\n| `endpoint_not_confirmed` | 400 | The binding would give the install its first subscriptions, or `confirm_subscriptions_endpoint` does not equal the manifest\'s `subscriptions_endpoint`. An owner action \u2014 re-send with the confirmation. |\n| `slot_unbound` | 400 / 409 | A required requirement slot has no binding (400 at install/rebind, 409 when a run resolves an already-installed version). The owner binds the named aliases. |\n| `slot_unknown` | 400 | The request named an alias the manifest declares no slot for. Fix the manifest or the request. |\n| `hosted_manifest_read_only` | 409 | The app\'s manifest is fetched from the vendor\'s URL, so local edits are refused. Edit at the vendor host, then `POST /v1/apps/{id}/refresh`. |\n| `hosted_surface_fixed` | 422 | A hosted app\'s surface URL comes from its manifest and moves only when a new version is approved; drop `surface_url` from the patch. |\n| `manifest_fetch_failed` | 422 | The vendor\'s manifest URL could not be read. `details.violations` carries the fetch reason. Fix it at the vendor host and retry. |\n| `schema_validation_failed` | 422 | A manifest does not validate, on publish or on a hosted fetch. `details.violations` carries `{ pointer, keyword, message }` per failure. |\n| `refresh_failed` | 422 | A hosted refresh did not happen; the failure is recorded on the app and it stays live on its approved version. `details` carries `{ changed, error }`. Fix it at the vendor host. |\n| `insufficient_scope` | 403 | The key or token lacks a required scope. `required_scopes` names the ones that admit. Workspace keys and OAuth clients receive this; an app service key never does, because both scope paths hand an app principal to its grant checks instead. |\n| `unauthenticated` | 403 | The Apps surface saw no authenticated principal. |\n| `workspace_required` | 403 | The Apps surface needs a concrete workspace; a master-view key cannot call it. |\n| `insufficient_tier` | 403 | The caller\'s workspace role (or an OAuth token\'s role claim) ranks below the route\'s tier. `required` names the tier. |\n| `owner_required` | 403 | Grant and OAuth-client management needs a human workspace owner; no machine caller reaches it. |\n| `insufficient_app_grant` | 403 | The API key holds app grants, but none at the level this route needs. `required` names the tier. |\n| `decide_grant_required` | 403 | The decision-task protocol admits only a machine caller holding an explicit `decide` grant on the app. |\n\n## Async Extraction Flow\n\nDocuments \u22645 pages return results synchronously (`200`). Larger documents\n\u2014 or any request with `options: {"async": true}` \u2014 return `202 Accepted`.\n\n**1. Submit extraction:**\n\n```bash\ncurl -X POST https://api.talonic.com/v1/extract \\\n -H "Authorization: Bearer tlnc_live_abc123" \\\n -F "file=@contract.pdf" \\\n -F \'options={"async": true}\'\n```\n\nResponse `202`:\n```json\n{\n "request_id": "req_x7y8z9a0",\n "status": "processing",\n "document": { "id": "f0e1d2c3-b4a5-9687-8765-432109876543" },\n "poll_url": "/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543"\n}\n```\n\n**2. Poll until complete:**\n\n```bash\ncurl https://api.talonic.com/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543 \\\n -H "Authorization: Bearer tlnc_live_abc123"\n```\n\nWhile processing: `{ "status": "processing" }`\nWhen done: `{ "status": "completed" }`\n\n**3. Retrieve results:**\n\n```bash\ncurl https://api.talonic.com/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543/extractions \\\n -H "Authorization: Bearer tlnc_live_abc123"\n```\n\n**Python \u2014 complete async flow with exponential backoff:**\n\n```python\nimport time\nimport requests\n\nAPI_KEY = "tlnc_live_..."\nBASE = "https://api.talonic.com/v1"\nHEADERS = {"Authorization": f"Bearer {API_KEY}"}\n\n# Step 1: Submit async extraction\nresp = requests.post(f"{BASE}/extract",\n headers=HEADERS,\n files={"file": open("contract.pdf", "rb")},\n data={"options": \'{"async": true}\'})\ndoc_id = resp.json()["document"]["id"]\n\n# Step 2: Poll with exponential backoff (2s \u2192 4s \u2192 8s \u2192 16s \u2192 30s cap)\ndelay = 2\nfor _ in range(20):\n time.sleep(delay)\n doc = requests.get(f"{BASE}/documents/{doc_id}", headers=HEADERS).json()\n if doc["status"] == "completed":\n break\n if doc["status"] == "error":\n raise Exception(f"Extraction failed: {doc.get(\'error\')}")\n delay = min(delay * 2, 30)\n\n# Step 3: Retrieve extracted data\nextractions = requests.get(\n f"{BASE}/documents/{doc_id}/extractions", headers=HEADERS).json()\ndata = extractions["data"][0]["data"]\nconfidence = extractions["data"][0]["confidence"]["overall"]\nprint(f"Extracted {len(data)} fields (confidence: {confidence})")\nprint(data)\n# \u2192 {"vendor_name": "Acme Corp", "total_amount": 1250.00, ...}\n```\n\n**TypeScript \u2014 same flow:**\n\n```typescript\nconst API_KEY = "tlnc_live_...";\nconst BASE = "https://api.talonic.com/v1";\nconst headers = { Authorization: `Bearer ${API_KEY}` };\n\n// Step 1: Submit async extraction\nconst form = new FormData();\nform.append("file", fs.createReadStream("contract.pdf"));\nform.append("options", \'{"async": true}\');\nconst { document } = await fetch(`${BASE}/extract`, {\n method: "POST", headers, body: form,\n}).then((r) => r.json());\n\n// Step 2: Poll with exponential backoff\nlet delay = 2000;\nlet doc: any;\nfor (let i = 0; i < 20; i++) {\n await new Promise((r) => setTimeout(r, delay));\n doc = await fetch(`${BASE}/documents/${document.id}`, { headers }).then((r) => r.json());\n if (doc.status === "completed") break;\n if (doc.status === "error") throw new Error(`Extraction failed: ${doc.error}`);\n delay = Math.min(delay * 2, 30_000);\n}\n\n// Step 3: Retrieve extracted data\nconst { data: extractions } = await fetch(\n `${BASE}/documents/${document.id}/extractions`, { headers }\n).then((r) => r.json());\nconsole.log(extractions[0].data);\n// \u2192 { vendor_name: "Acme Corp", total_amount: 1250.00, ... }\n```\n\nRecommended polling: 2s initial, exponential backoff (2\u21924\u21928\u219216\u219230s cap),\ntimeout after 5 minutes.\n\n**Alternative \u2014 Webhooks:** Configure a delivery destination and listen for\n`document.extracted` events. See the Delivery tag.\n\n**Job status state machine:**\n`pending` \u2192 `queued` \u2192 `processing` \u2192 `complete` | `failed`\n\n## Performance\n\n| Document size | Expected latency | Max timeout |\n|---------------|------------------|-------------|\n| 1\u20135 pages | Sync, <3s | 30s |\n| 6\u201350 pages | <30s average | 5 min |\n| 50+ pages | <5 min average | 30 min |\n\n**Uptime SLA:** 99.5% (Build), 99.9% (Scale), custom (Enterprise).\n\n**Max file size:** 500 MB. JSON request bodies (schemas, jobs): 1 MB.\n\n**Idempotency:** Pass `Idempotency-Key` header on POST requests. Keys are\nscoped to your organization (all keys in a workspace share one namespace)\nand at most 64 characters (a longer key is refused with 400\n`invalid_idempotency_key` before any work). Duplicates return the cached\nresponse with `cached: true`.\n',
139
+ description: 'Structure any document into schema-validated data.\n\nThe Talonic API lets you extract structured data from documents (PDFs, images,\nDOCX, CSV, plain text), manage reusable extraction schemas, track async jobs,\nand organise documents through sources.\n\n## Quick Start\n\n**1. Get your API key**\n\nSign up at [app.talonic.com](https://app.talonic.com) \u2192 Settings \u2192 API Keys \u2192 Create key.\nKeys start with `tlnc_`. All examples below use `tlnc_live_abc123` as a placeholder.\n\n**2. Extract your first document**\n\n```bash\ncurl -X POST https://api.talonic.com/v1/extract \\\n -H "Authorization: Bearer tlnc_live_abc123" \\\n -F "file=@invoice.pdf" \\\n -F \'schema={"properties":{"vendor_name":{"type":"string"},"total_amount":{"type":"number"},"invoice_date":{"type":"string"}}}\'\n```\n\n**Python:**\n```python\nimport requests\nresp = requests.post("https://api.talonic.com/v1/extract",\n headers={"Authorization": "Bearer tlnc_live_abc123"},\n files={"file": open("invoice.pdf", "rb")},\n data={"schema": \'{"properties":{"vendor_name":{"type":"string"},"total_amount":{"type":"number"},"invoice_date":{"type":"string"}}}\'})\nprint(resp.json()["data"])\n```\n\n**TypeScript:**\n```typescript\nconst form = new FormData();\nform.append("file", fs.createReadStream("invoice.pdf"));\nform.append("schema", \'{"properties":{"vendor_name":{"type":"string"},"total_amount":{"type":"number"},"invoice_date":{"type":"string"}}}\');\nconst res = await fetch("https://api.talonic.com/v1/extract", {\n method: "POST",\n headers: { Authorization: "Bearer tlnc_live_abc123" },\n body: form,\n}).then(r => r.json());\nconsole.log(res.data);\n```\n\n**3. What you get back**\n\n```json\n{\n "extraction_id": "d1a2b3c4-5678-9abc-def0-1234567890ab",\n "request_id": "req_x7y8z9a0b1c2d3e4",\n "status": "complete",\n "document": {\n "id": "f0e1d2c3-b4a5-9687-8765-432109876543",\n "filename": "invoice.pdf",\n "pages": 2,\n "size_bytes": 184320,\n "type_detected": "Invoice",\n "language_detected": "en"\n },\n "data": {\n "vendor_name": "Acme GmbH",\n "total_amount": 14250.00,\n "invoice_date": "2025-03-15"\n },\n "confidence": {\n "overall": 0.96,\n "fields": {\n "vendor_name": 0.97,\n "total_amount": 0.94,\n "invoice_date": 0.99\n }\n },\n "processing": {\n "duration_ms": 1840,\n "pages_processed": 2,\n "region": "eu-west"\n },\n "links": {\n "self": "/v1/extractions/d1a2b3c4-5678-9abc-def0-1234567890ab",\n "document": "/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543"\n }\n}\n```\n\n- **`data`** \u2014 extracted fields as key-value pairs matching your schema.\n- **`confidence.fields`** \u2014 per-field score from 0 to 1. Above 0.9 is high confidence; below 0.7 flags for review.\n- **`extraction_id`** \u2014 use this to retrieve, correct, or deliver results later.\n- Full response schema: [ExtractSyncResponse](#/components/schemas/ExtractSyncResponse)\n\n**4. Next steps**\n\n- **50+ pages?** Use async mode \u2014 see [Async Extraction Flow](#section/Async-Extraction-Flow) below.\n- **Reusable schemas** \u2014 save field definitions with `POST /v1/schemas`, then pass `schema_id` on future extractions.\n- **Receive results via webhook** \u2014 configure a delivery destination and listen for `document.extracted` events. See the [Delivery](#tag/Delivery) tag.\n\n---\n\n## Authentication\n\nAll requests require a Bearer token in the `Authorization` header.\nAPI keys are prefixed with `tlnc_` and scoped per customer.\n\n```\nAuthorization: Bearer tlnc_live_abc123...\n```\n\n## Async Extraction Pattern\n\nSmall documents (\u22645 pages) are processed synchronously and return a `200`\nwith the extracted data immediately. Larger documents return a `202 Accepted`\nwith a `poll_url` \u2014 poll `GET /v1/documents/{id}` until `status` transitions\nto `completed`, then fetch results via `GET /v1/documents/{id}/extractions`.\n\nYou can force async processing by passing `options: {"async": true}` on\nany extraction request. Combine with webhooks for a fully event-driven flow:\nconfigure a webhook destination under Delivery and listen for the\n`extraction.complete` event.\n\n**Job status lifecycle:** `pending` \u2192 `processing` \u2192 `complete` | `failed`\n\n## Rate Limits\n\nThe **Free** tier is metered by a recurring **5,000-credit monthly grant**\n(no card required) that refreshes on the 1st of each month (UTC). Free\nrequests run until the monthly credit balance is spent, then return `402`\nuntil the next grant. A generous daily request ceiling is retained purely as\nabuse protection and does not bind a legitimate free user within the monthly\nenvelope. Inspect your balance and reset date via `GET /v1/account`.\n\nPaid tiers are metered per calendar day (UTC):\n\n| Tier | Extract | Platform | Ingest | Operations | Run | Ask |\n|------------|---------|----------|--------|------------|-----|-----|\n| Free | 1,000/day | 2,000/day | 1,000/day | 1,000/day | 1,000/day | 200/day |\n| Pro | 25,000/day | 50,000/day | 25,000/day | 25,000/day | 25,000/day | 5,000/day |\n| Enterprise | Unlimited | Unlimited | Unlimited | Unlimited | Unlimited | Unlimited |\n\nFree workspaces additionally receive 5,000 credits/month; spend is governed\nby credits (402 on exhaustion), with daily ceilings acting as abuse protection.\n\nResponses with a finite limit include rate-limit headers:\n- `X-RateLimit-Limit` \u2014 daily cap for the namespace\n- `X-RateLimit-Remaining` \u2014 requests left today\n- `X-RateLimit-Reset` \u2014 ISO 8601 timestamp when the window resets (midnight UTC)\n\n## Pagination\n\nList endpoints use cursor-based pagination. Pass `limit` (1\u2013100, default 20),\n`cursor` (opaque token from `pagination.next_cursor`), and `order` (`asc` or `desc`, default `desc`).\n\n## Errors\n\nAll errors return a JSON body with `error` (machine-readable code) and `message`\n(human-readable explanation). Additional fields vary by error type.\n\n| Code | Error | Description |\n|------|--------------------|------------------------------------------|\n| 400 | validation_error | Request body is malformed or invalid |\n| 401 | unauthorized | Missing or invalid API key |\n| 403 | insufficient_scope | API key lacks the required scope |\n| 404 | not_found | Resource does not exist |\n| 409 | conflict | Resource state conflict |\n| 413 | payload_too_large | File exceeds 500 MB limit |\n| 422 | extraction_failed | Document could not be processed |\n| 429 | rate_limit_exceeded| Daily rate limit reached |\n| 500 | internal_error | Unexpected server error (retryable) |\n\nEvery error response follows this envelope:\n\n```json\n{\n "statusCode": 400,\n "code": "VALIDATION_ERROR",\n "error": "Bad Request",\n "message": "name is required.",\n "retryable": false,\n "timestamp": "2026-04-25T14:30:00.000Z",\n "path": "/v1/schemas"\n}\n```\n\nThe `code` field is one of: `VALIDATION_ERROR`, `AUTH_REQUIRED`, `TOKEN_EXPIRED`,\n`INSUFFICIENT_PERMISSIONS`, `RESOURCE_NOT_FOUND`, `QUOTA_EXCEEDED`,\n`INSUFFICIENT_CREDITS`, `LLM_RATE_LIMITED`, `LLM_TIMEOUT`, `LLM_UNAVAILABLE`,\n`OCR_FAILED`, `EXTRACTION_FAILED`, `EXTRACTION_TIMEOUT`, `FILE_TOO_LARGE`,\n`DUPLICATE_RESOURCE`, `DATASPACE_RUN_FAILED`, `INTERNAL_ERROR`.\n\n### Refusal reasons\n\nA refusal an integration must branch on also carries `reason`, a stable\ntoken beside `code`. Branch on `reason`, not on `code`, `error` or the\nmessage: `code` says only which HTTP family the refusal belongs to, `error`\nis the HTTP status name on some refusals and a body discriminant on others,\nand messages are prose. The key is present only on refusals; absent means\n"no stable reason, read `message`". Message prefixes (`insufficient_grant:\n\u2026`) are kept for older clients that parse them; where a message carries one it equals `reason`, but not every refusal has a prefix (the Apps-ladder refusals are plain sentences), so branch on `reason`.\n\n| `reason` | Status | What the caller does |\n|---|---|---|\n| `insufficient_grant` | 403 | The app holds no approved grant covering this resource, or the route is not reachable by an app service key at all. Not retryable \u2014 stop and ask the workspace owner to grant it. |\n| `install_pending_approval` | 403 | A newer version of the app awaits owner approval and the install is paused. Poll `GET /v1/apps/{id}/install/status`. |\n| `install_not_ready` | 403 / 409 | The install is not in force (403, no installed binding for this service key) or is parked on an unapproved version / has no bound OAuth client (409). Poll `GET /v1/apps/{id}/install/status`. |\n| `endpoint_not_confirmed` | 400 | The binding would give the install its first subscriptions, or `confirm_subscriptions_endpoint` does not equal the manifest\'s `subscriptions_endpoint`. An owner action \u2014 re-send with the confirmation. |\n| `slot_unbound` | 400 / 409 | A required requirement slot has no binding (400 at install/rebind, 409 when a run resolves an already-installed version). The owner binds the named aliases. |\n| `slot_unknown` | 400 | The request named an alias the manifest declares no slot for. Fix the manifest or the request. |\n| `hosted_manifest_read_only` | 409 | The app\'s manifest is fetched from the vendor\'s URL, so local edits are refused. Edit at the vendor host, then `POST /v1/apps/{id}/refresh`. |\n| `hosted_surface_fixed` | 422 | A hosted app\'s surface URL comes from its manifest and moves only when a new version is approved; drop `surface_url` from the patch. |\n| `manifest_fetch_failed` | 422 | The vendor\'s manifest URL could not be read. `details.violations` carries the fetch reason. Fix it at the vendor host and retry. |\n| `schema_validation_failed` | 422 | A manifest does not validate, on publish or on a hosted fetch. `details.violations` carries `{ pointer, keyword, message }` per failure. |\n| `refresh_failed` | 422 | A hosted refresh did not happen; the failure is recorded on the app and it stays live on its approved version. `details` carries `{ changed, error }`. Fix it at the vendor host. |\n| `insufficient_scope` | 403 | The key or token lacks a required scope. `required_scopes` names the ones that admit. Workspace keys and OAuth clients receive this; an app service key never does, because both scope paths hand an app principal to its grant checks instead. |\n| `unauthenticated` | 403 | The Apps surface saw no authenticated principal. |\n| `workspace_required` | 403 | The Apps surface needs a concrete workspace; a master-view key cannot call it. |\n| `insufficient_tier` | 403 | The caller\'s workspace role (or an OAuth token\'s role claim) ranks below the route\'s tier. `required` names the tier. |\n| `owner_required` | 403 | Grant and OAuth-client management needs a human workspace owner; no machine caller reaches it. |\n| `insufficient_app_grant` | 403 | The API key holds app grants, but none at the level this route needs. `required` names the tier. |\n| `decide_grant_required` | 403 | The decision-task protocol admits only a machine caller holding an explicit `decide` grant on the app. |\n\n## Async Extraction Flow\n\nDocuments \u22645 pages return results synchronously (`200`). Larger documents\n\u2014 or any request with `options: {"async": true}` \u2014 return `202 Accepted`.\n\n**1. Submit extraction:**\n\n```bash\ncurl -X POST https://api.talonic.com/v1/extract \\\n -H "Authorization: Bearer tlnc_live_abc123" \\\n -F "file=@contract.pdf" \\\n -F \'options={"async": true}\'\n```\n\nResponse `202`:\n```json\n{\n "request_id": "req_x7y8z9a0",\n "status": "processing",\n "document": { "id": "f0e1d2c3-b4a5-9687-8765-432109876543" },\n "poll_url": "/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543"\n}\n```\n\n**2. Poll until complete:**\n\n```bash\ncurl https://api.talonic.com/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543 \\\n -H "Authorization: Bearer tlnc_live_abc123"\n```\n\nWhile processing: `{ "status": "processing" }`\nWhen done: `{ "status": "completed" }`\n\n**3. Retrieve results:**\n\n```bash\ncurl https://api.talonic.com/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543/extractions \\\n -H "Authorization: Bearer tlnc_live_abc123"\n```\n\n**Python \u2014 complete async flow with exponential backoff:**\n\n```python\nimport time\nimport requests\n\nAPI_KEY = "tlnc_live_..."\nBASE = "https://api.talonic.com/v1"\nHEADERS = {"Authorization": f"Bearer {API_KEY}"}\n\n# Step 1: Submit async extraction\nresp = requests.post(f"{BASE}/extract",\n headers=HEADERS,\n files={"file": open("contract.pdf", "rb")},\n data={"options": \'{"async": true}\'})\ndoc_id = resp.json()["document"]["id"]\n\n# Step 2: Poll with exponential backoff (2s \u2192 4s \u2192 8s \u2192 16s \u2192 30s cap)\ndelay = 2\nfor _ in range(20):\n time.sleep(delay)\n doc = requests.get(f"{BASE}/documents/{doc_id}", headers=HEADERS).json()\n if doc["status"] == "completed":\n break\n if doc["status"] == "error":\n raise Exception(f"Extraction failed: {doc.get(\'error\')}")\n delay = min(delay * 2, 30)\n\n# Step 3: Retrieve extracted data\nextractions = requests.get(\n f"{BASE}/documents/{doc_id}/extractions", headers=HEADERS).json()\ndata = extractions["data"][0]["data"]\nconfidence = extractions["data"][0]["confidence"]["overall"]\nprint(f"Extracted {len(data)} fields (confidence: {confidence})")\nprint(data)\n# \u2192 {"vendor_name": "Acme Corp", "total_amount": 1250.00, ...}\n```\n\n**TypeScript \u2014 same flow:**\n\n```typescript\nconst API_KEY = "tlnc_live_...";\nconst BASE = "https://api.talonic.com/v1";\nconst headers = { Authorization: `Bearer ${API_KEY}` };\n\n// Step 1: Submit async extraction\nconst form = new FormData();\nform.append("file", fs.createReadStream("contract.pdf"));\nform.append("options", \'{"async": true}\');\nconst { document } = await fetch(`${BASE}/extract`, {\n method: "POST", headers, body: form,\n}).then((r) => r.json());\n\n// Step 2: Poll with exponential backoff\nlet delay = 2000;\nlet doc: any;\nfor (let i = 0; i < 20; i++) {\n await new Promise((r) => setTimeout(r, delay));\n doc = await fetch(`${BASE}/documents/${document.id}`, { headers }).then((r) => r.json());\n if (doc.status === "completed") break;\n if (doc.status === "error") throw new Error(`Extraction failed: ${doc.error}`);\n delay = Math.min(delay * 2, 30_000);\n}\n\n// Step 3: Retrieve extracted data\nconst { data: extractions } = await fetch(\n `${BASE}/documents/${document.id}/extractions`, { headers }\n).then((r) => r.json());\nconsole.log(extractions[0].data);\n// \u2192 { vendor_name: "Acme Corp", total_amount: 1250.00, ... }\n```\n\nRecommended polling: 2s initial, exponential backoff (2\u21924\u21928\u219216\u219230s cap),\ntimeout after 5 minutes.\n\n**Alternative \u2014 Webhooks:** Configure a delivery destination and listen for\n`document.extracted` events. See the Delivery tag.\n\n**Job status state machine:**\n`pending` \u2192 `queued` \u2192 `processing` \u2192 `complete` | `failed`\n\n## Performance\n\n| Document size | Expected latency | Max timeout |\n|---------------|------------------|-------------|\n| 1\u20135 pages | Sync, <3s | 30s |\n| 6\u201350 pages | <30s average | 5 min |\n| 50+ pages | <5 min average | 30 min |\n\n**Uptime SLA:** 99.5% (Build), 99.9% (Scale), custom (Enterprise).\n\n**Max file size:** 500 MB. JSON request bodies (schemas, jobs): 1 MB.\n\n**Idempotency:** Pass an `Idempotency-Key` header (at most 64 characters;\na longer key is refused with 400 `invalid_idempotency_key` before any work)\non endpoints that list it. On write endpoints a retry with the same key,\nrequest and API key returns the first response with its original status\nand `Idempotent-Replayed: true`; the same key on a different request or\nfrom another API key answers 422 `idempotency_key_reused`, and a retry\nwhile the first request runs answers 409 `idempotency_request_in_progress`.\n`POST /v1/extract` returns its cached result with `cached: true` to any key\nof the workspace.\n',
128
140
  contact: {
129
141
  name: "Talonic Support",
130
142
  email: "support@talonic.ai",
@@ -469,6 +481,10 @@ var openapi_default = {
469
481
  {
470
482
  name: "My Data",
471
483
  description: "What you brought into the workspace, who can see it, and your sharing decisions. Always your own data, whichever credential asks."
484
+ },
485
+ {
486
+ name: "Access & sharing",
487
+ description: "Who holds each source, access requests to the holder, and sharing documents or whole sources you hold with members, groups or everyone in the workspace. Always as the credential's person."
472
488
  }
473
489
  ],
474
490
  paths: {
@@ -1925,6 +1941,122 @@ var openapi_default = {
1925
1941
  }
1926
1942
  }
1927
1943
  },
1944
+ "/v1/documents/{id}/mail-originals": {
1945
+ get: {
1946
+ operationId: "getDocumentMailOriginals",
1947
+ "x-audience": "public",
1948
+ tags: [
1949
+ "Documents"
1950
+ ],
1951
+ summary: "Get the original messages of an email document",
1952
+ description: "The original messages an email document was captured from, as they were\nsent: sender, subject, sent time, the HTML body (pictures shown inside the\nmail embedded) and the plain text. Use it to show an email the way its\nsender wrote it.\n\nThe HTML is returned as the sender wrote it. Show it in a sandbox without\nscripts or remote content. An HTML body larger than 1.5 MB is left out\n(`html` is null) and the text stays. A document that was not captured from\nan email answers an empty `originals` list. At most 200 originals are\nreturned.\n\nAnswers only what the key's person may read: a document that is missing,\nin another workspace, or hidden from that person answers the same `404`.\nRequires the `read` scope (or `documents:read`). Any member of the\nworkspace may call it.\n",
1953
+ security: [
1954
+ {
1955
+ BearerAuth: []
1956
+ }
1957
+ ],
1958
+ "x-required-scopes": [
1959
+ "read"
1960
+ ],
1961
+ parameters: [
1962
+ {
1963
+ $ref: "#/components/parameters/ResourceId"
1964
+ }
1965
+ ],
1966
+ responses: {
1967
+ "200": {
1968
+ description: "The original messages, in the order they were stored.",
1969
+ content: {
1970
+ "application/json": {
1971
+ schema: {
1972
+ type: "object",
1973
+ required: [
1974
+ "originals"
1975
+ ],
1976
+ properties: {
1977
+ originals: {
1978
+ type: "array",
1979
+ items: {
1980
+ type: "object",
1981
+ required: [
1982
+ "asset_id",
1983
+ "message_id",
1984
+ "date",
1985
+ "from",
1986
+ "subject",
1987
+ "html",
1988
+ "text"
1989
+ ],
1990
+ properties: {
1991
+ asset_id: {
1992
+ type: "string",
1993
+ format: "uuid",
1994
+ description: "The stored original this message was read from."
1995
+ },
1996
+ message_id: {
1997
+ type: "string",
1998
+ nullable: true,
1999
+ description: "The message's own `Message-ID` header."
2000
+ },
2001
+ date: {
2002
+ type: "string",
2003
+ format: "date-time",
2004
+ nullable: true,
2005
+ description: "When the message was sent."
2006
+ },
2007
+ from: {
2008
+ type: "string",
2009
+ nullable: true
2010
+ },
2011
+ subject: {
2012
+ type: "string",
2013
+ nullable: true
2014
+ },
2015
+ html: {
2016
+ type: "string",
2017
+ nullable: true,
2018
+ description: "The HTML body as sent; null when the mail has none or it is larger than 1.5 MB."
2019
+ },
2020
+ text: {
2021
+ type: "string",
2022
+ nullable: true
2023
+ }
2024
+ }
2025
+ }
2026
+ }
2027
+ }
2028
+ },
2029
+ example: {
2030
+ originals: [
2031
+ {
2032
+ asset_id: "7f1c2b9e-4d3a-4e8b-9a61-0c5d2e8f4b10",
2033
+ message_id: "<CAF9x2k@mail.example.com>",
2034
+ date: "2026-10-02T08:14:00.000Z",
2035
+ from: '"Anna Weber" <anna.weber@example.com>',
2036
+ subject: "Invoice 4471203",
2037
+ html: "<p>Please find the invoice attached.</p>",
2038
+ text: "Please find the invoice attached."
2039
+ }
2040
+ ]
2041
+ }
2042
+ }
2043
+ }
2044
+ },
2045
+ "401": {
2046
+ $ref: "#/components/responses/Unauthorized"
2047
+ },
2048
+ "403": {
2049
+ $ref: "#/components/responses/Forbidden"
2050
+ },
2051
+ "404": {
2052
+ $ref: "#/components/responses/NotFound"
2053
+ },
2054
+ "429": {
2055
+ $ref: "#/components/responses/RateLimitExceeded"
2056
+ }
2057
+ }
2058
+ }
2059
+ },
1928
2060
  "/v1/documents/upload-session": {
1929
2061
  post: {
1930
2062
  operationId: "createUploadSession",
@@ -3134,6 +3266,73 @@ var openapi_default = {
3134
3266
  }
3135
3267
  }
3136
3268
  },
3269
+ "/v1/jobs/{id}/documents/{documentId}": {
3270
+ delete: {
3271
+ tags: [
3272
+ "Jobs & Batches"
3273
+ ],
3274
+ summary: "Take a document out of a structuring run",
3275
+ description: "Removes one document from a structuring run. Held to the web route's tier; a document the caller's person may not change answers like one not in the run (404).\n",
3276
+ operationId: "removeJobDocument",
3277
+ "x-audience": "public",
3278
+ "x-required-scopes": [
3279
+ "runs:write"
3280
+ ],
3281
+ security: [
3282
+ {
3283
+ BearerAuth: []
3284
+ }
3285
+ ],
3286
+ parameters: [
3287
+ {
3288
+ name: "id",
3289
+ in: "path",
3290
+ required: true,
3291
+ schema: {
3292
+ type: "string",
3293
+ format: "uuid"
3294
+ }
3295
+ },
3296
+ {
3297
+ name: "documentId",
3298
+ in: "path",
3299
+ required: true,
3300
+ schema: {
3301
+ type: "string",
3302
+ format: "uuid"
3303
+ }
3304
+ }
3305
+ ],
3306
+ responses: {
3307
+ "200": {
3308
+ description: "Removed",
3309
+ content: {
3310
+ "application/json": {
3311
+ schema: {
3312
+ type: "object",
3313
+ additionalProperties: true
3314
+ }
3315
+ }
3316
+ }
3317
+ },
3318
+ "400": {
3319
+ $ref: "#/components/responses/BadRequest"
3320
+ },
3321
+ "401": {
3322
+ $ref: "#/components/responses/Unauthorized"
3323
+ },
3324
+ "403": {
3325
+ $ref: "#/components/responses/Forbidden"
3326
+ },
3327
+ "404": {
3328
+ $ref: "#/components/responses/NotFound"
3329
+ },
3330
+ "429": {
3331
+ $ref: "#/components/responses/RateLimitExceeded"
3332
+ }
3333
+ }
3334
+ }
3335
+ },
3137
3336
  "/v1/jobs/{id}": {
3138
3337
  get: {
3139
3338
  operationId: "getJob",
@@ -24011,6 +24210,64 @@ var openapi_default = {
24011
24210
  }
24012
24211
  }
24013
24212
  },
24213
+ "/v1/documents/{id}/claims/recompute": {
24214
+ post: {
24215
+ tags: [
24216
+ "Provenance"
24217
+ ],
24218
+ summary: "Rebuild a document's claims",
24219
+ description: "Rebuilds the document's claims from its current captured fields. A document the caller's person may not change answers as a missing one does (`claims: 0`).\n",
24220
+ operationId: "recomputeDocumentClaims",
24221
+ "x-audience": "public",
24222
+ "x-required-scopes": [
24223
+ "documents:write"
24224
+ ],
24225
+ security: [
24226
+ {
24227
+ BearerAuth: []
24228
+ }
24229
+ ],
24230
+ parameters: [
24231
+ {
24232
+ name: "id",
24233
+ in: "path",
24234
+ required: true,
24235
+ schema: {
24236
+ type: "string",
24237
+ format: "uuid"
24238
+ }
24239
+ }
24240
+ ],
24241
+ responses: {
24242
+ "200": {
24243
+ description: "Rebuilt",
24244
+ content: {
24245
+ "application/json": {
24246
+ schema: {
24247
+ type: "object",
24248
+ additionalProperties: true
24249
+ }
24250
+ }
24251
+ }
24252
+ },
24253
+ "400": {
24254
+ $ref: "#/components/responses/BadRequest"
24255
+ },
24256
+ "401": {
24257
+ $ref: "#/components/responses/Unauthorized"
24258
+ },
24259
+ "403": {
24260
+ $ref: "#/components/responses/Forbidden"
24261
+ },
24262
+ "404": {
24263
+ $ref: "#/components/responses/NotFound"
24264
+ },
24265
+ "429": {
24266
+ $ref: "#/components/responses/RateLimitExceeded"
24267
+ }
24268
+ }
24269
+ }
24270
+ },
24014
24271
  "/v1/documents/{id}/claims": {
24015
24272
  get: {
24016
24273
  tags: [
@@ -31193,6 +31450,7 @@ var openapi_default = {
31193
31450
  operationId: "getAppRunEvents",
31194
31451
  "x-audience": "public",
31195
31452
  summary: "Run journal (append-only, ordered)",
31453
+ description: "404 when the run names a document the caller cannot read (the journal carries the decision).",
31196
31454
  tags: [
31197
31455
  "Apps"
31198
31456
  ],
@@ -31210,6 +31468,9 @@ var openapi_default = {
31210
31468
  responses: {
31211
31469
  "200": {
31212
31470
  description: "Journal events."
31471
+ },
31472
+ "404": {
31473
+ $ref: "#/components/responses/NotFound"
31213
31474
  }
31214
31475
  }
31215
31476
  }
@@ -31722,7 +31983,7 @@ var openapi_default = {
31722
31983
  operationId: "getAppRunRecord",
31723
31984
  "x-audience": "public",
31724
31985
  summary: "Sealed decision record (the export; 404 until the run seals)",
31725
- description: "Reading the sealed record is an audited export (app.record_exported).",
31986
+ description: "Reading the sealed record is an audited export (app.record_exported). 404 also when the run names a document the caller cannot read.",
31726
31987
  tags: [
31727
31988
  "Apps"
31728
31989
  ],
@@ -65128,7 +65389,7 @@ var openapi_default = {
65128
65389
  "Documents"
65129
65390
  ],
65130
65391
  summary: "Process a skipped duplicate anyway",
65131
- description: "Creates a new document that reuses an existing document's content and values, without reading the file again. The existing document must be visible to the key's person. Send an `Idempotency-Key` header to make retries safe: the same key within 24 hours answers the first copy (200, `Idempotent-Replayed: true`) instead of creating another; the same key for another existing document answers 409 `idempotency_key_reused`, a retry while the first call still runs 409 `idempotency_in_progress`. Requires the `documents:write` scope. The key's person needs the `ingest` permission (Contract Management and above by default), as in the web app.",
65392
+ description: "Creates a new document that reuses an existing document's content and values, without reading the file again. The existing document must be visible to the key's person. Send an `Idempotency-Key` header to make retries safe: the same request with the same key from the same API key within 24 hours returns the first copy with its original status and `Idempotent-Replayed: true` instead of creating another; the same key with a different body, or from another API key, answers 422 `idempotency_key_reused`; a retry while the first call still runs answers 409 `idempotency_request_in_progress`. Requires the `documents:write` scope. The key's person needs the `ingest` permission (Contract Management and above by default), as in the web app.",
65132
65393
  security: [
65133
65394
  {
65134
65395
  BearerAuth: []
@@ -65139,14 +65400,7 @@ var openapi_default = {
65139
65400
  ],
65140
65401
  parameters: [
65141
65402
  {
65142
- name: "Idempotency-Key",
65143
- in: "header",
65144
- required: false,
65145
- description: "Up to 255 characters; remembered for 24 hours per workspace.",
65146
- schema: {
65147
- type: "string",
65148
- maxLength: 255
65149
- }
65403
+ $ref: "#/components/parameters/IdempotencyKey"
65150
65404
  }
65151
65405
  ],
65152
65406
  requestBody: {
@@ -65184,19 +65438,20 @@ var openapi_default = {
65184
65438
  }
65185
65439
  },
65186
65440
  responses: {
65187
- "200": {
65188
- description: "A retry with the same Idempotency-Key: the first copy, with the header `Idempotent-Replayed: true`.",
65189
- content: {
65190
- "application/json": {
65441
+ "201": {
65442
+ description: "The new document. On a retry with the same Idempotency-Key, the first copy with `Idempotent-Replayed: true`.",
65443
+ headers: {
65444
+ "Idempotent-Replayed": {
65191
65445
  schema: {
65192
- type: "object",
65193
- additionalProperties: true
65194
- }
65446
+ type: "string",
65447
+ enum: [
65448
+ "true",
65449
+ "false"
65450
+ ]
65451
+ },
65452
+ description: "`true` when the body is the stored answer to an earlier request with the same key."
65195
65453
  }
65196
- }
65197
- },
65198
- "201": {
65199
- description: "OK",
65454
+ },
65200
65455
  content: {
65201
65456
  "application/json": {
65202
65457
  schema: {
@@ -65236,13 +65491,13 @@ var openapi_default = {
65236
65491
  $ref: "#/components/responses/Forbidden"
65237
65492
  },
65238
65493
  "409": {
65239
- description: "`idempotency_key_reused` or `idempotency_in_progress` (retry shortly)."
65494
+ description: "`idempotency_request_in_progress`: a request with the same Idempotency-Key is still running; retry shortly."
65495
+ },
65496
+ "422": {
65497
+ description: "`idempotency_key_reused`: the Idempotency-Key was already used for a different request or by another API key."
65240
65498
  },
65241
65499
  "429": {
65242
65500
  $ref: "#/components/responses/RateLimitExceeded"
65243
- },
65244
- "503": {
65245
- description: "`idempotency_unavailable`: a request with an Idempotency-Key cannot be guaranteed right now; retry shortly."
65246
65501
  }
65247
65502
  }
65248
65503
  }
@@ -65552,7 +65807,7 @@ var openapi_default = {
65552
65807
  "Documents"
65553
65808
  ],
65554
65809
  summary: "Tag many documents at once",
65555
- description: "Adds, removes or sets tags on up to 1000 documents. All or nothing: one hidden or missing document refuses the whole batch with 404 and nothing changes. Answers each document's resulting tags and the id of the audit event recorded for the change. Requires the `documents:write` scope. The key's person must be an Admin of the workspace, as in the web app; in a workspace whose model configuration Talonic manages this answers 403 `insufficient_role`.",
65810
+ description: "Adds, removes or sets tags on up to 1000 documents. Tags the documents the key's person may classify; the others (hidden, missing, or on access scopes held by someone else) are listed in `refused` and answer `status: refused` without their tags, and nothing changes on them. Answers each tagged document's resulting tags and the id of the audit event recorded for the change. Requires the `documents:write` scope. The key's person must be an Admin of the workspace, as in the web app; in a workspace whose model configuration Talonic manages this answers 403 `insufficient_role`.",
65556
65811
  security: [
65557
65812
  {
65558
65813
  BearerAuth: []
@@ -65623,6 +65878,13 @@ var openapi_default = {
65623
65878
  type: "string"
65624
65879
  }
65625
65880
  },
65881
+ refused: {
65882
+ type: "array",
65883
+ items: {
65884
+ type: "string",
65885
+ format: "uuid"
65886
+ }
65887
+ },
65626
65888
  results: {
65627
65889
  type: "array",
65628
65890
  items: {
@@ -65635,7 +65897,8 @@ var openapi_default = {
65635
65897
  status: {
65636
65898
  type: "string",
65637
65899
  enum: [
65638
- "updated"
65900
+ "updated",
65901
+ "refused"
65639
65902
  ]
65640
65903
  },
65641
65904
  tags: {
@@ -70593,6 +70856,64 @@ var openapi_default = {
70593
70856
  }
70594
70857
  }
70595
70858
  },
70859
+ "/v1/documents/{id}/relation-claims/recompute": {
70860
+ post: {
70861
+ tags: [
70862
+ "Cases"
70863
+ ],
70864
+ summary: "Rebuild a document's relation claims",
70865
+ description: "Rebuilds the document's relation-claims ledger from its raw extraction, then resolves it when resolution is on. Needs the person's member tier; a document they may not change answers like a missing one (nothing rebuilt).\n",
70866
+ operationId: "recomputeDocumentRelationClaims",
70867
+ "x-audience": "public",
70868
+ "x-required-scopes": [
70869
+ "cases:write"
70870
+ ],
70871
+ security: [
70872
+ {
70873
+ BearerAuth: []
70874
+ }
70875
+ ],
70876
+ parameters: [
70877
+ {
70878
+ name: "id",
70879
+ in: "path",
70880
+ required: true,
70881
+ schema: {
70882
+ type: "string",
70883
+ format: "uuid"
70884
+ }
70885
+ }
70886
+ ],
70887
+ responses: {
70888
+ "200": {
70889
+ description: "Rebuilt",
70890
+ content: {
70891
+ "application/json": {
70892
+ schema: {
70893
+ type: "object",
70894
+ additionalProperties: true
70895
+ }
70896
+ }
70897
+ }
70898
+ },
70899
+ "400": {
70900
+ $ref: "#/components/responses/BadRequest"
70901
+ },
70902
+ "401": {
70903
+ $ref: "#/components/responses/Unauthorized"
70904
+ },
70905
+ "403": {
70906
+ $ref: "#/components/responses/Forbidden"
70907
+ },
70908
+ "404": {
70909
+ $ref: "#/components/responses/NotFound"
70910
+ },
70911
+ "429": {
70912
+ $ref: "#/components/responses/RateLimitExceeded"
70913
+ }
70914
+ }
70915
+ }
70916
+ },
70596
70917
  "/v1/relation-claims/cases": {
70597
70918
  get: {
70598
70919
  operationId: "listReferenceCases",
@@ -81818,66 +82139,1551 @@ var openapi_default = {
81818
82139
  }
81819
82140
  }
81820
82141
  },
82142
+ "/v1/me/data/groups": {
82143
+ get: {
82144
+ operationId: "listMeDataGroups",
82145
+ "x-audience": "public",
82146
+ "x-required-scopes": [
82147
+ "documents:read"
82148
+ ],
82149
+ summary: "Group your data",
82150
+ description: "Your uploads or the values read out of them, counted per group (`by` source, document type, month or, for values, field) and per who can see them; narrow with the group parameters.\n",
82151
+ tags: [
82152
+ "My Data"
82153
+ ],
82154
+ parameters: [
82155
+ {
82156
+ name: "kind",
82157
+ in: "query",
82158
+ required: true,
82159
+ schema: {
82160
+ type: "string",
82161
+ enum: [
82162
+ "uploads",
82163
+ "extracted"
82164
+ ]
82165
+ }
82166
+ },
82167
+ {
82168
+ name: "by",
82169
+ in: "query",
82170
+ schema: {
82171
+ type: "string",
82172
+ enum: [
82173
+ "source",
82174
+ "type",
82175
+ "month",
82176
+ "field",
82177
+ "all"
82178
+ ],
82179
+ default: "all"
82180
+ }
82181
+ },
82182
+ {
82183
+ name: "source",
82184
+ in: "query",
82185
+ description: "A source id, or `none`.",
82186
+ schema: {
82187
+ type: "string"
82188
+ }
82189
+ },
82190
+ {
82191
+ name: "type",
82192
+ in: "query",
82193
+ description: "A document type id, or `none`.",
82194
+ schema: {
82195
+ type: "string"
82196
+ }
82197
+ },
82198
+ {
82199
+ name: "month",
82200
+ in: "query",
82201
+ description: "Month, `YYYY-MM`.",
82202
+ schema: {
82203
+ type: "string",
82204
+ pattern: "^\\d{4}-(0[1-9]|1[0-2])$"
82205
+ }
82206
+ },
82207
+ {
82208
+ name: "field",
82209
+ in: "query",
82210
+ description: "A field id, or `none`.",
82211
+ schema: {
82212
+ type: "string"
82213
+ }
82214
+ }
82215
+ ],
82216
+ responses: {
82217
+ "200": {
82218
+ description: "OK",
82219
+ content: {
82220
+ "application/json": {
82221
+ schema: {
82222
+ type: "object",
82223
+ additionalProperties: true
82224
+ }
82225
+ }
82226
+ }
82227
+ },
82228
+ "400": {
82229
+ $ref: "#/components/responses/BadRequest"
82230
+ },
82231
+ "401": {
82232
+ $ref: "#/components/responses/Unauthorized"
82233
+ },
82234
+ "403": {
82235
+ $ref: "#/components/responses/Forbidden"
82236
+ },
82237
+ "429": {
82238
+ $ref: "#/components/responses/RateLimitExceeded"
82239
+ }
82240
+ }
82241
+ }
82242
+ },
81821
82243
  "/v1/me/data/items": {
81822
82244
  get: {
81823
82245
  operationId: "listMeDataItems",
81824
82246
  "x-audience": "public",
81825
82247
  "x-required-scopes": [
81826
- "documents:read"
82248
+ "documents:read"
82249
+ ],
82250
+ summary: "List your data items",
82251
+ description: "A page of one group of your uploads or values, newest first: pass the `next` cursor of a page as `after` for the following one. Or one item by `id`.\n",
82252
+ tags: [
82253
+ "My Data"
82254
+ ],
82255
+ parameters: [
82256
+ {
82257
+ name: "kind",
82258
+ in: "query",
82259
+ required: true,
82260
+ schema: {
82261
+ type: "string",
82262
+ enum: [
82263
+ "uploads",
82264
+ "extracted"
82265
+ ]
82266
+ }
82267
+ },
82268
+ {
82269
+ name: "id",
82270
+ in: "query",
82271
+ schema: {
82272
+ type: "string"
82273
+ }
82274
+ },
82275
+ {
82276
+ name: "source",
82277
+ in: "query",
82278
+ description: "A source id, or `none`.",
82279
+ schema: {
82280
+ type: "string"
82281
+ }
82282
+ },
82283
+ {
82284
+ name: "type",
82285
+ in: "query",
82286
+ description: "A document type id, or `none`.",
82287
+ schema: {
82288
+ type: "string"
82289
+ }
82290
+ },
82291
+ {
82292
+ name: "month",
82293
+ in: "query",
82294
+ description: "Month, `YYYY-MM`.",
82295
+ schema: {
82296
+ type: "string",
82297
+ pattern: "^\\d{4}-(0[1-9]|1[0-2])$"
82298
+ }
82299
+ },
82300
+ {
82301
+ name: "field",
82302
+ in: "query",
82303
+ description: "A field id, or `none`.",
82304
+ schema: {
82305
+ type: "string"
82306
+ }
82307
+ },
82308
+ {
82309
+ name: "vis",
82310
+ in: "query",
82311
+ schema: {
82312
+ type: "string",
82313
+ enum: [
82314
+ "me",
82315
+ "shared",
82316
+ "company"
82317
+ ]
82318
+ }
82319
+ },
82320
+ {
82321
+ name: "after",
82322
+ in: "query",
82323
+ schema: {
82324
+ type: "string"
82325
+ }
82326
+ },
82327
+ {
82328
+ name: "limit",
82329
+ in: "query",
82330
+ schema: {
82331
+ type: "integer",
82332
+ minimum: 1,
82333
+ default: 50
82334
+ }
82335
+ }
82336
+ ],
82337
+ responses: {
82338
+ "200": {
82339
+ description: "OK",
82340
+ content: {
82341
+ "application/json": {
82342
+ schema: {
82343
+ type: "object",
82344
+ additionalProperties: true
82345
+ }
82346
+ }
82347
+ }
82348
+ },
82349
+ "400": {
82350
+ $ref: "#/components/responses/BadRequest"
82351
+ },
82352
+ "401": {
82353
+ $ref: "#/components/responses/Unauthorized"
82354
+ },
82355
+ "403": {
82356
+ $ref: "#/components/responses/Forbidden"
82357
+ },
82358
+ "429": {
82359
+ $ref: "#/components/responses/RateLimitExceeded"
82360
+ }
82361
+ }
82362
+ }
82363
+ },
82364
+ "/v1/me/workspace-data": {
82365
+ get: {
82366
+ operationId: "getMeWorkspaceData",
82367
+ "x-audience": "public",
82368
+ "x-required-scopes": [
82369
+ "documents:read"
82370
+ ],
82371
+ summary: "Count workspace data by owner",
82372
+ description: "The workspace's documents, fields and data points you can see, counted by whose they are: `me`, `shared` with you, or `company`.\n",
82373
+ tags: [
82374
+ "My Data"
82375
+ ],
82376
+ responses: {
82377
+ "200": {
82378
+ description: "OK",
82379
+ content: {
82380
+ "application/json": {
82381
+ schema: {
82382
+ type: "object",
82383
+ additionalProperties: true
82384
+ }
82385
+ }
82386
+ }
82387
+ },
82388
+ "401": {
82389
+ $ref: "#/components/responses/Unauthorized"
82390
+ },
82391
+ "403": {
82392
+ $ref: "#/components/responses/Forbidden"
82393
+ },
82394
+ "429": {
82395
+ $ref: "#/components/responses/RateLimitExceeded"
82396
+ }
82397
+ }
82398
+ }
82399
+ },
82400
+ "/v1/governance/directory": {
82401
+ get: {
82402
+ operationId: "getAccessDirectory",
82403
+ "x-audience": "public",
82404
+ "x-required-scopes": [
82405
+ "access:read"
82406
+ ],
82407
+ summary: "List sources and their holders",
82408
+ description: "Every source and every person's uploads in the workspace with who holds each, and the caller's standing on it (held, through a team, licensed, an open request). Never items or counts.\n",
82409
+ tags: [
82410
+ "Access & sharing"
82411
+ ],
82412
+ responses: {
82413
+ "200": {
82414
+ description: "OK",
82415
+ content: {
82416
+ "application/json": {
82417
+ schema: {
82418
+ type: "object",
82419
+ additionalProperties: true
82420
+ }
82421
+ }
82422
+ }
82423
+ },
82424
+ "401": {
82425
+ $ref: "#/components/responses/Unauthorized"
82426
+ },
82427
+ "403": {
82428
+ $ref: "#/components/responses/Forbidden"
82429
+ },
82430
+ "429": {
82431
+ $ref: "#/components/responses/RateLimitExceeded"
82432
+ }
82433
+ }
82434
+ }
82435
+ },
82436
+ "/v1/governance/access-requests": {
82437
+ get: {
82438
+ operationId: "listAccessRequests",
82439
+ "x-audience": "public",
82440
+ "x-required-scopes": [
82441
+ "access:read"
82442
+ ],
82443
+ summary: "List access requests",
82444
+ description: "The caller's own requests (`mine`), those on scopes they decide on (`for_my_scopes`) and, for the workspace's data protection officer, those waiting for the second decision (`to_second`).\n",
82445
+ tags: [
82446
+ "Access & sharing"
82447
+ ],
82448
+ responses: {
82449
+ "200": {
82450
+ description: "OK",
82451
+ content: {
82452
+ "application/json": {
82453
+ schema: {
82454
+ type: "object",
82455
+ additionalProperties: true
82456
+ }
82457
+ }
82458
+ }
82459
+ },
82460
+ "401": {
82461
+ $ref: "#/components/responses/Unauthorized"
82462
+ },
82463
+ "403": {
82464
+ $ref: "#/components/responses/Forbidden"
82465
+ },
82466
+ "429": {
82467
+ $ref: "#/components/responses/RateLimitExceeded"
82468
+ }
82469
+ }
82470
+ },
82471
+ post: {
82472
+ operationId: "createAccessRequest",
82473
+ "x-audience": "public",
82474
+ "x-required-scopes": [
82475
+ "access:write"
82476
+ ],
82477
+ summary: "Ask for access",
82478
+ description: "Ask the holder of a source, of a person's uploads, or of one document in them for time-limited access. Exactly one of `scope_id` / `source_connection_id`; `document_id` narrows the request to one document. A document that does not exist and one the caller may not see answer alike (404).\n",
82479
+ tags: [
82480
+ "Access & sharing"
82481
+ ],
82482
+ requestBody: {
82483
+ required: true,
82484
+ content: {
82485
+ "application/json": {
82486
+ schema: {
82487
+ type: "object",
82488
+ required: [
82489
+ "purpose",
82490
+ "duration_days"
82491
+ ],
82492
+ properties: {
82493
+ scope_id: {
82494
+ type: "string",
82495
+ pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
82496
+ description: "An access scope (8-4-4-4-12 hex; version digits are arbitrary)."
82497
+ },
82498
+ source_connection_id: {
82499
+ type: "string",
82500
+ format: "uuid"
82501
+ },
82502
+ document_id: {
82503
+ type: "string",
82504
+ format: "uuid"
82505
+ },
82506
+ purpose: {
82507
+ type: "string",
82508
+ maxLength: 500
82509
+ },
82510
+ duration_days: {
82511
+ type: "integer",
82512
+ minimum: 1,
82513
+ maximum: 90
82514
+ },
82515
+ capabilities: {
82516
+ type: "array",
82517
+ items: {
82518
+ type: "string",
82519
+ enum: [
82520
+ "delete",
82521
+ "discover",
82522
+ "read",
82523
+ "write"
82524
+ ]
82525
+ }
82526
+ }
82527
+ }
82528
+ }
82529
+ }
82530
+ }
82531
+ },
82532
+ responses: {
82533
+ "201": {
82534
+ description: "Created",
82535
+ content: {
82536
+ "application/json": {
82537
+ schema: {
82538
+ type: "object",
82539
+ additionalProperties: true
82540
+ }
82541
+ }
82542
+ }
82543
+ },
82544
+ "400": {
82545
+ $ref: "#/components/responses/BadRequest"
82546
+ },
82547
+ "401": {
82548
+ $ref: "#/components/responses/Unauthorized"
82549
+ },
82550
+ "403": {
82551
+ $ref: "#/components/responses/Forbidden"
82552
+ },
82553
+ "404": {
82554
+ $ref: "#/components/responses/NotFound"
82555
+ },
82556
+ "409": {
82557
+ $ref: "#/components/responses/Conflict"
82558
+ },
82559
+ "429": {
82560
+ $ref: "#/components/responses/RateLimitExceeded"
82561
+ }
82562
+ }
82563
+ }
82564
+ },
82565
+ "/v1/governance/access-requests/{id}/approve": {
82566
+ post: {
82567
+ operationId: "approveAccessRequest",
82568
+ "x-audience": "public",
82569
+ "x-required-scopes": [
82570
+ "access:write"
82571
+ ],
82572
+ summary: "Approve an access request",
82573
+ description: "A holder of the request's scope approves: a licence on the scope, or a share of the one document for an item request.\n",
82574
+ tags: [
82575
+ "Access & sharing"
82576
+ ],
82577
+ parameters: [
82578
+ {
82579
+ name: "id",
82580
+ in: "path",
82581
+ required: true,
82582
+ schema: {
82583
+ type: "string",
82584
+ format: "uuid"
82585
+ }
82586
+ }
82587
+ ],
82588
+ responses: {
82589
+ "200": {
82590
+ description: "OK",
82591
+ content: {
82592
+ "application/json": {
82593
+ schema: {
82594
+ type: "object",
82595
+ additionalProperties: true
82596
+ }
82597
+ }
82598
+ }
82599
+ },
82600
+ "400": {
82601
+ $ref: "#/components/responses/BadRequest"
82602
+ },
82603
+ "401": {
82604
+ $ref: "#/components/responses/Unauthorized"
82605
+ },
82606
+ "403": {
82607
+ $ref: "#/components/responses/Forbidden"
82608
+ },
82609
+ "404": {
82610
+ $ref: "#/components/responses/NotFound"
82611
+ },
82612
+ "409": {
82613
+ $ref: "#/components/responses/Conflict"
82614
+ },
82615
+ "429": {
82616
+ $ref: "#/components/responses/RateLimitExceeded"
82617
+ }
82618
+ }
82619
+ }
82620
+ },
82621
+ "/v1/governance/access-requests/{id}/deny": {
82622
+ post: {
82623
+ operationId: "denyAccessRequest",
82624
+ "x-audience": "public",
82625
+ "x-required-scopes": [
82626
+ "access:write"
82627
+ ],
82628
+ summary: "Deny an access request",
82629
+ description: "A holder of the request's scope refuses a pending request, with a reason.\n",
82630
+ tags: [
82631
+ "Access & sharing"
82632
+ ],
82633
+ parameters: [
82634
+ {
82635
+ name: "id",
82636
+ in: "path",
82637
+ required: true,
82638
+ schema: {
82639
+ type: "string",
82640
+ format: "uuid"
82641
+ }
82642
+ }
82643
+ ],
82644
+ requestBody: {
82645
+ required: true,
82646
+ content: {
82647
+ "application/json": {
82648
+ schema: {
82649
+ type: "object",
82650
+ required: [
82651
+ "reason"
82652
+ ],
82653
+ properties: {
82654
+ reason: {
82655
+ type: "string",
82656
+ maxLength: 500
82657
+ }
82658
+ }
82659
+ }
82660
+ }
82661
+ }
82662
+ },
82663
+ responses: {
82664
+ "200": {
82665
+ description: "OK",
82666
+ content: {
82667
+ "application/json": {
82668
+ schema: {
82669
+ type: "object",
82670
+ additionalProperties: true
82671
+ }
82672
+ }
82673
+ }
82674
+ },
82675
+ "400": {
82676
+ $ref: "#/components/responses/BadRequest"
82677
+ },
82678
+ "401": {
82679
+ $ref: "#/components/responses/Unauthorized"
82680
+ },
82681
+ "403": {
82682
+ $ref: "#/components/responses/Forbidden"
82683
+ },
82684
+ "404": {
82685
+ $ref: "#/components/responses/NotFound"
82686
+ },
82687
+ "409": {
82688
+ $ref: "#/components/responses/Conflict"
82689
+ },
82690
+ "429": {
82691
+ $ref: "#/components/responses/RateLimitExceeded"
82692
+ }
82693
+ }
82694
+ }
82695
+ },
82696
+ "/v1/governance/access-requests/{id}/second": {
82697
+ post: {
82698
+ operationId: "secondAccessRequest",
82699
+ "x-audience": "public",
82700
+ "x-required-scopes": [
82701
+ "access:write"
82702
+ ],
82703
+ summary: "Decide an access request as data protection officer",
82704
+ description: "The workspace's data protection officer decides after the holder approved: `ok` true opens it, false refuses it, with `text` as the reason or note.\n",
82705
+ tags: [
82706
+ "Access & sharing"
82707
+ ],
82708
+ parameters: [
82709
+ {
82710
+ name: "id",
82711
+ in: "path",
82712
+ required: true,
82713
+ schema: {
82714
+ type: "string",
82715
+ format: "uuid"
82716
+ }
82717
+ }
82718
+ ],
82719
+ requestBody: {
82720
+ required: true,
82721
+ content: {
82722
+ "application/json": {
82723
+ schema: {
82724
+ type: "object",
82725
+ required: [
82726
+ "ok",
82727
+ "text"
82728
+ ],
82729
+ properties: {
82730
+ ok: {
82731
+ type: "boolean"
82732
+ },
82733
+ text: {
82734
+ type: "string"
82735
+ }
82736
+ }
82737
+ }
82738
+ }
82739
+ }
82740
+ },
82741
+ responses: {
82742
+ "200": {
82743
+ description: "OK",
82744
+ content: {
82745
+ "application/json": {
82746
+ schema: {
82747
+ type: "object",
82748
+ additionalProperties: true
82749
+ }
82750
+ }
82751
+ }
82752
+ },
82753
+ "400": {
82754
+ $ref: "#/components/responses/BadRequest"
82755
+ },
82756
+ "401": {
82757
+ $ref: "#/components/responses/Unauthorized"
82758
+ },
82759
+ "403": {
82760
+ $ref: "#/components/responses/Forbidden"
82761
+ },
82762
+ "404": {
82763
+ $ref: "#/components/responses/NotFound"
82764
+ },
82765
+ "409": {
82766
+ $ref: "#/components/responses/Conflict"
82767
+ },
82768
+ "429": {
82769
+ $ref: "#/components/responses/RateLimitExceeded"
82770
+ }
82771
+ }
82772
+ }
82773
+ },
82774
+ "/v1/governance/access-requests/{id}/stop": {
82775
+ post: {
82776
+ operationId: "stopAccessRequest",
82777
+ "x-audience": "public",
82778
+ "x-required-scopes": [
82779
+ "access:write"
82780
+ ],
82781
+ summary: "Stop an access request",
82782
+ description: "The requester or a holder ends an approved request; its licence or document share is revoked.\n",
82783
+ tags: [
82784
+ "Access & sharing"
82785
+ ],
82786
+ parameters: [
82787
+ {
82788
+ name: "id",
82789
+ in: "path",
82790
+ required: true,
82791
+ schema: {
82792
+ type: "string",
82793
+ format: "uuid"
82794
+ }
82795
+ }
82796
+ ],
82797
+ responses: {
82798
+ "200": {
82799
+ description: "OK",
82800
+ content: {
82801
+ "application/json": {
82802
+ schema: {
82803
+ type: "object",
82804
+ additionalProperties: true
82805
+ }
82806
+ }
82807
+ }
82808
+ },
82809
+ "400": {
82810
+ $ref: "#/components/responses/BadRequest"
82811
+ },
82812
+ "401": {
82813
+ $ref: "#/components/responses/Unauthorized"
82814
+ },
82815
+ "403": {
82816
+ $ref: "#/components/responses/Forbidden"
82817
+ },
82818
+ "404": {
82819
+ $ref: "#/components/responses/NotFound"
82820
+ },
82821
+ "409": {
82822
+ $ref: "#/components/responses/Conflict"
82823
+ },
82824
+ "429": {
82825
+ $ref: "#/components/responses/RateLimitExceeded"
82826
+ }
82827
+ }
82828
+ }
82829
+ },
82830
+ "/v1/governance/sharing": {
82831
+ get: {
82832
+ operationId: "getSharing",
82833
+ "x-audience": "public",
82834
+ "x-required-scopes": [
82835
+ "access:read"
82836
+ ],
82837
+ summary: "List shares",
82838
+ description: "Whether sharing applies in this workspace (`available`), the shares the caller gave (`given`) and the shares naming the caller (`received`).\n",
82839
+ tags: [
82840
+ "Access & sharing"
82841
+ ],
82842
+ responses: {
82843
+ "200": {
82844
+ description: "OK",
82845
+ content: {
82846
+ "application/json": {
82847
+ schema: {
82848
+ type: "object",
82849
+ additionalProperties: true
82850
+ }
82851
+ }
82852
+ }
82853
+ },
82854
+ "401": {
82855
+ $ref: "#/components/responses/Unauthorized"
82856
+ },
82857
+ "403": {
82858
+ $ref: "#/components/responses/Forbidden"
82859
+ },
82860
+ "429": {
82861
+ $ref: "#/components/responses/RateLimitExceeded"
82862
+ }
82863
+ }
82864
+ }
82865
+ },
82866
+ "/v1/governance/documents/{id}/access": {
82867
+ get: {
82868
+ operationId: "getDocumentAccess",
82869
+ "x-audience": "public",
82870
+ "x-required-scopes": [
82871
+ "access:read"
82872
+ ],
82873
+ summary: "What you may do with a document",
82874
+ description: "For a document the caller can read: whether they may share it, write it and classify it (change its tags; a holder of its access scope only), and `pass_on`: whether they may pass it on (a share they received as a person with `may_pass_on`, its chain intact; false while the workspace's sub-shares switch is off). `managed: false` when the workspace is not on access scopes. A hidden document and a missing one answer 404 alike.\n",
82875
+ tags: [
82876
+ "Access & sharing"
82877
+ ],
82878
+ parameters: [
82879
+ {
82880
+ name: "id",
82881
+ in: "path",
82882
+ required: true,
82883
+ schema: {
82884
+ type: "string",
82885
+ format: "uuid"
82886
+ }
82887
+ }
82888
+ ],
82889
+ responses: {
82890
+ "200": {
82891
+ description: "OK",
82892
+ content: {
82893
+ "application/json": {
82894
+ schema: {
82895
+ type: "object",
82896
+ properties: {
82897
+ managed: {
82898
+ type: "boolean"
82899
+ },
82900
+ share: {
82901
+ type: "boolean"
82902
+ },
82903
+ write: {
82904
+ type: "boolean"
82905
+ },
82906
+ classify: {
82907
+ type: "boolean"
82908
+ }
82909
+ }
82910
+ }
82911
+ }
82912
+ }
82913
+ },
82914
+ "401": {
82915
+ $ref: "#/components/responses/Unauthorized"
82916
+ },
82917
+ "403": {
82918
+ $ref: "#/components/responses/Forbidden"
82919
+ },
82920
+ "404": {
82921
+ $ref: "#/components/responses/NotFound"
82922
+ },
82923
+ "429": {
82924
+ $ref: "#/components/responses/RateLimitExceeded"
82925
+ }
82926
+ }
82927
+ }
82928
+ },
82929
+ "/v1/governance/documents/{id}/shares": {
82930
+ get: {
82931
+ operationId: "listDocumentShares",
82932
+ "x-audience": "public",
82933
+ "x-required-scopes": [
82934
+ "access:read"
82935
+ ],
82936
+ summary: "List who a document is shared with",
82937
+ description: "The document shares of a document the caller holds, and the whole-scope shares of its scope. 404 when the caller does not hold it.\n",
82938
+ tags: [
82939
+ "Access & sharing"
82940
+ ],
82941
+ parameters: [
82942
+ {
82943
+ name: "id",
82944
+ in: "path",
82945
+ required: true,
82946
+ schema: {
82947
+ type: "string",
82948
+ format: "uuid"
82949
+ }
82950
+ }
82951
+ ],
82952
+ responses: {
82953
+ "200": {
82954
+ description: "OK",
82955
+ content: {
82956
+ "application/json": {
82957
+ schema: {
82958
+ type: "object",
82959
+ additionalProperties: true
82960
+ }
82961
+ }
82962
+ }
82963
+ },
82964
+ "401": {
82965
+ $ref: "#/components/responses/Unauthorized"
82966
+ },
82967
+ "403": {
82968
+ $ref: "#/components/responses/Forbidden"
82969
+ },
82970
+ "404": {
82971
+ $ref: "#/components/responses/NotFound"
82972
+ },
82973
+ "429": {
82974
+ $ref: "#/components/responses/RateLimitExceeded"
82975
+ }
82976
+ }
82977
+ }
82978
+ },
82979
+ "/v1/governance/shares/documents": {
82980
+ post: {
82981
+ operationId: "shareDocuments",
82982
+ "x-audience": "public",
82983
+ "x-required-scopes": [
82984
+ "access:write"
82985
+ ],
82986
+ summary: "Share documents",
82987
+ description: "Share documents the caller holds with a member, a workspace group or everyone, for reading, for `duration_days` or until stopped. Sharing a document again with the same principal replaces its window and note. Everything else in the workspace's access rules still applies to the recipient.\n",
82988
+ tags: [
82989
+ "Access & sharing"
82990
+ ],
82991
+ requestBody: {
82992
+ required: true,
82993
+ content: {
82994
+ "application/json": {
82995
+ schema: {
82996
+ type: "object",
82997
+ required: [
82998
+ "document_ids",
82999
+ "to"
83000
+ ],
83001
+ properties: {
83002
+ document_ids: {
83003
+ type: "array",
83004
+ minItems: 1,
83005
+ maxItems: 200,
83006
+ items: {
83007
+ type: "string",
83008
+ format: "uuid"
83009
+ }
83010
+ },
83011
+ to: {
83012
+ type: "object",
83013
+ required: [
83014
+ "type"
83015
+ ],
83016
+ properties: {
83017
+ type: {
83018
+ type: "string",
83019
+ enum: [
83020
+ "person",
83021
+ "group",
83022
+ "everyone"
83023
+ ]
83024
+ },
83025
+ id: {
83026
+ type: "string",
83027
+ format: "uuid",
83028
+ description: "The member or group; absent for everyone."
83029
+ }
83030
+ }
83031
+ },
83032
+ duration_days: {
83033
+ type: "integer",
83034
+ minimum: 1,
83035
+ maximum: 365,
83036
+ nullable: true
83037
+ },
83038
+ note: {
83039
+ type: "string",
83040
+ maxLength: 500
83041
+ },
83042
+ allow_pass_on: {
83043
+ type: "boolean",
83044
+ description: "Let the one member shared with pass it on (a person target only; needs the workspace's sub-shares switch). `false` withdraws it and ends what was passed on; omitted leaves it as it is."
83045
+ }
83046
+ }
83047
+ }
83048
+ }
83049
+ }
83050
+ },
83051
+ responses: {
83052
+ "201": {
83053
+ description: "Created",
83054
+ content: {
83055
+ "application/json": {
83056
+ schema: {
83057
+ type: "object",
83058
+ additionalProperties: true
83059
+ }
83060
+ }
83061
+ }
83062
+ },
83063
+ "400": {
83064
+ $ref: "#/components/responses/BadRequest"
83065
+ },
83066
+ "401": {
83067
+ $ref: "#/components/responses/Unauthorized"
83068
+ },
83069
+ "403": {
83070
+ $ref: "#/components/responses/Forbidden"
83071
+ },
83072
+ "404": {
83073
+ $ref: "#/components/responses/NotFound"
83074
+ },
83075
+ "409": {
83076
+ $ref: "#/components/responses/Conflict"
83077
+ },
83078
+ "429": {
83079
+ $ref: "#/components/responses/RateLimitExceeded"
83080
+ }
83081
+ }
83082
+ }
83083
+ },
83084
+ "/v1/governance/shares/pass-on": {
83085
+ post: {
83086
+ operationId: "passOnShare",
83087
+ "x-audience": "public",
83088
+ "x-required-scopes": [
83089
+ "access:write"
83090
+ ],
83091
+ summary: "Pass a share on",
83092
+ description: "Pass on a share the caller received with `may_pass_on` (given to them as a person by the holder): documents of it (`document_ids`), or the whole source (exactly one of `scope_id` / `source_connection_id`), to a member or a workspace group, never everyone. The new share is never wider than the one received: the same or fewer capabilities, ending at the latest when it ends (no `duration_days`: when it ends), and it cannot be passed on further. It holds only while the whole chain behind it does: the received share, its permission to pass on, the caller's membership and an active person holder of the source. The holders hear of it and can stop it. A document holding a sensitive field is not passed on. Needs the caller's member role and the workspace's sub-shares switch (409 while off). Something the caller may not pass on answers 404, like a missing one.\n",
83093
+ tags: [
83094
+ "Access & sharing"
83095
+ ],
83096
+ requestBody: {
83097
+ required: true,
83098
+ content: {
83099
+ "application/json": {
83100
+ schema: {
83101
+ type: "object",
83102
+ required: [
83103
+ "to"
83104
+ ],
83105
+ properties: {
83106
+ document_ids: {
83107
+ type: "array",
83108
+ minItems: 1,
83109
+ maxItems: 200,
83110
+ items: {
83111
+ type: "string",
83112
+ format: "uuid"
83113
+ }
83114
+ },
83115
+ scope_id: {
83116
+ type: "string",
83117
+ pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
83118
+ description: "An access scope (8-4-4-4-12 hex; version digits are arbitrary)."
83119
+ },
83120
+ source_connection_id: {
83121
+ type: "string",
83122
+ format: "uuid"
83123
+ },
83124
+ to: {
83125
+ type: "object",
83126
+ required: [
83127
+ "type",
83128
+ "id"
83129
+ ],
83130
+ properties: {
83131
+ type: {
83132
+ type: "string",
83133
+ enum: [
83134
+ "person",
83135
+ "group"
83136
+ ]
83137
+ },
83138
+ id: {
83139
+ type: "string",
83140
+ format: "uuid",
83141
+ description: "The member or group."
83142
+ }
83143
+ }
83144
+ },
83145
+ duration_days: {
83146
+ type: "integer",
83147
+ minimum: 1,
83148
+ maximum: 365,
83149
+ nullable: true
83150
+ },
83151
+ note: {
83152
+ type: "string",
83153
+ maxLength: 500
83154
+ }
83155
+ }
83156
+ }
83157
+ }
83158
+ }
83159
+ },
83160
+ responses: {
83161
+ "201": {
83162
+ description: "The shares written.",
83163
+ content: {
83164
+ "application/json": {
83165
+ schema: {
83166
+ type: "array",
83167
+ items: {
83168
+ type: "object",
83169
+ additionalProperties: true
83170
+ }
83171
+ }
83172
+ }
83173
+ }
83174
+ },
83175
+ "400": {
83176
+ $ref: "#/components/responses/BadRequest"
83177
+ },
83178
+ "401": {
83179
+ $ref: "#/components/responses/Unauthorized"
83180
+ },
83181
+ "403": {
83182
+ $ref: "#/components/responses/Forbidden"
83183
+ },
83184
+ "404": {
83185
+ $ref: "#/components/responses/NotFound"
83186
+ },
83187
+ "409": {
83188
+ $ref: "#/components/responses/Conflict"
83189
+ },
83190
+ "429": {
83191
+ $ref: "#/components/responses/RateLimitExceeded"
83192
+ }
83193
+ }
83194
+ }
83195
+ },
83196
+ "/v1/governance/shares/scopes": {
83197
+ post: {
83198
+ operationId: "shareScope",
83199
+ "x-audience": "public",
83200
+ "x-required-scopes": [
83201
+ "access:write"
83202
+ ],
83203
+ summary: "Share a whole source",
83204
+ description: "Share a whole source the caller holds in person, or their uploads, for reading: every document of it, new ones included, until stopped or for `duration_days`. Exactly one of `scope_id` / `source_connection_id`.\n",
83205
+ tags: [
83206
+ "Access & sharing"
83207
+ ],
83208
+ requestBody: {
83209
+ required: true,
83210
+ content: {
83211
+ "application/json": {
83212
+ schema: {
83213
+ type: "object",
83214
+ required: [
83215
+ "to"
83216
+ ],
83217
+ properties: {
83218
+ scope_id: {
83219
+ type: "string",
83220
+ pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
83221
+ description: "An access scope (8-4-4-4-12 hex; version digits are arbitrary)."
83222
+ },
83223
+ source_connection_id: {
83224
+ type: "string",
83225
+ format: "uuid"
83226
+ },
83227
+ to: {
83228
+ type: "object",
83229
+ required: [
83230
+ "type"
83231
+ ],
83232
+ properties: {
83233
+ type: {
83234
+ type: "string",
83235
+ enum: [
83236
+ "person",
83237
+ "group",
83238
+ "everyone"
83239
+ ]
83240
+ },
83241
+ id: {
83242
+ type: "string",
83243
+ format: "uuid",
83244
+ description: "The member or group; absent for everyone."
83245
+ }
83246
+ }
83247
+ },
83248
+ duration_days: {
83249
+ type: "integer",
83250
+ minimum: 1,
83251
+ maximum: 365,
83252
+ nullable: true
83253
+ },
83254
+ allow_pass_on: {
83255
+ type: "boolean",
83256
+ description: "Let the one member shared with pass it on (a person target only; needs the workspace's sub-shares switch). `false` withdraws it and ends what was passed on; omitted leaves it as it is."
83257
+ }
83258
+ }
83259
+ }
83260
+ }
83261
+ }
83262
+ },
83263
+ responses: {
83264
+ "201": {
83265
+ description: "Created",
83266
+ content: {
83267
+ "application/json": {
83268
+ schema: {
83269
+ type: "object",
83270
+ additionalProperties: true
83271
+ }
83272
+ }
83273
+ }
83274
+ },
83275
+ "400": {
83276
+ $ref: "#/components/responses/BadRequest"
83277
+ },
83278
+ "401": {
83279
+ $ref: "#/components/responses/Unauthorized"
83280
+ },
83281
+ "403": {
83282
+ $ref: "#/components/responses/Forbidden"
83283
+ },
83284
+ "404": {
83285
+ $ref: "#/components/responses/NotFound"
83286
+ },
83287
+ "409": {
83288
+ $ref: "#/components/responses/Conflict"
83289
+ },
83290
+ "429": {
83291
+ $ref: "#/components/responses/RateLimitExceeded"
83292
+ }
83293
+ }
83294
+ }
83295
+ },
83296
+ "/v1/governance/shares/workspace": {
83297
+ post: {
83298
+ operationId: "setWorkspaceOpen",
83299
+ "x-audience": "public",
83300
+ "x-required-scopes": [
83301
+ "access:write"
81827
83302
  ],
81828
- summary: "List your data items",
81829
- description: "What one kind of your data stands for (`uploads` or `extracted`), a page at a time, or one item by `id`.\n",
83303
+ summary: "Open or close a source to the workspace",
83304
+ description: "Where the workspace's governance default is `open`, every member reads what the access rules open to them, unless the holder closes the scope. Open (`open: true`) or close (`open: false`) a source the caller holds in person, or their uploads. Closed, its documents open only to holders, licences and shares. Exactly one of `scope_id` / `source_connection_id`.\n",
81830
83305
  tags: [
81831
- "My Data"
83306
+ "Access & sharing"
83307
+ ],
83308
+ requestBody: {
83309
+ required: true,
83310
+ content: {
83311
+ "application/json": {
83312
+ schema: {
83313
+ type: "object",
83314
+ required: [
83315
+ "open"
83316
+ ],
83317
+ properties: {
83318
+ scope_id: {
83319
+ type: "string",
83320
+ pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
83321
+ description: "An access scope (8-4-4-4-12 hex; version digits are arbitrary)."
83322
+ },
83323
+ source_connection_id: {
83324
+ type: "string",
83325
+ format: "uuid"
83326
+ },
83327
+ open: {
83328
+ type: "boolean"
83329
+ }
83330
+ }
83331
+ }
83332
+ }
83333
+ }
83334
+ },
83335
+ responses: {
83336
+ "200": {
83337
+ description: "The scope, with `open_to_workspace`.",
83338
+ content: {
83339
+ "application/json": {
83340
+ schema: {
83341
+ type: "object",
83342
+ additionalProperties: true
83343
+ }
83344
+ }
83345
+ }
83346
+ },
83347
+ "400": {
83348
+ $ref: "#/components/responses/BadRequest"
83349
+ },
83350
+ "401": {
83351
+ $ref: "#/components/responses/Unauthorized"
83352
+ },
83353
+ "403": {
83354
+ $ref: "#/components/responses/Forbidden"
83355
+ },
83356
+ "404": {
83357
+ $ref: "#/components/responses/NotFound"
83358
+ },
83359
+ "409": {
83360
+ $ref: "#/components/responses/Conflict"
83361
+ },
83362
+ "429": {
83363
+ $ref: "#/components/responses/RateLimitExceeded"
83364
+ }
83365
+ }
83366
+ }
83367
+ },
83368
+ "/v1/governance/shares/{kind}/{id}/stop": {
83369
+ post: {
83370
+ operationId: "stopShare",
83371
+ "x-audience": "public",
83372
+ "x-required-scopes": [
83373
+ "access:write"
83374
+ ],
83375
+ summary: "Stop a share",
83376
+ description: "Stop a share: its granter or a holder ends it; the person it names may remove it from their own access.\n",
83377
+ tags: [
83378
+ "Access & sharing"
81832
83379
  ],
81833
83380
  parameters: [
81834
83381
  {
81835
83382
  name: "kind",
81836
- in: "query",
83383
+ in: "path",
81837
83384
  required: true,
81838
83385
  schema: {
81839
83386
  type: "string",
81840
83387
  enum: [
81841
- "uploads",
81842
- "extracted"
83388
+ "document",
83389
+ "scope"
81843
83390
  ]
81844
83391
  }
81845
83392
  },
81846
83393
  {
81847
83394
  name: "id",
81848
- in: "query",
83395
+ in: "path",
83396
+ required: true,
81849
83397
  schema: {
81850
- type: "string"
83398
+ type: "string",
83399
+ format: "uuid"
83400
+ }
83401
+ }
83402
+ ],
83403
+ responses: {
83404
+ "200": {
83405
+ description: "OK",
83406
+ content: {
83407
+ "application/json": {
83408
+ schema: {
83409
+ type: "object",
83410
+ additionalProperties: true
83411
+ }
83412
+ }
83413
+ }
83414
+ },
83415
+ "400": {
83416
+ $ref: "#/components/responses/BadRequest"
83417
+ },
83418
+ "401": {
83419
+ $ref: "#/components/responses/Unauthorized"
83420
+ },
83421
+ "403": {
83422
+ $ref: "#/components/responses/Forbidden"
83423
+ },
83424
+ "404": {
83425
+ $ref: "#/components/responses/NotFound"
83426
+ },
83427
+ "409": {
83428
+ $ref: "#/components/responses/Conflict"
83429
+ },
83430
+ "429": {
83431
+ $ref: "#/components/responses/RateLimitExceeded"
83432
+ }
83433
+ }
83434
+ }
83435
+ },
83436
+ "/v1/governance/data-points": {
83437
+ get: {
83438
+ operationId: "listMyDataPoints",
83439
+ "x-audience": "public",
83440
+ "x-required-scopes": [
83441
+ "access:read"
83442
+ ],
83443
+ summary: "My data points",
83444
+ description: "The Specs run over the caller's own documents: per field, what the Spec proposes (kind, audience) and the\ncaller's confirmed choice, plus the caller's overlay (hide who it came from, date precision, documents left out).\n`available: false` when the workspace's documents do not follow the access scope model.\n",
83445
+ tags: [
83446
+ "Access & sharing"
83447
+ ],
83448
+ responses: {
83449
+ "200": {
83450
+ description: "OK",
83451
+ content: {
83452
+ "application/json": {
83453
+ schema: {
83454
+ type: "object",
83455
+ additionalProperties: true
83456
+ }
83457
+ }
81851
83458
  }
81852
83459
  },
83460
+ "400": {
83461
+ $ref: "#/components/responses/BadRequest"
83462
+ },
83463
+ "401": {
83464
+ $ref: "#/components/responses/Unauthorized"
83465
+ },
83466
+ "403": {
83467
+ $ref: "#/components/responses/Forbidden"
83468
+ },
83469
+ "404": {
83470
+ $ref: "#/components/responses/NotFound"
83471
+ },
83472
+ "409": {
83473
+ $ref: "#/components/responses/Conflict"
83474
+ },
83475
+ "429": {
83476
+ $ref: "#/components/responses/RateLimitExceeded"
83477
+ }
83478
+ }
83479
+ }
83480
+ },
83481
+ "/v1/governance/data-points/shared": {
83482
+ get: {
83483
+ operationId: "listSharedDataPoints",
83484
+ "x-audience": "public",
83485
+ "x-required-scopes": [
83486
+ "access:read"
83487
+ ],
83488
+ summary: "Data points shared with me",
83489
+ description: "Values of Spec fields colleagues shared with the caller, per Spec, lined up per row (`row_key`, opaque) with\ntheir context: document type, a date at the holder's precision, and who it came from unless the holder hides\nit. Never a document id, file name, link, source text or reasoning. At most 500 rows per Spec; `total_rows` and\n`truncated` say when more exist.\n",
83490
+ tags: [
83491
+ "Access & sharing"
83492
+ ],
83493
+ parameters: [
81853
83494
  {
81854
- name: "offset",
83495
+ name: "spec_id",
81855
83496
  in: "query",
83497
+ required: false,
81856
83498
  schema: {
81857
- type: "integer",
81858
- minimum: 0,
81859
- default: 0
83499
+ type: "string",
83500
+ format: "uuid"
81860
83501
  }
83502
+ }
83503
+ ],
83504
+ responses: {
83505
+ "200": {
83506
+ description: "OK",
83507
+ content: {
83508
+ "application/json": {
83509
+ schema: {
83510
+ type: "object",
83511
+ additionalProperties: true
83512
+ }
83513
+ }
83514
+ }
83515
+ },
83516
+ "400": {
83517
+ $ref: "#/components/responses/BadRequest"
81861
83518
  },
83519
+ "401": {
83520
+ $ref: "#/components/responses/Unauthorized"
83521
+ },
83522
+ "403": {
83523
+ $ref: "#/components/responses/Forbidden"
83524
+ },
83525
+ "404": {
83526
+ $ref: "#/components/responses/NotFound"
83527
+ },
83528
+ "409": {
83529
+ $ref: "#/components/responses/Conflict"
83530
+ },
83531
+ "429": {
83532
+ $ref: "#/components/responses/RateLimitExceeded"
83533
+ }
83534
+ }
83535
+ }
83536
+ },
83537
+ "/v1/governance/data-points/{specId}": {
83538
+ put: {
83539
+ operationId: "confirmDataPoints",
83540
+ "x-audience": "public",
83541
+ "x-required-scopes": [
83542
+ "access:write"
83543
+ ],
83544
+ summary: "Confirm my data points for one Spec",
83545
+ description: "The caller's choices for one Spec run over their own documents: per field an audience (`private`, `people`\nwith `shared_with`, `everyone`) and optionally their own kind; a `sensitive` field stays private. The overlay\n(`hide_holder`, `date_precision`, `excluded_document_ids`) applies to every field of the Spec. Nothing is shared\nbefore this call. 404 when the caller holds no document the Spec ran over.\n",
83546
+ tags: [
83547
+ "Access & sharing"
83548
+ ],
83549
+ parameters: [
81862
83550
  {
81863
- name: "limit",
81864
- in: "query",
83551
+ name: "specId",
83552
+ in: "path",
83553
+ required: true,
81865
83554
  schema: {
81866
- type: "integer",
81867
- minimum: 1,
81868
- default: 50
83555
+ type: "string",
83556
+ format: "uuid"
83557
+ }
83558
+ }
83559
+ ],
83560
+ requestBody: {
83561
+ required: true,
83562
+ content: {
83563
+ "application/json": {
83564
+ schema: {
83565
+ type: "object",
83566
+ required: [
83567
+ "fields"
83568
+ ],
83569
+ properties: {
83570
+ fields: {
83571
+ type: "array",
83572
+ items: {
83573
+ type: "object",
83574
+ required: [
83575
+ "field_key",
83576
+ "audience"
83577
+ ],
83578
+ properties: {
83579
+ field_key: {
83580
+ type: "string"
83581
+ },
83582
+ audience: {
83583
+ type: "string",
83584
+ enum: [
83585
+ "private",
83586
+ "people",
83587
+ "everyone"
83588
+ ]
83589
+ },
83590
+ kind: {
83591
+ type: "string",
83592
+ enum: [
83593
+ "plain",
83594
+ "customer_information",
83595
+ "personal",
83596
+ "sensitive"
83597
+ ],
83598
+ nullable: true
83599
+ },
83600
+ shared_with: {
83601
+ type: "array",
83602
+ items: {
83603
+ type: "string",
83604
+ format: "uuid"
83605
+ }
83606
+ }
83607
+ }
83608
+ }
83609
+ },
83610
+ hide_holder: {
83611
+ type: "boolean"
83612
+ },
83613
+ date_precision: {
83614
+ type: "string",
83615
+ enum: [
83616
+ "day",
83617
+ "month",
83618
+ "year",
83619
+ "none"
83620
+ ]
83621
+ },
83622
+ excluded_document_ids: {
83623
+ type: "array",
83624
+ items: {
83625
+ type: "string",
83626
+ format: "uuid"
83627
+ }
83628
+ }
83629
+ }
83630
+ }
83631
+ }
83632
+ }
83633
+ },
83634
+ responses: {
83635
+ "200": {
83636
+ description: "OK",
83637
+ content: {
83638
+ "application/json": {
83639
+ schema: {
83640
+ type: "object",
83641
+ additionalProperties: true
83642
+ }
83643
+ }
81869
83644
  }
81870
83645
  },
83646
+ "400": {
83647
+ $ref: "#/components/responses/BadRequest"
83648
+ },
83649
+ "401": {
83650
+ $ref: "#/components/responses/Unauthorized"
83651
+ },
83652
+ "403": {
83653
+ $ref: "#/components/responses/Forbidden"
83654
+ },
83655
+ "404": {
83656
+ $ref: "#/components/responses/NotFound"
83657
+ },
83658
+ "409": {
83659
+ $ref: "#/components/responses/Conflict"
83660
+ },
83661
+ "429": {
83662
+ $ref: "#/components/responses/RateLimitExceeded"
83663
+ }
83664
+ }
83665
+ }
83666
+ },
83667
+ "/v1/governance/data-points/{specId}/stop": {
83668
+ post: {
83669
+ operationId: "stopDataPoints",
83670
+ "x-audience": "public",
83671
+ "x-required-scopes": [
83672
+ "access:write"
83673
+ ],
83674
+ summary: "Stop sharing a Spec's data points",
83675
+ description: "Stops sharing every field of one Spec from the caller's documents. 404 when the caller shares none of it.\n",
83676
+ tags: [
83677
+ "Access & sharing"
83678
+ ],
83679
+ parameters: [
81871
83680
  {
81872
- name: "order",
81873
- in: "query",
83681
+ name: "specId",
83682
+ in: "path",
83683
+ required: true,
81874
83684
  schema: {
81875
83685
  type: "string",
81876
- enum: [
81877
- "time",
81878
- "state"
81879
- ],
81880
- default: "time"
83686
+ format: "uuid"
81881
83687
  }
81882
83688
  }
81883
83689
  ],
@@ -81888,43 +83694,106 @@ var openapi_default = {
81888
83694
  "application/json": {
81889
83695
  schema: {
81890
83696
  type: "object",
81891
- properties: {
81892
- items: {
81893
- type: "array",
81894
- items: {
81895
- type: "object",
81896
- additionalProperties: true
81897
- }
81898
- }
81899
- }
83697
+ additionalProperties: true
81900
83698
  }
81901
83699
  }
81902
83700
  }
81903
83701
  },
83702
+ "400": {
83703
+ $ref: "#/components/responses/BadRequest"
83704
+ },
81904
83705
  "401": {
81905
83706
  $ref: "#/components/responses/Unauthorized"
81906
83707
  },
81907
83708
  "403": {
81908
83709
  $ref: "#/components/responses/Forbidden"
81909
83710
  },
83711
+ "404": {
83712
+ $ref: "#/components/responses/NotFound"
83713
+ },
83714
+ "409": {
83715
+ $ref: "#/components/responses/Conflict"
83716
+ },
81910
83717
  "429": {
81911
83718
  $ref: "#/components/responses/RateLimitExceeded"
81912
83719
  }
81913
83720
  }
81914
83721
  }
81915
83722
  },
81916
- "/v1/me/workspace-data": {
83723
+ "/v1/me/workspace-data/groups": {
81917
83724
  get: {
81918
- operationId: "getMeWorkspaceData",
83725
+ operationId: "listMeWorkspaceDataGroups",
81919
83726
  "x-audience": "public",
81920
83727
  "x-required-scopes": [
81921
83728
  "documents:read"
81922
83729
  ],
81923
- summary: "Count workspace data by owner",
81924
- description: "The workspace's documents, fields and data points you can see, counted by whose they are: `me`, `shared` with you, or `company`.\n",
83730
+ summary: "Group workspace data",
83731
+ description: "The workspace's documents or data points you can see, counted per group (`by` source, document type, month or, for points, field) and per owner; narrow with the group parameters.\n",
81925
83732
  tags: [
81926
83733
  "My Data"
81927
83734
  ],
83735
+ parameters: [
83736
+ {
83737
+ name: "kind",
83738
+ in: "query",
83739
+ required: true,
83740
+ schema: {
83741
+ type: "string",
83742
+ enum: [
83743
+ "documents",
83744
+ "points"
83745
+ ]
83746
+ }
83747
+ },
83748
+ {
83749
+ name: "by",
83750
+ in: "query",
83751
+ schema: {
83752
+ type: "string",
83753
+ enum: [
83754
+ "source",
83755
+ "type",
83756
+ "month",
83757
+ "field",
83758
+ "all"
83759
+ ],
83760
+ default: "all"
83761
+ }
83762
+ },
83763
+ {
83764
+ name: "source",
83765
+ in: "query",
83766
+ description: "A source id, or `none`.",
83767
+ schema: {
83768
+ type: "string"
83769
+ }
83770
+ },
83771
+ {
83772
+ name: "type",
83773
+ in: "query",
83774
+ description: "A document type id, or `none`.",
83775
+ schema: {
83776
+ type: "string"
83777
+ }
83778
+ },
83779
+ {
83780
+ name: "month",
83781
+ in: "query",
83782
+ description: "Month, `YYYY-MM`.",
83783
+ schema: {
83784
+ type: "string",
83785
+ pattern: "^\\d{4}-(0[1-9]|1[0-2])$"
83786
+ }
83787
+ },
83788
+ {
83789
+ name: "field",
83790
+ in: "query",
83791
+ description: "A field id, or `none`.",
83792
+ schema: {
83793
+ type: "string"
83794
+ }
83795
+ }
83796
+ ],
81928
83797
  responses: {
81929
83798
  "200": {
81930
83799
  description: "OK",
@@ -81937,6 +83806,9 @@ var openapi_default = {
81937
83806
  }
81938
83807
  }
81939
83808
  },
83809
+ "400": {
83810
+ $ref: "#/components/responses/BadRequest"
83811
+ },
81940
83812
  "401": {
81941
83813
  $ref: "#/components/responses/Unauthorized"
81942
83814
  },
@@ -81957,7 +83829,7 @@ var openapi_default = {
81957
83829
  "documents:read"
81958
83830
  ],
81959
83831
  summary: "List workspace data by owner",
81960
- description: "The documents, fields or data points behind one of those counts, a page at a time.\n",
83832
+ description: "The documents or data points of one group and owner, newest first (pass a page's `next` as `after`), or the fields of one owner by `offset`.\n",
81961
83833
  tags: [
81962
83834
  "My Data"
81963
83835
  ],
@@ -81988,9 +83860,50 @@ var openapi_default = {
81988
83860
  ]
81989
83861
  }
81990
83862
  },
83863
+ {
83864
+ name: "source",
83865
+ in: "query",
83866
+ description: "A source id, or `none`.",
83867
+ schema: {
83868
+ type: "string"
83869
+ }
83870
+ },
83871
+ {
83872
+ name: "type",
83873
+ in: "query",
83874
+ description: "A document type id, or `none`.",
83875
+ schema: {
83876
+ type: "string"
83877
+ }
83878
+ },
83879
+ {
83880
+ name: "month",
83881
+ in: "query",
83882
+ description: "Month, `YYYY-MM`.",
83883
+ schema: {
83884
+ type: "string",
83885
+ pattern: "^\\d{4}-(0[1-9]|1[0-2])$"
83886
+ }
83887
+ },
83888
+ {
83889
+ name: "field",
83890
+ in: "query",
83891
+ description: "A field id, or `none`.",
83892
+ schema: {
83893
+ type: "string"
83894
+ }
83895
+ },
83896
+ {
83897
+ name: "after",
83898
+ in: "query",
83899
+ schema: {
83900
+ type: "string"
83901
+ }
83902
+ },
81991
83903
  {
81992
83904
  name: "offset",
81993
83905
  in: "query",
83906
+ description: "Fields only.",
81994
83907
  schema: {
81995
83908
  type: "integer",
81996
83909
  minimum: 0,
@@ -82014,19 +83927,14 @@ var openapi_default = {
82014
83927
  "application/json": {
82015
83928
  schema: {
82016
83929
  type: "object",
82017
- properties: {
82018
- items: {
82019
- type: "array",
82020
- items: {
82021
- type: "object",
82022
- additionalProperties: true
82023
- }
82024
- }
82025
- }
83930
+ additionalProperties: true
82026
83931
  }
82027
83932
  }
82028
83933
  }
82029
83934
  },
83935
+ "400": {
83936
+ $ref: "#/components/responses/BadRequest"
83937
+ },
82030
83938
  "401": {
82031
83939
  $ref: "#/components/responses/Unauthorized"
82032
83940
  },
@@ -82126,7 +84034,7 @@ var openapi_default = {
82126
84034
  type: "string",
82127
84035
  maxLength: 64
82128
84036
  },
82129
- description: "Unique key for idempotent requests, at most 64 characters (a longer key\nis refused with 400 `invalid_idempotency_key` before any work). If a\nrequest with the same key was already processed, the cached result is\nreturned.\n"
84037
+ description: "Unique key for idempotent requests, at most 64 characters (a longer key\nis refused with 400 `invalid_idempotency_key` before any work). A retry\nwith the same key, request and API key within 24 hours returns the\nfirst response with `Idempotent-Replayed: true`; the same key on a\ndifferent request or from another API key answers 422\n`idempotency_key_reused`. On `POST /v1/extract` the key caches the\nextraction result for the workspace instead: any key of the workspace\nsending it gets that result with `cached: true`.\n"
82130
84038
  },
82131
84039
  SourceConnectionId: {
82132
84040
  name: "connectionId",
@@ -83109,7 +85017,12 @@ var openapi_default = {
83109
85017
  },
83110
85018
  decision: {
83111
85019
  type: "object",
83112
- nullable: true
85020
+ nullable: true,
85021
+ description: "Null while undecided, or when withheld (`decision_withheld`)."
85022
+ },
85023
+ decision_withheld: {
85024
+ type: "boolean",
85025
+ description: "True when the run names a document the caller cannot read: the decision is composed over all of them, so it is not served."
83113
85026
  },
83114
85027
  decided_by: {
83115
85028
  type: "object",
@@ -83211,7 +85124,12 @@ var openapi_default = {
83211
85124
  },
83212
85125
  decision: {
83213
85126
  type: "object",
83214
- nullable: true
85127
+ nullable: true,
85128
+ description: "Null while undecided, or when withheld (`decision_withheld`)."
85129
+ },
85130
+ decision_withheld: {
85131
+ type: "boolean",
85132
+ description: "Present and true when the run names a document the caller cannot read: the decision is composed over all of them, so it is not served."
83215
85133
  },
83216
85134
  decided_by: {
83217
85135
  type: "object",