@talonic/docs 0.21.83 → 0.21.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/openapi.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "info": {
4
4
  "title": "Talonic API",
5
5
  "version": "1.1.0",
6
- "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) → Settings → API Keys → 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`** — extracted fields as key-value pairs matching your schema.\n- **`confidence.fields`** — per-field score from 0 to 1. Above 0.9 is high confidence; below 0.7 flags for review.\n- **`extraction_id`** — 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 — see [Async Extraction Flow](#section/Async-Extraction-Flow) below.\n- **Reusable schemas** — save field definitions with `POST /v1/schemas`, then pass `schema_id` on future extractions.\n- **Receive results via webhook** — 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 (≤5 pages) are processed synchronously and return a `200`\nwith the extracted data immediately. Larger documents return a `202 Accepted`\nwith a `poll_url` — 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` → `processing` → `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` — daily cap for the namespace\n- `X-RateLimit-Remaining` — requests left today\n- `X-RateLimit-Reset` — ISO 8601 timestamp when the window resets (midnight UTC)\n\n## Pagination\n\nList endpoints use cursor-based pagination. Pass `limit` (1–100, 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…`) 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 — 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 — 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 ≤5 pages return results synchronously (`200`). Larger documents\n— or any request with `options: {\"async\": true}` — 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 — 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 → 4s → 8s → 16s → 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# → {\"vendor_name\": \"Acme Corp\", \"total_amount\": 1250.00, ...}\n```\n\n**TypeScript — 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// → { vendor_name: \"Acme Corp\", total_amount: 1250.00, ... }\n```\n\nRecommended polling: 2s initial, exponential backoff (2→4→8→16→30s cap),\ntimeout after 5 minutes.\n\n**Alternative — Webhooks:** Configure a delivery destination and listen for\n`document.extracted` events. See the Delivery tag.\n\n**Job status state machine:**\n`pending` → `queued` → `processing` → `complete` | `failed`\n\n## Performance\n\n| Document size | Expected latency | Max timeout |\n|---------------|------------------|-------------|\n| 1–5 pages | Sync, <3s | 30s |\n| 6–50 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",
6
+ "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) → Settings → API Keys → 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`** — extracted fields as key-value pairs matching your schema.\n- **`confidence.fields`** — per-field score from 0 to 1. Above 0.9 is high confidence; below 0.7 flags for review.\n- **`extraction_id`** — 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 — see [Async Extraction Flow](#section/Async-Extraction-Flow) below.\n- **Reusable schemas** — save field definitions with `POST /v1/schemas`, then pass `schema_id` on future extractions.\n- **Receive results via webhook** — 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 (≤5 pages) are processed synchronously and return a `200`\nwith the extracted data immediately. Larger documents return a `202 Accepted`\nwith a `poll_url` — 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` → `processing` → `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` — daily cap for the namespace\n- `X-RateLimit-Remaining` — requests left today\n- `X-RateLimit-Reset` — ISO 8601 timestamp when the window resets (midnight UTC)\n\n## Pagination\n\nList endpoints use cursor-based pagination. Pass `limit` (1–100, 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…`) 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 — 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 — 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 ≤5 pages return results synchronously (`200`). Larger documents\n— or any request with `options: {\"async\": true}` — 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 — 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 → 4s → 8s → 16s → 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# → {\"vendor_name\": \"Acme Corp\", \"total_amount\": 1250.00, ...}\n```\n\n**TypeScript — 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// → { vendor_name: \"Acme Corp\", total_amount: 1250.00, ... }\n```\n\nRecommended polling: 2s initial, exponential backoff (2→4→8→16→30s cap),\ntimeout after 5 minutes.\n\n**Alternative — Webhooks:** Configure a delivery destination and listen for\n`document.extracted` events. See the Delivery tag.\n\n**Job status state machine:**\n`pending` → `queued` → `processing` → `complete` | `failed`\n\n## Performance\n\n| Document size | Expected latency | Max timeout |\n|---------------|------------------|-------------|\n| 1–5 pages | Sync, <3s | 30s |\n| 6–50 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",
7
7
  "contact": {
8
8
  "name": "Talonic Support",
9
9
  "email": "support@talonic.ai",
@@ -348,6 +348,10 @@
348
348
  {
349
349
  "name": "My Data",
350
350
  "description": "What you brought into the workspace, who can see it, and your sharing decisions. Always your own data, whichever credential asks."
351
+ },
352
+ {
353
+ "name": "Access & sharing",
354
+ "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."
351
355
  }
352
356
  ],
353
357
  "paths": {
@@ -1799,6 +1803,122 @@
1799
1803
  }
1800
1804
  }
1801
1805
  },
1806
+ "/v1/documents/{id}/mail-originals": {
1807
+ "get": {
1808
+ "operationId": "getDocumentMailOriginals",
1809
+ "x-audience": "public",
1810
+ "tags": [
1811
+ "Documents"
1812
+ ],
1813
+ "summary": "Get the original messages of an email document",
1814
+ "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",
1815
+ "security": [
1816
+ {
1817
+ "BearerAuth": []
1818
+ }
1819
+ ],
1820
+ "x-required-scopes": [
1821
+ "read"
1822
+ ],
1823
+ "parameters": [
1824
+ {
1825
+ "$ref": "#/components/parameters/ResourceId"
1826
+ }
1827
+ ],
1828
+ "responses": {
1829
+ "200": {
1830
+ "description": "The original messages, in the order they were stored.",
1831
+ "content": {
1832
+ "application/json": {
1833
+ "schema": {
1834
+ "type": "object",
1835
+ "required": [
1836
+ "originals"
1837
+ ],
1838
+ "properties": {
1839
+ "originals": {
1840
+ "type": "array",
1841
+ "items": {
1842
+ "type": "object",
1843
+ "required": [
1844
+ "asset_id",
1845
+ "message_id",
1846
+ "date",
1847
+ "from",
1848
+ "subject",
1849
+ "html",
1850
+ "text"
1851
+ ],
1852
+ "properties": {
1853
+ "asset_id": {
1854
+ "type": "string",
1855
+ "format": "uuid",
1856
+ "description": "The stored original this message was read from."
1857
+ },
1858
+ "message_id": {
1859
+ "type": "string",
1860
+ "nullable": true,
1861
+ "description": "The message's own `Message-ID` header."
1862
+ },
1863
+ "date": {
1864
+ "type": "string",
1865
+ "format": "date-time",
1866
+ "nullable": true,
1867
+ "description": "When the message was sent."
1868
+ },
1869
+ "from": {
1870
+ "type": "string",
1871
+ "nullable": true
1872
+ },
1873
+ "subject": {
1874
+ "type": "string",
1875
+ "nullable": true
1876
+ },
1877
+ "html": {
1878
+ "type": "string",
1879
+ "nullable": true,
1880
+ "description": "The HTML body as sent; null when the mail has none or it is larger than 1.5 MB."
1881
+ },
1882
+ "text": {
1883
+ "type": "string",
1884
+ "nullable": true
1885
+ }
1886
+ }
1887
+ }
1888
+ }
1889
+ }
1890
+ },
1891
+ "example": {
1892
+ "originals": [
1893
+ {
1894
+ "asset_id": "7f1c2b9e-4d3a-4e8b-9a61-0c5d2e8f4b10",
1895
+ "message_id": "<CAF9x2k@mail.example.com>",
1896
+ "date": "2026-10-02T08:14:00.000Z",
1897
+ "from": "\"Anna Weber\" <anna.weber@example.com>",
1898
+ "subject": "Invoice 4471203",
1899
+ "html": "<p>Please find the invoice attached.</p>",
1900
+ "text": "Please find the invoice attached."
1901
+ }
1902
+ ]
1903
+ }
1904
+ }
1905
+ }
1906
+ },
1907
+ "401": {
1908
+ "$ref": "#/components/responses/Unauthorized"
1909
+ },
1910
+ "403": {
1911
+ "$ref": "#/components/responses/Forbidden"
1912
+ },
1913
+ "404": {
1914
+ "$ref": "#/components/responses/NotFound"
1915
+ },
1916
+ "429": {
1917
+ "$ref": "#/components/responses/RateLimitExceeded"
1918
+ }
1919
+ }
1920
+ }
1921
+ },
1802
1922
  "/v1/documents/upload-session": {
1803
1923
  "post": {
1804
1924
  "operationId": "createUploadSession",
@@ -2994,6 +3114,73 @@
2994
3114
  }
2995
3115
  }
2996
3116
  },
3117
+ "/v1/jobs/{id}/documents/{documentId}": {
3118
+ "delete": {
3119
+ "tags": [
3120
+ "Jobs & Batches"
3121
+ ],
3122
+ "summary": "Take a document out of a structuring run",
3123
+ "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",
3124
+ "operationId": "removeJobDocument",
3125
+ "x-audience": "public",
3126
+ "x-required-scopes": [
3127
+ "runs:write"
3128
+ ],
3129
+ "security": [
3130
+ {
3131
+ "BearerAuth": []
3132
+ }
3133
+ ],
3134
+ "parameters": [
3135
+ {
3136
+ "name": "id",
3137
+ "in": "path",
3138
+ "required": true,
3139
+ "schema": {
3140
+ "type": "string",
3141
+ "format": "uuid"
3142
+ }
3143
+ },
3144
+ {
3145
+ "name": "documentId",
3146
+ "in": "path",
3147
+ "required": true,
3148
+ "schema": {
3149
+ "type": "string",
3150
+ "format": "uuid"
3151
+ }
3152
+ }
3153
+ ],
3154
+ "responses": {
3155
+ "200": {
3156
+ "description": "Removed",
3157
+ "content": {
3158
+ "application/json": {
3159
+ "schema": {
3160
+ "type": "object",
3161
+ "additionalProperties": true
3162
+ }
3163
+ }
3164
+ }
3165
+ },
3166
+ "400": {
3167
+ "$ref": "#/components/responses/BadRequest"
3168
+ },
3169
+ "401": {
3170
+ "$ref": "#/components/responses/Unauthorized"
3171
+ },
3172
+ "403": {
3173
+ "$ref": "#/components/responses/Forbidden"
3174
+ },
3175
+ "404": {
3176
+ "$ref": "#/components/responses/NotFound"
3177
+ },
3178
+ "429": {
3179
+ "$ref": "#/components/responses/RateLimitExceeded"
3180
+ }
3181
+ }
3182
+ }
3183
+ },
2997
3184
  "/v1/jobs/{id}": {
2998
3185
  "get": {
2999
3186
  "operationId": "getJob",
@@ -23871,6 +24058,64 @@
23871
24058
  }
23872
24059
  }
23873
24060
  },
24061
+ "/v1/documents/{id}/claims/recompute": {
24062
+ "post": {
24063
+ "tags": [
24064
+ "Provenance"
24065
+ ],
24066
+ "summary": "Rebuild a document's claims",
24067
+ "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",
24068
+ "operationId": "recomputeDocumentClaims",
24069
+ "x-audience": "public",
24070
+ "x-required-scopes": [
24071
+ "documents:write"
24072
+ ],
24073
+ "security": [
24074
+ {
24075
+ "BearerAuth": []
24076
+ }
24077
+ ],
24078
+ "parameters": [
24079
+ {
24080
+ "name": "id",
24081
+ "in": "path",
24082
+ "required": true,
24083
+ "schema": {
24084
+ "type": "string",
24085
+ "format": "uuid"
24086
+ }
24087
+ }
24088
+ ],
24089
+ "responses": {
24090
+ "200": {
24091
+ "description": "Rebuilt",
24092
+ "content": {
24093
+ "application/json": {
24094
+ "schema": {
24095
+ "type": "object",
24096
+ "additionalProperties": true
24097
+ }
24098
+ }
24099
+ }
24100
+ },
24101
+ "400": {
24102
+ "$ref": "#/components/responses/BadRequest"
24103
+ },
24104
+ "401": {
24105
+ "$ref": "#/components/responses/Unauthorized"
24106
+ },
24107
+ "403": {
24108
+ "$ref": "#/components/responses/Forbidden"
24109
+ },
24110
+ "404": {
24111
+ "$ref": "#/components/responses/NotFound"
24112
+ },
24113
+ "429": {
24114
+ "$ref": "#/components/responses/RateLimitExceeded"
24115
+ }
24116
+ }
24117
+ }
24118
+ },
23874
24119
  "/v1/documents/{id}/claims": {
23875
24120
  "get": {
23876
24121
  "tags": [
@@ -31053,6 +31298,7 @@
31053
31298
  "operationId": "getAppRunEvents",
31054
31299
  "x-audience": "public",
31055
31300
  "summary": "Run journal (append-only, ordered)",
31301
+ "description": "404 when the run names a document the caller cannot read (the journal carries the decision).",
31056
31302
  "tags": [
31057
31303
  "Apps"
31058
31304
  ],
@@ -31070,6 +31316,9 @@
31070
31316
  "responses": {
31071
31317
  "200": {
31072
31318
  "description": "Journal events."
31319
+ },
31320
+ "404": {
31321
+ "$ref": "#/components/responses/NotFound"
31073
31322
  }
31074
31323
  }
31075
31324
  }
@@ -31582,7 +31831,7 @@
31582
31831
  "operationId": "getAppRunRecord",
31583
31832
  "x-audience": "public",
31584
31833
  "summary": "Sealed decision record (the export; 404 until the run seals)",
31585
- "description": "Reading the sealed record is an audited export (app.record_exported).",
31834
+ "description": "Reading the sealed record is an audited export (app.record_exported). 404 also when the run names a document the caller cannot read.",
31586
31835
  "tags": [
31587
31836
  "Apps"
31588
31837
  ],
@@ -64988,7 +65237,7 @@
64988
65237
  "Documents"
64989
65238
  ],
64990
65239
  "summary": "Process a skipped duplicate anyway",
64991
- "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.",
65240
+ "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.",
64992
65241
  "security": [
64993
65242
  {
64994
65243
  "BearerAuth": []
@@ -64999,14 +65248,7 @@
64999
65248
  ],
65000
65249
  "parameters": [
65001
65250
  {
65002
- "name": "Idempotency-Key",
65003
- "in": "header",
65004
- "required": false,
65005
- "description": "Up to 255 characters; remembered for 24 hours per workspace.",
65006
- "schema": {
65007
- "type": "string",
65008
- "maxLength": 255
65009
- }
65251
+ "$ref": "#/components/parameters/IdempotencyKey"
65010
65252
  }
65011
65253
  ],
65012
65254
  "requestBody": {
@@ -65044,19 +65286,20 @@
65044
65286
  }
65045
65287
  },
65046
65288
  "responses": {
65047
- "200": {
65048
- "description": "A retry with the same Idempotency-Key: the first copy, with the header `Idempotent-Replayed: true`.",
65049
- "content": {
65050
- "application/json": {
65289
+ "201": {
65290
+ "description": "The new document. On a retry with the same Idempotency-Key, the first copy with `Idempotent-Replayed: true`.",
65291
+ "headers": {
65292
+ "Idempotent-Replayed": {
65051
65293
  "schema": {
65052
- "type": "object",
65053
- "additionalProperties": true
65054
- }
65294
+ "type": "string",
65295
+ "enum": [
65296
+ "true",
65297
+ "false"
65298
+ ]
65299
+ },
65300
+ "description": "`true` when the body is the stored answer to an earlier request with the same key."
65055
65301
  }
65056
- }
65057
- },
65058
- "201": {
65059
- "description": "OK",
65302
+ },
65060
65303
  "content": {
65061
65304
  "application/json": {
65062
65305
  "schema": {
@@ -65096,13 +65339,13 @@
65096
65339
  "$ref": "#/components/responses/Forbidden"
65097
65340
  },
65098
65341
  "409": {
65099
- "description": "`idempotency_key_reused` or `idempotency_in_progress` (retry shortly)."
65342
+ "description": "`idempotency_request_in_progress`: a request with the same Idempotency-Key is still running; retry shortly."
65343
+ },
65344
+ "422": {
65345
+ "description": "`idempotency_key_reused`: the Idempotency-Key was already used for a different request or by another API key."
65100
65346
  },
65101
65347
  "429": {
65102
65348
  "$ref": "#/components/responses/RateLimitExceeded"
65103
- },
65104
- "503": {
65105
- "description": "`idempotency_unavailable`: a request with an Idempotency-Key cannot be guaranteed right now; retry shortly."
65106
65349
  }
65107
65350
  }
65108
65351
  }
@@ -65412,7 +65655,7 @@
65412
65655
  "Documents"
65413
65656
  ],
65414
65657
  "summary": "Tag many documents at once",
65415
- "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`.",
65658
+ "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`.",
65416
65659
  "security": [
65417
65660
  {
65418
65661
  "BearerAuth": []
@@ -65483,6 +65726,13 @@
65483
65726
  "type": "string"
65484
65727
  }
65485
65728
  },
65729
+ "refused": {
65730
+ "type": "array",
65731
+ "items": {
65732
+ "type": "string",
65733
+ "format": "uuid"
65734
+ }
65735
+ },
65486
65736
  "results": {
65487
65737
  "type": "array",
65488
65738
  "items": {
@@ -65495,7 +65745,8 @@
65495
65745
  "status": {
65496
65746
  "type": "string",
65497
65747
  "enum": [
65498
- "updated"
65748
+ "updated",
65749
+ "refused"
65499
65750
  ]
65500
65751
  },
65501
65752
  "tags": {
@@ -70453,6 +70704,64 @@
70453
70704
  }
70454
70705
  }
70455
70706
  },
70707
+ "/v1/documents/{id}/relation-claims/recompute": {
70708
+ "post": {
70709
+ "tags": [
70710
+ "Cases"
70711
+ ],
70712
+ "summary": "Rebuild a document's relation claims",
70713
+ "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",
70714
+ "operationId": "recomputeDocumentRelationClaims",
70715
+ "x-audience": "public",
70716
+ "x-required-scopes": [
70717
+ "cases:write"
70718
+ ],
70719
+ "security": [
70720
+ {
70721
+ "BearerAuth": []
70722
+ }
70723
+ ],
70724
+ "parameters": [
70725
+ {
70726
+ "name": "id",
70727
+ "in": "path",
70728
+ "required": true,
70729
+ "schema": {
70730
+ "type": "string",
70731
+ "format": "uuid"
70732
+ }
70733
+ }
70734
+ ],
70735
+ "responses": {
70736
+ "200": {
70737
+ "description": "Rebuilt",
70738
+ "content": {
70739
+ "application/json": {
70740
+ "schema": {
70741
+ "type": "object",
70742
+ "additionalProperties": true
70743
+ }
70744
+ }
70745
+ }
70746
+ },
70747
+ "400": {
70748
+ "$ref": "#/components/responses/BadRequest"
70749
+ },
70750
+ "401": {
70751
+ "$ref": "#/components/responses/Unauthorized"
70752
+ },
70753
+ "403": {
70754
+ "$ref": "#/components/responses/Forbidden"
70755
+ },
70756
+ "404": {
70757
+ "$ref": "#/components/responses/NotFound"
70758
+ },
70759
+ "429": {
70760
+ "$ref": "#/components/responses/RateLimitExceeded"
70761
+ }
70762
+ }
70763
+ }
70764
+ },
70456
70765
  "/v1/relation-claims/cases": {
70457
70766
  "get": {
70458
70767
  "operationId": "listReferenceCases",
@@ -81678,66 +81987,1551 @@
81678
81987
  }
81679
81988
  }
81680
81989
  },
81990
+ "/v1/me/data/groups": {
81991
+ "get": {
81992
+ "operationId": "listMeDataGroups",
81993
+ "x-audience": "public",
81994
+ "x-required-scopes": [
81995
+ "documents:read"
81996
+ ],
81997
+ "summary": "Group your data",
81998
+ "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",
81999
+ "tags": [
82000
+ "My Data"
82001
+ ],
82002
+ "parameters": [
82003
+ {
82004
+ "name": "kind",
82005
+ "in": "query",
82006
+ "required": true,
82007
+ "schema": {
82008
+ "type": "string",
82009
+ "enum": [
82010
+ "uploads",
82011
+ "extracted"
82012
+ ]
82013
+ }
82014
+ },
82015
+ {
82016
+ "name": "by",
82017
+ "in": "query",
82018
+ "schema": {
82019
+ "type": "string",
82020
+ "enum": [
82021
+ "source",
82022
+ "type",
82023
+ "month",
82024
+ "field",
82025
+ "all"
82026
+ ],
82027
+ "default": "all"
82028
+ }
82029
+ },
82030
+ {
82031
+ "name": "source",
82032
+ "in": "query",
82033
+ "description": "A source id, or `none`.",
82034
+ "schema": {
82035
+ "type": "string"
82036
+ }
82037
+ },
82038
+ {
82039
+ "name": "type",
82040
+ "in": "query",
82041
+ "description": "A document type id, or `none`.",
82042
+ "schema": {
82043
+ "type": "string"
82044
+ }
82045
+ },
82046
+ {
82047
+ "name": "month",
82048
+ "in": "query",
82049
+ "description": "Month, `YYYY-MM`.",
82050
+ "schema": {
82051
+ "type": "string",
82052
+ "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
82053
+ }
82054
+ },
82055
+ {
82056
+ "name": "field",
82057
+ "in": "query",
82058
+ "description": "A field id, or `none`.",
82059
+ "schema": {
82060
+ "type": "string"
82061
+ }
82062
+ }
82063
+ ],
82064
+ "responses": {
82065
+ "200": {
82066
+ "description": "OK",
82067
+ "content": {
82068
+ "application/json": {
82069
+ "schema": {
82070
+ "type": "object",
82071
+ "additionalProperties": true
82072
+ }
82073
+ }
82074
+ }
82075
+ },
82076
+ "400": {
82077
+ "$ref": "#/components/responses/BadRequest"
82078
+ },
82079
+ "401": {
82080
+ "$ref": "#/components/responses/Unauthorized"
82081
+ },
82082
+ "403": {
82083
+ "$ref": "#/components/responses/Forbidden"
82084
+ },
82085
+ "429": {
82086
+ "$ref": "#/components/responses/RateLimitExceeded"
82087
+ }
82088
+ }
82089
+ }
82090
+ },
81681
82091
  "/v1/me/data/items": {
81682
82092
  "get": {
81683
82093
  "operationId": "listMeDataItems",
81684
82094
  "x-audience": "public",
81685
82095
  "x-required-scopes": [
81686
- "documents:read"
82096
+ "documents:read"
82097
+ ],
82098
+ "summary": "List your data items",
82099
+ "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",
82100
+ "tags": [
82101
+ "My Data"
82102
+ ],
82103
+ "parameters": [
82104
+ {
82105
+ "name": "kind",
82106
+ "in": "query",
82107
+ "required": true,
82108
+ "schema": {
82109
+ "type": "string",
82110
+ "enum": [
82111
+ "uploads",
82112
+ "extracted"
82113
+ ]
82114
+ }
82115
+ },
82116
+ {
82117
+ "name": "id",
82118
+ "in": "query",
82119
+ "schema": {
82120
+ "type": "string"
82121
+ }
82122
+ },
82123
+ {
82124
+ "name": "source",
82125
+ "in": "query",
82126
+ "description": "A source id, or `none`.",
82127
+ "schema": {
82128
+ "type": "string"
82129
+ }
82130
+ },
82131
+ {
82132
+ "name": "type",
82133
+ "in": "query",
82134
+ "description": "A document type id, or `none`.",
82135
+ "schema": {
82136
+ "type": "string"
82137
+ }
82138
+ },
82139
+ {
82140
+ "name": "month",
82141
+ "in": "query",
82142
+ "description": "Month, `YYYY-MM`.",
82143
+ "schema": {
82144
+ "type": "string",
82145
+ "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
82146
+ }
82147
+ },
82148
+ {
82149
+ "name": "field",
82150
+ "in": "query",
82151
+ "description": "A field id, or `none`.",
82152
+ "schema": {
82153
+ "type": "string"
82154
+ }
82155
+ },
82156
+ {
82157
+ "name": "vis",
82158
+ "in": "query",
82159
+ "schema": {
82160
+ "type": "string",
82161
+ "enum": [
82162
+ "me",
82163
+ "shared",
82164
+ "company"
82165
+ ]
82166
+ }
82167
+ },
82168
+ {
82169
+ "name": "after",
82170
+ "in": "query",
82171
+ "schema": {
82172
+ "type": "string"
82173
+ }
82174
+ },
82175
+ {
82176
+ "name": "limit",
82177
+ "in": "query",
82178
+ "schema": {
82179
+ "type": "integer",
82180
+ "minimum": 1,
82181
+ "default": 50
82182
+ }
82183
+ }
82184
+ ],
82185
+ "responses": {
82186
+ "200": {
82187
+ "description": "OK",
82188
+ "content": {
82189
+ "application/json": {
82190
+ "schema": {
82191
+ "type": "object",
82192
+ "additionalProperties": true
82193
+ }
82194
+ }
82195
+ }
82196
+ },
82197
+ "400": {
82198
+ "$ref": "#/components/responses/BadRequest"
82199
+ },
82200
+ "401": {
82201
+ "$ref": "#/components/responses/Unauthorized"
82202
+ },
82203
+ "403": {
82204
+ "$ref": "#/components/responses/Forbidden"
82205
+ },
82206
+ "429": {
82207
+ "$ref": "#/components/responses/RateLimitExceeded"
82208
+ }
82209
+ }
82210
+ }
82211
+ },
82212
+ "/v1/me/workspace-data": {
82213
+ "get": {
82214
+ "operationId": "getMeWorkspaceData",
82215
+ "x-audience": "public",
82216
+ "x-required-scopes": [
82217
+ "documents:read"
82218
+ ],
82219
+ "summary": "Count workspace data by owner",
82220
+ "description": "The workspace's documents, fields and data points you can see, counted by whose they are: `me`, `shared` with you, or `company`.\n",
82221
+ "tags": [
82222
+ "My Data"
82223
+ ],
82224
+ "responses": {
82225
+ "200": {
82226
+ "description": "OK",
82227
+ "content": {
82228
+ "application/json": {
82229
+ "schema": {
82230
+ "type": "object",
82231
+ "additionalProperties": true
82232
+ }
82233
+ }
82234
+ }
82235
+ },
82236
+ "401": {
82237
+ "$ref": "#/components/responses/Unauthorized"
82238
+ },
82239
+ "403": {
82240
+ "$ref": "#/components/responses/Forbidden"
82241
+ },
82242
+ "429": {
82243
+ "$ref": "#/components/responses/RateLimitExceeded"
82244
+ }
82245
+ }
82246
+ }
82247
+ },
82248
+ "/v1/governance/directory": {
82249
+ "get": {
82250
+ "operationId": "getAccessDirectory",
82251
+ "x-audience": "public",
82252
+ "x-required-scopes": [
82253
+ "access:read"
82254
+ ],
82255
+ "summary": "List sources and their holders",
82256
+ "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",
82257
+ "tags": [
82258
+ "Access & sharing"
82259
+ ],
82260
+ "responses": {
82261
+ "200": {
82262
+ "description": "OK",
82263
+ "content": {
82264
+ "application/json": {
82265
+ "schema": {
82266
+ "type": "object",
82267
+ "additionalProperties": true
82268
+ }
82269
+ }
82270
+ }
82271
+ },
82272
+ "401": {
82273
+ "$ref": "#/components/responses/Unauthorized"
82274
+ },
82275
+ "403": {
82276
+ "$ref": "#/components/responses/Forbidden"
82277
+ },
82278
+ "429": {
82279
+ "$ref": "#/components/responses/RateLimitExceeded"
82280
+ }
82281
+ }
82282
+ }
82283
+ },
82284
+ "/v1/governance/access-requests": {
82285
+ "get": {
82286
+ "operationId": "listAccessRequests",
82287
+ "x-audience": "public",
82288
+ "x-required-scopes": [
82289
+ "access:read"
82290
+ ],
82291
+ "summary": "List access requests",
82292
+ "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",
82293
+ "tags": [
82294
+ "Access & sharing"
82295
+ ],
82296
+ "responses": {
82297
+ "200": {
82298
+ "description": "OK",
82299
+ "content": {
82300
+ "application/json": {
82301
+ "schema": {
82302
+ "type": "object",
82303
+ "additionalProperties": true
82304
+ }
82305
+ }
82306
+ }
82307
+ },
82308
+ "401": {
82309
+ "$ref": "#/components/responses/Unauthorized"
82310
+ },
82311
+ "403": {
82312
+ "$ref": "#/components/responses/Forbidden"
82313
+ },
82314
+ "429": {
82315
+ "$ref": "#/components/responses/RateLimitExceeded"
82316
+ }
82317
+ }
82318
+ },
82319
+ "post": {
82320
+ "operationId": "createAccessRequest",
82321
+ "x-audience": "public",
82322
+ "x-required-scopes": [
82323
+ "access:write"
82324
+ ],
82325
+ "summary": "Ask for access",
82326
+ "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",
82327
+ "tags": [
82328
+ "Access & sharing"
82329
+ ],
82330
+ "requestBody": {
82331
+ "required": true,
82332
+ "content": {
82333
+ "application/json": {
82334
+ "schema": {
82335
+ "type": "object",
82336
+ "required": [
82337
+ "purpose",
82338
+ "duration_days"
82339
+ ],
82340
+ "properties": {
82341
+ "scope_id": {
82342
+ "type": "string",
82343
+ "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}$",
82344
+ "description": "An access scope (8-4-4-4-12 hex; version digits are arbitrary)."
82345
+ },
82346
+ "source_connection_id": {
82347
+ "type": "string",
82348
+ "format": "uuid"
82349
+ },
82350
+ "document_id": {
82351
+ "type": "string",
82352
+ "format": "uuid"
82353
+ },
82354
+ "purpose": {
82355
+ "type": "string",
82356
+ "maxLength": 500
82357
+ },
82358
+ "duration_days": {
82359
+ "type": "integer",
82360
+ "minimum": 1,
82361
+ "maximum": 90
82362
+ },
82363
+ "capabilities": {
82364
+ "type": "array",
82365
+ "items": {
82366
+ "type": "string",
82367
+ "enum": [
82368
+ "delete",
82369
+ "discover",
82370
+ "read",
82371
+ "write"
82372
+ ]
82373
+ }
82374
+ }
82375
+ }
82376
+ }
82377
+ }
82378
+ }
82379
+ },
82380
+ "responses": {
82381
+ "201": {
82382
+ "description": "Created",
82383
+ "content": {
82384
+ "application/json": {
82385
+ "schema": {
82386
+ "type": "object",
82387
+ "additionalProperties": true
82388
+ }
82389
+ }
82390
+ }
82391
+ },
82392
+ "400": {
82393
+ "$ref": "#/components/responses/BadRequest"
82394
+ },
82395
+ "401": {
82396
+ "$ref": "#/components/responses/Unauthorized"
82397
+ },
82398
+ "403": {
82399
+ "$ref": "#/components/responses/Forbidden"
82400
+ },
82401
+ "404": {
82402
+ "$ref": "#/components/responses/NotFound"
82403
+ },
82404
+ "409": {
82405
+ "$ref": "#/components/responses/Conflict"
82406
+ },
82407
+ "429": {
82408
+ "$ref": "#/components/responses/RateLimitExceeded"
82409
+ }
82410
+ }
82411
+ }
82412
+ },
82413
+ "/v1/governance/access-requests/{id}/approve": {
82414
+ "post": {
82415
+ "operationId": "approveAccessRequest",
82416
+ "x-audience": "public",
82417
+ "x-required-scopes": [
82418
+ "access:write"
82419
+ ],
82420
+ "summary": "Approve an access request",
82421
+ "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",
82422
+ "tags": [
82423
+ "Access & sharing"
82424
+ ],
82425
+ "parameters": [
82426
+ {
82427
+ "name": "id",
82428
+ "in": "path",
82429
+ "required": true,
82430
+ "schema": {
82431
+ "type": "string",
82432
+ "format": "uuid"
82433
+ }
82434
+ }
82435
+ ],
82436
+ "responses": {
82437
+ "200": {
82438
+ "description": "OK",
82439
+ "content": {
82440
+ "application/json": {
82441
+ "schema": {
82442
+ "type": "object",
82443
+ "additionalProperties": true
82444
+ }
82445
+ }
82446
+ }
82447
+ },
82448
+ "400": {
82449
+ "$ref": "#/components/responses/BadRequest"
82450
+ },
82451
+ "401": {
82452
+ "$ref": "#/components/responses/Unauthorized"
82453
+ },
82454
+ "403": {
82455
+ "$ref": "#/components/responses/Forbidden"
82456
+ },
82457
+ "404": {
82458
+ "$ref": "#/components/responses/NotFound"
82459
+ },
82460
+ "409": {
82461
+ "$ref": "#/components/responses/Conflict"
82462
+ },
82463
+ "429": {
82464
+ "$ref": "#/components/responses/RateLimitExceeded"
82465
+ }
82466
+ }
82467
+ }
82468
+ },
82469
+ "/v1/governance/access-requests/{id}/deny": {
82470
+ "post": {
82471
+ "operationId": "denyAccessRequest",
82472
+ "x-audience": "public",
82473
+ "x-required-scopes": [
82474
+ "access:write"
82475
+ ],
82476
+ "summary": "Deny an access request",
82477
+ "description": "A holder of the request's scope refuses a pending request, with a reason.\n",
82478
+ "tags": [
82479
+ "Access & sharing"
82480
+ ],
82481
+ "parameters": [
82482
+ {
82483
+ "name": "id",
82484
+ "in": "path",
82485
+ "required": true,
82486
+ "schema": {
82487
+ "type": "string",
82488
+ "format": "uuid"
82489
+ }
82490
+ }
82491
+ ],
82492
+ "requestBody": {
82493
+ "required": true,
82494
+ "content": {
82495
+ "application/json": {
82496
+ "schema": {
82497
+ "type": "object",
82498
+ "required": [
82499
+ "reason"
82500
+ ],
82501
+ "properties": {
82502
+ "reason": {
82503
+ "type": "string",
82504
+ "maxLength": 500
82505
+ }
82506
+ }
82507
+ }
82508
+ }
82509
+ }
82510
+ },
82511
+ "responses": {
82512
+ "200": {
82513
+ "description": "OK",
82514
+ "content": {
82515
+ "application/json": {
82516
+ "schema": {
82517
+ "type": "object",
82518
+ "additionalProperties": true
82519
+ }
82520
+ }
82521
+ }
82522
+ },
82523
+ "400": {
82524
+ "$ref": "#/components/responses/BadRequest"
82525
+ },
82526
+ "401": {
82527
+ "$ref": "#/components/responses/Unauthorized"
82528
+ },
82529
+ "403": {
82530
+ "$ref": "#/components/responses/Forbidden"
82531
+ },
82532
+ "404": {
82533
+ "$ref": "#/components/responses/NotFound"
82534
+ },
82535
+ "409": {
82536
+ "$ref": "#/components/responses/Conflict"
82537
+ },
82538
+ "429": {
82539
+ "$ref": "#/components/responses/RateLimitExceeded"
82540
+ }
82541
+ }
82542
+ }
82543
+ },
82544
+ "/v1/governance/access-requests/{id}/second": {
82545
+ "post": {
82546
+ "operationId": "secondAccessRequest",
82547
+ "x-audience": "public",
82548
+ "x-required-scopes": [
82549
+ "access:write"
82550
+ ],
82551
+ "summary": "Decide an access request as data protection officer",
82552
+ "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",
82553
+ "tags": [
82554
+ "Access & sharing"
82555
+ ],
82556
+ "parameters": [
82557
+ {
82558
+ "name": "id",
82559
+ "in": "path",
82560
+ "required": true,
82561
+ "schema": {
82562
+ "type": "string",
82563
+ "format": "uuid"
82564
+ }
82565
+ }
82566
+ ],
82567
+ "requestBody": {
82568
+ "required": true,
82569
+ "content": {
82570
+ "application/json": {
82571
+ "schema": {
82572
+ "type": "object",
82573
+ "required": [
82574
+ "ok",
82575
+ "text"
82576
+ ],
82577
+ "properties": {
82578
+ "ok": {
82579
+ "type": "boolean"
82580
+ },
82581
+ "text": {
82582
+ "type": "string"
82583
+ }
82584
+ }
82585
+ }
82586
+ }
82587
+ }
82588
+ },
82589
+ "responses": {
82590
+ "200": {
82591
+ "description": "OK",
82592
+ "content": {
82593
+ "application/json": {
82594
+ "schema": {
82595
+ "type": "object",
82596
+ "additionalProperties": true
82597
+ }
82598
+ }
82599
+ }
82600
+ },
82601
+ "400": {
82602
+ "$ref": "#/components/responses/BadRequest"
82603
+ },
82604
+ "401": {
82605
+ "$ref": "#/components/responses/Unauthorized"
82606
+ },
82607
+ "403": {
82608
+ "$ref": "#/components/responses/Forbidden"
82609
+ },
82610
+ "404": {
82611
+ "$ref": "#/components/responses/NotFound"
82612
+ },
82613
+ "409": {
82614
+ "$ref": "#/components/responses/Conflict"
82615
+ },
82616
+ "429": {
82617
+ "$ref": "#/components/responses/RateLimitExceeded"
82618
+ }
82619
+ }
82620
+ }
82621
+ },
82622
+ "/v1/governance/access-requests/{id}/stop": {
82623
+ "post": {
82624
+ "operationId": "stopAccessRequest",
82625
+ "x-audience": "public",
82626
+ "x-required-scopes": [
82627
+ "access:write"
82628
+ ],
82629
+ "summary": "Stop an access request",
82630
+ "description": "The requester or a holder ends an approved request; its licence or document share is revoked.\n",
82631
+ "tags": [
82632
+ "Access & sharing"
82633
+ ],
82634
+ "parameters": [
82635
+ {
82636
+ "name": "id",
82637
+ "in": "path",
82638
+ "required": true,
82639
+ "schema": {
82640
+ "type": "string",
82641
+ "format": "uuid"
82642
+ }
82643
+ }
82644
+ ],
82645
+ "responses": {
82646
+ "200": {
82647
+ "description": "OK",
82648
+ "content": {
82649
+ "application/json": {
82650
+ "schema": {
82651
+ "type": "object",
82652
+ "additionalProperties": true
82653
+ }
82654
+ }
82655
+ }
82656
+ },
82657
+ "400": {
82658
+ "$ref": "#/components/responses/BadRequest"
82659
+ },
82660
+ "401": {
82661
+ "$ref": "#/components/responses/Unauthorized"
82662
+ },
82663
+ "403": {
82664
+ "$ref": "#/components/responses/Forbidden"
82665
+ },
82666
+ "404": {
82667
+ "$ref": "#/components/responses/NotFound"
82668
+ },
82669
+ "409": {
82670
+ "$ref": "#/components/responses/Conflict"
82671
+ },
82672
+ "429": {
82673
+ "$ref": "#/components/responses/RateLimitExceeded"
82674
+ }
82675
+ }
82676
+ }
82677
+ },
82678
+ "/v1/governance/sharing": {
82679
+ "get": {
82680
+ "operationId": "getSharing",
82681
+ "x-audience": "public",
82682
+ "x-required-scopes": [
82683
+ "access:read"
82684
+ ],
82685
+ "summary": "List shares",
82686
+ "description": "Whether sharing applies in this workspace (`available`), the shares the caller gave (`given`) and the shares naming the caller (`received`).\n",
82687
+ "tags": [
82688
+ "Access & sharing"
82689
+ ],
82690
+ "responses": {
82691
+ "200": {
82692
+ "description": "OK",
82693
+ "content": {
82694
+ "application/json": {
82695
+ "schema": {
82696
+ "type": "object",
82697
+ "additionalProperties": true
82698
+ }
82699
+ }
82700
+ }
82701
+ },
82702
+ "401": {
82703
+ "$ref": "#/components/responses/Unauthorized"
82704
+ },
82705
+ "403": {
82706
+ "$ref": "#/components/responses/Forbidden"
82707
+ },
82708
+ "429": {
82709
+ "$ref": "#/components/responses/RateLimitExceeded"
82710
+ }
82711
+ }
82712
+ }
82713
+ },
82714
+ "/v1/governance/documents/{id}/access": {
82715
+ "get": {
82716
+ "operationId": "getDocumentAccess",
82717
+ "x-audience": "public",
82718
+ "x-required-scopes": [
82719
+ "access:read"
82720
+ ],
82721
+ "summary": "What you may do with a document",
82722
+ "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",
82723
+ "tags": [
82724
+ "Access & sharing"
82725
+ ],
82726
+ "parameters": [
82727
+ {
82728
+ "name": "id",
82729
+ "in": "path",
82730
+ "required": true,
82731
+ "schema": {
82732
+ "type": "string",
82733
+ "format": "uuid"
82734
+ }
82735
+ }
82736
+ ],
82737
+ "responses": {
82738
+ "200": {
82739
+ "description": "OK",
82740
+ "content": {
82741
+ "application/json": {
82742
+ "schema": {
82743
+ "type": "object",
82744
+ "properties": {
82745
+ "managed": {
82746
+ "type": "boolean"
82747
+ },
82748
+ "share": {
82749
+ "type": "boolean"
82750
+ },
82751
+ "write": {
82752
+ "type": "boolean"
82753
+ },
82754
+ "classify": {
82755
+ "type": "boolean"
82756
+ }
82757
+ }
82758
+ }
82759
+ }
82760
+ }
82761
+ },
82762
+ "401": {
82763
+ "$ref": "#/components/responses/Unauthorized"
82764
+ },
82765
+ "403": {
82766
+ "$ref": "#/components/responses/Forbidden"
82767
+ },
82768
+ "404": {
82769
+ "$ref": "#/components/responses/NotFound"
82770
+ },
82771
+ "429": {
82772
+ "$ref": "#/components/responses/RateLimitExceeded"
82773
+ }
82774
+ }
82775
+ }
82776
+ },
82777
+ "/v1/governance/documents/{id}/shares": {
82778
+ "get": {
82779
+ "operationId": "listDocumentShares",
82780
+ "x-audience": "public",
82781
+ "x-required-scopes": [
82782
+ "access:read"
82783
+ ],
82784
+ "summary": "List who a document is shared with",
82785
+ "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",
82786
+ "tags": [
82787
+ "Access & sharing"
82788
+ ],
82789
+ "parameters": [
82790
+ {
82791
+ "name": "id",
82792
+ "in": "path",
82793
+ "required": true,
82794
+ "schema": {
82795
+ "type": "string",
82796
+ "format": "uuid"
82797
+ }
82798
+ }
82799
+ ],
82800
+ "responses": {
82801
+ "200": {
82802
+ "description": "OK",
82803
+ "content": {
82804
+ "application/json": {
82805
+ "schema": {
82806
+ "type": "object",
82807
+ "additionalProperties": true
82808
+ }
82809
+ }
82810
+ }
82811
+ },
82812
+ "401": {
82813
+ "$ref": "#/components/responses/Unauthorized"
82814
+ },
82815
+ "403": {
82816
+ "$ref": "#/components/responses/Forbidden"
82817
+ },
82818
+ "404": {
82819
+ "$ref": "#/components/responses/NotFound"
82820
+ },
82821
+ "429": {
82822
+ "$ref": "#/components/responses/RateLimitExceeded"
82823
+ }
82824
+ }
82825
+ }
82826
+ },
82827
+ "/v1/governance/shares/documents": {
82828
+ "post": {
82829
+ "operationId": "shareDocuments",
82830
+ "x-audience": "public",
82831
+ "x-required-scopes": [
82832
+ "access:write"
82833
+ ],
82834
+ "summary": "Share documents",
82835
+ "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",
82836
+ "tags": [
82837
+ "Access & sharing"
82838
+ ],
82839
+ "requestBody": {
82840
+ "required": true,
82841
+ "content": {
82842
+ "application/json": {
82843
+ "schema": {
82844
+ "type": "object",
82845
+ "required": [
82846
+ "document_ids",
82847
+ "to"
82848
+ ],
82849
+ "properties": {
82850
+ "document_ids": {
82851
+ "type": "array",
82852
+ "minItems": 1,
82853
+ "maxItems": 200,
82854
+ "items": {
82855
+ "type": "string",
82856
+ "format": "uuid"
82857
+ }
82858
+ },
82859
+ "to": {
82860
+ "type": "object",
82861
+ "required": [
82862
+ "type"
82863
+ ],
82864
+ "properties": {
82865
+ "type": {
82866
+ "type": "string",
82867
+ "enum": [
82868
+ "person",
82869
+ "group",
82870
+ "everyone"
82871
+ ]
82872
+ },
82873
+ "id": {
82874
+ "type": "string",
82875
+ "format": "uuid",
82876
+ "description": "The member or group; absent for everyone."
82877
+ }
82878
+ }
82879
+ },
82880
+ "duration_days": {
82881
+ "type": "integer",
82882
+ "minimum": 1,
82883
+ "maximum": 365,
82884
+ "nullable": true
82885
+ },
82886
+ "note": {
82887
+ "type": "string",
82888
+ "maxLength": 500
82889
+ },
82890
+ "allow_pass_on": {
82891
+ "type": "boolean",
82892
+ "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."
82893
+ }
82894
+ }
82895
+ }
82896
+ }
82897
+ }
82898
+ },
82899
+ "responses": {
82900
+ "201": {
82901
+ "description": "Created",
82902
+ "content": {
82903
+ "application/json": {
82904
+ "schema": {
82905
+ "type": "object",
82906
+ "additionalProperties": true
82907
+ }
82908
+ }
82909
+ }
82910
+ },
82911
+ "400": {
82912
+ "$ref": "#/components/responses/BadRequest"
82913
+ },
82914
+ "401": {
82915
+ "$ref": "#/components/responses/Unauthorized"
82916
+ },
82917
+ "403": {
82918
+ "$ref": "#/components/responses/Forbidden"
82919
+ },
82920
+ "404": {
82921
+ "$ref": "#/components/responses/NotFound"
82922
+ },
82923
+ "409": {
82924
+ "$ref": "#/components/responses/Conflict"
82925
+ },
82926
+ "429": {
82927
+ "$ref": "#/components/responses/RateLimitExceeded"
82928
+ }
82929
+ }
82930
+ }
82931
+ },
82932
+ "/v1/governance/shares/pass-on": {
82933
+ "post": {
82934
+ "operationId": "passOnShare",
82935
+ "x-audience": "public",
82936
+ "x-required-scopes": [
82937
+ "access:write"
82938
+ ],
82939
+ "summary": "Pass a share on",
82940
+ "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",
82941
+ "tags": [
82942
+ "Access & sharing"
82943
+ ],
82944
+ "requestBody": {
82945
+ "required": true,
82946
+ "content": {
82947
+ "application/json": {
82948
+ "schema": {
82949
+ "type": "object",
82950
+ "required": [
82951
+ "to"
82952
+ ],
82953
+ "properties": {
82954
+ "document_ids": {
82955
+ "type": "array",
82956
+ "minItems": 1,
82957
+ "maxItems": 200,
82958
+ "items": {
82959
+ "type": "string",
82960
+ "format": "uuid"
82961
+ }
82962
+ },
82963
+ "scope_id": {
82964
+ "type": "string",
82965
+ "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}$",
82966
+ "description": "An access scope (8-4-4-4-12 hex; version digits are arbitrary)."
82967
+ },
82968
+ "source_connection_id": {
82969
+ "type": "string",
82970
+ "format": "uuid"
82971
+ },
82972
+ "to": {
82973
+ "type": "object",
82974
+ "required": [
82975
+ "type",
82976
+ "id"
82977
+ ],
82978
+ "properties": {
82979
+ "type": {
82980
+ "type": "string",
82981
+ "enum": [
82982
+ "person",
82983
+ "group"
82984
+ ]
82985
+ },
82986
+ "id": {
82987
+ "type": "string",
82988
+ "format": "uuid",
82989
+ "description": "The member or group."
82990
+ }
82991
+ }
82992
+ },
82993
+ "duration_days": {
82994
+ "type": "integer",
82995
+ "minimum": 1,
82996
+ "maximum": 365,
82997
+ "nullable": true
82998
+ },
82999
+ "note": {
83000
+ "type": "string",
83001
+ "maxLength": 500
83002
+ }
83003
+ }
83004
+ }
83005
+ }
83006
+ }
83007
+ },
83008
+ "responses": {
83009
+ "201": {
83010
+ "description": "The shares written.",
83011
+ "content": {
83012
+ "application/json": {
83013
+ "schema": {
83014
+ "type": "array",
83015
+ "items": {
83016
+ "type": "object",
83017
+ "additionalProperties": true
83018
+ }
83019
+ }
83020
+ }
83021
+ }
83022
+ },
83023
+ "400": {
83024
+ "$ref": "#/components/responses/BadRequest"
83025
+ },
83026
+ "401": {
83027
+ "$ref": "#/components/responses/Unauthorized"
83028
+ },
83029
+ "403": {
83030
+ "$ref": "#/components/responses/Forbidden"
83031
+ },
83032
+ "404": {
83033
+ "$ref": "#/components/responses/NotFound"
83034
+ },
83035
+ "409": {
83036
+ "$ref": "#/components/responses/Conflict"
83037
+ },
83038
+ "429": {
83039
+ "$ref": "#/components/responses/RateLimitExceeded"
83040
+ }
83041
+ }
83042
+ }
83043
+ },
83044
+ "/v1/governance/shares/scopes": {
83045
+ "post": {
83046
+ "operationId": "shareScope",
83047
+ "x-audience": "public",
83048
+ "x-required-scopes": [
83049
+ "access:write"
83050
+ ],
83051
+ "summary": "Share a whole source",
83052
+ "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",
83053
+ "tags": [
83054
+ "Access & sharing"
83055
+ ],
83056
+ "requestBody": {
83057
+ "required": true,
83058
+ "content": {
83059
+ "application/json": {
83060
+ "schema": {
83061
+ "type": "object",
83062
+ "required": [
83063
+ "to"
83064
+ ],
83065
+ "properties": {
83066
+ "scope_id": {
83067
+ "type": "string",
83068
+ "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}$",
83069
+ "description": "An access scope (8-4-4-4-12 hex; version digits are arbitrary)."
83070
+ },
83071
+ "source_connection_id": {
83072
+ "type": "string",
83073
+ "format": "uuid"
83074
+ },
83075
+ "to": {
83076
+ "type": "object",
83077
+ "required": [
83078
+ "type"
83079
+ ],
83080
+ "properties": {
83081
+ "type": {
83082
+ "type": "string",
83083
+ "enum": [
83084
+ "person",
83085
+ "group",
83086
+ "everyone"
83087
+ ]
83088
+ },
83089
+ "id": {
83090
+ "type": "string",
83091
+ "format": "uuid",
83092
+ "description": "The member or group; absent for everyone."
83093
+ }
83094
+ }
83095
+ },
83096
+ "duration_days": {
83097
+ "type": "integer",
83098
+ "minimum": 1,
83099
+ "maximum": 365,
83100
+ "nullable": true
83101
+ },
83102
+ "allow_pass_on": {
83103
+ "type": "boolean",
83104
+ "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."
83105
+ }
83106
+ }
83107
+ }
83108
+ }
83109
+ }
83110
+ },
83111
+ "responses": {
83112
+ "201": {
83113
+ "description": "Created",
83114
+ "content": {
83115
+ "application/json": {
83116
+ "schema": {
83117
+ "type": "object",
83118
+ "additionalProperties": true
83119
+ }
83120
+ }
83121
+ }
83122
+ },
83123
+ "400": {
83124
+ "$ref": "#/components/responses/BadRequest"
83125
+ },
83126
+ "401": {
83127
+ "$ref": "#/components/responses/Unauthorized"
83128
+ },
83129
+ "403": {
83130
+ "$ref": "#/components/responses/Forbidden"
83131
+ },
83132
+ "404": {
83133
+ "$ref": "#/components/responses/NotFound"
83134
+ },
83135
+ "409": {
83136
+ "$ref": "#/components/responses/Conflict"
83137
+ },
83138
+ "429": {
83139
+ "$ref": "#/components/responses/RateLimitExceeded"
83140
+ }
83141
+ }
83142
+ }
83143
+ },
83144
+ "/v1/governance/shares/workspace": {
83145
+ "post": {
83146
+ "operationId": "setWorkspaceOpen",
83147
+ "x-audience": "public",
83148
+ "x-required-scopes": [
83149
+ "access:write"
81687
83150
  ],
81688
- "summary": "List your data items",
81689
- "description": "What one kind of your data stands for (`uploads` or `extracted`), a page at a time, or one item by `id`.\n",
83151
+ "summary": "Open or close a source to the workspace",
83152
+ "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",
81690
83153
  "tags": [
81691
- "My Data"
83154
+ "Access & sharing"
83155
+ ],
83156
+ "requestBody": {
83157
+ "required": true,
83158
+ "content": {
83159
+ "application/json": {
83160
+ "schema": {
83161
+ "type": "object",
83162
+ "required": [
83163
+ "open"
83164
+ ],
83165
+ "properties": {
83166
+ "scope_id": {
83167
+ "type": "string",
83168
+ "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}$",
83169
+ "description": "An access scope (8-4-4-4-12 hex; version digits are arbitrary)."
83170
+ },
83171
+ "source_connection_id": {
83172
+ "type": "string",
83173
+ "format": "uuid"
83174
+ },
83175
+ "open": {
83176
+ "type": "boolean"
83177
+ }
83178
+ }
83179
+ }
83180
+ }
83181
+ }
83182
+ },
83183
+ "responses": {
83184
+ "200": {
83185
+ "description": "The scope, with `open_to_workspace`.",
83186
+ "content": {
83187
+ "application/json": {
83188
+ "schema": {
83189
+ "type": "object",
83190
+ "additionalProperties": true
83191
+ }
83192
+ }
83193
+ }
83194
+ },
83195
+ "400": {
83196
+ "$ref": "#/components/responses/BadRequest"
83197
+ },
83198
+ "401": {
83199
+ "$ref": "#/components/responses/Unauthorized"
83200
+ },
83201
+ "403": {
83202
+ "$ref": "#/components/responses/Forbidden"
83203
+ },
83204
+ "404": {
83205
+ "$ref": "#/components/responses/NotFound"
83206
+ },
83207
+ "409": {
83208
+ "$ref": "#/components/responses/Conflict"
83209
+ },
83210
+ "429": {
83211
+ "$ref": "#/components/responses/RateLimitExceeded"
83212
+ }
83213
+ }
83214
+ }
83215
+ },
83216
+ "/v1/governance/shares/{kind}/{id}/stop": {
83217
+ "post": {
83218
+ "operationId": "stopShare",
83219
+ "x-audience": "public",
83220
+ "x-required-scopes": [
83221
+ "access:write"
83222
+ ],
83223
+ "summary": "Stop a share",
83224
+ "description": "Stop a share: its granter or a holder ends it; the person it names may remove it from their own access.\n",
83225
+ "tags": [
83226
+ "Access & sharing"
81692
83227
  ],
81693
83228
  "parameters": [
81694
83229
  {
81695
83230
  "name": "kind",
81696
- "in": "query",
83231
+ "in": "path",
81697
83232
  "required": true,
81698
83233
  "schema": {
81699
83234
  "type": "string",
81700
83235
  "enum": [
81701
- "uploads",
81702
- "extracted"
83236
+ "document",
83237
+ "scope"
81703
83238
  ]
81704
83239
  }
81705
83240
  },
81706
83241
  {
81707
83242
  "name": "id",
81708
- "in": "query",
83243
+ "in": "path",
83244
+ "required": true,
81709
83245
  "schema": {
81710
- "type": "string"
83246
+ "type": "string",
83247
+ "format": "uuid"
83248
+ }
83249
+ }
83250
+ ],
83251
+ "responses": {
83252
+ "200": {
83253
+ "description": "OK",
83254
+ "content": {
83255
+ "application/json": {
83256
+ "schema": {
83257
+ "type": "object",
83258
+ "additionalProperties": true
83259
+ }
83260
+ }
83261
+ }
83262
+ },
83263
+ "400": {
83264
+ "$ref": "#/components/responses/BadRequest"
83265
+ },
83266
+ "401": {
83267
+ "$ref": "#/components/responses/Unauthorized"
83268
+ },
83269
+ "403": {
83270
+ "$ref": "#/components/responses/Forbidden"
83271
+ },
83272
+ "404": {
83273
+ "$ref": "#/components/responses/NotFound"
83274
+ },
83275
+ "409": {
83276
+ "$ref": "#/components/responses/Conflict"
83277
+ },
83278
+ "429": {
83279
+ "$ref": "#/components/responses/RateLimitExceeded"
83280
+ }
83281
+ }
83282
+ }
83283
+ },
83284
+ "/v1/governance/data-points": {
83285
+ "get": {
83286
+ "operationId": "listMyDataPoints",
83287
+ "x-audience": "public",
83288
+ "x-required-scopes": [
83289
+ "access:read"
83290
+ ],
83291
+ "summary": "My data points",
83292
+ "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",
83293
+ "tags": [
83294
+ "Access & sharing"
83295
+ ],
83296
+ "responses": {
83297
+ "200": {
83298
+ "description": "OK",
83299
+ "content": {
83300
+ "application/json": {
83301
+ "schema": {
83302
+ "type": "object",
83303
+ "additionalProperties": true
83304
+ }
83305
+ }
81711
83306
  }
81712
83307
  },
83308
+ "400": {
83309
+ "$ref": "#/components/responses/BadRequest"
83310
+ },
83311
+ "401": {
83312
+ "$ref": "#/components/responses/Unauthorized"
83313
+ },
83314
+ "403": {
83315
+ "$ref": "#/components/responses/Forbidden"
83316
+ },
83317
+ "404": {
83318
+ "$ref": "#/components/responses/NotFound"
83319
+ },
83320
+ "409": {
83321
+ "$ref": "#/components/responses/Conflict"
83322
+ },
83323
+ "429": {
83324
+ "$ref": "#/components/responses/RateLimitExceeded"
83325
+ }
83326
+ }
83327
+ }
83328
+ },
83329
+ "/v1/governance/data-points/shared": {
83330
+ "get": {
83331
+ "operationId": "listSharedDataPoints",
83332
+ "x-audience": "public",
83333
+ "x-required-scopes": [
83334
+ "access:read"
83335
+ ],
83336
+ "summary": "Data points shared with me",
83337
+ "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",
83338
+ "tags": [
83339
+ "Access & sharing"
83340
+ ],
83341
+ "parameters": [
81713
83342
  {
81714
- "name": "offset",
83343
+ "name": "spec_id",
81715
83344
  "in": "query",
83345
+ "required": false,
81716
83346
  "schema": {
81717
- "type": "integer",
81718
- "minimum": 0,
81719
- "default": 0
83347
+ "type": "string",
83348
+ "format": "uuid"
81720
83349
  }
83350
+ }
83351
+ ],
83352
+ "responses": {
83353
+ "200": {
83354
+ "description": "OK",
83355
+ "content": {
83356
+ "application/json": {
83357
+ "schema": {
83358
+ "type": "object",
83359
+ "additionalProperties": true
83360
+ }
83361
+ }
83362
+ }
83363
+ },
83364
+ "400": {
83365
+ "$ref": "#/components/responses/BadRequest"
81721
83366
  },
83367
+ "401": {
83368
+ "$ref": "#/components/responses/Unauthorized"
83369
+ },
83370
+ "403": {
83371
+ "$ref": "#/components/responses/Forbidden"
83372
+ },
83373
+ "404": {
83374
+ "$ref": "#/components/responses/NotFound"
83375
+ },
83376
+ "409": {
83377
+ "$ref": "#/components/responses/Conflict"
83378
+ },
83379
+ "429": {
83380
+ "$ref": "#/components/responses/RateLimitExceeded"
83381
+ }
83382
+ }
83383
+ }
83384
+ },
83385
+ "/v1/governance/data-points/{specId}": {
83386
+ "put": {
83387
+ "operationId": "confirmDataPoints",
83388
+ "x-audience": "public",
83389
+ "x-required-scopes": [
83390
+ "access:write"
83391
+ ],
83392
+ "summary": "Confirm my data points for one Spec",
83393
+ "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",
83394
+ "tags": [
83395
+ "Access & sharing"
83396
+ ],
83397
+ "parameters": [
81722
83398
  {
81723
- "name": "limit",
81724
- "in": "query",
83399
+ "name": "specId",
83400
+ "in": "path",
83401
+ "required": true,
81725
83402
  "schema": {
81726
- "type": "integer",
81727
- "minimum": 1,
81728
- "default": 50
83403
+ "type": "string",
83404
+ "format": "uuid"
83405
+ }
83406
+ }
83407
+ ],
83408
+ "requestBody": {
83409
+ "required": true,
83410
+ "content": {
83411
+ "application/json": {
83412
+ "schema": {
83413
+ "type": "object",
83414
+ "required": [
83415
+ "fields"
83416
+ ],
83417
+ "properties": {
83418
+ "fields": {
83419
+ "type": "array",
83420
+ "items": {
83421
+ "type": "object",
83422
+ "required": [
83423
+ "field_key",
83424
+ "audience"
83425
+ ],
83426
+ "properties": {
83427
+ "field_key": {
83428
+ "type": "string"
83429
+ },
83430
+ "audience": {
83431
+ "type": "string",
83432
+ "enum": [
83433
+ "private",
83434
+ "people",
83435
+ "everyone"
83436
+ ]
83437
+ },
83438
+ "kind": {
83439
+ "type": "string",
83440
+ "enum": [
83441
+ "plain",
83442
+ "customer_information",
83443
+ "personal",
83444
+ "sensitive"
83445
+ ],
83446
+ "nullable": true
83447
+ },
83448
+ "shared_with": {
83449
+ "type": "array",
83450
+ "items": {
83451
+ "type": "string",
83452
+ "format": "uuid"
83453
+ }
83454
+ }
83455
+ }
83456
+ }
83457
+ },
83458
+ "hide_holder": {
83459
+ "type": "boolean"
83460
+ },
83461
+ "date_precision": {
83462
+ "type": "string",
83463
+ "enum": [
83464
+ "day",
83465
+ "month",
83466
+ "year",
83467
+ "none"
83468
+ ]
83469
+ },
83470
+ "excluded_document_ids": {
83471
+ "type": "array",
83472
+ "items": {
83473
+ "type": "string",
83474
+ "format": "uuid"
83475
+ }
83476
+ }
83477
+ }
83478
+ }
83479
+ }
83480
+ }
83481
+ },
83482
+ "responses": {
83483
+ "200": {
83484
+ "description": "OK",
83485
+ "content": {
83486
+ "application/json": {
83487
+ "schema": {
83488
+ "type": "object",
83489
+ "additionalProperties": true
83490
+ }
83491
+ }
81729
83492
  }
81730
83493
  },
83494
+ "400": {
83495
+ "$ref": "#/components/responses/BadRequest"
83496
+ },
83497
+ "401": {
83498
+ "$ref": "#/components/responses/Unauthorized"
83499
+ },
83500
+ "403": {
83501
+ "$ref": "#/components/responses/Forbidden"
83502
+ },
83503
+ "404": {
83504
+ "$ref": "#/components/responses/NotFound"
83505
+ },
83506
+ "409": {
83507
+ "$ref": "#/components/responses/Conflict"
83508
+ },
83509
+ "429": {
83510
+ "$ref": "#/components/responses/RateLimitExceeded"
83511
+ }
83512
+ }
83513
+ }
83514
+ },
83515
+ "/v1/governance/data-points/{specId}/stop": {
83516
+ "post": {
83517
+ "operationId": "stopDataPoints",
83518
+ "x-audience": "public",
83519
+ "x-required-scopes": [
83520
+ "access:write"
83521
+ ],
83522
+ "summary": "Stop sharing a Spec's data points",
83523
+ "description": "Stops sharing every field of one Spec from the caller's documents. 404 when the caller shares none of it.\n",
83524
+ "tags": [
83525
+ "Access & sharing"
83526
+ ],
83527
+ "parameters": [
81731
83528
  {
81732
- "name": "order",
81733
- "in": "query",
83529
+ "name": "specId",
83530
+ "in": "path",
83531
+ "required": true,
81734
83532
  "schema": {
81735
83533
  "type": "string",
81736
- "enum": [
81737
- "time",
81738
- "state"
81739
- ],
81740
- "default": "time"
83534
+ "format": "uuid"
81741
83535
  }
81742
83536
  }
81743
83537
  ],
@@ -81748,43 +83542,106 @@
81748
83542
  "application/json": {
81749
83543
  "schema": {
81750
83544
  "type": "object",
81751
- "properties": {
81752
- "items": {
81753
- "type": "array",
81754
- "items": {
81755
- "type": "object",
81756
- "additionalProperties": true
81757
- }
81758
- }
81759
- }
83545
+ "additionalProperties": true
81760
83546
  }
81761
83547
  }
81762
83548
  }
81763
83549
  },
83550
+ "400": {
83551
+ "$ref": "#/components/responses/BadRequest"
83552
+ },
81764
83553
  "401": {
81765
83554
  "$ref": "#/components/responses/Unauthorized"
81766
83555
  },
81767
83556
  "403": {
81768
83557
  "$ref": "#/components/responses/Forbidden"
81769
83558
  },
83559
+ "404": {
83560
+ "$ref": "#/components/responses/NotFound"
83561
+ },
83562
+ "409": {
83563
+ "$ref": "#/components/responses/Conflict"
83564
+ },
81770
83565
  "429": {
81771
83566
  "$ref": "#/components/responses/RateLimitExceeded"
81772
83567
  }
81773
83568
  }
81774
83569
  }
81775
83570
  },
81776
- "/v1/me/workspace-data": {
83571
+ "/v1/me/workspace-data/groups": {
81777
83572
  "get": {
81778
- "operationId": "getMeWorkspaceData",
83573
+ "operationId": "listMeWorkspaceDataGroups",
81779
83574
  "x-audience": "public",
81780
83575
  "x-required-scopes": [
81781
83576
  "documents:read"
81782
83577
  ],
81783
- "summary": "Count workspace data by owner",
81784
- "description": "The workspace's documents, fields and data points you can see, counted by whose they are: `me`, `shared` with you, or `company`.\n",
83578
+ "summary": "Group workspace data",
83579
+ "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",
81785
83580
  "tags": [
81786
83581
  "My Data"
81787
83582
  ],
83583
+ "parameters": [
83584
+ {
83585
+ "name": "kind",
83586
+ "in": "query",
83587
+ "required": true,
83588
+ "schema": {
83589
+ "type": "string",
83590
+ "enum": [
83591
+ "documents",
83592
+ "points"
83593
+ ]
83594
+ }
83595
+ },
83596
+ {
83597
+ "name": "by",
83598
+ "in": "query",
83599
+ "schema": {
83600
+ "type": "string",
83601
+ "enum": [
83602
+ "source",
83603
+ "type",
83604
+ "month",
83605
+ "field",
83606
+ "all"
83607
+ ],
83608
+ "default": "all"
83609
+ }
83610
+ },
83611
+ {
83612
+ "name": "source",
83613
+ "in": "query",
83614
+ "description": "A source id, or `none`.",
83615
+ "schema": {
83616
+ "type": "string"
83617
+ }
83618
+ },
83619
+ {
83620
+ "name": "type",
83621
+ "in": "query",
83622
+ "description": "A document type id, or `none`.",
83623
+ "schema": {
83624
+ "type": "string"
83625
+ }
83626
+ },
83627
+ {
83628
+ "name": "month",
83629
+ "in": "query",
83630
+ "description": "Month, `YYYY-MM`.",
83631
+ "schema": {
83632
+ "type": "string",
83633
+ "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
83634
+ }
83635
+ },
83636
+ {
83637
+ "name": "field",
83638
+ "in": "query",
83639
+ "description": "A field id, or `none`.",
83640
+ "schema": {
83641
+ "type": "string"
83642
+ }
83643
+ }
83644
+ ],
81788
83645
  "responses": {
81789
83646
  "200": {
81790
83647
  "description": "OK",
@@ -81797,6 +83654,9 @@
81797
83654
  }
81798
83655
  }
81799
83656
  },
83657
+ "400": {
83658
+ "$ref": "#/components/responses/BadRequest"
83659
+ },
81800
83660
  "401": {
81801
83661
  "$ref": "#/components/responses/Unauthorized"
81802
83662
  },
@@ -81817,7 +83677,7 @@
81817
83677
  "documents:read"
81818
83678
  ],
81819
83679
  "summary": "List workspace data by owner",
81820
- "description": "The documents, fields or data points behind one of those counts, a page at a time.\n",
83680
+ "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",
81821
83681
  "tags": [
81822
83682
  "My Data"
81823
83683
  ],
@@ -81848,9 +83708,50 @@
81848
83708
  ]
81849
83709
  }
81850
83710
  },
83711
+ {
83712
+ "name": "source",
83713
+ "in": "query",
83714
+ "description": "A source id, or `none`.",
83715
+ "schema": {
83716
+ "type": "string"
83717
+ }
83718
+ },
83719
+ {
83720
+ "name": "type",
83721
+ "in": "query",
83722
+ "description": "A document type id, or `none`.",
83723
+ "schema": {
83724
+ "type": "string"
83725
+ }
83726
+ },
83727
+ {
83728
+ "name": "month",
83729
+ "in": "query",
83730
+ "description": "Month, `YYYY-MM`.",
83731
+ "schema": {
83732
+ "type": "string",
83733
+ "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
83734
+ }
83735
+ },
83736
+ {
83737
+ "name": "field",
83738
+ "in": "query",
83739
+ "description": "A field id, or `none`.",
83740
+ "schema": {
83741
+ "type": "string"
83742
+ }
83743
+ },
83744
+ {
83745
+ "name": "after",
83746
+ "in": "query",
83747
+ "schema": {
83748
+ "type": "string"
83749
+ }
83750
+ },
81851
83751
  {
81852
83752
  "name": "offset",
81853
83753
  "in": "query",
83754
+ "description": "Fields only.",
81854
83755
  "schema": {
81855
83756
  "type": "integer",
81856
83757
  "minimum": 0,
@@ -81874,19 +83775,14 @@
81874
83775
  "application/json": {
81875
83776
  "schema": {
81876
83777
  "type": "object",
81877
- "properties": {
81878
- "items": {
81879
- "type": "array",
81880
- "items": {
81881
- "type": "object",
81882
- "additionalProperties": true
81883
- }
81884
- }
81885
- }
83778
+ "additionalProperties": true
81886
83779
  }
81887
83780
  }
81888
83781
  }
81889
83782
  },
83783
+ "400": {
83784
+ "$ref": "#/components/responses/BadRequest"
83785
+ },
81890
83786
  "401": {
81891
83787
  "$ref": "#/components/responses/Unauthorized"
81892
83788
  },
@@ -81986,7 +83882,7 @@
81986
83882
  "type": "string",
81987
83883
  "maxLength": 64
81988
83884
  },
81989
- "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"
83885
+ "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"
81990
83886
  },
81991
83887
  "SourceConnectionId": {
81992
83888
  "name": "connectionId",
@@ -82969,7 +84865,12 @@
82969
84865
  },
82970
84866
  "decision": {
82971
84867
  "type": "object",
82972
- "nullable": true
84868
+ "nullable": true,
84869
+ "description": "Null while undecided, or when withheld (`decision_withheld`)."
84870
+ },
84871
+ "decision_withheld": {
84872
+ "type": "boolean",
84873
+ "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."
82973
84874
  },
82974
84875
  "decided_by": {
82975
84876
  "type": "object",
@@ -83071,7 +84972,12 @@
83071
84972
  },
83072
84973
  "decision": {
83073
84974
  "type": "object",
83074
- "nullable": true
84975
+ "nullable": true,
84976
+ "description": "Null while undecided, or when withheld (`decision_withheld`)."
84977
+ },
84978
+ "decision_withheld": {
84979
+ "type": "boolean",
84980
+ "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."
83075
84981
  },
83076
84982
  "decided_by": {
83077
84983
  "type": "object",