@talonic/docs 0.21.83 → 0.21.94

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,14 @@ var generated_nav_default = {
114
122
  {
115
123
  id: "ref-suggestions",
116
124
  label: "Suggestions"
125
+ },
126
+ {
127
+ id: "ref-team",
128
+ label: "Team"
129
+ },
130
+ {
131
+ id: "ref-access-and-sharing",
132
+ label: "Access & sharing"
117
133
  }
118
134
  ]
119
135
  };
@@ -124,7 +140,7 @@ var openapi_default = {
124
140
  info: {
125
141
  title: "Talonic API",
126
142
  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',
143
+ 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
144
  contact: {
129
145
  name: "Talonic Support",
130
146
  email: "support@talonic.ai",
@@ -469,6 +485,10 @@ var openapi_default = {
469
485
  {
470
486
  name: "My Data",
471
487
  description: "What you brought into the workspace, who can see it, and your sharing decisions. Always your own data, whichever credential asks."
488
+ },
489
+ {
490
+ name: "Access & sharing",
491
+ 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
492
  }
473
493
  ],
474
494
  paths: {
@@ -1925,6 +1945,122 @@ var openapi_default = {
1925
1945
  }
1926
1946
  }
1927
1947
  },
1948
+ "/v1/documents/{id}/mail-originals": {
1949
+ get: {
1950
+ operationId: "getDocumentMailOriginals",
1951
+ "x-audience": "public",
1952
+ tags: [
1953
+ "Documents"
1954
+ ],
1955
+ summary: "Get the original messages of an email document",
1956
+ 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",
1957
+ security: [
1958
+ {
1959
+ BearerAuth: []
1960
+ }
1961
+ ],
1962
+ "x-required-scopes": [
1963
+ "read"
1964
+ ],
1965
+ parameters: [
1966
+ {
1967
+ $ref: "#/components/parameters/ResourceId"
1968
+ }
1969
+ ],
1970
+ responses: {
1971
+ "200": {
1972
+ description: "The original messages, in the order they were stored.",
1973
+ content: {
1974
+ "application/json": {
1975
+ schema: {
1976
+ type: "object",
1977
+ required: [
1978
+ "originals"
1979
+ ],
1980
+ properties: {
1981
+ originals: {
1982
+ type: "array",
1983
+ items: {
1984
+ type: "object",
1985
+ required: [
1986
+ "asset_id",
1987
+ "message_id",
1988
+ "date",
1989
+ "from",
1990
+ "subject",
1991
+ "html",
1992
+ "text"
1993
+ ],
1994
+ properties: {
1995
+ asset_id: {
1996
+ type: "string",
1997
+ format: "uuid",
1998
+ description: "The stored original this message was read from."
1999
+ },
2000
+ message_id: {
2001
+ type: "string",
2002
+ nullable: true,
2003
+ description: "The message's own `Message-ID` header."
2004
+ },
2005
+ date: {
2006
+ type: "string",
2007
+ format: "date-time",
2008
+ nullable: true,
2009
+ description: "When the message was sent."
2010
+ },
2011
+ from: {
2012
+ type: "string",
2013
+ nullable: true
2014
+ },
2015
+ subject: {
2016
+ type: "string",
2017
+ nullable: true
2018
+ },
2019
+ html: {
2020
+ type: "string",
2021
+ nullable: true,
2022
+ description: "The HTML body as sent; null when the mail has none or it is larger than 1.5 MB."
2023
+ },
2024
+ text: {
2025
+ type: "string",
2026
+ nullable: true
2027
+ }
2028
+ }
2029
+ }
2030
+ }
2031
+ }
2032
+ },
2033
+ example: {
2034
+ originals: [
2035
+ {
2036
+ asset_id: "7f1c2b9e-4d3a-4e8b-9a61-0c5d2e8f4b10",
2037
+ message_id: "<CAF9x2k@mail.example.com>",
2038
+ date: "2026-10-02T08:14:00.000Z",
2039
+ from: '"Anna Weber" <anna.weber@example.com>',
2040
+ subject: "Invoice 4471203",
2041
+ html: "<p>Please find the invoice attached.</p>",
2042
+ text: "Please find the invoice attached."
2043
+ }
2044
+ ]
2045
+ }
2046
+ }
2047
+ }
2048
+ },
2049
+ "401": {
2050
+ $ref: "#/components/responses/Unauthorized"
2051
+ },
2052
+ "403": {
2053
+ $ref: "#/components/responses/Forbidden"
2054
+ },
2055
+ "404": {
2056
+ $ref: "#/components/responses/NotFound"
2057
+ },
2058
+ "429": {
2059
+ $ref: "#/components/responses/RateLimitExceeded"
2060
+ }
2061
+ }
2062
+ }
2063
+ },
1928
2064
  "/v1/documents/upload-session": {
1929
2065
  post: {
1930
2066
  operationId: "createUploadSession",
@@ -3134,6 +3270,73 @@ var openapi_default = {
3134
3270
  }
3135
3271
  }
3136
3272
  },
3273
+ "/v1/jobs/{id}/documents/{documentId}": {
3274
+ delete: {
3275
+ tags: [
3276
+ "Jobs & Batches"
3277
+ ],
3278
+ summary: "Take a document out of a structuring run",
3279
+ 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",
3280
+ operationId: "removeJobDocument",
3281
+ "x-audience": "public",
3282
+ "x-required-scopes": [
3283
+ "runs:write"
3284
+ ],
3285
+ security: [
3286
+ {
3287
+ BearerAuth: []
3288
+ }
3289
+ ],
3290
+ parameters: [
3291
+ {
3292
+ name: "id",
3293
+ in: "path",
3294
+ required: true,
3295
+ schema: {
3296
+ type: "string",
3297
+ format: "uuid"
3298
+ }
3299
+ },
3300
+ {
3301
+ name: "documentId",
3302
+ in: "path",
3303
+ required: true,
3304
+ schema: {
3305
+ type: "string",
3306
+ format: "uuid"
3307
+ }
3308
+ }
3309
+ ],
3310
+ responses: {
3311
+ "200": {
3312
+ description: "Removed",
3313
+ content: {
3314
+ "application/json": {
3315
+ schema: {
3316
+ type: "object",
3317
+ additionalProperties: true
3318
+ }
3319
+ }
3320
+ }
3321
+ },
3322
+ "400": {
3323
+ $ref: "#/components/responses/BadRequest"
3324
+ },
3325
+ "401": {
3326
+ $ref: "#/components/responses/Unauthorized"
3327
+ },
3328
+ "403": {
3329
+ $ref: "#/components/responses/Forbidden"
3330
+ },
3331
+ "404": {
3332
+ $ref: "#/components/responses/NotFound"
3333
+ },
3334
+ "429": {
3335
+ $ref: "#/components/responses/RateLimitExceeded"
3336
+ }
3337
+ }
3338
+ }
3339
+ },
3137
3340
  "/v1/jobs/{id}": {
3138
3341
  get: {
3139
3342
  operationId: "getJob",
@@ -24011,6 +24214,64 @@ var openapi_default = {
24011
24214
  }
24012
24215
  }
24013
24216
  },
24217
+ "/v1/documents/{id}/claims/recompute": {
24218
+ post: {
24219
+ tags: [
24220
+ "Provenance"
24221
+ ],
24222
+ summary: "Rebuild a document's claims",
24223
+ 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",
24224
+ operationId: "recomputeDocumentClaims",
24225
+ "x-audience": "public",
24226
+ "x-required-scopes": [
24227
+ "documents:write"
24228
+ ],
24229
+ security: [
24230
+ {
24231
+ BearerAuth: []
24232
+ }
24233
+ ],
24234
+ parameters: [
24235
+ {
24236
+ name: "id",
24237
+ in: "path",
24238
+ required: true,
24239
+ schema: {
24240
+ type: "string",
24241
+ format: "uuid"
24242
+ }
24243
+ }
24244
+ ],
24245
+ responses: {
24246
+ "200": {
24247
+ description: "Rebuilt",
24248
+ content: {
24249
+ "application/json": {
24250
+ schema: {
24251
+ type: "object",
24252
+ additionalProperties: true
24253
+ }
24254
+ }
24255
+ }
24256
+ },
24257
+ "400": {
24258
+ $ref: "#/components/responses/BadRequest"
24259
+ },
24260
+ "401": {
24261
+ $ref: "#/components/responses/Unauthorized"
24262
+ },
24263
+ "403": {
24264
+ $ref: "#/components/responses/Forbidden"
24265
+ },
24266
+ "404": {
24267
+ $ref: "#/components/responses/NotFound"
24268
+ },
24269
+ "429": {
24270
+ $ref: "#/components/responses/RateLimitExceeded"
24271
+ }
24272
+ }
24273
+ }
24274
+ },
24014
24275
  "/v1/documents/{id}/claims": {
24015
24276
  get: {
24016
24277
  tags: [
@@ -31193,6 +31454,7 @@ var openapi_default = {
31193
31454
  operationId: "getAppRunEvents",
31194
31455
  "x-audience": "public",
31195
31456
  summary: "Run journal (append-only, ordered)",
31457
+ description: "404 when the run names a document the caller cannot read (the journal carries the decision).",
31196
31458
  tags: [
31197
31459
  "Apps"
31198
31460
  ],
@@ -31210,6 +31472,9 @@ var openapi_default = {
31210
31472
  responses: {
31211
31473
  "200": {
31212
31474
  description: "Journal events."
31475
+ },
31476
+ "404": {
31477
+ $ref: "#/components/responses/NotFound"
31213
31478
  }
31214
31479
  }
31215
31480
  }
@@ -31722,7 +31987,7 @@ var openapi_default = {
31722
31987
  operationId: "getAppRunRecord",
31723
31988
  "x-audience": "public",
31724
31989
  summary: "Sealed decision record (the export; 404 until the run seals)",
31725
- description: "Reading the sealed record is an audited export (app.record_exported).",
31990
+ 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
31991
  tags: [
31727
31992
  "Apps"
31728
31993
  ],
@@ -54027,144 +54292,65 @@ var openapi_default = {
54027
54292
  }
54028
54293
  }
54029
54294
  },
54030
- "/v1/sources/s3/dedicated-egress": {
54295
+ "/v1/sources/egress": {
54296
+ get: {
54297
+ operationId: "getSourceEgress",
54298
+ "x-audience": "public",
54299
+ "x-required-scopes": [
54300
+ "read"
54301
+ ],
54302
+ summary: "Get the workspace's dedicated egress IPs",
54303
+ description: "Whether Talonic has given this workspace dedicated sync egress: every source then connects from fixed IP addresses that a customer firewall can allow. `ips` lists them when `enabled` is true and is empty otherwise.\n\n**Scope:** `read` or `sources:read`.\n",
54304
+ tags: [
54305
+ "Sources"
54306
+ ],
54307
+ responses: {
54308
+ "200": {
54309
+ description: "Egress state of the workspace.",
54310
+ content: {
54311
+ "application/json": {
54312
+ schema: {
54313
+ type: "object",
54314
+ required: [
54315
+ "enabled",
54316
+ "ips"
54317
+ ],
54318
+ properties: {
54319
+ enabled: {
54320
+ type: "boolean"
54321
+ },
54322
+ ips: {
54323
+ type: "array",
54324
+ items: {
54325
+ type: "string"
54326
+ }
54327
+ }
54328
+ }
54329
+ }
54330
+ }
54331
+ }
54332
+ },
54333
+ "401": {
54334
+ $ref: "#/components/responses/Unauthorized"
54335
+ },
54336
+ "403": {
54337
+ $ref: "#/components/responses/Forbidden"
54338
+ },
54339
+ "429": {
54340
+ $ref: "#/components/responses/RateLimitExceeded"
54341
+ }
54342
+ }
54343
+ }
54344
+ },
54345
+ "/v1/sources/slack/sign-in": {
54031
54346
  get: {
54032
- operationId: "getS3DedicatedEgress",
54347
+ operationId: "getSlackSignInAvailability",
54033
54348
  "x-audience": "public",
54034
54349
  "x-required-scopes": [
54035
54350
  "read"
54036
54351
  ],
54037
- summary: "Check dedicated egress for Amazon S3",
54038
- description: "Whether this workspace may route Amazon S3 connections through a fixed outbound address, for a system that only accepts traffic from allowlisted addresses. The same answer is served for Amazon S3, Kendox and SQL.\n\n**Scope:** `read` or `sources:read`.\n",
54039
- tags: [
54040
- "Sources"
54041
- ],
54042
- responses: {
54043
- "200": {
54044
- description: "Availability.",
54045
- content: {
54046
- "application/json": {
54047
- schema: {
54048
- type: "object",
54049
- required: [
54050
- "available"
54051
- ],
54052
- properties: {
54053
- available: {
54054
- type: "boolean"
54055
- }
54056
- }
54057
- }
54058
- }
54059
- }
54060
- },
54061
- "401": {
54062
- $ref: "#/components/responses/Unauthorized"
54063
- },
54064
- "403": {
54065
- $ref: "#/components/responses/Forbidden"
54066
- },
54067
- "429": {
54068
- $ref: "#/components/responses/RateLimitExceeded"
54069
- }
54070
- }
54071
- }
54072
- },
54073
- "/v1/sources/kendox/dedicated-egress": {
54074
- get: {
54075
- operationId: "getKendoxDedicatedEgress",
54076
- "x-audience": "public",
54077
- "x-required-scopes": [
54078
- "read"
54079
- ],
54080
- summary: "Check dedicated egress for Kendox",
54081
- description: "Whether this workspace may route Kendox connections through a fixed outbound address, for a system that only accepts traffic from allowlisted addresses. The same answer is served for Amazon S3, Kendox and SQL.\n\n**Scope:** `read` or `sources:read`.\n",
54082
- tags: [
54083
- "Sources"
54084
- ],
54085
- responses: {
54086
- "200": {
54087
- description: "Availability.",
54088
- content: {
54089
- "application/json": {
54090
- schema: {
54091
- type: "object",
54092
- required: [
54093
- "available"
54094
- ],
54095
- properties: {
54096
- available: {
54097
- type: "boolean"
54098
- }
54099
- }
54100
- }
54101
- }
54102
- }
54103
- },
54104
- "401": {
54105
- $ref: "#/components/responses/Unauthorized"
54106
- },
54107
- "403": {
54108
- $ref: "#/components/responses/Forbidden"
54109
- },
54110
- "429": {
54111
- $ref: "#/components/responses/RateLimitExceeded"
54112
- }
54113
- }
54114
- }
54115
- },
54116
- "/v1/sources/sql/dedicated-egress": {
54117
- get: {
54118
- operationId: "getSqlDedicatedEgress",
54119
- "x-audience": "public",
54120
- "x-required-scopes": [
54121
- "read"
54122
- ],
54123
- summary: "Check dedicated egress for SQL",
54124
- description: "Whether this workspace may route SQL connections through a fixed outbound address, for a system that only accepts traffic from allowlisted addresses. The same answer is served for Amazon S3, Kendox and SQL.\n\n**Scope:** `read` or `sources:read`.\n",
54125
- tags: [
54126
- "Sources"
54127
- ],
54128
- responses: {
54129
- "200": {
54130
- description: "Availability.",
54131
- content: {
54132
- "application/json": {
54133
- schema: {
54134
- type: "object",
54135
- required: [
54136
- "available"
54137
- ],
54138
- properties: {
54139
- available: {
54140
- type: "boolean"
54141
- }
54142
- }
54143
- }
54144
- }
54145
- }
54146
- },
54147
- "401": {
54148
- $ref: "#/components/responses/Unauthorized"
54149
- },
54150
- "403": {
54151
- $ref: "#/components/responses/Forbidden"
54152
- },
54153
- "429": {
54154
- $ref: "#/components/responses/RateLimitExceeded"
54155
- }
54156
- }
54157
- }
54158
- },
54159
- "/v1/sources/slack/sign-in": {
54160
- get: {
54161
- operationId: "getSlackSignInAvailability",
54162
- "x-audience": "public",
54163
- "x-required-scopes": [
54164
- "read"
54165
- ],
54166
- summary: "Check Slack sign-in availability",
54167
- description: "Whether this deployment offers connecting Slack through a browser sign-in (`POST /v1/integrations/slack/authorize`). When it does not, connect Slack with a token (`POST /v1/sources/connections/slack`).\n\n**Scope:** `read` or `sources:read`.\n",
54352
+ summary: "Check Slack sign-in availability",
54353
+ description: "Whether this deployment offers connecting Slack through a browser sign-in (`POST /v1/integrations/slack/authorize`). When it does not, connect Slack with a token (`POST /v1/sources/connections/slack`).\n\n**Scope:** `read` or `sources:read`.\n",
54168
54354
  tags: [
54169
54355
  "Sources"
54170
54356
  ],
@@ -54253,10 +54439,6 @@ var openapi_default = {
54253
54439
  type: "string",
54254
54440
  maxLength: 255,
54255
54441
  description: "Bucket name."
54256
- },
54257
- dedicated_egress: {
54258
- type: "boolean",
54259
- description: "Route every call through the workspace's fixed outbound address (see `GET /v1/sources/s3/dedicated-egress`)."
54260
54442
  }
54261
54443
  }
54262
54444
  }
@@ -54578,10 +54760,6 @@ var openapi_default = {
54578
54760
  maxLength: 1e3,
54579
54761
  writeOnly: true,
54580
54762
  description: "Password, for `auth_mode: password`. Write-only."
54581
- },
54582
- dedicated_egress: {
54583
- type: "boolean",
54584
- description: "Route every call through the workspace's fixed outbound address."
54585
54763
  }
54586
54764
  }
54587
54765
  }
@@ -54657,10 +54835,6 @@ var openapi_default = {
54657
54835
  maxLength: 2048,
54658
54836
  writeOnly: true,
54659
54837
  description: "Connection string including credentials. Write-only."
54660
- },
54661
- dedicated_egress: {
54662
- type: "boolean",
54663
- description: "Connect through the workspace's fixed outbound address."
54664
54838
  }
54665
54839
  }
54666
54840
  }
@@ -55909,10 +56083,6 @@ var openapi_default = {
55909
56083
  quick_extraction: {
55910
56084
  type: "boolean",
55911
56085
  description: "Use quick extraction for files brought in from this connection."
55912
- },
55913
- dedicated_egress: {
55914
- type: "boolean",
55915
- description: "Route every call through the workspace's fixed outbound address; turning it on checks the bucket is reachable that way first."
55916
56086
  }
55917
56087
  }
55918
56088
  }
@@ -55983,10 +56153,6 @@ var openapi_default = {
55983
56153
  type: "string",
55984
56154
  pattern: "^[a-z]{2}(-[A-Za-z]{2})?$",
55985
56155
  description: "Language for localized Kendox names, e.g. `de`, `en`, `de-CH`."
55986
- },
55987
- dedicated_egress: {
55988
- type: "boolean",
55989
- description: "Route every call through the workspace's fixed outbound address."
55990
56156
  }
55991
56157
  }
55992
56158
  }
@@ -56058,10 +56224,6 @@ var openapi_default = {
56058
56224
  minLength: 1,
56059
56225
  maxLength: 255,
56060
56226
  description: "New display name."
56061
- },
56062
- dedicated_egress: {
56063
- type: "boolean",
56064
- description: "Connect through the workspace's fixed outbound address; turning it on checks the database is reachable that way first."
56065
56227
  }
56066
56228
  }
56067
56229
  }
@@ -56989,7 +57151,7 @@ var openapi_default = {
56989
57151
  "documents:write"
56990
57152
  ],
56991
57153
  summary: "Import files from a connection",
56992
- description: "Brings the named files (ids from `GET /v1/sources/{id}/browse`) in as documents of the workspace, attributed to the caller's person, and processes them. Files already imported are skipped. A personal connection can be imported from only by the person who connected it. A key that belongs to no person (one created before keys named their creator) is refused with 403.\n\n**Scope:** `documents:write`. A key holding only the legacy `write` scope does not satisfy it.\n",
57154
+ description: "Brings the named files (ids from `GET /v1/sources/{id}/browse`) in as documents of the workspace, attributed to the caller's person, and processes them. Files already imported are skipped. A personal connection can be imported from only by the person who connected it. A key that belongs to no person (one created before keys named their creator) is refused with 403.\n\n**Two ways.** Without `async` the call imports before it answers (`201` with what was imported, skipped or failed): fit for a few files, since every file is fetched and read inside the request. With `async: true` the import is recorded and answered at once (`202` with the import run), then carried out in the background as the same person; read its progress and outcome from `GET /v1/sources/{id}/import-runs/{runId}`. Files that fail do not stop the others, and importing the same selection again brings in only what is not in yet. `folder_ids` (a mail, a thread, a directory: the files directly inside each are imported) exist only with `async: true`.\n\n**Scope:** `documents:write`. A key holding only the legacy `write` scope does not satisfy it.\n",
56993
57155
  tags: [
56994
57156
  "Sources"
56995
57157
  ],
@@ -57004,9 +57166,6 @@ var openapi_default = {
57004
57166
  "application/json": {
57005
57167
  schema: {
57006
57168
  type: "object",
57007
- required: [
57008
- "file_ids"
57009
- ],
57010
57169
  properties: {
57011
57170
  file_ids: {
57012
57171
  type: "array",
@@ -57015,7 +57174,20 @@ var openapi_default = {
57015
57174
  items: {
57016
57175
  type: "string"
57017
57176
  },
57018
- description: "File ids to import."
57177
+ description: "File ids to import. Required unless `async` is true and `folder_ids` names something."
57178
+ },
57179
+ folder_ids: {
57180
+ type: "array",
57181
+ maxItems: 500,
57182
+ items: {
57183
+ type: "string"
57184
+ },
57185
+ description: "Folder ids from browse (a mail, a thread, a directory). The files directly inside each are imported; each folder counts as one item of the run. Only with `async: true`.\n"
57186
+ },
57187
+ async: {
57188
+ type: "boolean",
57189
+ default: false,
57190
+ description: "True records the import and answers `202` with the run; the files are imported in the background."
57019
57191
  },
57020
57192
  tags: {
57021
57193
  type: "array",
@@ -57032,7 +57204,7 @@ var openapi_default = {
57032
57204
  },
57033
57205
  responses: {
57034
57206
  "201": {
57035
- description: "What was imported, skipped or failed.",
57207
+ description: "Without `async`. What was imported, skipped or failed.",
57036
57208
  content: {
57037
57209
  "application/json": {
57038
57210
  schema: {
@@ -57041,55 +57213,19 @@ var openapi_default = {
57041
57213
  }
57042
57214
  }
57043
57215
  },
57044
- "400": {
57045
- $ref: "#/components/responses/BadRequest"
57046
- },
57047
- "401": {
57048
- $ref: "#/components/responses/Unauthorized"
57049
- },
57050
- "403": {
57051
- $ref: "#/components/responses/Forbidden"
57052
- },
57053
- "404": {
57054
- $ref: "#/components/responses/NotFound"
57055
- },
57056
- "429": {
57057
- $ref: "#/components/responses/RateLimitExceeded"
57058
- }
57059
- }
57060
- }
57061
- },
57062
- "/v1/sources/{id}/imports": {
57063
- get: {
57064
- operationId: "listSourceImports",
57065
- "x-audience": "public",
57066
- "x-required-scopes": [
57067
- "read"
57068
- ],
57069
- summary: "List imports from a connection",
57070
- description: "What was brought in from the connection, one entry per imported file. Reads of a personal connection (a mailbox, notes, Slack) answer only to the person who connected it.\n\n**Scope:** `read` or `sources:read`.\n",
57071
- tags: [
57072
- "Sources"
57073
- ],
57074
- parameters: [
57075
- {
57076
- $ref: "#/components/parameters/ResourceId"
57077
- }
57078
- ],
57079
- responses: {
57080
- "200": {
57081
- description: "The imports.",
57216
+ "202": {
57217
+ description: "With `async: true`. The import run, still queued.",
57082
57218
  content: {
57083
57219
  "application/json": {
57084
57220
  schema: {
57085
- type: "array",
57086
- items: {
57087
- $ref: "#/components/schemas/SourceImport"
57088
- }
57221
+ $ref: "#/components/schemas/SourceImportRun"
57089
57222
  }
57090
57223
  }
57091
57224
  }
57092
57225
  },
57226
+ "400": {
57227
+ $ref: "#/components/responses/BadRequest"
57228
+ },
57093
57229
  "401": {
57094
57230
  $ref: "#/components/responses/Unauthorized"
57095
57231
  },
@@ -57105,15 +57241,15 @@ var openapi_default = {
57105
57241
  }
57106
57242
  }
57107
57243
  },
57108
- "/v1/sources/{id}/imports/{importId}/resync": {
57109
- post: {
57110
- operationId: "resyncSourceImport",
57244
+ "/v1/sources/{id}/import-runs": {
57245
+ get: {
57246
+ operationId: "listSourceImportRuns",
57111
57247
  "x-audience": "public",
57112
57248
  "x-required-scopes": [
57113
- "documents:write"
57249
+ "read"
57114
57250
  ],
57115
- summary: "Read a Microsoft Teams import again",
57116
- description: "Reads one imported Microsoft Teams conversation period again and brings in what is new; unchanged content is not processed again. A personal connection can be read again only by the person who connected it.\n\n**Scope:** `documents:write`. A key holding only the legacy `write` scope does not satisfy it.\n",
57251
+ summary: "List import runs of a connection",
57252
+ description: "The connection's latest import runs (imports started with `async: true`, or from the Sources page), newest first, without their failure lists. Reads of a personal connection (a mailbox, notes, Slack) answer only to the person who connected it.\n\n**Scope:** `read` or `sources:read`.\n",
57117
57253
  tags: [
57118
57254
  "Sources"
57119
57255
  ],
@@ -57122,35 +57258,27 @@ var openapi_default = {
57122
57258
  $ref: "#/components/parameters/ResourceId"
57123
57259
  },
57124
57260
  {
57125
- name: "importId",
57126
- in: "path",
57127
- required: true,
57261
+ name: "open",
57262
+ in: "query",
57263
+ required: false,
57128
57264
  schema: {
57129
- type: "string",
57130
- format: "uuid"
57265
+ type: "boolean"
57131
57266
  },
57132
- description: "Import UUID from `GET /v1/sources/{id}/imports`."
57267
+ description: "True keeps only runs that are still queued or running."
57133
57268
  }
57134
57269
  ],
57135
57270
  responses: {
57136
- "201": {
57137
- description: "Whether anything changed.",
57271
+ "200": {
57272
+ description: "The runs.",
57138
57273
  content: {
57139
57274
  "application/json": {
57140
57275
  schema: {
57141
57276
  type: "object",
57142
57277
  properties: {
57143
- status: {
57144
- type: "string",
57145
- enum: [
57146
- "up_to_date",
57147
- "refreshed"
57148
- ]
57149
- },
57150
- new_attachments: {
57278
+ data: {
57151
57279
  type: "array",
57152
57280
  items: {
57153
- type: "string"
57281
+ $ref: "#/components/schemas/SourceImportRun"
57154
57282
  }
57155
57283
  }
57156
57284
  }
@@ -57167,55 +57295,225 @@ var openapi_default = {
57167
57295
  "403": {
57168
57296
  $ref: "#/components/responses/Forbidden"
57169
57297
  },
57170
- "404": {
57171
- $ref: "#/components/responses/NotFound"
57172
- },
57173
57298
  "429": {
57174
57299
  $ref: "#/components/responses/RateLimitExceeded"
57175
57300
  }
57176
57301
  }
57177
57302
  }
57178
57303
  },
57179
- "/v1/sources/{id}/make-private": {
57180
- post: {
57181
- operationId: "makeSourceConnectionPrivate",
57304
+ "/v1/sources/{id}/import-runs/{runId}": {
57305
+ get: {
57306
+ operationId: "getSourceImportRun",
57182
57307
  "x-audience": "public",
57183
57308
  "x-required-scopes": [
57184
- "sources:write"
57309
+ "read"
57185
57310
  ],
57186
- summary: "Make a connection private",
57187
- description: "Restricts what the connection holds to the person who connected it (and the people they name). Idempotent: when a rule already restricts the connection, `created` is false. Allowed to the person who connected it, a member with the Integrations permission, or an owner.\n\n**Scope:** `sources:write`. A key holding only the legacy `write` scope does not satisfy it.\n",
57311
+ summary: "Read one import run",
57312
+ description: "Progress and outcome of one import run: how many items were asked for, how many are in, how many failed, and for each failure which item and why. `running` is true until the run has finished. Items already in stay in when others fail. Reads of a personal connection answer only to the person who connected it.\n\n**Scope:** `read` or `sources:read`.\n",
57188
57313
  tags: [
57189
57314
  "Sources"
57190
57315
  ],
57191
57316
  parameters: [
57192
57317
  {
57193
57318
  $ref: "#/components/parameters/ResourceId"
57319
+ },
57320
+ {
57321
+ name: "runId",
57322
+ in: "path",
57323
+ required: true,
57324
+ schema: {
57325
+ type: "string",
57326
+ format: "uuid"
57327
+ },
57328
+ description: "Import run UUID from `POST /v1/sources/{id}/import` (`async: true`) or `GET /v1/sources/{id}/import-runs`."
57194
57329
  }
57195
57330
  ],
57196
57331
  responses: {
57197
57332
  "200": {
57198
- description: "Whether a restriction was added.",
57333
+ description: "The run, with its failures named.",
57199
57334
  content: {
57200
57335
  "application/json": {
57201
57336
  schema: {
57202
- type: "object",
57203
- required: [
57204
- "created"
57205
- ],
57206
- properties: {
57207
- created: {
57208
- type: "boolean"
57209
- },
57210
- rule: {
57211
- type: "object",
57212
- additionalProperties: true,
57213
- description: "The visibility rule that was added."
57214
- },
57215
- message: {
57216
- type: "string"
57217
- }
57218
- }
57337
+ $ref: "#/components/schemas/SourceImportRun"
57338
+ }
57339
+ }
57340
+ }
57341
+ },
57342
+ "400": {
57343
+ $ref: "#/components/responses/BadRequest"
57344
+ },
57345
+ "401": {
57346
+ $ref: "#/components/responses/Unauthorized"
57347
+ },
57348
+ "403": {
57349
+ $ref: "#/components/responses/Forbidden"
57350
+ },
57351
+ "404": {
57352
+ $ref: "#/components/responses/NotFound"
57353
+ },
57354
+ "429": {
57355
+ $ref: "#/components/responses/RateLimitExceeded"
57356
+ }
57357
+ }
57358
+ }
57359
+ },
57360
+ "/v1/sources/{id}/imports": {
57361
+ get: {
57362
+ operationId: "listSourceImports",
57363
+ "x-audience": "public",
57364
+ "x-required-scopes": [
57365
+ "read"
57366
+ ],
57367
+ summary: "List imports from a connection",
57368
+ description: "What was brought in from the connection, one entry per imported file. Reads of a personal connection (a mailbox, notes, Slack) answer only to the person who connected it.\n\n**Scope:** `read` or `sources:read`.\n",
57369
+ tags: [
57370
+ "Sources"
57371
+ ],
57372
+ parameters: [
57373
+ {
57374
+ $ref: "#/components/parameters/ResourceId"
57375
+ }
57376
+ ],
57377
+ responses: {
57378
+ "200": {
57379
+ description: "The imports.",
57380
+ content: {
57381
+ "application/json": {
57382
+ schema: {
57383
+ type: "array",
57384
+ items: {
57385
+ $ref: "#/components/schemas/SourceImport"
57386
+ }
57387
+ }
57388
+ }
57389
+ }
57390
+ },
57391
+ "401": {
57392
+ $ref: "#/components/responses/Unauthorized"
57393
+ },
57394
+ "403": {
57395
+ $ref: "#/components/responses/Forbidden"
57396
+ },
57397
+ "404": {
57398
+ $ref: "#/components/responses/NotFound"
57399
+ },
57400
+ "429": {
57401
+ $ref: "#/components/responses/RateLimitExceeded"
57402
+ }
57403
+ }
57404
+ }
57405
+ },
57406
+ "/v1/sources/{id}/imports/{importId}/resync": {
57407
+ post: {
57408
+ operationId: "resyncSourceImport",
57409
+ "x-audience": "public",
57410
+ "x-required-scopes": [
57411
+ "documents:write"
57412
+ ],
57413
+ summary: "Read a Microsoft Teams import again",
57414
+ description: "Reads one imported Microsoft Teams conversation period again and brings in what is new; unchanged content is not processed again. A personal connection can be read again only by the person who connected it.\n\n**Scope:** `documents:write`. A key holding only the legacy `write` scope does not satisfy it.\n",
57415
+ tags: [
57416
+ "Sources"
57417
+ ],
57418
+ parameters: [
57419
+ {
57420
+ $ref: "#/components/parameters/ResourceId"
57421
+ },
57422
+ {
57423
+ name: "importId",
57424
+ in: "path",
57425
+ required: true,
57426
+ schema: {
57427
+ type: "string",
57428
+ format: "uuid"
57429
+ },
57430
+ description: "Import UUID from `GET /v1/sources/{id}/imports`."
57431
+ }
57432
+ ],
57433
+ responses: {
57434
+ "201": {
57435
+ description: "Whether anything changed.",
57436
+ content: {
57437
+ "application/json": {
57438
+ schema: {
57439
+ type: "object",
57440
+ properties: {
57441
+ status: {
57442
+ type: "string",
57443
+ enum: [
57444
+ "up_to_date",
57445
+ "refreshed"
57446
+ ]
57447
+ },
57448
+ new_attachments: {
57449
+ type: "array",
57450
+ items: {
57451
+ type: "string"
57452
+ }
57453
+ }
57454
+ }
57455
+ }
57456
+ }
57457
+ }
57458
+ },
57459
+ "400": {
57460
+ $ref: "#/components/responses/BadRequest"
57461
+ },
57462
+ "401": {
57463
+ $ref: "#/components/responses/Unauthorized"
57464
+ },
57465
+ "403": {
57466
+ $ref: "#/components/responses/Forbidden"
57467
+ },
57468
+ "404": {
57469
+ $ref: "#/components/responses/NotFound"
57470
+ },
57471
+ "429": {
57472
+ $ref: "#/components/responses/RateLimitExceeded"
57473
+ }
57474
+ }
57475
+ }
57476
+ },
57477
+ "/v1/sources/{id}/make-private": {
57478
+ post: {
57479
+ operationId: "makeSourceConnectionPrivate",
57480
+ "x-audience": "public",
57481
+ "x-required-scopes": [
57482
+ "sources:write"
57483
+ ],
57484
+ summary: "Make a connection private",
57485
+ description: "Restricts what the connection holds to the person who connected it (and the people they name). Idempotent: when a rule already restricts the connection, `created` is false. Allowed to the person who connected it, a member with the Integrations permission, or an owner.\n\n**Scope:** `sources:write`. A key holding only the legacy `write` scope does not satisfy it.\n",
57486
+ tags: [
57487
+ "Sources"
57488
+ ],
57489
+ parameters: [
57490
+ {
57491
+ $ref: "#/components/parameters/ResourceId"
57492
+ }
57493
+ ],
57494
+ responses: {
57495
+ "200": {
57496
+ description: "Whether a restriction was added.",
57497
+ content: {
57498
+ "application/json": {
57499
+ schema: {
57500
+ type: "object",
57501
+ required: [
57502
+ "created"
57503
+ ],
57504
+ properties: {
57505
+ created: {
57506
+ type: "boolean"
57507
+ },
57508
+ rule: {
57509
+ type: "object",
57510
+ additionalProperties: true,
57511
+ description: "The visibility rule that was added."
57512
+ },
57513
+ message: {
57514
+ type: "string"
57515
+ }
57516
+ }
57219
57517
  }
57220
57518
  }
57221
57519
  }
@@ -65128,7 +65426,7 @@ var openapi_default = {
65128
65426
  "Documents"
65129
65427
  ],
65130
65428
  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.",
65429
+ 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
65430
  security: [
65133
65431
  {
65134
65432
  BearerAuth: []
@@ -65139,14 +65437,7 @@ var openapi_default = {
65139
65437
  ],
65140
65438
  parameters: [
65141
65439
  {
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
- }
65440
+ $ref: "#/components/parameters/IdempotencyKey"
65150
65441
  }
65151
65442
  ],
65152
65443
  requestBody: {
@@ -65184,19 +65475,20 @@ var openapi_default = {
65184
65475
  }
65185
65476
  },
65186
65477
  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": {
65478
+ "201": {
65479
+ description: "The new document. On a retry with the same Idempotency-Key, the first copy with `Idempotent-Replayed: true`.",
65480
+ headers: {
65481
+ "Idempotent-Replayed": {
65191
65482
  schema: {
65192
- type: "object",
65193
- additionalProperties: true
65194
- }
65483
+ type: "string",
65484
+ enum: [
65485
+ "true",
65486
+ "false"
65487
+ ]
65488
+ },
65489
+ description: "`true` when the body is the stored answer to an earlier request with the same key."
65195
65490
  }
65196
- }
65197
- },
65198
- "201": {
65199
- description: "OK",
65491
+ },
65200
65492
  content: {
65201
65493
  "application/json": {
65202
65494
  schema: {
@@ -65236,13 +65528,13 @@ var openapi_default = {
65236
65528
  $ref: "#/components/responses/Forbidden"
65237
65529
  },
65238
65530
  "409": {
65239
- description: "`idempotency_key_reused` or `idempotency_in_progress` (retry shortly)."
65531
+ description: "`idempotency_request_in_progress`: a request with the same Idempotency-Key is still running; retry shortly."
65532
+ },
65533
+ "422": {
65534
+ description: "`idempotency_key_reused`: the Idempotency-Key was already used for a different request or by another API key."
65240
65535
  },
65241
65536
  "429": {
65242
65537
  $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
65538
  }
65247
65539
  }
65248
65540
  }
@@ -65552,7 +65844,7 @@ var openapi_default = {
65552
65844
  "Documents"
65553
65845
  ],
65554
65846
  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`.",
65847
+ 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
65848
  security: [
65557
65849
  {
65558
65850
  BearerAuth: []
@@ -65623,6 +65915,13 @@ var openapi_default = {
65623
65915
  type: "string"
65624
65916
  }
65625
65917
  },
65918
+ refused: {
65919
+ type: "array",
65920
+ items: {
65921
+ type: "string",
65922
+ format: "uuid"
65923
+ }
65924
+ },
65626
65925
  results: {
65627
65926
  type: "array",
65628
65927
  items: {
@@ -65635,7 +65934,8 @@ var openapi_default = {
65635
65934
  status: {
65636
65935
  type: "string",
65637
65936
  enum: [
65638
- "updated"
65937
+ "updated",
65938
+ "refused"
65639
65939
  ]
65640
65940
  },
65641
65941
  tags: {
@@ -70593,6 +70893,64 @@ var openapi_default = {
70593
70893
  }
70594
70894
  }
70595
70895
  },
70896
+ "/v1/documents/{id}/relation-claims/recompute": {
70897
+ post: {
70898
+ tags: [
70899
+ "Cases"
70900
+ ],
70901
+ summary: "Rebuild a document's relation claims",
70902
+ 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",
70903
+ operationId: "recomputeDocumentRelationClaims",
70904
+ "x-audience": "public",
70905
+ "x-required-scopes": [
70906
+ "cases:write"
70907
+ ],
70908
+ security: [
70909
+ {
70910
+ BearerAuth: []
70911
+ }
70912
+ ],
70913
+ parameters: [
70914
+ {
70915
+ name: "id",
70916
+ in: "path",
70917
+ required: true,
70918
+ schema: {
70919
+ type: "string",
70920
+ format: "uuid"
70921
+ }
70922
+ }
70923
+ ],
70924
+ responses: {
70925
+ "200": {
70926
+ description: "Rebuilt",
70927
+ content: {
70928
+ "application/json": {
70929
+ schema: {
70930
+ type: "object",
70931
+ additionalProperties: true
70932
+ }
70933
+ }
70934
+ }
70935
+ },
70936
+ "400": {
70937
+ $ref: "#/components/responses/BadRequest"
70938
+ },
70939
+ "401": {
70940
+ $ref: "#/components/responses/Unauthorized"
70941
+ },
70942
+ "403": {
70943
+ $ref: "#/components/responses/Forbidden"
70944
+ },
70945
+ "404": {
70946
+ $ref: "#/components/responses/NotFound"
70947
+ },
70948
+ "429": {
70949
+ $ref: "#/components/responses/RateLimitExceeded"
70950
+ }
70951
+ }
70952
+ }
70953
+ },
70596
70954
  "/v1/relation-claims/cases": {
70597
70955
  get: {
70598
70956
  operationId: "listReferenceCases",
@@ -77381,6 +77739,97 @@ var openapi_default = {
77381
77739
  }
77382
77740
  }
77383
77741
  },
77742
+ "/v1/team/members/{userId}/access-until": {
77743
+ put: {
77744
+ operationId: "setMemberAccessUntil",
77745
+ "x-required-scopes": [
77746
+ "team:write"
77747
+ ],
77748
+ "x-audience": "public",
77749
+ summary: "Make a membership temporary",
77750
+ description: "Sets when a member's membership ends, or `null` for no end. The hourly expiry then removes\nthe member with their shares and personal API keys, as a removal does. The moment must be\nin the future; nobody sets their own, and the workspace always keeps a member who holds `team`.\n\nScope: `team:write`. The person behind the credential needs the `team` permission\n(Admins by default).\n",
77751
+ tags: [
77752
+ "Team"
77753
+ ],
77754
+ parameters: [
77755
+ {
77756
+ name: "userId",
77757
+ in: "path",
77758
+ required: true,
77759
+ schema: {
77760
+ type: "string",
77761
+ format: "uuid"
77762
+ }
77763
+ }
77764
+ ],
77765
+ requestBody: {
77766
+ required: true,
77767
+ content: {
77768
+ "application/json": {
77769
+ schema: {
77770
+ type: "object",
77771
+ properties: {
77772
+ access_until: {
77773
+ oneOf: [
77774
+ {
77775
+ type: "string",
77776
+ format: "date-time"
77777
+ },
77778
+ {
77779
+ type: "null"
77780
+ }
77781
+ ]
77782
+ }
77783
+ },
77784
+ required: [
77785
+ "access_until"
77786
+ ]
77787
+ }
77788
+ }
77789
+ }
77790
+ },
77791
+ responses: {
77792
+ "200": {
77793
+ description: "Make a membership temporary: done.",
77794
+ content: {
77795
+ "application/json": {
77796
+ schema: {
77797
+ type: "object",
77798
+ properties: {
77799
+ user_id: {
77800
+ type: "string",
77801
+ format: "uuid"
77802
+ },
77803
+ access_until: {
77804
+ type: [
77805
+ "string",
77806
+ "null"
77807
+ ],
77808
+ format: "date-time"
77809
+ }
77810
+ }
77811
+ }
77812
+ }
77813
+ }
77814
+ },
77815
+ "400": {
77816
+ $ref: "#/components/responses/BadRequest"
77817
+ },
77818
+ "401": {
77819
+ $ref: "#/components/responses/Unauthorized"
77820
+ },
77821
+ "403": {
77822
+ $ref: "#/components/responses/Forbidden"
77823
+ },
77824
+ "404": {
77825
+ $ref: "#/components/responses/NotFound"
77826
+ },
77827
+ "429": {
77828
+ $ref: "#/components/responses/RateLimitExceeded"
77829
+ }
77830
+ }
77831
+ }
77832
+ },
77384
77833
  "/v1/team/role-permissions": {
77385
77834
  get: {
77386
77835
  operationId: "getRolePermissions",
@@ -79356,7 +79805,7 @@ var openapi_default = {
79356
79805
  "thread:read"
79357
79806
  ],
79358
79807
  summary: "Read the thread",
79359
- description: "The last exchange of your thread and anything waiting for your decision. `enabled: false` when the thread is not available to you; `cursor` is where to start reading events.\n",
79808
+ description: "The newest page of your conversation and anything waiting for your decision. `enabled: false` when the thread is not available to you; `cursor` is where to start reading events, and `has_older` says earlier messages can be read with the history route.\n",
79360
79809
  tags: [
79361
79810
  "Thread"
79362
79811
  ],
@@ -79456,6 +79905,76 @@ var openapi_default = {
79456
79905
  }
79457
79906
  }
79458
79907
  },
79908
+ "/v1/thread/history": {
79909
+ get: {
79910
+ operationId: "listThreadHistory",
79911
+ "x-audience": "public",
79912
+ "x-required-scopes": [
79913
+ "thread:read"
79914
+ ],
79915
+ summary: "Read earlier thread messages",
79916
+ description: "One page of your conversation further back: messages, reactions and decision cards before a given row, oldest first. Start from the `seq` of the oldest event you hold and repeat while `has_older` is true.\n",
79917
+ tags: [
79918
+ "Thread"
79919
+ ],
79920
+ parameters: [
79921
+ {
79922
+ name: "before",
79923
+ in: "query",
79924
+ schema: {
79925
+ type: "integer",
79926
+ minimum: 1
79927
+ },
79928
+ description: "The `seq` of the oldest event you already hold. Omitted, the newest page is returned."
79929
+ },
79930
+ {
79931
+ name: "limit",
79932
+ in: "query",
79933
+ schema: {
79934
+ type: "integer",
79935
+ minimum: 1,
79936
+ maximum: 100,
79937
+ default: 50
79938
+ }
79939
+ }
79940
+ ],
79941
+ responses: {
79942
+ "200": {
79943
+ description: "OK",
79944
+ content: {
79945
+ "application/json": {
79946
+ schema: {
79947
+ type: "object",
79948
+ properties: {
79949
+ events: {
79950
+ type: "array",
79951
+ items: {
79952
+ $ref: "#/components/schemas/ThreadEvent"
79953
+ }
79954
+ },
79955
+ has_older: {
79956
+ type: "boolean"
79957
+ }
79958
+ }
79959
+ }
79960
+ }
79961
+ }
79962
+ },
79963
+ "401": {
79964
+ $ref: "#/components/responses/Unauthorized"
79965
+ },
79966
+ "403": {
79967
+ $ref: "#/components/responses/Forbidden"
79968
+ },
79969
+ "404": {
79970
+ $ref: "#/components/responses/NotFound"
79971
+ },
79972
+ "429": {
79973
+ $ref: "#/components/responses/RateLimitExceeded"
79974
+ }
79975
+ }
79976
+ }
79977
+ },
79459
79978
  "/v1/thread/messages": {
79460
79979
  post: {
79461
79980
  operationId: "sendThreadMessage",
@@ -79631,106 +80150,37 @@ var openapi_default = {
79631
80150
  }
79632
80151
  }
79633
80152
  },
79634
- "/v1/thread/approvals/{id}": {
79635
- post: {
79636
- operationId: "decideThreadApproval",
80153
+ "/v1/thread/files/{documentId}": {
80154
+ get: {
80155
+ operationId: "getThreadFile",
79637
80156
  "x-audience": "public",
79638
80157
  "x-required-scopes": [
79639
- "thread:write"
80158
+ "thread:read"
79640
80159
  ],
79641
- summary: "Decide a held action",
79642
- description: "Approves or declines an action your thread is holding for you (an `approval` event without a draft). It is decided once: a second decision answers 404. The outcome arrives as events.\n",
80160
+ summary: "Get a picture you handed in",
80161
+ description: "A picture you handed your thread, as an image for showing it: upright and at most 1,600 pixels on its longer side. The id is `document_id` of an entry with `kind: image` in `meta.attachments` of your own message event. Anything else answers 404: a file that is not a picture, a document of the workspace, another person's file.\n",
79643
80162
  tags: [
79644
80163
  "Thread"
79645
80164
  ],
79646
80165
  parameters: [
79647
80166
  {
79648
- name: "id",
80167
+ name: "documentId",
79649
80168
  in: "path",
79650
80169
  required: true,
79651
80170
  schema: {
79652
80171
  type: "string",
79653
80172
  format: "uuid"
79654
- },
79655
- description: "The approval id from the card event (`meta.approvalId`)."
79656
- }
79657
- ],
79658
- requestBody: {
79659
- required: true,
79660
- content: {
79661
- "application/json": {
79662
- schema: {
79663
- type: "object",
79664
- required: [
79665
- "approved"
79666
- ],
79667
- properties: {
79668
- approved: {
79669
- type: "boolean"
79670
- }
79671
- }
79672
- }
79673
- }
79674
- }
79675
- },
79676
- responses: {
79677
- "202": {
79678
- description: "Accepted.",
79679
- content: {
79680
- "application/json": {
79681
- schema: {
79682
- type: "object",
79683
- properties: {
79684
- ok: {
79685
- type: "boolean"
79686
- }
79687
- }
79688
- }
79689
- }
79690
80173
  }
79691
- },
79692
- "401": {
79693
- $ref: "#/components/responses/Unauthorized"
79694
- },
79695
- "403": {
79696
- $ref: "#/components/responses/Forbidden"
79697
- },
79698
- "404": {
79699
- $ref: "#/components/responses/NotFound"
79700
- },
79701
- "429": {
79702
- $ref: "#/components/responses/RateLimitExceeded"
79703
80174
  }
79704
- }
79705
- }
79706
- },
79707
- "/v1/thread/drafts": {
79708
- get: {
79709
- operationId: "listThreadDrafts",
79710
- "x-audience": "public",
79711
- "x-required-scopes": [
79712
- "thread:read"
79713
- ],
79714
- summary: "List prepared drafts",
79715
- description: "The drafts your thread prepared and is waiting for you to approve: an email, a start of one of your processes, or sharing one of your documents. Each names what a decision must quote back.\n",
79716
- tags: [
79717
- "Thread"
79718
80175
  ],
79719
80176
  responses: {
79720
80177
  "200": {
79721
- description: "OK",
80178
+ description: "The picture.",
79722
80179
  content: {
79723
- "application/json": {
80180
+ "image/webp": {
79724
80181
  schema: {
79725
- type: "object",
79726
- properties: {
79727
- drafts: {
79728
- type: "array",
79729
- items: {
79730
- $ref: "#/components/schemas/ThreadDraft"
79731
- }
79732
- }
79733
- }
80182
+ type: "string",
80183
+ format: "binary"
79734
80184
  }
79735
80185
  }
79736
80186
  }
@@ -79750,27 +80200,28 @@ var openapi_default = {
79750
80200
  }
79751
80201
  }
79752
80202
  },
79753
- "/v1/thread/drafts/{approvalId}/decision": {
80203
+ "/v1/thread/approvals/{id}": {
79754
80204
  post: {
79755
- operationId: "decideThreadDraft",
80205
+ operationId: "decideThreadApproval",
79756
80206
  "x-audience": "public",
79757
80207
  "x-required-scopes": [
79758
80208
  "thread:write"
79759
80209
  ],
79760
- summary: "Approve or decline a draft",
79761
- description: "Approves or declines one draft, naming the version you saw (`draft_id`, `draft_version`, `payload_hash`). An approval carries the action out only for the current version of a card that is not too old. A repeated request answers what the first one did (`replayed: true`) and nothing is carried out twice.\n",
80210
+ summary: "Decide a held action",
80211
+ description: "Approves or declines an action your thread is holding for you (an `approval` event without a draft). It is decided once: a second decision answers 404. The outcome arrives as events.\n",
79762
80212
  tags: [
79763
80213
  "Thread"
79764
80214
  ],
79765
80215
  parameters: [
79766
80216
  {
79767
- name: "approvalId",
80217
+ name: "id",
79768
80218
  in: "path",
79769
80219
  required: true,
79770
80220
  schema: {
79771
80221
  type: "string",
79772
80222
  format: "uuid"
79773
- }
80223
+ },
80224
+ description: "The approval id from the card event (`meta.approvalId`)."
79774
80225
  }
79775
80226
  ],
79776
80227
  requestBody: {
@@ -79778,25 +80229,35 @@ var openapi_default = {
79778
80229
  content: {
79779
80230
  "application/json": {
79780
80231
  schema: {
79781
- $ref: "#/components/schemas/ThreadDraftDecision"
80232
+ type: "object",
80233
+ required: [
80234
+ "approved"
80235
+ ],
80236
+ properties: {
80237
+ approved: {
80238
+ type: "boolean"
80239
+ }
80240
+ }
79782
80241
  }
79783
80242
  }
79784
80243
  }
79785
80244
  },
79786
80245
  responses: {
79787
- "200": {
79788
- description: "OK",
80246
+ "202": {
80247
+ description: "Accepted.",
79789
80248
  content: {
79790
80249
  "application/json": {
79791
80250
  schema: {
79792
- $ref: "#/components/schemas/ThreadDraftOutcome"
80251
+ type: "object",
80252
+ properties: {
80253
+ ok: {
80254
+ type: "boolean"
80255
+ }
80256
+ }
79793
80257
  }
79794
80258
  }
79795
80259
  }
79796
80260
  },
79797
- "400": {
79798
- $ref: "#/components/responses/ValidationError"
79799
- },
79800
80261
  "401": {
79801
80262
  $ref: "#/components/responses/Unauthorized"
79802
80263
  },
@@ -79812,15 +80273,15 @@ var openapi_default = {
79812
80273
  }
79813
80274
  }
79814
80275
  },
79815
- "/v1/thread/sheets": {
80276
+ "/v1/thread/drafts": {
79816
80277
  get: {
79817
- operationId: "listThreadSheets",
80278
+ operationId: "listThreadDrafts",
79818
80279
  "x-audience": "public",
79819
80280
  "x-required-scopes": [
79820
80281
  "thread:read"
79821
80282
  ],
79822
- summary: "List screens",
79823
- description: "Your screens: tasks over a set of records that your thread opened for you. Open ones first, then done ones.\n",
80283
+ summary: "List prepared drafts",
80284
+ description: "The drafts your thread prepared and is waiting for you to approve: an email, a start of one of your processes, or sharing one of your documents. Each names what a decision must quote back.\n",
79824
80285
  tags: [
79825
80286
  "Thread"
79826
80287
  ],
@@ -79832,34 +80293,142 @@ var openapi_default = {
79832
80293
  schema: {
79833
80294
  type: "object",
79834
80295
  properties: {
79835
- sheets: {
80296
+ drafts: {
79836
80297
  type: "array",
79837
80298
  items: {
79838
- type: "object",
79839
- properties: {
79840
- id: {
79841
- type: "string",
79842
- format: "uuid"
79843
- },
79844
- title: {
79845
- type: "string"
79846
- },
79847
- status: {
79848
- type: "string",
79849
- enum: [
79850
- "open",
79851
- "done"
79852
- ]
79853
- },
79854
- createdAt: {
79855
- type: "string",
79856
- format: "date-time"
79857
- },
79858
- updatedAt: {
79859
- type: "string",
79860
- format: "date-time"
79861
- }
79862
- }
80299
+ $ref: "#/components/schemas/ThreadDraft"
80300
+ }
80301
+ }
80302
+ }
80303
+ }
80304
+ }
80305
+ }
80306
+ },
80307
+ "401": {
80308
+ $ref: "#/components/responses/Unauthorized"
80309
+ },
80310
+ "403": {
80311
+ $ref: "#/components/responses/Forbidden"
80312
+ },
80313
+ "404": {
80314
+ $ref: "#/components/responses/NotFound"
80315
+ },
80316
+ "429": {
80317
+ $ref: "#/components/responses/RateLimitExceeded"
80318
+ }
80319
+ }
80320
+ }
80321
+ },
80322
+ "/v1/thread/drafts/{approvalId}/decision": {
80323
+ post: {
80324
+ operationId: "decideThreadDraft",
80325
+ "x-audience": "public",
80326
+ "x-required-scopes": [
80327
+ "thread:write"
80328
+ ],
80329
+ summary: "Approve or decline a draft",
80330
+ description: "Approves or declines one draft, naming the version you saw (`draft_id`, `draft_version`, `payload_hash`). An approval carries the action out only for the current version of a card that is not too old. A repeated request answers what the first one did (`replayed: true`) and nothing is carried out twice.\n",
80331
+ tags: [
80332
+ "Thread"
80333
+ ],
80334
+ parameters: [
80335
+ {
80336
+ name: "approvalId",
80337
+ in: "path",
80338
+ required: true,
80339
+ schema: {
80340
+ type: "string",
80341
+ format: "uuid"
80342
+ }
80343
+ }
80344
+ ],
80345
+ requestBody: {
80346
+ required: true,
80347
+ content: {
80348
+ "application/json": {
80349
+ schema: {
80350
+ $ref: "#/components/schemas/ThreadDraftDecision"
80351
+ }
80352
+ }
80353
+ }
80354
+ },
80355
+ responses: {
80356
+ "200": {
80357
+ description: "OK",
80358
+ content: {
80359
+ "application/json": {
80360
+ schema: {
80361
+ $ref: "#/components/schemas/ThreadDraftOutcome"
80362
+ }
80363
+ }
80364
+ }
80365
+ },
80366
+ "400": {
80367
+ $ref: "#/components/responses/ValidationError"
80368
+ },
80369
+ "401": {
80370
+ $ref: "#/components/responses/Unauthorized"
80371
+ },
80372
+ "403": {
80373
+ $ref: "#/components/responses/Forbidden"
80374
+ },
80375
+ "404": {
80376
+ $ref: "#/components/responses/NotFound"
80377
+ },
80378
+ "429": {
80379
+ $ref: "#/components/responses/RateLimitExceeded"
80380
+ }
80381
+ }
80382
+ }
80383
+ },
80384
+ "/v1/thread/sheets": {
80385
+ get: {
80386
+ operationId: "listThreadSheets",
80387
+ "x-audience": "public",
80388
+ "x-required-scopes": [
80389
+ "thread:read"
80390
+ ],
80391
+ summary: "List screens",
80392
+ description: "Your screens: tasks over a set of records that your thread opened for you. Open ones first, then done ones.\n",
80393
+ tags: [
80394
+ "Thread"
80395
+ ],
80396
+ responses: {
80397
+ "200": {
80398
+ description: "OK",
80399
+ content: {
80400
+ "application/json": {
80401
+ schema: {
80402
+ type: "object",
80403
+ properties: {
80404
+ sheets: {
80405
+ type: "array",
80406
+ items: {
80407
+ type: "object",
80408
+ properties: {
80409
+ id: {
80410
+ type: "string",
80411
+ format: "uuid"
80412
+ },
80413
+ title: {
80414
+ type: "string"
80415
+ },
80416
+ status: {
80417
+ type: "string",
80418
+ enum: [
80419
+ "open",
80420
+ "done"
80421
+ ]
80422
+ },
80423
+ createdAt: {
80424
+ type: "string",
80425
+ format: "date-time"
80426
+ },
80427
+ updatedAt: {
80428
+ type: "string",
80429
+ format: "date-time"
80430
+ }
80431
+ }
79863
80432
  }
79864
80433
  }
79865
80434
  }
@@ -81762,7 +82331,1931 @@ var openapi_default = {
81762
82331
  }
81763
82332
  },
81764
82333
  "400": {
81765
- $ref: "#/components/responses/ValidationError"
82334
+ $ref: "#/components/responses/ValidationError"
82335
+ },
82336
+ "401": {
82337
+ $ref: "#/components/responses/Unauthorized"
82338
+ },
82339
+ "403": {
82340
+ $ref: "#/components/responses/Forbidden"
82341
+ },
82342
+ "404": {
82343
+ $ref: "#/components/responses/NotFound"
82344
+ },
82345
+ "409": {
82346
+ $ref: "#/components/responses/Conflict"
82347
+ },
82348
+ "429": {
82349
+ $ref: "#/components/responses/RateLimitExceeded"
82350
+ }
82351
+ }
82352
+ }
82353
+ },
82354
+ "/v1/me/data": {
82355
+ get: {
82356
+ operationId: "getMeData",
82357
+ "x-audience": "public",
82358
+ "x-required-scopes": [
82359
+ "documents:read"
82360
+ ],
82361
+ summary: "Count your data",
82362
+ description: "How much you brought into this workspace, per kind: uploads, values read out of them, decisions, apps and profile.\n",
82363
+ tags: [
82364
+ "My Data"
82365
+ ],
82366
+ responses: {
82367
+ "200": {
82368
+ description: "OK",
82369
+ content: {
82370
+ "application/json": {
82371
+ schema: {
82372
+ type: "object",
82373
+ additionalProperties: true
82374
+ }
82375
+ }
82376
+ }
82377
+ },
82378
+ "401": {
82379
+ $ref: "#/components/responses/Unauthorized"
82380
+ },
82381
+ "403": {
82382
+ $ref: "#/components/responses/Forbidden"
82383
+ },
82384
+ "429": {
82385
+ $ref: "#/components/responses/RateLimitExceeded"
82386
+ }
82387
+ }
82388
+ }
82389
+ },
82390
+ "/v1/me/data/groups": {
82391
+ get: {
82392
+ operationId: "listMeDataGroups",
82393
+ "x-audience": "public",
82394
+ "x-required-scopes": [
82395
+ "documents:read"
82396
+ ],
82397
+ summary: "Group your data",
82398
+ 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",
82399
+ tags: [
82400
+ "My Data"
82401
+ ],
82402
+ parameters: [
82403
+ {
82404
+ name: "kind",
82405
+ in: "query",
82406
+ required: true,
82407
+ schema: {
82408
+ type: "string",
82409
+ enum: [
82410
+ "uploads",
82411
+ "extracted"
82412
+ ]
82413
+ }
82414
+ },
82415
+ {
82416
+ name: "by",
82417
+ in: "query",
82418
+ schema: {
82419
+ type: "string",
82420
+ enum: [
82421
+ "source",
82422
+ "type",
82423
+ "month",
82424
+ "field",
82425
+ "all"
82426
+ ],
82427
+ default: "all"
82428
+ }
82429
+ },
82430
+ {
82431
+ name: "source",
82432
+ in: "query",
82433
+ description: "A source id, or `none`.",
82434
+ schema: {
82435
+ type: "string"
82436
+ }
82437
+ },
82438
+ {
82439
+ name: "type",
82440
+ in: "query",
82441
+ description: "A document type id, or `none`.",
82442
+ schema: {
82443
+ type: "string"
82444
+ }
82445
+ },
82446
+ {
82447
+ name: "month",
82448
+ in: "query",
82449
+ description: "Month, `YYYY-MM`.",
82450
+ schema: {
82451
+ type: "string",
82452
+ pattern: "^\\d{4}-(0[1-9]|1[0-2])$"
82453
+ }
82454
+ },
82455
+ {
82456
+ name: "field",
82457
+ in: "query",
82458
+ description: "A field id, or `none`.",
82459
+ schema: {
82460
+ type: "string"
82461
+ }
82462
+ }
82463
+ ],
82464
+ responses: {
82465
+ "200": {
82466
+ description: "OK",
82467
+ content: {
82468
+ "application/json": {
82469
+ schema: {
82470
+ type: "object",
82471
+ additionalProperties: true
82472
+ }
82473
+ }
82474
+ }
82475
+ },
82476
+ "400": {
82477
+ $ref: "#/components/responses/BadRequest"
82478
+ },
82479
+ "401": {
82480
+ $ref: "#/components/responses/Unauthorized"
82481
+ },
82482
+ "403": {
82483
+ $ref: "#/components/responses/Forbidden"
82484
+ },
82485
+ "429": {
82486
+ $ref: "#/components/responses/RateLimitExceeded"
82487
+ }
82488
+ }
82489
+ }
82490
+ },
82491
+ "/v1/me/data/items": {
82492
+ get: {
82493
+ operationId: "listMeDataItems",
82494
+ "x-audience": "public",
82495
+ "x-required-scopes": [
82496
+ "documents:read"
82497
+ ],
82498
+ summary: "List your data items",
82499
+ 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",
82500
+ tags: [
82501
+ "My Data"
82502
+ ],
82503
+ parameters: [
82504
+ {
82505
+ name: "kind",
82506
+ in: "query",
82507
+ required: true,
82508
+ schema: {
82509
+ type: "string",
82510
+ enum: [
82511
+ "uploads",
82512
+ "extracted"
82513
+ ]
82514
+ }
82515
+ },
82516
+ {
82517
+ name: "id",
82518
+ in: "query",
82519
+ schema: {
82520
+ type: "string"
82521
+ }
82522
+ },
82523
+ {
82524
+ name: "source",
82525
+ in: "query",
82526
+ description: "A source id, or `none`.",
82527
+ schema: {
82528
+ type: "string"
82529
+ }
82530
+ },
82531
+ {
82532
+ name: "type",
82533
+ in: "query",
82534
+ description: "A document type id, or `none`.",
82535
+ schema: {
82536
+ type: "string"
82537
+ }
82538
+ },
82539
+ {
82540
+ name: "month",
82541
+ in: "query",
82542
+ description: "Month, `YYYY-MM`.",
82543
+ schema: {
82544
+ type: "string",
82545
+ pattern: "^\\d{4}-(0[1-9]|1[0-2])$"
82546
+ }
82547
+ },
82548
+ {
82549
+ name: "field",
82550
+ in: "query",
82551
+ description: "A field id, or `none`.",
82552
+ schema: {
82553
+ type: "string"
82554
+ }
82555
+ },
82556
+ {
82557
+ name: "vis",
82558
+ in: "query",
82559
+ schema: {
82560
+ type: "string",
82561
+ enum: [
82562
+ "me",
82563
+ "shared",
82564
+ "company"
82565
+ ]
82566
+ }
82567
+ },
82568
+ {
82569
+ name: "after",
82570
+ in: "query",
82571
+ schema: {
82572
+ type: "string"
82573
+ }
82574
+ },
82575
+ {
82576
+ name: "limit",
82577
+ in: "query",
82578
+ schema: {
82579
+ type: "integer",
82580
+ minimum: 1,
82581
+ default: 50
82582
+ }
82583
+ }
82584
+ ],
82585
+ responses: {
82586
+ "200": {
82587
+ description: "OK",
82588
+ content: {
82589
+ "application/json": {
82590
+ schema: {
82591
+ type: "object",
82592
+ additionalProperties: true
82593
+ }
82594
+ }
82595
+ }
82596
+ },
82597
+ "400": {
82598
+ $ref: "#/components/responses/BadRequest"
82599
+ },
82600
+ "401": {
82601
+ $ref: "#/components/responses/Unauthorized"
82602
+ },
82603
+ "403": {
82604
+ $ref: "#/components/responses/Forbidden"
82605
+ },
82606
+ "429": {
82607
+ $ref: "#/components/responses/RateLimitExceeded"
82608
+ }
82609
+ }
82610
+ }
82611
+ },
82612
+ "/v1/me/workspace-data": {
82613
+ get: {
82614
+ operationId: "getMeWorkspaceData",
82615
+ "x-audience": "public",
82616
+ "x-required-scopes": [
82617
+ "documents:read"
82618
+ ],
82619
+ summary: "Count workspace data by owner",
82620
+ description: "The workspace's documents, fields and data points you can see, counted by whose they are: `me`, `shared` with you, or `company`.\n",
82621
+ tags: [
82622
+ "My Data"
82623
+ ],
82624
+ responses: {
82625
+ "200": {
82626
+ description: "OK",
82627
+ content: {
82628
+ "application/json": {
82629
+ schema: {
82630
+ type: "object",
82631
+ additionalProperties: true
82632
+ }
82633
+ }
82634
+ }
82635
+ },
82636
+ "401": {
82637
+ $ref: "#/components/responses/Unauthorized"
82638
+ },
82639
+ "403": {
82640
+ $ref: "#/components/responses/Forbidden"
82641
+ },
82642
+ "429": {
82643
+ $ref: "#/components/responses/RateLimitExceeded"
82644
+ }
82645
+ }
82646
+ }
82647
+ },
82648
+ "/v1/governance/directory": {
82649
+ get: {
82650
+ operationId: "getAccessDirectory",
82651
+ "x-audience": "public",
82652
+ "x-required-scopes": [
82653
+ "access:read"
82654
+ ],
82655
+ summary: "List sources and their holders",
82656
+ 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",
82657
+ tags: [
82658
+ "Access & sharing"
82659
+ ],
82660
+ responses: {
82661
+ "200": {
82662
+ description: "OK",
82663
+ content: {
82664
+ "application/json": {
82665
+ schema: {
82666
+ type: "object",
82667
+ additionalProperties: true
82668
+ }
82669
+ }
82670
+ }
82671
+ },
82672
+ "401": {
82673
+ $ref: "#/components/responses/Unauthorized"
82674
+ },
82675
+ "403": {
82676
+ $ref: "#/components/responses/Forbidden"
82677
+ },
82678
+ "429": {
82679
+ $ref: "#/components/responses/RateLimitExceeded"
82680
+ }
82681
+ }
82682
+ }
82683
+ },
82684
+ "/v1/governance/access-requests": {
82685
+ get: {
82686
+ operationId: "listAccessRequests",
82687
+ "x-audience": "public",
82688
+ "x-required-scopes": [
82689
+ "access:read"
82690
+ ],
82691
+ summary: "List access requests",
82692
+ 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",
82693
+ tags: [
82694
+ "Access & sharing"
82695
+ ],
82696
+ responses: {
82697
+ "200": {
82698
+ description: "OK",
82699
+ content: {
82700
+ "application/json": {
82701
+ schema: {
82702
+ type: "object",
82703
+ additionalProperties: true
82704
+ }
82705
+ }
82706
+ }
82707
+ },
82708
+ "401": {
82709
+ $ref: "#/components/responses/Unauthorized"
82710
+ },
82711
+ "403": {
82712
+ $ref: "#/components/responses/Forbidden"
82713
+ },
82714
+ "429": {
82715
+ $ref: "#/components/responses/RateLimitExceeded"
82716
+ }
82717
+ }
82718
+ },
82719
+ post: {
82720
+ operationId: "createAccessRequest",
82721
+ "x-audience": "public",
82722
+ "x-required-scopes": [
82723
+ "access:write"
82724
+ ],
82725
+ summary: "Ask for access",
82726
+ 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",
82727
+ tags: [
82728
+ "Access & sharing"
82729
+ ],
82730
+ requestBody: {
82731
+ required: true,
82732
+ content: {
82733
+ "application/json": {
82734
+ schema: {
82735
+ type: "object",
82736
+ required: [
82737
+ "purpose",
82738
+ "duration_days"
82739
+ ],
82740
+ properties: {
82741
+ scope_id: {
82742
+ type: "string",
82743
+ 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}$",
82744
+ description: "An access scope (8-4-4-4-12 hex; version digits are arbitrary)."
82745
+ },
82746
+ source_connection_id: {
82747
+ type: "string",
82748
+ format: "uuid"
82749
+ },
82750
+ document_id: {
82751
+ type: "string",
82752
+ format: "uuid"
82753
+ },
82754
+ purpose: {
82755
+ type: "string",
82756
+ maxLength: 500
82757
+ },
82758
+ duration_days: {
82759
+ type: "integer",
82760
+ minimum: 1,
82761
+ maximum: 90
82762
+ },
82763
+ capabilities: {
82764
+ type: "array",
82765
+ items: {
82766
+ type: "string",
82767
+ enum: [
82768
+ "delete",
82769
+ "discover",
82770
+ "read",
82771
+ "write"
82772
+ ]
82773
+ }
82774
+ }
82775
+ }
82776
+ }
82777
+ }
82778
+ }
82779
+ },
82780
+ responses: {
82781
+ "201": {
82782
+ description: "Created",
82783
+ content: {
82784
+ "application/json": {
82785
+ schema: {
82786
+ type: "object",
82787
+ additionalProperties: true
82788
+ }
82789
+ }
82790
+ }
82791
+ },
82792
+ "400": {
82793
+ $ref: "#/components/responses/BadRequest"
82794
+ },
82795
+ "401": {
82796
+ $ref: "#/components/responses/Unauthorized"
82797
+ },
82798
+ "403": {
82799
+ $ref: "#/components/responses/Forbidden"
82800
+ },
82801
+ "404": {
82802
+ $ref: "#/components/responses/NotFound"
82803
+ },
82804
+ "409": {
82805
+ $ref: "#/components/responses/Conflict"
82806
+ },
82807
+ "429": {
82808
+ $ref: "#/components/responses/RateLimitExceeded"
82809
+ }
82810
+ }
82811
+ }
82812
+ },
82813
+ "/v1/governance/access-requests/{id}/approve": {
82814
+ post: {
82815
+ operationId: "approveAccessRequest",
82816
+ "x-audience": "public",
82817
+ "x-required-scopes": [
82818
+ "access:write"
82819
+ ],
82820
+ summary: "Approve an access request",
82821
+ 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",
82822
+ tags: [
82823
+ "Access & sharing"
82824
+ ],
82825
+ parameters: [
82826
+ {
82827
+ name: "id",
82828
+ in: "path",
82829
+ required: true,
82830
+ schema: {
82831
+ type: "string",
82832
+ format: "uuid"
82833
+ }
82834
+ }
82835
+ ],
82836
+ responses: {
82837
+ "200": {
82838
+ description: "OK",
82839
+ content: {
82840
+ "application/json": {
82841
+ schema: {
82842
+ type: "object",
82843
+ additionalProperties: true
82844
+ }
82845
+ }
82846
+ }
82847
+ },
82848
+ "400": {
82849
+ $ref: "#/components/responses/BadRequest"
82850
+ },
82851
+ "401": {
82852
+ $ref: "#/components/responses/Unauthorized"
82853
+ },
82854
+ "403": {
82855
+ $ref: "#/components/responses/Forbidden"
82856
+ },
82857
+ "404": {
82858
+ $ref: "#/components/responses/NotFound"
82859
+ },
82860
+ "409": {
82861
+ $ref: "#/components/responses/Conflict"
82862
+ },
82863
+ "429": {
82864
+ $ref: "#/components/responses/RateLimitExceeded"
82865
+ }
82866
+ }
82867
+ }
82868
+ },
82869
+ "/v1/governance/access-requests/{id}/deny": {
82870
+ post: {
82871
+ operationId: "denyAccessRequest",
82872
+ "x-audience": "public",
82873
+ "x-required-scopes": [
82874
+ "access:write"
82875
+ ],
82876
+ summary: "Deny an access request",
82877
+ description: "A holder of the request's scope refuses a pending request, with a reason.\n",
82878
+ tags: [
82879
+ "Access & sharing"
82880
+ ],
82881
+ parameters: [
82882
+ {
82883
+ name: "id",
82884
+ in: "path",
82885
+ required: true,
82886
+ schema: {
82887
+ type: "string",
82888
+ format: "uuid"
82889
+ }
82890
+ }
82891
+ ],
82892
+ requestBody: {
82893
+ required: true,
82894
+ content: {
82895
+ "application/json": {
82896
+ schema: {
82897
+ type: "object",
82898
+ required: [
82899
+ "reason"
82900
+ ],
82901
+ properties: {
82902
+ reason: {
82903
+ type: "string",
82904
+ maxLength: 500
82905
+ }
82906
+ }
82907
+ }
82908
+ }
82909
+ }
82910
+ },
82911
+ responses: {
82912
+ "200": {
82913
+ description: "OK",
82914
+ content: {
82915
+ "application/json": {
82916
+ schema: {
82917
+ type: "object",
82918
+ additionalProperties: true
82919
+ }
82920
+ }
82921
+ }
82922
+ },
82923
+ "400": {
82924
+ $ref: "#/components/responses/BadRequest"
82925
+ },
82926
+ "401": {
82927
+ $ref: "#/components/responses/Unauthorized"
82928
+ },
82929
+ "403": {
82930
+ $ref: "#/components/responses/Forbidden"
82931
+ },
82932
+ "404": {
82933
+ $ref: "#/components/responses/NotFound"
82934
+ },
82935
+ "409": {
82936
+ $ref: "#/components/responses/Conflict"
82937
+ },
82938
+ "429": {
82939
+ $ref: "#/components/responses/RateLimitExceeded"
82940
+ }
82941
+ }
82942
+ }
82943
+ },
82944
+ "/v1/governance/access-requests/{id}/second": {
82945
+ post: {
82946
+ operationId: "secondAccessRequest",
82947
+ "x-audience": "public",
82948
+ "x-required-scopes": [
82949
+ "access:write"
82950
+ ],
82951
+ summary: "Decide an access request as data protection officer",
82952
+ 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",
82953
+ tags: [
82954
+ "Access & sharing"
82955
+ ],
82956
+ parameters: [
82957
+ {
82958
+ name: "id",
82959
+ in: "path",
82960
+ required: true,
82961
+ schema: {
82962
+ type: "string",
82963
+ format: "uuid"
82964
+ }
82965
+ }
82966
+ ],
82967
+ requestBody: {
82968
+ required: true,
82969
+ content: {
82970
+ "application/json": {
82971
+ schema: {
82972
+ type: "object",
82973
+ required: [
82974
+ "ok",
82975
+ "text"
82976
+ ],
82977
+ properties: {
82978
+ ok: {
82979
+ type: "boolean"
82980
+ },
82981
+ text: {
82982
+ type: "string"
82983
+ }
82984
+ }
82985
+ }
82986
+ }
82987
+ }
82988
+ },
82989
+ responses: {
82990
+ "200": {
82991
+ description: "OK",
82992
+ content: {
82993
+ "application/json": {
82994
+ schema: {
82995
+ type: "object",
82996
+ additionalProperties: true
82997
+ }
82998
+ }
82999
+ }
83000
+ },
83001
+ "400": {
83002
+ $ref: "#/components/responses/BadRequest"
83003
+ },
83004
+ "401": {
83005
+ $ref: "#/components/responses/Unauthorized"
83006
+ },
83007
+ "403": {
83008
+ $ref: "#/components/responses/Forbidden"
83009
+ },
83010
+ "404": {
83011
+ $ref: "#/components/responses/NotFound"
83012
+ },
83013
+ "409": {
83014
+ $ref: "#/components/responses/Conflict"
83015
+ },
83016
+ "429": {
83017
+ $ref: "#/components/responses/RateLimitExceeded"
83018
+ }
83019
+ }
83020
+ }
83021
+ },
83022
+ "/v1/governance/access-requests/{id}/stop": {
83023
+ post: {
83024
+ operationId: "stopAccessRequest",
83025
+ "x-audience": "public",
83026
+ "x-required-scopes": [
83027
+ "access:write"
83028
+ ],
83029
+ summary: "Stop an access request",
83030
+ description: "The requester or a holder ends an approved request; its licence or document share is revoked.\n",
83031
+ tags: [
83032
+ "Access & sharing"
83033
+ ],
83034
+ parameters: [
83035
+ {
83036
+ name: "id",
83037
+ in: "path",
83038
+ required: true,
83039
+ schema: {
83040
+ type: "string",
83041
+ format: "uuid"
83042
+ }
83043
+ }
83044
+ ],
83045
+ responses: {
83046
+ "200": {
83047
+ description: "OK",
83048
+ content: {
83049
+ "application/json": {
83050
+ schema: {
83051
+ type: "object",
83052
+ additionalProperties: true
83053
+ }
83054
+ }
83055
+ }
83056
+ },
83057
+ "400": {
83058
+ $ref: "#/components/responses/BadRequest"
83059
+ },
83060
+ "401": {
83061
+ $ref: "#/components/responses/Unauthorized"
83062
+ },
83063
+ "403": {
83064
+ $ref: "#/components/responses/Forbidden"
83065
+ },
83066
+ "404": {
83067
+ $ref: "#/components/responses/NotFound"
83068
+ },
83069
+ "409": {
83070
+ $ref: "#/components/responses/Conflict"
83071
+ },
83072
+ "429": {
83073
+ $ref: "#/components/responses/RateLimitExceeded"
83074
+ }
83075
+ }
83076
+ }
83077
+ },
83078
+ "/v1/governance/sharing": {
83079
+ get: {
83080
+ operationId: "getSharing",
83081
+ "x-audience": "public",
83082
+ "x-required-scopes": [
83083
+ "access:read"
83084
+ ],
83085
+ summary: "List shares",
83086
+ description: "Whether sharing applies in this workspace (`available`), the shares the caller gave (`given`) and the shares naming the caller (`received`).\n",
83087
+ tags: [
83088
+ "Access & sharing"
83089
+ ],
83090
+ responses: {
83091
+ "200": {
83092
+ description: "OK",
83093
+ content: {
83094
+ "application/json": {
83095
+ schema: {
83096
+ type: "object",
83097
+ additionalProperties: true
83098
+ }
83099
+ }
83100
+ }
83101
+ },
83102
+ "401": {
83103
+ $ref: "#/components/responses/Unauthorized"
83104
+ },
83105
+ "403": {
83106
+ $ref: "#/components/responses/Forbidden"
83107
+ },
83108
+ "429": {
83109
+ $ref: "#/components/responses/RateLimitExceeded"
83110
+ }
83111
+ }
83112
+ }
83113
+ },
83114
+ "/v1/governance/documents/{id}/access": {
83115
+ get: {
83116
+ operationId: "getDocumentAccess",
83117
+ "x-audience": "public",
83118
+ "x-required-scopes": [
83119
+ "access:read"
83120
+ ],
83121
+ summary: "What you may do with a document",
83122
+ 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",
83123
+ tags: [
83124
+ "Access & sharing"
83125
+ ],
83126
+ parameters: [
83127
+ {
83128
+ name: "id",
83129
+ in: "path",
83130
+ required: true,
83131
+ schema: {
83132
+ type: "string",
83133
+ format: "uuid"
83134
+ }
83135
+ }
83136
+ ],
83137
+ responses: {
83138
+ "200": {
83139
+ description: "OK",
83140
+ content: {
83141
+ "application/json": {
83142
+ schema: {
83143
+ type: "object",
83144
+ properties: {
83145
+ managed: {
83146
+ type: "boolean"
83147
+ },
83148
+ share: {
83149
+ type: "boolean"
83150
+ },
83151
+ write: {
83152
+ type: "boolean"
83153
+ },
83154
+ classify: {
83155
+ type: "boolean"
83156
+ }
83157
+ }
83158
+ }
83159
+ }
83160
+ }
83161
+ },
83162
+ "401": {
83163
+ $ref: "#/components/responses/Unauthorized"
83164
+ },
83165
+ "403": {
83166
+ $ref: "#/components/responses/Forbidden"
83167
+ },
83168
+ "404": {
83169
+ $ref: "#/components/responses/NotFound"
83170
+ },
83171
+ "429": {
83172
+ $ref: "#/components/responses/RateLimitExceeded"
83173
+ }
83174
+ }
83175
+ }
83176
+ },
83177
+ "/v1/governance/documents/{id}/shares": {
83178
+ get: {
83179
+ operationId: "listDocumentShares",
83180
+ "x-audience": "public",
83181
+ "x-required-scopes": [
83182
+ "access:read"
83183
+ ],
83184
+ summary: "List who a document is shared with",
83185
+ 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",
83186
+ tags: [
83187
+ "Access & sharing"
83188
+ ],
83189
+ parameters: [
83190
+ {
83191
+ name: "id",
83192
+ in: "path",
83193
+ required: true,
83194
+ schema: {
83195
+ type: "string",
83196
+ format: "uuid"
83197
+ }
83198
+ }
83199
+ ],
83200
+ responses: {
83201
+ "200": {
83202
+ description: "OK",
83203
+ content: {
83204
+ "application/json": {
83205
+ schema: {
83206
+ type: "object",
83207
+ additionalProperties: true
83208
+ }
83209
+ }
83210
+ }
83211
+ },
83212
+ "401": {
83213
+ $ref: "#/components/responses/Unauthorized"
83214
+ },
83215
+ "403": {
83216
+ $ref: "#/components/responses/Forbidden"
83217
+ },
83218
+ "404": {
83219
+ $ref: "#/components/responses/NotFound"
83220
+ },
83221
+ "429": {
83222
+ $ref: "#/components/responses/RateLimitExceeded"
83223
+ }
83224
+ }
83225
+ }
83226
+ },
83227
+ "/v1/governance/shares/documents": {
83228
+ post: {
83229
+ operationId: "shareDocuments",
83230
+ "x-audience": "public",
83231
+ "x-required-scopes": [
83232
+ "access:write"
83233
+ ],
83234
+ summary: "Share documents",
83235
+ 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",
83236
+ tags: [
83237
+ "Access & sharing"
83238
+ ],
83239
+ requestBody: {
83240
+ required: true,
83241
+ content: {
83242
+ "application/json": {
83243
+ schema: {
83244
+ type: "object",
83245
+ required: [
83246
+ "document_ids",
83247
+ "to"
83248
+ ],
83249
+ properties: {
83250
+ document_ids: {
83251
+ type: "array",
83252
+ minItems: 1,
83253
+ maxItems: 200,
83254
+ items: {
83255
+ type: "string",
83256
+ format: "uuid"
83257
+ }
83258
+ },
83259
+ to: {
83260
+ type: "object",
83261
+ required: [
83262
+ "type"
83263
+ ],
83264
+ properties: {
83265
+ type: {
83266
+ type: "string",
83267
+ enum: [
83268
+ "person",
83269
+ "group",
83270
+ "everyone"
83271
+ ]
83272
+ },
83273
+ id: {
83274
+ type: "string",
83275
+ format: "uuid",
83276
+ description: "The member or group; absent for everyone."
83277
+ }
83278
+ }
83279
+ },
83280
+ duration_days: {
83281
+ type: "integer",
83282
+ minimum: 1,
83283
+ maximum: 365,
83284
+ nullable: true
83285
+ },
83286
+ note: {
83287
+ type: "string",
83288
+ maxLength: 500
83289
+ },
83290
+ allow_pass_on: {
83291
+ type: "boolean",
83292
+ 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."
83293
+ }
83294
+ }
83295
+ }
83296
+ }
83297
+ }
83298
+ },
83299
+ responses: {
83300
+ "201": {
83301
+ description: "Created",
83302
+ content: {
83303
+ "application/json": {
83304
+ schema: {
83305
+ type: "object",
83306
+ additionalProperties: true
83307
+ }
83308
+ }
83309
+ }
83310
+ },
83311
+ "400": {
83312
+ $ref: "#/components/responses/BadRequest"
83313
+ },
83314
+ "401": {
83315
+ $ref: "#/components/responses/Unauthorized"
83316
+ },
83317
+ "403": {
83318
+ $ref: "#/components/responses/Forbidden"
83319
+ },
83320
+ "404": {
83321
+ $ref: "#/components/responses/NotFound"
83322
+ },
83323
+ "409": {
83324
+ $ref: "#/components/responses/Conflict"
83325
+ },
83326
+ "429": {
83327
+ $ref: "#/components/responses/RateLimitExceeded"
83328
+ }
83329
+ }
83330
+ }
83331
+ },
83332
+ "/v1/governance/shares/pass-on": {
83333
+ post: {
83334
+ operationId: "passOnShare",
83335
+ "x-audience": "public",
83336
+ "x-required-scopes": [
83337
+ "access:write"
83338
+ ],
83339
+ summary: "Pass a share on",
83340
+ 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",
83341
+ tags: [
83342
+ "Access & sharing"
83343
+ ],
83344
+ requestBody: {
83345
+ required: true,
83346
+ content: {
83347
+ "application/json": {
83348
+ schema: {
83349
+ type: "object",
83350
+ required: [
83351
+ "to"
83352
+ ],
83353
+ properties: {
83354
+ document_ids: {
83355
+ type: "array",
83356
+ minItems: 1,
83357
+ maxItems: 200,
83358
+ items: {
83359
+ type: "string",
83360
+ format: "uuid"
83361
+ }
83362
+ },
83363
+ scope_id: {
83364
+ type: "string",
83365
+ 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}$",
83366
+ description: "An access scope (8-4-4-4-12 hex; version digits are arbitrary)."
83367
+ },
83368
+ source_connection_id: {
83369
+ type: "string",
83370
+ format: "uuid"
83371
+ },
83372
+ to: {
83373
+ type: "object",
83374
+ required: [
83375
+ "type",
83376
+ "id"
83377
+ ],
83378
+ properties: {
83379
+ type: {
83380
+ type: "string",
83381
+ enum: [
83382
+ "person",
83383
+ "group"
83384
+ ]
83385
+ },
83386
+ id: {
83387
+ type: "string",
83388
+ format: "uuid",
83389
+ description: "The member or group."
83390
+ }
83391
+ }
83392
+ },
83393
+ duration_days: {
83394
+ type: "integer",
83395
+ minimum: 1,
83396
+ maximum: 365,
83397
+ nullable: true
83398
+ },
83399
+ note: {
83400
+ type: "string",
83401
+ maxLength: 500
83402
+ }
83403
+ }
83404
+ }
83405
+ }
83406
+ }
83407
+ },
83408
+ responses: {
83409
+ "201": {
83410
+ description: "The shares written.",
83411
+ content: {
83412
+ "application/json": {
83413
+ schema: {
83414
+ type: "array",
83415
+ items: {
83416
+ type: "object",
83417
+ additionalProperties: true
83418
+ }
83419
+ }
83420
+ }
83421
+ }
83422
+ },
83423
+ "400": {
83424
+ $ref: "#/components/responses/BadRequest"
83425
+ },
83426
+ "401": {
83427
+ $ref: "#/components/responses/Unauthorized"
83428
+ },
83429
+ "403": {
83430
+ $ref: "#/components/responses/Forbidden"
83431
+ },
83432
+ "404": {
83433
+ $ref: "#/components/responses/NotFound"
83434
+ },
83435
+ "409": {
83436
+ $ref: "#/components/responses/Conflict"
83437
+ },
83438
+ "429": {
83439
+ $ref: "#/components/responses/RateLimitExceeded"
83440
+ }
83441
+ }
83442
+ }
83443
+ },
83444
+ "/v1/governance/shares/scopes": {
83445
+ post: {
83446
+ operationId: "shareScope",
83447
+ "x-audience": "public",
83448
+ "x-required-scopes": [
83449
+ "access:write"
83450
+ ],
83451
+ summary: "Share a whole source",
83452
+ 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",
83453
+ tags: [
83454
+ "Access & sharing"
83455
+ ],
83456
+ requestBody: {
83457
+ required: true,
83458
+ content: {
83459
+ "application/json": {
83460
+ schema: {
83461
+ type: "object",
83462
+ required: [
83463
+ "to"
83464
+ ],
83465
+ properties: {
83466
+ scope_id: {
83467
+ type: "string",
83468
+ 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}$",
83469
+ description: "An access scope (8-4-4-4-12 hex; version digits are arbitrary)."
83470
+ },
83471
+ source_connection_id: {
83472
+ type: "string",
83473
+ format: "uuid"
83474
+ },
83475
+ to: {
83476
+ type: "object",
83477
+ required: [
83478
+ "type"
83479
+ ],
83480
+ properties: {
83481
+ type: {
83482
+ type: "string",
83483
+ enum: [
83484
+ "person",
83485
+ "group",
83486
+ "everyone"
83487
+ ]
83488
+ },
83489
+ id: {
83490
+ type: "string",
83491
+ format: "uuid",
83492
+ description: "The member or group; absent for everyone."
83493
+ }
83494
+ }
83495
+ },
83496
+ duration_days: {
83497
+ type: "integer",
83498
+ minimum: 1,
83499
+ maximum: 365,
83500
+ nullable: true
83501
+ },
83502
+ allow_pass_on: {
83503
+ type: "boolean",
83504
+ 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."
83505
+ }
83506
+ }
83507
+ }
83508
+ }
83509
+ }
83510
+ },
83511
+ responses: {
83512
+ "201": {
83513
+ description: "Created",
83514
+ content: {
83515
+ "application/json": {
83516
+ schema: {
83517
+ type: "object",
83518
+ additionalProperties: true
83519
+ }
83520
+ }
83521
+ }
83522
+ },
83523
+ "400": {
83524
+ $ref: "#/components/responses/BadRequest"
83525
+ },
83526
+ "401": {
83527
+ $ref: "#/components/responses/Unauthorized"
83528
+ },
83529
+ "403": {
83530
+ $ref: "#/components/responses/Forbidden"
83531
+ },
83532
+ "404": {
83533
+ $ref: "#/components/responses/NotFound"
83534
+ },
83535
+ "409": {
83536
+ $ref: "#/components/responses/Conflict"
83537
+ },
83538
+ "429": {
83539
+ $ref: "#/components/responses/RateLimitExceeded"
83540
+ }
83541
+ }
83542
+ }
83543
+ },
83544
+ "/v1/governance/level": {
83545
+ get: {
83546
+ operationId: "getGovernanceLevel",
83547
+ "x-audience": "public",
83548
+ "x-required-scopes": [
83549
+ "access:read"
83550
+ ],
83551
+ summary: "The workspace's data governance",
83552
+ description: "Whether data governance is on, its default (`open`: what the access rules open to the workspace stays open, holders close their sources; `private`: holders, licences and shares only), and a turn-on in progress (`enabling`). Workspace owners only.\n",
83553
+ tags: [
83554
+ "Access & sharing"
83555
+ ],
83556
+ responses: {
83557
+ "200": {
83558
+ description: "The governance status.",
83559
+ content: {
83560
+ "application/json": {
83561
+ schema: {
83562
+ type: "object",
83563
+ properties: {
83564
+ on: {
83565
+ type: "boolean"
83566
+ },
83567
+ default: {
83568
+ type: "string",
83569
+ enum: [
83570
+ "open",
83571
+ "private"
83572
+ ]
83573
+ },
83574
+ stored_default: {
83575
+ type: "string",
83576
+ enum: [
83577
+ "open",
83578
+ "private"
83579
+ ],
83580
+ nullable: true
83581
+ },
83582
+ since: {
83583
+ type: "string",
83584
+ nullable: true
83585
+ },
83586
+ enabled: {
83587
+ type: "boolean",
83588
+ description: "governance.enabled: this deployment runs the scope model."
83589
+ },
83590
+ decision_point_on: {
83591
+ type: "boolean"
83592
+ },
83593
+ field_tiers: {
83594
+ type: "boolean"
83595
+ },
83596
+ enabling: {
83597
+ type: "object",
83598
+ nullable: true,
83599
+ description: "A turn-on in progress: the workspace keeps its current access rules until the job has given every document its access scope; then governance switches on.",
83600
+ properties: {
83601
+ state: {
83602
+ type: "string",
83603
+ enum: [
83604
+ "preparing",
83605
+ "failed"
83606
+ ]
83607
+ },
83608
+ default: {
83609
+ type: "string",
83610
+ enum: [
83611
+ "open",
83612
+ "private"
83613
+ ]
83614
+ },
83615
+ requested_at: {
83616
+ type: "string",
83617
+ nullable: true
83618
+ },
83619
+ requested_by: {
83620
+ type: "string",
83621
+ nullable: true
83622
+ },
83623
+ done: {
83624
+ type: "integer",
83625
+ nullable: true,
83626
+ description: "Documents given their access scope so far."
83627
+ },
83628
+ total: {
83629
+ type: "integer",
83630
+ nullable: true
83631
+ },
83632
+ error: {
83633
+ type: "string",
83634
+ nullable: true
83635
+ }
83636
+ }
83637
+ }
83638
+ }
83639
+ }
83640
+ }
83641
+ }
83642
+ },
83643
+ "400": {
83644
+ $ref: "#/components/responses/BadRequest"
83645
+ },
83646
+ "401": {
83647
+ $ref: "#/components/responses/Unauthorized"
83648
+ },
83649
+ "403": {
83650
+ $ref: "#/components/responses/Forbidden"
83651
+ },
83652
+ "429": {
83653
+ $ref: "#/components/responses/RateLimitExceeded"
83654
+ }
83655
+ }
83656
+ },
83657
+ put: {
83658
+ operationId: "setGovernanceLevel",
83659
+ "x-audience": "public",
83660
+ "x-required-scopes": [
83661
+ "access:write"
83662
+ ],
83663
+ summary: "Turn data governance on or off",
83664
+ description: "Turn data governance on or off and choose its default. When documents still need their access scope, turning on answers at once with `enabling.state = preparing`; a background job gives every document its access scope and then switches governance on (poll `GET /v1/governance/level`). The workspace keeps its current access rules until then. A failed preparation is reported in `enabling.error`; turning on again continues where it stopped. Turning off is immediate and ends a preparation. Workspace owners only.\n",
83665
+ tags: [
83666
+ "Access & sharing"
83667
+ ],
83668
+ requestBody: {
83669
+ required: true,
83670
+ content: {
83671
+ "application/json": {
83672
+ schema: {
83673
+ type: "object",
83674
+ required: [
83675
+ "on"
83676
+ ],
83677
+ properties: {
83678
+ on: {
83679
+ type: "boolean"
83680
+ },
83681
+ default: {
83682
+ type: "string",
83683
+ enum: [
83684
+ "open",
83685
+ "private"
83686
+ ]
83687
+ }
83688
+ }
83689
+ }
83690
+ }
83691
+ }
83692
+ },
83693
+ responses: {
83694
+ "200": {
83695
+ description: "The governance status after the change (or with `enabling` while it prepares).",
83696
+ content: {
83697
+ "application/json": {
83698
+ schema: {
83699
+ type: "object",
83700
+ properties: {
83701
+ on: {
83702
+ type: "boolean"
83703
+ },
83704
+ default: {
83705
+ type: "string",
83706
+ enum: [
83707
+ "open",
83708
+ "private"
83709
+ ]
83710
+ },
83711
+ stored_default: {
83712
+ type: "string",
83713
+ enum: [
83714
+ "open",
83715
+ "private"
83716
+ ],
83717
+ nullable: true
83718
+ },
83719
+ since: {
83720
+ type: "string",
83721
+ nullable: true
83722
+ },
83723
+ enabled: {
83724
+ type: "boolean",
83725
+ description: "governance.enabled: this deployment runs the scope model."
83726
+ },
83727
+ decision_point_on: {
83728
+ type: "boolean"
83729
+ },
83730
+ field_tiers: {
83731
+ type: "boolean"
83732
+ },
83733
+ enabling: {
83734
+ type: "object",
83735
+ nullable: true,
83736
+ description: "A turn-on in progress: the workspace keeps its current access rules until the job has given every document its access scope; then governance switches on.",
83737
+ properties: {
83738
+ state: {
83739
+ type: "string",
83740
+ enum: [
83741
+ "preparing",
83742
+ "failed"
83743
+ ]
83744
+ },
83745
+ default: {
83746
+ type: "string",
83747
+ enum: [
83748
+ "open",
83749
+ "private"
83750
+ ]
83751
+ },
83752
+ requested_at: {
83753
+ type: "string",
83754
+ nullable: true
83755
+ },
83756
+ requested_by: {
83757
+ type: "string",
83758
+ nullable: true
83759
+ },
83760
+ done: {
83761
+ type: "integer",
83762
+ nullable: true,
83763
+ description: "Documents given their access scope so far."
83764
+ },
83765
+ total: {
83766
+ type: "integer",
83767
+ nullable: true
83768
+ },
83769
+ error: {
83770
+ type: "string",
83771
+ nullable: true
83772
+ }
83773
+ }
83774
+ }
83775
+ }
83776
+ }
83777
+ }
83778
+ }
83779
+ },
83780
+ "400": {
83781
+ $ref: "#/components/responses/BadRequest"
83782
+ },
83783
+ "401": {
83784
+ $ref: "#/components/responses/Unauthorized"
83785
+ },
83786
+ "403": {
83787
+ $ref: "#/components/responses/Forbidden"
83788
+ },
83789
+ "409": {
83790
+ $ref: "#/components/responses/Conflict"
83791
+ },
83792
+ "429": {
83793
+ $ref: "#/components/responses/RateLimitExceeded"
83794
+ }
83795
+ }
83796
+ }
83797
+ },
83798
+ "/v1/governance/level/dry-run": {
83799
+ get: {
83800
+ operationId: "dryRunGovernanceLevel",
83801
+ "x-audience": "public",
83802
+ "x-required-scopes": [
83803
+ "access:read"
83804
+ ],
83805
+ summary: "Who reads what under data governance",
83806
+ description: "Per active member: live documents read today and under governance with the given default (`default=open|private`, `open` when omitted), with how many they would gain or lose, and the stamp report (documents still needing their access scope). Reads only. Workspace owners only.\n",
83807
+ tags: [
83808
+ "Access & sharing"
83809
+ ],
83810
+ parameters: [
83811
+ {
83812
+ name: "default",
83813
+ in: "query",
83814
+ required: false,
83815
+ schema: {
83816
+ type: "string",
83817
+ enum: [
83818
+ "open",
83819
+ "private"
83820
+ ]
83821
+ }
83822
+ }
83823
+ ],
83824
+ responses: {
83825
+ "200": {
83826
+ description: "The dry run.",
83827
+ content: {
83828
+ "application/json": {
83829
+ schema: {
83830
+ type: "object",
83831
+ additionalProperties: true
83832
+ }
83833
+ }
83834
+ }
83835
+ },
83836
+ "400": {
83837
+ $ref: "#/components/responses/BadRequest"
83838
+ },
83839
+ "401": {
83840
+ $ref: "#/components/responses/Unauthorized"
83841
+ },
83842
+ "403": {
83843
+ $ref: "#/components/responses/Forbidden"
83844
+ },
83845
+ "429": {
83846
+ $ref: "#/components/responses/RateLimitExceeded"
83847
+ }
83848
+ }
83849
+ }
83850
+ },
83851
+ "/v1/governance/shares/workspace": {
83852
+ post: {
83853
+ operationId: "setWorkspaceOpen",
83854
+ "x-audience": "public",
83855
+ "x-required-scopes": [
83856
+ "access:write"
83857
+ ],
83858
+ summary: "Open or close a source to the workspace",
83859
+ 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",
83860
+ tags: [
83861
+ "Access & sharing"
83862
+ ],
83863
+ requestBody: {
83864
+ required: true,
83865
+ content: {
83866
+ "application/json": {
83867
+ schema: {
83868
+ type: "object",
83869
+ required: [
83870
+ "open"
83871
+ ],
83872
+ properties: {
83873
+ scope_id: {
83874
+ type: "string",
83875
+ 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}$",
83876
+ description: "An access scope (8-4-4-4-12 hex; version digits are arbitrary)."
83877
+ },
83878
+ source_connection_id: {
83879
+ type: "string",
83880
+ format: "uuid"
83881
+ },
83882
+ open: {
83883
+ type: "boolean"
83884
+ }
83885
+ }
83886
+ }
83887
+ }
83888
+ }
83889
+ },
83890
+ responses: {
83891
+ "200": {
83892
+ description: "The scope, with `open_to_workspace`.",
83893
+ content: {
83894
+ "application/json": {
83895
+ schema: {
83896
+ type: "object",
83897
+ additionalProperties: true
83898
+ }
83899
+ }
83900
+ }
83901
+ },
83902
+ "400": {
83903
+ $ref: "#/components/responses/BadRequest"
83904
+ },
83905
+ "401": {
83906
+ $ref: "#/components/responses/Unauthorized"
83907
+ },
83908
+ "403": {
83909
+ $ref: "#/components/responses/Forbidden"
83910
+ },
83911
+ "404": {
83912
+ $ref: "#/components/responses/NotFound"
83913
+ },
83914
+ "409": {
83915
+ $ref: "#/components/responses/Conflict"
83916
+ },
83917
+ "429": {
83918
+ $ref: "#/components/responses/RateLimitExceeded"
83919
+ }
83920
+ }
83921
+ }
83922
+ },
83923
+ "/v1/governance/shares/{kind}/{id}/stop": {
83924
+ post: {
83925
+ operationId: "stopShare",
83926
+ "x-audience": "public",
83927
+ "x-required-scopes": [
83928
+ "access:write"
83929
+ ],
83930
+ summary: "Stop a share",
83931
+ description: "Stop a share: its granter or a holder ends it; the person it names may remove it from their own access.\n",
83932
+ tags: [
83933
+ "Access & sharing"
83934
+ ],
83935
+ parameters: [
83936
+ {
83937
+ name: "kind",
83938
+ in: "path",
83939
+ required: true,
83940
+ schema: {
83941
+ type: "string",
83942
+ enum: [
83943
+ "document",
83944
+ "scope"
83945
+ ]
83946
+ }
83947
+ },
83948
+ {
83949
+ name: "id",
83950
+ in: "path",
83951
+ required: true,
83952
+ schema: {
83953
+ type: "string",
83954
+ format: "uuid"
83955
+ }
83956
+ }
83957
+ ],
83958
+ responses: {
83959
+ "200": {
83960
+ description: "OK",
83961
+ content: {
83962
+ "application/json": {
83963
+ schema: {
83964
+ type: "object",
83965
+ additionalProperties: true
83966
+ }
83967
+ }
83968
+ }
83969
+ },
83970
+ "400": {
83971
+ $ref: "#/components/responses/BadRequest"
83972
+ },
83973
+ "401": {
83974
+ $ref: "#/components/responses/Unauthorized"
83975
+ },
83976
+ "403": {
83977
+ $ref: "#/components/responses/Forbidden"
83978
+ },
83979
+ "404": {
83980
+ $ref: "#/components/responses/NotFound"
83981
+ },
83982
+ "409": {
83983
+ $ref: "#/components/responses/Conflict"
83984
+ },
83985
+ "429": {
83986
+ $ref: "#/components/responses/RateLimitExceeded"
83987
+ }
83988
+ }
83989
+ }
83990
+ },
83991
+ "/v1/governance/data-points": {
83992
+ get: {
83993
+ operationId: "listMyDataPoints",
83994
+ "x-audience": "public",
83995
+ "x-required-scopes": [
83996
+ "access:read"
83997
+ ],
83998
+ summary: "My data points",
83999
+ 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",
84000
+ tags: [
84001
+ "Access & sharing"
84002
+ ],
84003
+ responses: {
84004
+ "200": {
84005
+ description: "OK",
84006
+ content: {
84007
+ "application/json": {
84008
+ schema: {
84009
+ type: "object",
84010
+ additionalProperties: true
84011
+ }
84012
+ }
84013
+ }
84014
+ },
84015
+ "400": {
84016
+ $ref: "#/components/responses/BadRequest"
84017
+ },
84018
+ "401": {
84019
+ $ref: "#/components/responses/Unauthorized"
84020
+ },
84021
+ "403": {
84022
+ $ref: "#/components/responses/Forbidden"
84023
+ },
84024
+ "404": {
84025
+ $ref: "#/components/responses/NotFound"
84026
+ },
84027
+ "409": {
84028
+ $ref: "#/components/responses/Conflict"
84029
+ },
84030
+ "429": {
84031
+ $ref: "#/components/responses/RateLimitExceeded"
84032
+ }
84033
+ }
84034
+ }
84035
+ },
84036
+ "/v1/governance/data-points/shared": {
84037
+ get: {
84038
+ operationId: "listSharedDataPoints",
84039
+ "x-audience": "public",
84040
+ "x-required-scopes": [
84041
+ "access:read"
84042
+ ],
84043
+ summary: "Data points shared with me",
84044
+ 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",
84045
+ tags: [
84046
+ "Access & sharing"
84047
+ ],
84048
+ parameters: [
84049
+ {
84050
+ name: "spec_id",
84051
+ in: "query",
84052
+ required: false,
84053
+ schema: {
84054
+ type: "string",
84055
+ format: "uuid"
84056
+ }
84057
+ }
84058
+ ],
84059
+ responses: {
84060
+ "200": {
84061
+ description: "OK",
84062
+ content: {
84063
+ "application/json": {
84064
+ schema: {
84065
+ type: "object",
84066
+ additionalProperties: true
84067
+ }
84068
+ }
84069
+ }
84070
+ },
84071
+ "400": {
84072
+ $ref: "#/components/responses/BadRequest"
84073
+ },
84074
+ "401": {
84075
+ $ref: "#/components/responses/Unauthorized"
84076
+ },
84077
+ "403": {
84078
+ $ref: "#/components/responses/Forbidden"
84079
+ },
84080
+ "404": {
84081
+ $ref: "#/components/responses/NotFound"
84082
+ },
84083
+ "409": {
84084
+ $ref: "#/components/responses/Conflict"
84085
+ },
84086
+ "429": {
84087
+ $ref: "#/components/responses/RateLimitExceeded"
84088
+ }
84089
+ }
84090
+ }
84091
+ },
84092
+ "/v1/governance/data-points/{specId}": {
84093
+ put: {
84094
+ operationId: "confirmDataPoints",
84095
+ "x-audience": "public",
84096
+ "x-required-scopes": [
84097
+ "access:write"
84098
+ ],
84099
+ summary: "Confirm my data points for one Spec",
84100
+ 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",
84101
+ tags: [
84102
+ "Access & sharing"
84103
+ ],
84104
+ parameters: [
84105
+ {
84106
+ name: "specId",
84107
+ in: "path",
84108
+ required: true,
84109
+ schema: {
84110
+ type: "string",
84111
+ format: "uuid"
84112
+ }
84113
+ }
84114
+ ],
84115
+ requestBody: {
84116
+ required: true,
84117
+ content: {
84118
+ "application/json": {
84119
+ schema: {
84120
+ type: "object",
84121
+ required: [
84122
+ "fields"
84123
+ ],
84124
+ properties: {
84125
+ fields: {
84126
+ type: "array",
84127
+ items: {
84128
+ type: "object",
84129
+ required: [
84130
+ "field_key",
84131
+ "audience"
84132
+ ],
84133
+ properties: {
84134
+ field_key: {
84135
+ type: "string"
84136
+ },
84137
+ audience: {
84138
+ type: "string",
84139
+ enum: [
84140
+ "private",
84141
+ "people",
84142
+ "everyone"
84143
+ ]
84144
+ },
84145
+ kind: {
84146
+ type: "string",
84147
+ enum: [
84148
+ "plain",
84149
+ "customer_information",
84150
+ "personal",
84151
+ "sensitive"
84152
+ ],
84153
+ nullable: true
84154
+ },
84155
+ shared_with: {
84156
+ type: "array",
84157
+ items: {
84158
+ type: "string",
84159
+ format: "uuid"
84160
+ }
84161
+ }
84162
+ }
84163
+ }
84164
+ },
84165
+ hide_holder: {
84166
+ type: "boolean"
84167
+ },
84168
+ date_precision: {
84169
+ type: "string",
84170
+ enum: [
84171
+ "day",
84172
+ "month",
84173
+ "year",
84174
+ "none"
84175
+ ]
84176
+ },
84177
+ excluded_document_ids: {
84178
+ type: "array",
84179
+ items: {
84180
+ type: "string",
84181
+ format: "uuid"
84182
+ }
84183
+ }
84184
+ }
84185
+ }
84186
+ }
84187
+ }
84188
+ },
84189
+ responses: {
84190
+ "200": {
84191
+ description: "OK",
84192
+ content: {
84193
+ "application/json": {
84194
+ schema: {
84195
+ type: "object",
84196
+ additionalProperties: true
84197
+ }
84198
+ }
84199
+ }
84200
+ },
84201
+ "400": {
84202
+ $ref: "#/components/responses/BadRequest"
84203
+ },
84204
+ "401": {
84205
+ $ref: "#/components/responses/Unauthorized"
84206
+ },
84207
+ "403": {
84208
+ $ref: "#/components/responses/Forbidden"
84209
+ },
84210
+ "404": {
84211
+ $ref: "#/components/responses/NotFound"
84212
+ },
84213
+ "409": {
84214
+ $ref: "#/components/responses/Conflict"
84215
+ },
84216
+ "429": {
84217
+ $ref: "#/components/responses/RateLimitExceeded"
84218
+ }
84219
+ }
84220
+ }
84221
+ },
84222
+ "/v1/governance/data-points/{specId}/stop": {
84223
+ post: {
84224
+ operationId: "stopDataPoints",
84225
+ "x-audience": "public",
84226
+ "x-required-scopes": [
84227
+ "access:write"
84228
+ ],
84229
+ summary: "Stop sharing a Spec's data points",
84230
+ description: "Stops sharing every field of one Spec from the caller's documents. 404 when the caller shares none of it.\n",
84231
+ tags: [
84232
+ "Access & sharing"
84233
+ ],
84234
+ parameters: [
84235
+ {
84236
+ name: "specId",
84237
+ in: "path",
84238
+ required: true,
84239
+ schema: {
84240
+ type: "string",
84241
+ format: "uuid"
84242
+ }
84243
+ }
84244
+ ],
84245
+ responses: {
84246
+ "200": {
84247
+ description: "OK",
84248
+ content: {
84249
+ "application/json": {
84250
+ schema: {
84251
+ type: "object",
84252
+ additionalProperties: true
84253
+ }
84254
+ }
84255
+ }
84256
+ },
84257
+ "400": {
84258
+ $ref: "#/components/responses/BadRequest"
81766
84259
  },
81767
84260
  "401": {
81768
84261
  $ref: "#/components/responses/Unauthorized"
@@ -81782,51 +84275,15 @@ var openapi_default = {
81782
84275
  }
81783
84276
  }
81784
84277
  },
81785
- "/v1/me/data": {
84278
+ "/v1/me/workspace-data/groups": {
81786
84279
  get: {
81787
- operationId: "getMeData",
84280
+ operationId: "listMeWorkspaceDataGroups",
81788
84281
  "x-audience": "public",
81789
84282
  "x-required-scopes": [
81790
84283
  "documents:read"
81791
84284
  ],
81792
- summary: "Count your data",
81793
- description: "How much you brought into this workspace, per kind: uploads, values read out of them, decisions, apps and profile.\n",
81794
- tags: [
81795
- "My Data"
81796
- ],
81797
- responses: {
81798
- "200": {
81799
- description: "OK",
81800
- content: {
81801
- "application/json": {
81802
- schema: {
81803
- type: "object",
81804
- additionalProperties: true
81805
- }
81806
- }
81807
- }
81808
- },
81809
- "401": {
81810
- $ref: "#/components/responses/Unauthorized"
81811
- },
81812
- "403": {
81813
- $ref: "#/components/responses/Forbidden"
81814
- },
81815
- "429": {
81816
- $ref: "#/components/responses/RateLimitExceeded"
81817
- }
81818
- }
81819
- }
81820
- },
81821
- "/v1/me/data/items": {
81822
- get: {
81823
- operationId: "listMeDataItems",
81824
- "x-audience": "public",
81825
- "x-required-scopes": [
81826
- "documents:read"
81827
- ],
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",
84285
+ summary: "Group workspace data",
84286
+ 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",
81830
84287
  tags: [
81831
84288
  "My Data"
81832
84289
  ],
@@ -81838,92 +84295,59 @@ var openapi_default = {
81838
84295
  schema: {
81839
84296
  type: "string",
81840
84297
  enum: [
81841
- "uploads",
81842
- "extracted"
84298
+ "documents",
84299
+ "points"
81843
84300
  ]
81844
84301
  }
81845
84302
  },
81846
84303
  {
81847
- name: "id",
84304
+ name: "by",
81848
84305
  in: "query",
81849
84306
  schema: {
81850
- type: "string"
84307
+ type: "string",
84308
+ enum: [
84309
+ "source",
84310
+ "type",
84311
+ "month",
84312
+ "field",
84313
+ "all"
84314
+ ],
84315
+ default: "all"
81851
84316
  }
81852
84317
  },
81853
84318
  {
81854
- name: "offset",
84319
+ name: "source",
81855
84320
  in: "query",
84321
+ description: "A source id, or `none`.",
81856
84322
  schema: {
81857
- type: "integer",
81858
- minimum: 0,
81859
- default: 0
84323
+ type: "string"
81860
84324
  }
81861
84325
  },
81862
84326
  {
81863
- name: "limit",
84327
+ name: "type",
81864
84328
  in: "query",
84329
+ description: "A document type id, or `none`.",
81865
84330
  schema: {
81866
- type: "integer",
81867
- minimum: 1,
81868
- default: 50
84331
+ type: "string"
81869
84332
  }
81870
84333
  },
81871
84334
  {
81872
- name: "order",
84335
+ name: "month",
81873
84336
  in: "query",
84337
+ description: "Month, `YYYY-MM`.",
81874
84338
  schema: {
81875
84339
  type: "string",
81876
- enum: [
81877
- "time",
81878
- "state"
81879
- ],
81880
- default: "time"
84340
+ pattern: "^\\d{4}-(0[1-9]|1[0-2])$"
81881
84341
  }
81882
- }
81883
- ],
81884
- responses: {
81885
- "200": {
81886
- description: "OK",
81887
- content: {
81888
- "application/json": {
81889
- schema: {
81890
- type: "object",
81891
- properties: {
81892
- items: {
81893
- type: "array",
81894
- items: {
81895
- type: "object",
81896
- additionalProperties: true
81897
- }
81898
- }
81899
- }
81900
- }
81901
- }
81902
- }
81903
- },
81904
- "401": {
81905
- $ref: "#/components/responses/Unauthorized"
81906
84342
  },
81907
- "403": {
81908
- $ref: "#/components/responses/Forbidden"
81909
- },
81910
- "429": {
81911
- $ref: "#/components/responses/RateLimitExceeded"
84343
+ {
84344
+ name: "field",
84345
+ in: "query",
84346
+ description: "A field id, or `none`.",
84347
+ schema: {
84348
+ type: "string"
84349
+ }
81912
84350
  }
81913
- }
81914
- }
81915
- },
81916
- "/v1/me/workspace-data": {
81917
- get: {
81918
- operationId: "getMeWorkspaceData",
81919
- "x-audience": "public",
81920
- "x-required-scopes": [
81921
- "documents:read"
81922
- ],
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",
81925
- tags: [
81926
- "My Data"
81927
84351
  ],
81928
84352
  responses: {
81929
84353
  "200": {
@@ -81937,6 +84361,9 @@ var openapi_default = {
81937
84361
  }
81938
84362
  }
81939
84363
  },
84364
+ "400": {
84365
+ $ref: "#/components/responses/BadRequest"
84366
+ },
81940
84367
  "401": {
81941
84368
  $ref: "#/components/responses/Unauthorized"
81942
84369
  },
@@ -81957,7 +84384,7 @@ var openapi_default = {
81957
84384
  "documents:read"
81958
84385
  ],
81959
84386
  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",
84387
+ 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
84388
  tags: [
81962
84389
  "My Data"
81963
84390
  ],
@@ -81988,9 +84415,50 @@ var openapi_default = {
81988
84415
  ]
81989
84416
  }
81990
84417
  },
84418
+ {
84419
+ name: "source",
84420
+ in: "query",
84421
+ description: "A source id, or `none`.",
84422
+ schema: {
84423
+ type: "string"
84424
+ }
84425
+ },
84426
+ {
84427
+ name: "type",
84428
+ in: "query",
84429
+ description: "A document type id, or `none`.",
84430
+ schema: {
84431
+ type: "string"
84432
+ }
84433
+ },
84434
+ {
84435
+ name: "month",
84436
+ in: "query",
84437
+ description: "Month, `YYYY-MM`.",
84438
+ schema: {
84439
+ type: "string",
84440
+ pattern: "^\\d{4}-(0[1-9]|1[0-2])$"
84441
+ }
84442
+ },
84443
+ {
84444
+ name: "field",
84445
+ in: "query",
84446
+ description: "A field id, or `none`.",
84447
+ schema: {
84448
+ type: "string"
84449
+ }
84450
+ },
84451
+ {
84452
+ name: "after",
84453
+ in: "query",
84454
+ schema: {
84455
+ type: "string"
84456
+ }
84457
+ },
81991
84458
  {
81992
84459
  name: "offset",
81993
84460
  in: "query",
84461
+ description: "Fields only.",
81994
84462
  schema: {
81995
84463
  type: "integer",
81996
84464
  minimum: 0,
@@ -82014,19 +84482,14 @@ var openapi_default = {
82014
84482
  "application/json": {
82015
84483
  schema: {
82016
84484
  type: "object",
82017
- properties: {
82018
- items: {
82019
- type: "array",
82020
- items: {
82021
- type: "object",
82022
- additionalProperties: true
82023
- }
82024
- }
82025
- }
84485
+ additionalProperties: true
82026
84486
  }
82027
84487
  }
82028
84488
  }
82029
84489
  },
84490
+ "400": {
84491
+ $ref: "#/components/responses/BadRequest"
84492
+ },
82030
84493
  "401": {
82031
84494
  $ref: "#/components/responses/Unauthorized"
82032
84495
  },
@@ -82126,7 +84589,7 @@ var openapi_default = {
82126
84589
  type: "string",
82127
84590
  maxLength: 64
82128
84591
  },
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"
84592
+ 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
84593
  },
82131
84594
  SourceConnectionId: {
82132
84595
  name: "connectionId",
@@ -83109,7 +85572,12 @@ var openapi_default = {
83109
85572
  },
83110
85573
  decision: {
83111
85574
  type: "object",
83112
- nullable: true
85575
+ nullable: true,
85576
+ description: "Null while undecided, or when withheld (`decision_withheld`)."
85577
+ },
85578
+ decision_withheld: {
85579
+ type: "boolean",
85580
+ 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
85581
  },
83114
85582
  decided_by: {
83115
85583
  type: "object",
@@ -83211,7 +85679,12 @@ var openapi_default = {
83211
85679
  },
83212
85680
  decision: {
83213
85681
  type: "object",
83214
- nullable: true
85682
+ nullable: true,
85683
+ description: "Null while undecided, or when withheld (`decision_withheld`)."
85684
+ },
85685
+ decision_withheld: {
85686
+ type: "boolean",
85687
+ 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
85688
  },
83216
85689
  decided_by: {
83217
85690
  type: "object",
@@ -114860,10 +117333,119 @@ var openapi_default = {
114860
117333
  type: "string"
114861
117334
  },
114862
117335
  error: {
117336
+ type: "string",
117337
+ description: "The raw failure message."
117338
+ },
117339
+ reason: {
117340
+ type: "string",
117341
+ description: "Why the file could not be imported, in words for a person."
117342
+ }
117343
+ }
117344
+ }
117345
+ }
117346
+ }
117347
+ },
117348
+ SourceImportRun: {
117349
+ type: "object",
117350
+ description: "One import carried out in the background. Counts are in requested items (a folder is one item however many files it holds): `requested = imported + skipped + empty + failed + pending`.\n",
117351
+ properties: {
117352
+ id: {
117353
+ type: "string",
117354
+ format: "uuid"
117355
+ },
117356
+ source_connection_id: {
117357
+ type: "string",
117358
+ format: "uuid"
117359
+ },
117360
+ status: {
117361
+ type: "string",
117362
+ enum: [
117363
+ "queued",
117364
+ "running",
117365
+ "completed",
117366
+ "failed"
117367
+ ],
117368
+ description: "`completed` also when some items failed (see `failed` and `failures`); `failed` when the run itself stopped (see `error`).\n"
117369
+ },
117370
+ running: {
117371
+ type: "boolean",
117372
+ description: "True while the run is queued or being worked on."
117373
+ },
117374
+ requested: {
117375
+ type: "integer",
117376
+ description: "Items asked for."
117377
+ },
117378
+ imported: {
117379
+ type: "integer",
117380
+ description: "Items brought into the workspace by this run."
117381
+ },
117382
+ skipped: {
117383
+ type: "integer",
117384
+ description: "Items that were in the workspace already; nothing was imported twice."
117385
+ },
117386
+ empty: {
117387
+ type: "integer",
117388
+ description: "Folders that held nothing to import."
117389
+ },
117390
+ failed: {
117391
+ type: "integer"
117392
+ },
117393
+ pending: {
117394
+ type: "integer",
117395
+ description: "Items not worked on yet (or never, when the run itself failed)."
117396
+ },
117397
+ error: {
117398
+ type: [
117399
+ "string",
117400
+ "null"
117401
+ ],
117402
+ description: "Why the run as a whole stopped, when it did."
117403
+ },
117404
+ created_at: {
117405
+ type: "string",
117406
+ format: "date-time"
117407
+ },
117408
+ started_at: {
117409
+ type: [
117410
+ "string",
117411
+ "null"
117412
+ ],
117413
+ format: "date-time"
117414
+ },
117415
+ finished_at: {
117416
+ type: [
117417
+ "string",
117418
+ "null"
117419
+ ],
117420
+ format: "date-time"
117421
+ },
117422
+ failures: {
117423
+ type: "array",
117424
+ description: "On the single-run read. What could not be imported.",
117425
+ items: {
117426
+ type: "object",
117427
+ properties: {
117428
+ item_id: {
117429
+ type: "string",
117430
+ description: "The requested item (a file or folder id)."
117431
+ },
117432
+ file_id: {
117433
+ type: "string",
117434
+ description: "The file inside a requested folder, when the failure is that file's."
117435
+ },
117436
+ name: {
114863
117437
  type: "string"
117438
+ },
117439
+ reason: {
117440
+ type: "string",
117441
+ description: "Why, in words for a person."
114864
117442
  }
114865
117443
  }
114866
117444
  }
117445
+ },
117446
+ failures_truncated: {
117447
+ type: "boolean",
117448
+ description: "True when more failures exist than `failures` names; `failed` is always exact."
114867
117449
  }
114868
117450
  }
114869
117451
  },
@@ -115767,6 +118349,10 @@ var openapi_default = {
115767
118349
  },
115768
118350
  cursor: {
115769
118351
  type: "integer"
118352
+ },
118353
+ has_older: {
118354
+ type: "boolean",
118355
+ description: "True when the conversation goes further back than this page."
115770
118356
  }
115771
118357
  }
115772
118358
  },