@talonic/docs 0.21.44 → 0.21.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/seo.js CHANGED
@@ -4,7 +4,7 @@ var openapi_default = {
4
4
  info: {
5
5
  title: "Talonic API",
6
6
  version: "1.1.0",
7
- description: 'Structure any document into schema-validated data.\n\nThe Talonic API lets you extract structured data from documents (PDFs, images,\nDOCX, CSV, plain text), manage reusable extraction schemas, track async jobs,\nand organise documents through sources.\n\n## Quick Start\n\n**1. Get your API key**\n\nSign up at [app.talonic.com](https://app.talonic.com) \u2192 Settings \u2192 API Keys \u2192 Create key.\nKeys start with `tlnc_`. All examples below use `tlnc_live_abc123` as a placeholder.\n\n**2. Extract your first document**\n\n```bash\ncurl -X POST https://api.talonic.com/v1/extract \\\n -H "Authorization: Bearer tlnc_live_abc123" \\\n -F "file=@invoice.pdf" \\\n -F \'schema={"properties":{"vendor_name":{"type":"string"},"total_amount":{"type":"number"},"invoice_date":{"type":"string"}}}\'\n```\n\n**Python:**\n```python\nimport requests\nresp = requests.post("https://api.talonic.com/v1/extract",\n headers={"Authorization": "Bearer tlnc_live_abc123"},\n files={"file": open("invoice.pdf", "rb")},\n data={"schema": \'{"properties":{"vendor_name":{"type":"string"},"total_amount":{"type":"number"},"invoice_date":{"type":"string"}}}\'})\nprint(resp.json()["data"])\n```\n\n**TypeScript:**\n```typescript\nconst form = new FormData();\nform.append("file", fs.createReadStream("invoice.pdf"));\nform.append("schema", \'{"properties":{"vendor_name":{"type":"string"},"total_amount":{"type":"number"},"invoice_date":{"type":"string"}}}\');\nconst res = await fetch("https://api.talonic.com/v1/extract", {\n method: "POST",\n headers: { Authorization: "Bearer tlnc_live_abc123" },\n body: form,\n}).then(r => r.json());\nconsole.log(res.data);\n```\n\n**3. What you get back**\n\n```json\n{\n "extraction_id": "d1a2b3c4-5678-9abc-def0-1234567890ab",\n "request_id": "req_x7y8z9a0b1c2d3e4",\n "status": "complete",\n "document": {\n "id": "f0e1d2c3-b4a5-9687-8765-432109876543",\n "filename": "invoice.pdf",\n "pages": 2,\n "size_bytes": 184320,\n "type_detected": "Invoice",\n "language_detected": "en"\n },\n "data": {\n "vendor_name": "Acme GmbH",\n "total_amount": 14250.00,\n "invoice_date": "2025-03-15"\n },\n "confidence": {\n "overall": 0.96,\n "fields": {\n "vendor_name": 0.97,\n "total_amount": 0.94,\n "invoice_date": 0.99\n }\n },\n "processing": {\n "duration_ms": 1840,\n "pages_processed": 2,\n "region": "eu-west"\n },\n "links": {\n "self": "/v1/extractions/d1a2b3c4-5678-9abc-def0-1234567890ab",\n "document": "/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543"\n }\n}\n```\n\n- **`data`** \u2014 extracted fields as key-value pairs matching your schema.\n- **`confidence.fields`** \u2014 per-field score from 0 to 1. Above 0.9 is high confidence; below 0.7 flags for review.\n- **`extraction_id`** \u2014 use this to retrieve, correct, or deliver results later.\n- Full response schema: [ExtractSyncResponse](#/components/schemas/ExtractSyncResponse)\n\n**4. Next steps**\n\n- **50+ pages?** Use async mode \u2014 see [Async Extraction Flow](#section/Async-Extraction-Flow) below.\n- **Reusable schemas** \u2014 save field definitions with `POST /v1/schemas`, then pass `schema_id` on future extractions.\n- **Receive results via webhook** \u2014 configure a delivery destination and listen for `document.extracted` events. See the [Delivery](#tag/Delivery) tag.\n\n---\n\n## Authentication\n\nAll requests require a Bearer token in the `Authorization` header.\nAPI keys are prefixed with `tlnc_` and scoped per customer.\n\n```\nAuthorization: Bearer tlnc_live_abc123...\n```\n\n## Async Extraction Pattern\n\nSmall documents (\u22645 pages) are processed synchronously and return a `200`\nwith the extracted data immediately. Larger documents return a `202 Accepted`\nwith a `poll_url` \u2014 poll `GET /v1/documents/{id}` until `status` transitions\nto `completed`, then fetch results via `GET /v1/documents/{id}/extractions`.\n\nYou can force async processing by passing `options: {"async": true}` on\nany extraction request. Combine with webhooks for a fully event-driven flow:\nconfigure a webhook destination under Delivery and listen for the\n`extraction.complete` event.\n\n**Job status lifecycle:** `pending` \u2192 `processing` \u2192 `complete` | `failed`\n\n## Rate Limits\n\nThe **Free** tier is metered by a recurring **5,000-credit monthly grant**\n(no card required) that refreshes on the 1st of each month (UTC). Free\nrequests run until the monthly credit balance is spent, then return `402`\nuntil the next grant. A generous daily request ceiling is retained purely as\nabuse protection and does not bind a legitimate free user within the monthly\nenvelope. Inspect your balance and reset date via `GET /v1/account`.\n\nPaid tiers are metered per calendar day (UTC):\n\n| Tier | Extract | Platform | Ingest | Operations | Run | Ask |\n|------------|---------|----------|--------|------------|-----|-----|\n| Free | 1,000/day | 2,000/day | 1,000/day | 1,000/day | 1,000/day | 200/day |\n| Pro | 25,000/day | 50,000/day | 25,000/day | 25,000/day | 25,000/day | 5,000/day |\n| Enterprise | Unlimited | Unlimited | Unlimited | Unlimited | Unlimited | Unlimited |\n\nFree workspaces additionally receive 5,000 credits/month; spend is governed\nby credits (402 on exhaustion), with daily ceilings acting as abuse protection.\n\nResponses with a finite limit include rate-limit headers:\n- `X-RateLimit-Limit` \u2014 daily cap for the namespace\n- `X-RateLimit-Remaining` \u2014 requests left today\n- `X-RateLimit-Reset` \u2014 ISO 8601 timestamp when the window resets (midnight UTC)\n\n## Pagination\n\nList endpoints use cursor-based pagination. Pass `limit` (1\u2013100, default 20),\n`cursor` (opaque token from `pagination.next_cursor`), and `order` (`asc` or `desc`, default `desc`).\n\n## Errors\n\nAll errors return a JSON body with `error` (machine-readable code) and `message`\n(human-readable explanation). Additional fields vary by error type.\n\n| Code | Error | Description |\n|------|--------------------|------------------------------------------|\n| 400 | validation_error | Request body is malformed or invalid |\n| 401 | unauthorized | Missing or invalid API key |\n| 403 | insufficient_scope | API key lacks the required scope |\n| 404 | not_found | Resource does not exist |\n| 409 | conflict | Resource state conflict |\n| 413 | payload_too_large | File exceeds 500 MB limit |\n| 422 | extraction_failed | Document could not be processed |\n| 429 | rate_limit_exceeded| Daily rate limit reached |\n| 500 | internal_error | Unexpected server error (retryable) |\n\nEvery error response follows this envelope:\n\n```json\n{\n "statusCode": 400,\n "code": "VALIDATION_ERROR",\n "error": "Bad Request",\n "message": "name is required.",\n "retryable": false,\n "timestamp": "2026-04-25T14:30:00.000Z",\n "path": "/v1/schemas"\n}\n```\n\nThe `code` field is one of: `VALIDATION_ERROR`, `AUTH_REQUIRED`, `TOKEN_EXPIRED`,\n`INSUFFICIENT_PERMISSIONS`, `RESOURCE_NOT_FOUND`, `QUOTA_EXCEEDED`,\n`INSUFFICIENT_CREDITS`, `LLM_RATE_LIMITED`, `LLM_TIMEOUT`, `LLM_UNAVAILABLE`,\n`OCR_FAILED`, `EXTRACTION_FAILED`, `EXTRACTION_TIMEOUT`, `FILE_TOO_LARGE`,\n`DUPLICATE_RESOURCE`, `DATASPACE_RUN_FAILED`, `INTERNAL_ERROR`.\n\n### Refusal reasons\n\nA refusal an integration must branch on also carries `reason`, a stable\ntoken beside `code`. Branch on `reason`, not on `code`, `error` or the\nmessage: `code` says only which HTTP family the refusal belongs to, `error`\nis the HTTP status name on some refusals and a body discriminant on others,\nand messages are prose. The key is present only on refusals; absent means\n"no stable reason, read `message`". Message prefixes (`insufficient_grant:\n\u2026`) are kept for older clients that parse them; where a message carries one it equals `reason`, but not every refusal has a prefix (the Apps-ladder refusals are plain sentences), so branch on `reason`.\n\n| `reason` | Status | What the caller does |\n|---|---|---|\n| `insufficient_grant` | 403 | The app holds no approved grant covering this resource, or the route is not reachable by an app service key at all. Not retryable \u2014 stop and ask the workspace owner to grant it. |\n| `install_pending_approval` | 403 | A newer version of the app awaits owner approval and the install is paused. Poll `GET /v1/apps/{id}/install/status`. |\n| `install_not_ready` | 403 / 409 | The install is not in force (403, no installed binding for this service key) or is parked on an unapproved version / has no bound OAuth client (409). Poll `GET /v1/apps/{id}/install/status`. |\n| `endpoint_not_confirmed` | 400 | The binding would give the install its first subscriptions, or `confirm_subscriptions_endpoint` does not equal the manifest\'s `subscriptions_endpoint`. An owner action \u2014 re-send with the confirmation. |\n| `slot_unbound` | 400 / 409 | A required requirement slot has no binding (400 at install/rebind, 409 when a run resolves an already-installed version). The owner binds the named aliases. |\n| `slot_unknown` | 400 | The request named an alias the manifest declares no slot for. Fix the manifest or the request. |\n| `hosted_manifest_read_only` | 409 | The app\'s manifest is fetched from the vendor\'s URL, so local edits are refused. Edit at the vendor host, then `POST /v1/apps/{id}/refresh`. |\n| `hosted_surface_fixed` | 422 | A hosted app\'s surface URL comes from its manifest and moves only when a new version is approved; drop `surface_url` from the patch. |\n| `manifest_fetch_failed` | 422 | The vendor\'s manifest URL could not be read. `details.violations` carries the fetch reason. Fix it at the vendor host and retry. |\n| `schema_validation_failed` | 422 | A manifest does not validate, on publish or on a hosted fetch. `details.violations` carries `{ pointer, keyword, message }` per failure. |\n| `refresh_failed` | 422 | A hosted refresh did not happen; the failure is recorded on the app and it stays live on its approved version. `details` carries `{ changed, error }`. Fix it at the vendor host. |\n| `insufficient_scope` | 403 | The key or token lacks a required scope. `required_scopes` names the ones that admit. Workspace keys and OAuth clients receive this; an app service key never does, because both scope paths hand an app principal to its grant checks instead. |\n| `unauthenticated` | 403 | The Apps surface saw no authenticated principal. |\n| `workspace_required` | 403 | The Apps surface needs a concrete workspace; a master-view key cannot call it. |\n| `insufficient_tier` | 403 | The caller\'s workspace role (or an OAuth token\'s role claim) ranks below the route\'s tier. `required` names the tier. |\n| `owner_required` | 403 | Grant and OAuth-client management needs a human workspace owner; no machine caller reaches it. |\n| `insufficient_app_grant` | 403 | The API key holds app grants, but none at the level this route needs. `required` names the tier. |\n| `decide_grant_required` | 403 | The decision-task protocol admits only a machine caller holding an explicit `decide` grant on the app. |\n\n## Async Extraction Flow\n\nDocuments \u22645 pages return results synchronously (`200`). Larger documents\n\u2014 or any request with `options: {"async": true}` \u2014 return `202 Accepted`.\n\n**1. Submit extraction:**\n\n```bash\ncurl -X POST https://api.talonic.com/v1/extract \\\n -H "Authorization: Bearer tlnc_live_abc123" \\\n -F "file=@contract.pdf" \\\n -F \'options={"async": true}\'\n```\n\nResponse `202`:\n```json\n{\n "request_id": "req_x7y8z9a0",\n "status": "processing",\n "document": { "id": "f0e1d2c3-b4a5-9687-8765-432109876543" },\n "poll_url": "/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543"\n}\n```\n\n**2. Poll until complete:**\n\n```bash\ncurl https://api.talonic.com/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543 \\\n -H "Authorization: Bearer tlnc_live_abc123"\n```\n\nWhile processing: `{ "status": "processing" }`\nWhen done: `{ "status": "completed" }`\n\n**3. Retrieve results:**\n\n```bash\ncurl https://api.talonic.com/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543/extractions \\\n -H "Authorization: Bearer tlnc_live_abc123"\n```\n\n**Python \u2014 complete async flow with exponential backoff:**\n\n```python\nimport time\nimport requests\n\nAPI_KEY = "tlnc_live_..."\nBASE = "https://api.talonic.com/v1"\nHEADERS = {"Authorization": f"Bearer {API_KEY}"}\n\n# Step 1: Submit async extraction\nresp = requests.post(f"{BASE}/extract",\n headers=HEADERS,\n files={"file": open("contract.pdf", "rb")},\n data={"options": \'{"async": true}\'})\ndoc_id = resp.json()["document"]["id"]\n\n# Step 2: Poll with exponential backoff (2s \u2192 4s \u2192 8s \u2192 16s \u2192 30s cap)\ndelay = 2\nfor _ in range(20):\n time.sleep(delay)\n doc = requests.get(f"{BASE}/documents/{doc_id}", headers=HEADERS).json()\n if doc["status"] == "completed":\n break\n if doc["status"] == "error":\n raise Exception(f"Extraction failed: {doc.get(\'error\')}")\n delay = min(delay * 2, 30)\n\n# Step 3: Retrieve extracted data\nextractions = requests.get(\n f"{BASE}/documents/{doc_id}/extractions", headers=HEADERS).json()\ndata = extractions["data"][0]["data"]\nconfidence = extractions["data"][0]["confidence"]["overall"]\nprint(f"Extracted {len(data)} fields (confidence: {confidence})")\nprint(data)\n# \u2192 {"vendor_name": "Acme Corp", "total_amount": 1250.00, ...}\n```\n\n**TypeScript \u2014 same flow:**\n\n```typescript\nconst API_KEY = "tlnc_live_...";\nconst BASE = "https://api.talonic.com/v1";\nconst headers = { Authorization: `Bearer ${API_KEY}` };\n\n// Step 1: Submit async extraction\nconst form = new FormData();\nform.append("file", fs.createReadStream("contract.pdf"));\nform.append("options", \'{"async": true}\');\nconst { document } = await fetch(`${BASE}/extract`, {\n method: "POST", headers, body: form,\n}).then((r) => r.json());\n\n// Step 2: Poll with exponential backoff\nlet delay = 2000;\nlet doc: any;\nfor (let i = 0; i < 20; i++) {\n await new Promise((r) => setTimeout(r, delay));\n doc = await fetch(`${BASE}/documents/${document.id}`, { headers }).then((r) => r.json());\n if (doc.status === "completed") break;\n if (doc.status === "error") throw new Error(`Extraction failed: ${doc.error}`);\n delay = Math.min(delay * 2, 30_000);\n}\n\n// Step 3: Retrieve extracted data\nconst { data: extractions } = await fetch(\n `${BASE}/documents/${document.id}/extractions`, { headers }\n).then((r) => r.json());\nconsole.log(extractions[0].data);\n// \u2192 { vendor_name: "Acme Corp", total_amount: 1250.00, ... }\n```\n\nRecommended polling: 2s initial, exponential backoff (2\u21924\u21928\u219216\u219230s cap),\ntimeout after 5 minutes.\n\n**Alternative \u2014 Webhooks:** Configure a delivery destination and listen for\n`document.extracted` events. See the Delivery tag.\n\n**Job status state machine:**\n`pending` \u2192 `queued` \u2192 `processing` \u2192 `complete` | `failed`\n\n## Performance\n\n| Document size | Expected latency | Max timeout |\n|---------------|------------------|-------------|\n| 1\u20135 pages | Sync, <3s | 30s |\n| 6\u201350 pages | <30s average | 5 min |\n| 50+ pages | <5 min average | 30 min |\n\n**Uptime SLA:** 99.5% (Build), 99.9% (Scale), custom (Enterprise).\n\n**Max file size:** 500 MB. JSON request bodies (schemas, jobs): 1 MB.\n\n**Idempotency:** Pass `Idempotency-Key` header on POST requests. Keys are\nscoped to your organization (all keys in a workspace share one namespace).\nDuplicates return the cached response with `cached: true`.\n',
7
+ description: 'Structure any document into schema-validated data.\n\nThe Talonic API lets you extract structured data from documents (PDFs, images,\nDOCX, CSV, plain text), manage reusable extraction schemas, track async jobs,\nand organise documents through sources.\n\n## Quick Start\n\n**1. Get your API key**\n\nSign up at [app.talonic.com](https://app.talonic.com) \u2192 Settings \u2192 API Keys \u2192 Create key.\nKeys start with `tlnc_`. All examples below use `tlnc_live_abc123` as a placeholder.\n\n**2. Extract your first document**\n\n```bash\ncurl -X POST https://api.talonic.com/v1/extract \\\n -H "Authorization: Bearer tlnc_live_abc123" \\\n -F "file=@invoice.pdf" \\\n -F \'schema={"properties":{"vendor_name":{"type":"string"},"total_amount":{"type":"number"},"invoice_date":{"type":"string"}}}\'\n```\n\n**Python:**\n```python\nimport requests\nresp = requests.post("https://api.talonic.com/v1/extract",\n headers={"Authorization": "Bearer tlnc_live_abc123"},\n files={"file": open("invoice.pdf", "rb")},\n data={"schema": \'{"properties":{"vendor_name":{"type":"string"},"total_amount":{"type":"number"},"invoice_date":{"type":"string"}}}\'})\nprint(resp.json()["data"])\n```\n\n**TypeScript:**\n```typescript\nconst form = new FormData();\nform.append("file", fs.createReadStream("invoice.pdf"));\nform.append("schema", \'{"properties":{"vendor_name":{"type":"string"},"total_amount":{"type":"number"},"invoice_date":{"type":"string"}}}\');\nconst res = await fetch("https://api.talonic.com/v1/extract", {\n method: "POST",\n headers: { Authorization: "Bearer tlnc_live_abc123" },\n body: form,\n}).then(r => r.json());\nconsole.log(res.data);\n```\n\n**3. What you get back**\n\n```json\n{\n "extraction_id": "d1a2b3c4-5678-9abc-def0-1234567890ab",\n "request_id": "req_x7y8z9a0b1c2d3e4",\n "status": "complete",\n "document": {\n "id": "f0e1d2c3-b4a5-9687-8765-432109876543",\n "filename": "invoice.pdf",\n "pages": 2,\n "size_bytes": 184320,\n "type_detected": "Invoice",\n "language_detected": "en"\n },\n "data": {\n "vendor_name": "Acme GmbH",\n "total_amount": 14250.00,\n "invoice_date": "2025-03-15"\n },\n "confidence": {\n "overall": 0.96,\n "fields": {\n "vendor_name": 0.97,\n "total_amount": 0.94,\n "invoice_date": 0.99\n }\n },\n "processing": {\n "duration_ms": 1840,\n "pages_processed": 2,\n "region": "eu-west"\n },\n "links": {\n "self": "/v1/extractions/d1a2b3c4-5678-9abc-def0-1234567890ab",\n "document": "/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543"\n }\n}\n```\n\n- **`data`** \u2014 extracted fields as key-value pairs matching your schema.\n- **`confidence.fields`** \u2014 per-field score from 0 to 1. Above 0.9 is high confidence; below 0.7 flags for review.\n- **`extraction_id`** \u2014 use this to retrieve, correct, or deliver results later.\n- Full response schema: [ExtractSyncResponse](#/components/schemas/ExtractSyncResponse)\n\n**4. Next steps**\n\n- **50+ pages?** Use async mode \u2014 see [Async Extraction Flow](#section/Async-Extraction-Flow) below.\n- **Reusable schemas** \u2014 save field definitions with `POST /v1/schemas`, then pass `schema_id` on future extractions.\n- **Receive results via webhook** \u2014 configure a delivery destination and listen for `document.extracted` events. See the [Delivery](#tag/Delivery) tag.\n\n---\n\n## Authentication\n\nAll requests require a Bearer token in the `Authorization` header.\nAPI keys are prefixed with `tlnc_` and scoped per customer.\n\n```\nAuthorization: Bearer tlnc_live_abc123...\n```\n\n## Async Extraction Pattern\n\nSmall documents (\u22645 pages) are processed synchronously and return a `200`\nwith the extracted data immediately. Larger documents return a `202 Accepted`\nwith a `poll_url` \u2014 poll `GET /v1/documents/{id}` until `status` transitions\nto `completed`, then fetch results via `GET /v1/documents/{id}/extractions`.\n\nYou can force async processing by passing `options: {"async": true}` on\nany extraction request. Combine with webhooks for a fully event-driven flow:\nconfigure a webhook destination under Delivery and listen for the\n`extraction.complete` event.\n\n**Job status lifecycle:** `pending` \u2192 `processing` \u2192 `complete` | `failed`\n\n## Rate Limits\n\nThe **Free** tier is metered by a recurring **5,000-credit monthly grant**\n(no card required) that refreshes on the 1st of each month (UTC). Free\nrequests run until the monthly credit balance is spent, then return `402`\nuntil the next grant. A generous daily request ceiling is retained purely as\nabuse protection and does not bind a legitimate free user within the monthly\nenvelope. Inspect your balance and reset date via `GET /v1/account`.\n\nPaid tiers are metered per calendar day (UTC):\n\n| Tier | Extract | Platform | Ingest | Operations | Run | Ask |\n|------------|---------|----------|--------|------------|-----|-----|\n| Free | 1,000/day | 2,000/day | 1,000/day | 1,000/day | 1,000/day | 200/day |\n| Pro | 25,000/day | 50,000/day | 25,000/day | 25,000/day | 25,000/day | 5,000/day |\n| Enterprise | Unlimited | Unlimited | Unlimited | Unlimited | Unlimited | Unlimited |\n\nFree workspaces additionally receive 5,000 credits/month; spend is governed\nby credits (402 on exhaustion), with daily ceilings acting as abuse protection.\n\nResponses with a finite limit include rate-limit headers:\n- `X-RateLimit-Limit` \u2014 daily cap for the namespace\n- `X-RateLimit-Remaining` \u2014 requests left today\n- `X-RateLimit-Reset` \u2014 ISO 8601 timestamp when the window resets (midnight UTC)\n\n## Pagination\n\nList endpoints use cursor-based pagination. Pass `limit` (1\u2013100, default 20),\n`cursor` (opaque token from `pagination.next_cursor`), and `order` (`asc` or `desc`, default `desc`).\n\n## Errors\n\nAll errors return a JSON body with `error` (machine-readable code) and `message`\n(human-readable explanation). Additional fields vary by error type.\n\n| Code | Error | Description |\n|------|--------------------|------------------------------------------|\n| 400 | validation_error | Request body is malformed or invalid |\n| 401 | unauthorized | Missing or invalid API key |\n| 403 | insufficient_scope | API key lacks the required scope |\n| 404 | not_found | Resource does not exist |\n| 409 | conflict | Resource state conflict |\n| 413 | payload_too_large | File exceeds 500 MB limit |\n| 422 | extraction_failed | Document could not be processed |\n| 429 | rate_limit_exceeded| Daily rate limit reached |\n| 500 | internal_error | Unexpected server error (retryable) |\n\nEvery error response follows this envelope:\n\n```json\n{\n "statusCode": 400,\n "code": "VALIDATION_ERROR",\n "error": "Bad Request",\n "message": "name is required.",\n "retryable": false,\n "timestamp": "2026-04-25T14:30:00.000Z",\n "path": "/v1/schemas"\n}\n```\n\nThe `code` field is one of: `VALIDATION_ERROR`, `AUTH_REQUIRED`, `TOKEN_EXPIRED`,\n`INSUFFICIENT_PERMISSIONS`, `RESOURCE_NOT_FOUND`, `QUOTA_EXCEEDED`,\n`INSUFFICIENT_CREDITS`, `LLM_RATE_LIMITED`, `LLM_TIMEOUT`, `LLM_UNAVAILABLE`,\n`OCR_FAILED`, `EXTRACTION_FAILED`, `EXTRACTION_TIMEOUT`, `FILE_TOO_LARGE`,\n`DUPLICATE_RESOURCE`, `DATASPACE_RUN_FAILED`, `INTERNAL_ERROR`.\n\n### Refusal reasons\n\nA refusal an integration must branch on also carries `reason`, a stable\ntoken beside `code`. Branch on `reason`, not on `code`, `error` or the\nmessage: `code` says only which HTTP family the refusal belongs to, `error`\nis the HTTP status name on some refusals and a body discriminant on others,\nand messages are prose. The key is present only on refusals; absent means\n"no stable reason, read `message`". Message prefixes (`insufficient_grant:\n\u2026`) are kept for older clients that parse them; where a message carries one it equals `reason`, but not every refusal has a prefix (the Apps-ladder refusals are plain sentences), so branch on `reason`.\n\n| `reason` | Status | What the caller does |\n|---|---|---|\n| `insufficient_grant` | 403 | The app holds no approved grant covering this resource, or the route is not reachable by an app service key at all. Not retryable \u2014 stop and ask the workspace owner to grant it. |\n| `install_pending_approval` | 403 | A newer version of the app awaits owner approval and the install is paused. Poll `GET /v1/apps/{id}/install/status`. |\n| `install_not_ready` | 403 / 409 | The install is not in force (403, no installed binding for this service key) or is parked on an unapproved version / has no bound OAuth client (409). Poll `GET /v1/apps/{id}/install/status`. |\n| `endpoint_not_confirmed` | 400 | The binding would give the install its first subscriptions, or `confirm_subscriptions_endpoint` does not equal the manifest\'s `subscriptions_endpoint`. An owner action \u2014 re-send with the confirmation. |\n| `slot_unbound` | 400 / 409 | A required requirement slot has no binding (400 at install/rebind, 409 when a run resolves an already-installed version). The owner binds the named aliases. |\n| `slot_unknown` | 400 | The request named an alias the manifest declares no slot for. Fix the manifest or the request. |\n| `hosted_manifest_read_only` | 409 | The app\'s manifest is fetched from the vendor\'s URL, so local edits are refused. Edit at the vendor host, then `POST /v1/apps/{id}/refresh`. |\n| `hosted_surface_fixed` | 422 | A hosted app\'s surface URL comes from its manifest and moves only when a new version is approved; drop `surface_url` from the patch. |\n| `manifest_fetch_failed` | 422 | The vendor\'s manifest URL could not be read. `details.violations` carries the fetch reason. Fix it at the vendor host and retry. |\n| `schema_validation_failed` | 422 | A manifest does not validate, on publish or on a hosted fetch. `details.violations` carries `{ pointer, keyword, message }` per failure. |\n| `refresh_failed` | 422 | A hosted refresh did not happen; the failure is recorded on the app and it stays live on its approved version. `details` carries `{ changed, error }`. Fix it at the vendor host. |\n| `insufficient_scope` | 403 | The key or token lacks a required scope. `required_scopes` names the ones that admit. Workspace keys and OAuth clients receive this; an app service key never does, because both scope paths hand an app principal to its grant checks instead. |\n| `unauthenticated` | 403 | The Apps surface saw no authenticated principal. |\n| `workspace_required` | 403 | The Apps surface needs a concrete workspace; a master-view key cannot call it. |\n| `insufficient_tier` | 403 | The caller\'s workspace role (or an OAuth token\'s role claim) ranks below the route\'s tier. `required` names the tier. |\n| `owner_required` | 403 | Grant and OAuth-client management needs a human workspace owner; no machine caller reaches it. |\n| `insufficient_app_grant` | 403 | The API key holds app grants, but none at the level this route needs. `required` names the tier. |\n| `decide_grant_required` | 403 | The decision-task protocol admits only a machine caller holding an explicit `decide` grant on the app. |\n\n## Async Extraction Flow\n\nDocuments \u22645 pages return results synchronously (`200`). Larger documents\n\u2014 or any request with `options: {"async": true}` \u2014 return `202 Accepted`.\n\n**1. Submit extraction:**\n\n```bash\ncurl -X POST https://api.talonic.com/v1/extract \\\n -H "Authorization: Bearer tlnc_live_abc123" \\\n -F "file=@contract.pdf" \\\n -F \'options={"async": true}\'\n```\n\nResponse `202`:\n```json\n{\n "request_id": "req_x7y8z9a0",\n "status": "processing",\n "document": { "id": "f0e1d2c3-b4a5-9687-8765-432109876543" },\n "poll_url": "/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543"\n}\n```\n\n**2. Poll until complete:**\n\n```bash\ncurl https://api.talonic.com/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543 \\\n -H "Authorization: Bearer tlnc_live_abc123"\n```\n\nWhile processing: `{ "status": "processing" }`\nWhen done: `{ "status": "completed" }`\n\n**3. Retrieve results:**\n\n```bash\ncurl https://api.talonic.com/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543/extractions \\\n -H "Authorization: Bearer tlnc_live_abc123"\n```\n\n**Python \u2014 complete async flow with exponential backoff:**\n\n```python\nimport time\nimport requests\n\nAPI_KEY = "tlnc_live_..."\nBASE = "https://api.talonic.com/v1"\nHEADERS = {"Authorization": f"Bearer {API_KEY}"}\n\n# Step 1: Submit async extraction\nresp = requests.post(f"{BASE}/extract",\n headers=HEADERS,\n files={"file": open("contract.pdf", "rb")},\n data={"options": \'{"async": true}\'})\ndoc_id = resp.json()["document"]["id"]\n\n# Step 2: Poll with exponential backoff (2s \u2192 4s \u2192 8s \u2192 16s \u2192 30s cap)\ndelay = 2\nfor _ in range(20):\n time.sleep(delay)\n doc = requests.get(f"{BASE}/documents/{doc_id}", headers=HEADERS).json()\n if doc["status"] == "completed":\n break\n if doc["status"] == "error":\n raise Exception(f"Extraction failed: {doc.get(\'error\')}")\n delay = min(delay * 2, 30)\n\n# Step 3: Retrieve extracted data\nextractions = requests.get(\n f"{BASE}/documents/{doc_id}/extractions", headers=HEADERS).json()\ndata = extractions["data"][0]["data"]\nconfidence = extractions["data"][0]["confidence"]["overall"]\nprint(f"Extracted {len(data)} fields (confidence: {confidence})")\nprint(data)\n# \u2192 {"vendor_name": "Acme Corp", "total_amount": 1250.00, ...}\n```\n\n**TypeScript \u2014 same flow:**\n\n```typescript\nconst API_KEY = "tlnc_live_...";\nconst BASE = "https://api.talonic.com/v1";\nconst headers = { Authorization: `Bearer ${API_KEY}` };\n\n// Step 1: Submit async extraction\nconst form = new FormData();\nform.append("file", fs.createReadStream("contract.pdf"));\nform.append("options", \'{"async": true}\');\nconst { document } = await fetch(`${BASE}/extract`, {\n method: "POST", headers, body: form,\n}).then((r) => r.json());\n\n// Step 2: Poll with exponential backoff\nlet delay = 2000;\nlet doc: any;\nfor (let i = 0; i < 20; i++) {\n await new Promise((r) => setTimeout(r, delay));\n doc = await fetch(`${BASE}/documents/${document.id}`, { headers }).then((r) => r.json());\n if (doc.status === "completed") break;\n if (doc.status === "error") throw new Error(`Extraction failed: ${doc.error}`);\n delay = Math.min(delay * 2, 30_000);\n}\n\n// Step 3: Retrieve extracted data\nconst { data: extractions } = await fetch(\n `${BASE}/documents/${document.id}/extractions`, { headers }\n).then((r) => r.json());\nconsole.log(extractions[0].data);\n// \u2192 { vendor_name: "Acme Corp", total_amount: 1250.00, ... }\n```\n\nRecommended polling: 2s initial, exponential backoff (2\u21924\u21928\u219216\u219230s cap),\ntimeout after 5 minutes.\n\n**Alternative \u2014 Webhooks:** Configure a delivery destination and listen for\n`document.extracted` events. See the Delivery tag.\n\n**Job status state machine:**\n`pending` \u2192 `queued` \u2192 `processing` \u2192 `complete` | `failed`\n\n## Performance\n\n| Document size | Expected latency | Max timeout |\n|---------------|------------------|-------------|\n| 1\u20135 pages | Sync, <3s | 30s |\n| 6\u201350 pages | <30s average | 5 min |\n| 50+ pages | <5 min average | 30 min |\n\n**Uptime SLA:** 99.5% (Build), 99.9% (Scale), custom (Enterprise).\n\n**Max file size:** 500 MB. JSON request bodies (schemas, jobs): 1 MB.\n\n**Idempotency:** Pass `Idempotency-Key` header on POST requests. Keys are\nscoped to your organization (all keys in a workspace share one namespace)\nand at most 64 characters (a longer key is refused with 400\n`invalid_idempotency_key` before any work). Duplicates return the cached\nresponse with `cached: true`.\n',
8
8
  contact: {
9
9
  name: "Talonic Support",
10
10
  email: "support@talonic.ai",
@@ -21158,7 +21158,7 @@ var openapi_default = {
21158
21158
  }
21159
21159
  },
21160
21160
  "409": {
21161
- description: "A governance hold blocks delivery for the run's documents.",
21161
+ description: "A governance hold blocks delivery for the run's documents (`RUN_RULE_HOLD`), or the dispatch is a `skipped` row written by the submitting request's delivery controls (`DISPATCH_SKIPPED_BY_REQUEST`) \u2014 trigger the node manually instead.",
21162
21162
  content: {
21163
21163
  "application/json": {
21164
21164
  schema: {
@@ -21251,6 +21251,16 @@ var openapi_default = {
21251
21251
  ],
21252
21252
  default: "ingest",
21253
21253
  description: "How far the platform processes the run's documents beyond the Spec pipeline. `ingest` (default): after OCR, Stage-2 field capture runs asynchronously so the corpus becomes queryable by the agent surfaces (POST /v1/ask) and the pipeline's Transfer phase \u2014 the pipeline still starts the moment OCR markdown is ready, capture never delays it. `extract`: markdown-only; the documents are not askable.\n"
21254
+ },
21255
+ dispatch: {
21256
+ type: "boolean",
21257
+ default: true,
21258
+ description: '`false` = none of the Spec\'s Dispatch nodes fires for this request\'s payloads (multipart carries it as the string "true"/"false"). The shorthand for `bindings` with every node set to null. A skipped node is recorded as a `skipped` dispatch on the pipeline (GET /v1/pipelines/{id}/dispatches) and cannot be re-dispatched; a manual trigger of the node still works. Legacy `document.structured` / `run.completed` deliveries are not affected. Named `dispatch`, not `deliver`: the Spec already has a `deliver` (Data Product) stage.\n'
21259
+ },
21260
+ bindings: {
21261
+ type: "string",
21262
+ maxLength: 8192,
21263
+ description: "Optional JSON string of `{ [dispatchNodeId]: destinationId | null }`. Per Dispatch node of the Spec's published version: deliver this request's payloads to that destination instead of each binding's own (every binding of the node is re-pointed as a unit, keeping its field map, serializer and retry policy), or `null` to skip that node. Keys are the node ids shown in the Spec editor and in `dispatch.*` binding filters (stable per Spec version; a node re-added after deletion mints a new id). A key is accepted when the node is on the Spec's published version OR on the newest pipeline's frozen rail: the early trigger modes read the published version, `on_run_completed` reads the rail frozen when the pipeline was created (an append request reuses it), and a node on only one side is accepted with a `warnings[]` entry. 400 `invalid_delivery_controls` when a key names no Dispatch node, a value is not an active destination of this workspace, a value's connector cannot carry one of the node's bindings, or `dispatch=false` is combined with a non-null value. A node with no active binding is accepted with a `warnings[]` entry. Controls attach to a document's FIRST request on a pipeline (a re-submitted document keeps its original request's controls for later re-emissions). Under `append`, a pipeline-level payload (assembly / data product) ships the non-skipping requests' records and applies an override only when every contributing request names the same destination.\n"
21254
21264
  }
21255
21265
  }
21256
21266
  }
@@ -21344,6 +21354,30 @@ var openapi_default = {
21344
21354
  deduplicated: false
21345
21355
  }
21346
21356
  }
21357
+ },
21358
+ warnings: {
21359
+ type: "array",
21360
+ description: "Present only when the accepted request carries a non-fatal note: `no_binding_for_node` (a `bindings` override names a Dispatch node that has no active binding, so nothing will be delivered for it); `node_not_in_live_pipeline` (the node is on the published version but not on the newest pipeline's frozen rail \u2014 if this request appends onto that pipeline, its on_run_completed trigger cannot see the node; the early trigger modes can); `node_not_on_published_version` (the node exists only on that pipeline's frozen rail \u2014 it governs on_run_completed there and nothing else).\n",
21361
+ items: {
21362
+ type: "object",
21363
+ required: [
21364
+ "code",
21365
+ "message"
21366
+ ],
21367
+ properties: {
21368
+ code: {
21369
+ type: "string",
21370
+ enum: [
21371
+ "no_binding_for_node",
21372
+ "node_not_in_live_pipeline",
21373
+ "node_not_on_published_version"
21374
+ ]
21375
+ },
21376
+ message: {
21377
+ type: "string"
21378
+ }
21379
+ }
21380
+ }
21347
21381
  }
21348
21382
  }
21349
21383
  }
@@ -21351,7 +21385,7 @@ var openapi_default = {
21351
21385
  }
21352
21386
  },
21353
21387
  "400": {
21354
- description: "Missing spec_id, no input provided (both files and file_urls empty), or metadata is not a valid flat JSON object."
21388
+ description: "Missing spec_id, no input provided (both files and file_urls empty), metadata is not a valid flat JSON object (`invalid_metadata`), or `dispatch` / `bindings` are malformed or name an unknown Dispatch node, an inactive or foreign destination, or a destination the node's bindings cannot deliver to (`invalid_delivery_controls`)."
21355
21389
  },
21356
21390
  "402": {
21357
21391
  description: "Insufficient credits for an ingest leg."
@@ -21448,6 +21482,26 @@ var openapi_default = {
21448
21482
  nullable: true,
21449
21483
  description: "The caller grouping key supplied on POST /v1/run, echoed back here."
21450
21484
  },
21485
+ dispatch: {
21486
+ type: "boolean",
21487
+ enum: [
21488
+ false
21489
+ ],
21490
+ description: "Present only when the request sent `dispatch=false`."
21491
+ },
21492
+ bindings: {
21493
+ type: "object",
21494
+ additionalProperties: {
21495
+ type: "string",
21496
+ format: "uuid",
21497
+ nullable: true
21498
+ },
21499
+ description: "The per-node overrides supplied on POST /v1/run (`null` = that node skipped), echoed back here; present only when sent."
21500
+ },
21501
+ dispatch_skipped: {
21502
+ type: "boolean",
21503
+ description: "Present only when the request carried delivery controls: true when they suppress at least one Dispatch node (`dispatch=false` or any null `bindings` value). Derived from the stored controls; what actually happened per node is on GET /v1/pipelines/{id}/dispatches (status `skipped`).\n"
21504
+ },
21451
21505
  created_at: {
21452
21506
  type: "string",
21453
21507
  format: "date-time"
@@ -29336,9 +29390,10 @@ var openapi_default = {
29336
29390
  name: "Idempotency-Key",
29337
29391
  in: "header",
29338
29392
  schema: {
29339
- type: "string"
29393
+ type: "string",
29394
+ maxLength: 64
29340
29395
  },
29341
- description: "Unique key for idempotent requests. If a request with the same key was\nalready processed, the cached result is returned.\n"
29396
+ 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"
29342
29397
  }
29343
29398
  },
29344
29399
  headers: {
@@ -35013,8 +35068,11 @@ var openapi_default = {
35013
35068
  "pending",
35014
35069
  "published",
35015
35070
  "empty",
35016
- "failed"
35017
- ]
35071
+ "failed",
35072
+ "superseded",
35073
+ "skipped"
35074
+ ],
35075
+ description: "`skipped` = the submitting POST /v1/run request's `dispatch` / `bindings` controls suppressed this node (no events; terminal, not re-dispatchable)."
35018
35076
  },
35019
35077
  record_count: {
35020
35078
  type: "integer",
@@ -35120,8 +35178,11 @@ var openapi_default = {
35120
35178
  "pending",
35121
35179
  "published",
35122
35180
  "empty",
35123
- "failed"
35124
- ]
35181
+ "failed",
35182
+ "superseded",
35183
+ "skipped"
35184
+ ],
35185
+ description: "`skipped` = the submitting POST /v1/run request's `dispatch` / `bindings` controls suppressed this node (no events; terminal, not re-dispatchable)."
35125
35186
  },
35126
35187
  error: {
35127
35188
  type: [
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Tailwind CSS preset for @talonic/docs consumers.
3
+ * Adds the Void design system color tokens and font families
4
+ * so doc components render correctly in any host app.
5
+ */
6
+ declare const voidDocsPreset: {
7
+ darkMode: "class";
8
+ theme: {
9
+ extend: {
10
+ colors: {
11
+ 'void-bg': string;
12
+ 'void-bg-elevated': string;
13
+ 'void-surface': string;
14
+ 'void-surface-2': string;
15
+ 'void-surface-3': string;
16
+ 'void-border': string;
17
+ 'void-border-hover': string;
18
+ 'void-text-primary': string;
19
+ 'void-text-secondary': string;
20
+ 'void-text-muted': string;
21
+ 'void-text-tertiary': string;
22
+ 'void-accent': string;
23
+ 'void-accent-hover': string;
24
+ 'void-accent-dim': string;
25
+ 'void-accent-tint': string;
26
+ 'void-danger': string;
27
+ 'void-danger-solid': string;
28
+ 'void-divider': string;
29
+ 'void-warning': string;
30
+ 'void-warning-dim': string;
31
+ 'void-tier-1': string;
32
+ 'void-tier-2': string;
33
+ 'void-tier-3': string;
34
+ };
35
+ fontFamily: {
36
+ space: string[];
37
+ body: string[];
38
+ mono: string[];
39
+ };
40
+ };
41
+ };
42
+ plugins: never[];
43
+ };
44
+
45
+ export { voidDocsPreset as default };
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Tailwind CSS preset for @talonic/docs consumers.
3
+ * Adds the Void design system color tokens and font families
4
+ * so doc components render correctly in any host app.
5
+ */
6
+ declare const voidDocsPreset: {
7
+ darkMode: "class";
8
+ theme: {
9
+ extend: {
10
+ colors: {
11
+ 'void-bg': string;
12
+ 'void-bg-elevated': string;
13
+ 'void-surface': string;
14
+ 'void-surface-2': string;
15
+ 'void-surface-3': string;
16
+ 'void-border': string;
17
+ 'void-border-hover': string;
18
+ 'void-text-primary': string;
19
+ 'void-text-secondary': string;
20
+ 'void-text-muted': string;
21
+ 'void-text-tertiary': string;
22
+ 'void-accent': string;
23
+ 'void-accent-hover': string;
24
+ 'void-accent-dim': string;
25
+ 'void-accent-tint': string;
26
+ 'void-danger': string;
27
+ 'void-danger-solid': string;
28
+ 'void-divider': string;
29
+ 'void-warning': string;
30
+ 'void-warning-dim': string;
31
+ 'void-tier-1': string;
32
+ 'void-tier-2': string;
33
+ 'void-tier-3': string;
34
+ };
35
+ fontFamily: {
36
+ space: string[];
37
+ body: string[];
38
+ mono: string[];
39
+ };
40
+ };
41
+ };
42
+ plugins: never[];
43
+ };
44
+
45
+ export { voidDocsPreset as default };
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).\nDuplicates return the cached response 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 `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",
7
7
  "contact": {
8
8
  "name": "Talonic Support",
9
9
  "email": "support@talonic.ai",
@@ -21138,7 +21138,7 @@
21138
21138
  }
21139
21139
  },
21140
21140
  "409": {
21141
- "description": "A governance hold blocks delivery for the run's documents.",
21141
+ "description": "A governance hold blocks delivery for the run's documents (`RUN_RULE_HOLD`), or the dispatch is a `skipped` row written by the submitting request's delivery controls (`DISPATCH_SKIPPED_BY_REQUEST`) — trigger the node manually instead.",
21142
21142
  "content": {
21143
21143
  "application/json": {
21144
21144
  "schema": {
@@ -21231,6 +21231,16 @@
21231
21231
  ],
21232
21232
  "default": "ingest",
21233
21233
  "description": "How far the platform processes the run's documents beyond the Spec pipeline. `ingest` (default): after OCR, Stage-2 field capture runs asynchronously so the corpus becomes queryable by the agent surfaces (POST /v1/ask) and the pipeline's Transfer phase — the pipeline still starts the moment OCR markdown is ready, capture never delays it. `extract`: markdown-only; the documents are not askable.\n"
21234
+ },
21235
+ "dispatch": {
21236
+ "type": "boolean",
21237
+ "default": true,
21238
+ "description": "`false` = none of the Spec's Dispatch nodes fires for this request's payloads (multipart carries it as the string \"true\"/\"false\"). The shorthand for `bindings` with every node set to null. A skipped node is recorded as a `skipped` dispatch on the pipeline (GET /v1/pipelines/{id}/dispatches) and cannot be re-dispatched; a manual trigger of the node still works. Legacy `document.structured` / `run.completed` deliveries are not affected. Named `dispatch`, not `deliver`: the Spec already has a `deliver` (Data Product) stage.\n"
21239
+ },
21240
+ "bindings": {
21241
+ "type": "string",
21242
+ "maxLength": 8192,
21243
+ "description": "Optional JSON string of `{ [dispatchNodeId]: destinationId | null }`. Per Dispatch node of the Spec's published version: deliver this request's payloads to that destination instead of each binding's own (every binding of the node is re-pointed as a unit, keeping its field map, serializer and retry policy), or `null` to skip that node. Keys are the node ids shown in the Spec editor and in `dispatch.*` binding filters (stable per Spec version; a node re-added after deletion mints a new id). A key is accepted when the node is on the Spec's published version OR on the newest pipeline's frozen rail: the early trigger modes read the published version, `on_run_completed` reads the rail frozen when the pipeline was created (an append request reuses it), and a node on only one side is accepted with a `warnings[]` entry. 400 `invalid_delivery_controls` when a key names no Dispatch node, a value is not an active destination of this workspace, a value's connector cannot carry one of the node's bindings, or `dispatch=false` is combined with a non-null value. A node with no active binding is accepted with a `warnings[]` entry. Controls attach to a document's FIRST request on a pipeline (a re-submitted document keeps its original request's controls for later re-emissions). Under `append`, a pipeline-level payload (assembly / data product) ships the non-skipping requests' records and applies an override only when every contributing request names the same destination.\n"
21234
21244
  }
21235
21245
  }
21236
21246
  }
@@ -21324,6 +21334,30 @@
21324
21334
  "deduplicated": false
21325
21335
  }
21326
21336
  }
21337
+ },
21338
+ "warnings": {
21339
+ "type": "array",
21340
+ "description": "Present only when the accepted request carries a non-fatal note: `no_binding_for_node` (a `bindings` override names a Dispatch node that has no active binding, so nothing will be delivered for it); `node_not_in_live_pipeline` (the node is on the published version but not on the newest pipeline's frozen rail — if this request appends onto that pipeline, its on_run_completed trigger cannot see the node; the early trigger modes can); `node_not_on_published_version` (the node exists only on that pipeline's frozen rail — it governs on_run_completed there and nothing else).\n",
21341
+ "items": {
21342
+ "type": "object",
21343
+ "required": [
21344
+ "code",
21345
+ "message"
21346
+ ],
21347
+ "properties": {
21348
+ "code": {
21349
+ "type": "string",
21350
+ "enum": [
21351
+ "no_binding_for_node",
21352
+ "node_not_in_live_pipeline",
21353
+ "node_not_on_published_version"
21354
+ ]
21355
+ },
21356
+ "message": {
21357
+ "type": "string"
21358
+ }
21359
+ }
21360
+ }
21327
21361
  }
21328
21362
  }
21329
21363
  }
@@ -21331,7 +21365,7 @@
21331
21365
  }
21332
21366
  },
21333
21367
  "400": {
21334
- "description": "Missing spec_id, no input provided (both files and file_urls empty), or metadata is not a valid flat JSON object."
21368
+ "description": "Missing spec_id, no input provided (both files and file_urls empty), metadata is not a valid flat JSON object (`invalid_metadata`), or `dispatch` / `bindings` are malformed or name an unknown Dispatch node, an inactive or foreign destination, or a destination the node's bindings cannot deliver to (`invalid_delivery_controls`)."
21335
21369
  },
21336
21370
  "402": {
21337
21371
  "description": "Insufficient credits for an ingest leg."
@@ -21428,6 +21462,26 @@
21428
21462
  "nullable": true,
21429
21463
  "description": "The caller grouping key supplied on POST /v1/run, echoed back here."
21430
21464
  },
21465
+ "dispatch": {
21466
+ "type": "boolean",
21467
+ "enum": [
21468
+ false
21469
+ ],
21470
+ "description": "Present only when the request sent `dispatch=false`."
21471
+ },
21472
+ "bindings": {
21473
+ "type": "object",
21474
+ "additionalProperties": {
21475
+ "type": "string",
21476
+ "format": "uuid",
21477
+ "nullable": true
21478
+ },
21479
+ "description": "The per-node overrides supplied on POST /v1/run (`null` = that node skipped), echoed back here; present only when sent."
21480
+ },
21481
+ "dispatch_skipped": {
21482
+ "type": "boolean",
21483
+ "description": "Present only when the request carried delivery controls: true when they suppress at least one Dispatch node (`dispatch=false` or any null `bindings` value). Derived from the stored controls; what actually happened per node is on GET /v1/pipelines/{id}/dispatches (status `skipped`).\n"
21484
+ },
21431
21485
  "created_at": {
21432
21486
  "type": "string",
21433
21487
  "format": "date-time"
@@ -29316,9 +29370,10 @@
29316
29370
  "name": "Idempotency-Key",
29317
29371
  "in": "header",
29318
29372
  "schema": {
29319
- "type": "string"
29373
+ "type": "string",
29374
+ "maxLength": 64
29320
29375
  },
29321
- "description": "Unique key for idempotent requests. If a request with the same key was\nalready processed, the cached result is returned.\n"
29376
+ "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"
29322
29377
  }
29323
29378
  },
29324
29379
  "headers": {
@@ -34993,8 +35048,11 @@
34993
35048
  "pending",
34994
35049
  "published",
34995
35050
  "empty",
34996
- "failed"
34997
- ]
35051
+ "failed",
35052
+ "superseded",
35053
+ "skipped"
35054
+ ],
35055
+ "description": "`skipped` = the submitting POST /v1/run request's `dispatch` / `bindings` controls suppressed this node (no events; terminal, not re-dispatchable)."
34998
35056
  },
34999
35057
  "record_count": {
35000
35058
  "type": "integer",
@@ -35100,8 +35158,11 @@
35100
35158
  "pending",
35101
35159
  "published",
35102
35160
  "empty",
35103
- "failed"
35104
- ]
35161
+ "failed",
35162
+ "superseded",
35163
+ "skipped"
35164
+ ],
35165
+ "description": "`skipped` = the submitting POST /v1/run request's `dispatch` / `bindings` controls suppressed this node (no events; terminal, not re-dispatchable)."
35105
35166
  },
35106
35167
  "error": {
35107
35168
  "type": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talonic/docs",
3
- "version": "0.21.44",
3
+ "version": "0.21.46",
4
4
  "description": "Talonic documentation components — API Reference & Platform Guide",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,