{"openapi":"3.1.0","info":{"title":"APODEXA API","description":"Validated finance-data tools. Messy files in. Validated data out.","version":"1.0.0"},"paths":{"/api/v1/health":{"get":{"tags":["health"],"summary":"Health","description":"Liveness: the process is up and serving. Intentionally hardcoded-OK and\ndependency-free so a healthy-but-degraded process is not killed by an LB.","operationId":"health_api_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}},"security":[]}},"/api/v1/ready":{"get":{"tags":["health"],"summary":"Ready","description":"Readiness: can this instance actually serve traffic right now? Checks the\ndatabase is queryable and the data dir is writable; returns 503 if not so an\nLB/orchestrator routes around a broken instance (audit #15).","operationId":"ready_api_v1_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadyResponse"}}}},"503":{"description":"One or more readiness checks failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadyResponse"}}}}},"security":[]}},"/api/v1/auth/login":{"post":{"tags":["auth"],"summary":"Login","operationId":"login_api_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSessionResponse"}}}},"401":{"description":"Unauthenticated — no valid session cookie or API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"description":"Rate limited — too many requests; back off and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/api/v1/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","operationId":"logout_api_v1_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}}}}},"/api/v1/auth/me":{"get":{"tags":["auth"],"summary":"Me","operationId":"me_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}}}}},"/api/v1/auth/signup":{"post":{"tags":["auth"],"summary":"Signup","operationId":"signup_api_v1_auth_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSessionResponse"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"409":{"description":"Conflict — the resource is not in a state that allows this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"description":"Rate limited — too many requests; back off and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/api/v1/auth/verify":{"get":{"tags":["auth"],"summary":"Verify","operationId":"verify_api_v1_auth_verify_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}}],"responses":{"307":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/api/v1/auth/resend-verification":{"post":{"tags":["auth"],"summary":"Resend Verification","operationId":"resend_verification_api_v1_auth_resend_verification_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlreadyVerifiedResponse"}}}},"401":{"description":"Unauthenticated — no valid session cookie or API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"description":"Rate limited — too many requests; back off and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}}}},"/api/v1/auth/forgot":{"post":{"tags":["auth"],"summary":"Forgot","operationId":"forgot_api_v1_auth_forgot_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"429":{"description":"Rate limited — too many requests; back off and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/api/v1/auth/reset":{"post":{"tags":["auth"],"summary":"Reset","operationId":"reset_api_v1_auth_reset_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/api/v1/auth/config":{"get":{"tags":["auth"],"summary":"Auth Config","description":"Public: lets the login UI decide whether to show the Google button.","operationId":"auth_config_api_v1_auth_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthConfigResponse"}}}}},"security":[]}},"/api/v1/auth/google/login":{"get":{"tags":["auth"],"summary":"Google Login","operationId":"google_login_api_v1_auth_google_login_get","responses":{"307":{"description":"Successful Response"},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleLoginDisabled"}}}}},"security":[]}},"/api/v1/auth/google/callback":{"get":{"tags":["auth"],"summary":"Google Callback","operationId":"google_callback_api_v1_auth_google_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"307":{"description":"Successful Response"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleLoginDisabled"}}},"description":"Service Unavailable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/api/v1/account/workspace":{"patch":{"tags":["account"],"summary":"Rename Workspace","operationId":"rename_workspace_api_v1_account_workspace_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameWorkspaceResponse"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"403":{"description":"Forbidden — authenticated, but not permitted to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/account/keys":{"get":{"tags":["account"],"summary":"List Keys","operationId":"list_keys_api_v1_account_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListKeysResponse"}}}},"403":{"description":"Forbidden — authenticated, but not permitted to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}}},"post":{"tags":["account"],"summary":"Create Key","operationId":"create_key_api_v1_account_keys_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CreateKeyBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyResponse"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"403":{"description":"Forbidden — authenticated, but not permitted to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"409":{"description":"Conflict — the resource is not in a state that allows this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/account/keys/{key_id}/revoke":{"post":{"tags":["account"],"summary":"Revoke Key","operationId":"revoke_key_api_v1_account_keys__key_id__revoke_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"403":{"description":"Forbidden — authenticated, but not permitted to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"404":{"description":"Not found — the resource does not exist, or belongs to another workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/account/export":{"get":{"tags":["account"],"summary":"Export Account","description":"Self-service data export (GDPR/APPI portability). Session-only, like every\nroute in this module — an API-key caller is rejected so a leaked key cannot\nexfiltrate the whole tenant. Scoped to the caller's own workspace; the bundle\nnever contains a password hash or an API-key secret (see accounts.export_account).","operationId":"export_account_api_v1_account_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportAccountResponse"}}}},"403":{"description":"Forbidden — authenticated, but not permitted to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}}}},"/api/v1/account":{"delete":{"tags":["account"],"summary":"Delete Account","description":"Erase the AUTHENTICATED caller's account and all of their workspace's data\n(GDPR/APPI right to erasure). Session-only and tenant-scoped: it can only ever\ntouch the workspace resolved from the caller's own session credential.\n\nOWNER GUARD: the seeded operator account — the migrated ``default`` workspace\nand the ``settings.owner_email`` user — is PROTECTED (409 ACCOUNT_PROTECTED).\nThat account owns the bootstrap tenant that ``db._bootstrap_default_tenant``\nre-seeds on every boot; letting it self-delete would either be silently undone\non the next restart or lock the operator out. Self-serve customer accounts (any\nsigned-up user with their own workspace) delete normally — the actual GDPR case.\nDeleting via the admin dashboard/infra remains available out-of-band.","operationId":"delete_account_api_v1_account_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountResponse"}}}},"403":{"description":"Forbidden — authenticated, but not permitted to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"409":{"description":"Conflict — the resource is not in a state that allows this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"502":{"description":"Upstream (Stripe) error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}}}},"/api/v1/detect_file_type":{"post":{"tags":["tools"],"summary":"Detect File Type","operationId":"detect_file_type_api_v1_detect_file_type_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_detect_file_type_api_v1_detect_file_type_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"402":{"description":"Payment required — plan quota/template limit reached, or a paid plan is needed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"413":{"description":"Payload too large — the request exceeds a size/row/file-count cap.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"description":"Rate limited — too many requests; back off and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/repair_csv":{"post":{"tags":["tools"],"summary":"Repair Csv","operationId":"repair_csv_api_v1_repair_csv_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_repair_csv_api_v1_repair_csv_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"402":{"description":"Payment required — plan quota/template limit reached, or a paid plan is needed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"413":{"description":"Payload too large — the request exceeds a size/row/file-count cap.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"description":"Rate limited — too many requests; back off and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/normalize_bank_csv":{"post":{"tags":["tools"],"summary":"Normalize Bank Csv","operationId":"normalize_bank_csv_api_v1_normalize_bank_csv_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_normalize_bank_csv_api_v1_normalize_bank_csv_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"402":{"description":"Payment required — plan quota/template limit reached, or a paid plan is needed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"413":{"description":"Payload too large — the request exceeds a size/row/file-count cap.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"description":"Rate limited — too many requests; back off and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/extract_invoice":{"post":{"tags":["tools"],"summary":"Extract Invoice","operationId":"extract_invoice_api_v1_extract_invoice_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_invoice_api_v1_extract_invoice_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"402":{"description":"Payment required — plan quota/template limit reached, or a paid plan is needed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"413":{"description":"Payload too large — the request exceeds a size/row/file-count cap.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"description":"Rate limited — too many requests; back off and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/batch":{"post":{"tags":["tools"],"summary":"Batch","description":"Process several bank-CSV / invoice files in one authenticated, tenant-scoped\nrequest (month-end + dev/agency batch wedge).\n\nField ``files`` carries the uploads (multipart, repeated); optional ``tool``\npins every item to one tool, else the type is auto-detected per file. For each\nfile we reserve quota (one unit per file, same counter as the single endpoints),\nrun the existing single-file logic, create a run, and collect\n``{filename, run_id, status, error?}``. Per-file size cap and content gating are\nidentical to the single-file routes. If quota runs out mid-batch we STOP\nreserving/processing and mark the rest QUOTA_EXCEEDED so nothing is over-charged.\nReturns ``{results: [...], processed: N}`` where N is the number of runs created.\n\n``idempotency_key`` (form field, or the ``Idempotency-Key`` header) makes the\nwhole batch replay-safe (audit API-D2-01): resending the identical request with\nthe same key returns the ORIGINAL response — no files reprocessed, no quota\nre-charged. The key is bound to a fingerprint of the request (tool + ordered\nfile names/contents); reuse with a different request is a 409 conflict.","operationId":"batch_api_v1_batch_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_batch_api_v1_batch_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResponse"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"402":{"description":"Payment required — plan quota/template limit reached, or a paid plan is needed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"409":{"description":"Conflict — the resource is not in a state that allows this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"413":{"description":"Payload too large — the request exceeds a size/row/file-count cap.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"description":"Rate limited — too many requests; back off and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/validate_invoice":{"post":{"tags":["tools"],"summary":"Validate Invoice","operationId":"validate_invoice_api_v1_validate_invoice_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"402":{"description":"Payment required — plan quota/template limit reached, or a paid plan is needed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"description":"Rate limited — too many requests; back off and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/demo":{"post":{"tags":["demo"],"summary":"Demo","description":"Run the provided (or bundled sample) CSV through ``normalize_bank_csv`` and\nreturn the public envelope. Rate-limited per IP; body and row caps enforced up\nfront; nothing is stored.","operationId":"demo_api_v1_demo_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicEnvelope"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"413":{"description":"Payload too large — the request exceeds a size/row/file-count cap.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"description":"Rate limited — too many requests; back off and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}},"security":[]}},"/api/v1/stats":{"get":{"tags":["platform"],"summary":"Get Stats","operationId":"get_stats_api_v1_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsResponse"}}}}}}},"/api/v1/runs":{"get":{"tags":["platform"],"summary":"Get Runs","operationId":"get_runs_api_v1_runs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RunSummary"},"title":"Response Get Runs Api V1 Runs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{run_id}":{"get":{"tags":["platform"],"summary":"Get Run","operationId":"get_run_api_v1_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunDetail"}}}},"404":{"description":"Not found — the resource does not exist, or belongs to another workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["platform"],"summary":"Delete Run","description":"User-visible deletion: remove a run and everything derived from it (its\ncorrection rows, the jobs that produced it, and its stored upload file).\nScoped to the caller's workspace; another tenant's run is a 404.","operationId":"delete_run_api_v1_runs__run_id__delete","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteRunResult"}}}},"404":{"description":"Not found — the resource does not exist, or belongs to another workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{run_id}/export":{"get":{"tags":["platform"],"summary":"Export Run","operationId":"export_run_api_v1_runs__run_id__export_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(csv|json|xero)$","default":"json","title":"Format"}},{"name":"date_format","in":"query","required":false,"schema":{"type":"string","pattern":"^(iso|dd/mm/yyyy)$","default":"iso","title":"Date Format"}}],"responses":{"200":{"description":"The run's data, re-serialized in the requested format.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"404":{"description":"Not found — the resource does not exist, or belongs to another workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"409":{"description":"Conflict — the resource is not in a state that allows this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Unprocessable — the corrected data failed re-validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}}}},"/api/v1/runs/{run_id}/evidence":{"get":{"tags":["platform"],"summary":"Evidence Pack","description":"Evidence-pack v1 (TASK-20260714-010): one GET → the run's proof bundle.\n\nBoundary rules mirror ``export_run`` exactly (ONE gate definition, not two\ncompeting ones): 404 for unknown/foreign runs, 422 for failed runs, and —\nper DECISION-011 Option A HARD-BLOCK — 409 for any run not in a final\nvalidated state. An in-review or rejected run must never yield a pack that\ncould be waved around as \"Validated data out.\"","operationId":"evidence_pack_api_v1_runs__run_id__evidence_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Self-contained, deterministic evidence pack for a validated run: output + checks + provenance + corrections + decision + output_hash, plus a tamper-evidence pack_hash. Byte-identical on re-export.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvidencePackResponse"}}}},"404":{"description":"Not found — the resource does not exist, or belongs to another workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"409":{"description":"Conflict — the resource is not in a state that allows this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Unprocessable — the corrected data failed re-validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}}}},"/api/v1/admin/retention":{"get":{"tags":["platform"],"summary":"Retention Policy","description":"The active retention policy so the dashboard can show the deletion window.","operationId":"retention_policy_api_v1_admin_retention_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionPolicy"}}}},"403":{"description":"Forbidden — authenticated, but not permitted to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}}}},"/api/v1/admin/retention/purge":{"post":{"tags":["platform"],"summary":"Retention Purge","description":"Run the retention sweep now (same work the daily background job does):\ndelete all customer content older than the retention window.","operationId":"retention_purge_api_v1_admin_retention_purge_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionPurgeResult"}}}},"403":{"description":"Forbidden — authenticated, but not permitted to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}}}},"/api/v1/admin/audit":{"get":{"tags":["platform"],"summary":"Admin Audit","description":"Owner-only read + integrity check for the security audit stream\n(SEC-D5-03: ``recent()``/``verify_chain()`` previously had no route, so the\nstated admin capability required raw DB access). Returns the chain/anchor\nverification result and the newest events (optionally filtered). Chain\nverification re-hashes only the newest ``audit.VERIFY_WINDOW`` rows per\ncall so the check stays O(window) as the 365-day table grows (SEC-D6-05);\npass ``?full=true`` for the complete O(rows) run.","operationId":"admin_audit_api_v1_admin_audit_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"event","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event"}},{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id"}},{"name":"full","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Full"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAuditResponse"}}}},"403":{"description":"Forbidden — authenticated, but not permitted to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/audit/anchor/clear":{"post":{"tags":["platform"],"summary":"Admin Audit Anchor Clear","description":"Owner-only AUDITED repair for a SUSPECT audit anchor (SEC-D8-01): after\ninvestigating a corrupt anchor (``/admin/audit`` chain ``anchor_ok:\nfalse``), clear it here — the clear is recorded as an\n``audit.anchor_cleared`` event whose own append re-anchors the chain.\nRefuses (``cleared: false``) when the anchor is intact or absent.","operationId":"admin_audit_anchor_clear_api_v1_admin_audit_anchor_clear_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnchorClearResult"}}}},"403":{"description":"Forbidden — authenticated, but not permitted to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}}}},"/api/v1/admin/metrics":{"get":{"tags":["platform"],"summary":"Admin Metrics","description":"Owner-only activation funnel (signup → activation → paid) from the DB — the\npilot's product-usage view, with no third-party analytics (audit: no product\nvisibility). Include ?recent_days=N (1–90) for the recent window.","operationId":"admin_metrics_api_v1_admin_metrics_get","parameters":[{"name":"recent_days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":7,"title":"Recent Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMetricsResponse"}}}},"403":{"description":"Forbidden — authenticated, but not permitted to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs":{"post":{"tags":["platform"],"summary":"Create Job","operationId":"create_job_api_v1_jobs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"402":{"description":"Payment required — plan quota/template limit reached, or a paid plan is needed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"409":{"description":"Conflict — the resource is not in a state that allows this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"413":{"description":"Payload too large — the request exceeds a size/row/file-count cap.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"description":"Rate limited — too many requests; back off and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}":{"get":{"tags":["platform"],"summary":"Get Job","operationId":"get_job_api_v1_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"404":{"description":"Not found — the resource does not exist, or belongs to another workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates":{"get":{"tags":["platform"],"summary":"List Templates","operationId":"list_templates_api_v1_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TemplatePublic"},"type":"array","title":"Response List Templates Api V1 Templates Get"}}}}}},"post":{"tags":["platform"],"summary":"Create Template","operationId":"create_template_api_v1_templates_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplatePublic"}}}},"402":{"description":"Payment required — plan quota/template limit reached, or a paid plan is needed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates/{template_id}":{"get":{"tags":["platform"],"summary":"Get Template","operationId":"get_template_api_v1_templates__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplatePublic"}}}},"404":{"description":"Not found — the resource does not exist, or belongs to another workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["platform"],"summary":"Delete Template","description":"Free-plan escape hatch (cap = 1 template): deleting frees the slot.\nWorkspace-scoped like every template read — a foreign id is a 404.","operationId":"delete_template_api_v1_templates__template_id__delete","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDeleted"}}}},"404":{"description":"Not found — the resource does not exist, or belongs to another workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates/{template_id}/versions":{"post":{"tags":["platform"],"summary":"Add Version","operationId":"add_version_api_v1_templates__template_id__versions_post","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplatePublic"}}}},"404":{"description":"Not found — the resource does not exist, or belongs to another workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review":{"get":{"tags":["platform"],"summary":"Review Queue","operationId":"review_queue_api_v1_review_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReviewItem"},"title":"Response Review Queue Api V1 Review Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/{run_id}/resolve":{"post":{"tags":["platform"],"summary":"Resolve Review","operationId":"resolve_review_api_v1_review__run_id__resolve_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveResult"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"404":{"description":"Not found — the resource does not exist, or belongs to another workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"409":{"description":"Conflict — the resource is not in a state that allows this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Unprocessable — the corrected data failed re-validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}}}},"/api/v1/billing/config":{"get":{"tags":["billing"],"summary":"Billing Config","description":"What the dashboard needs to render the Billing card. Never the secret key.","operationId":"billing_config_api_v1_billing_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingConfigResponse"}}}}}}},"/api/v1/billing/plans":{"get":{"tags":["billing"],"summary":"Billing Plans","description":"Plan catalog + current plan + this month's usage for the caller's workspace.\nPrices only (no secret).","operationId":"billing_plans_api_v1_billing_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingPlansResponse"}}}}}}},"/api/v1/billing/catalog":{"get":{"tags":["billing"],"summary":"Billing Catalog","description":"PUBLIC plan catalog for the marketing pricing page: names, prices, limits,\nand features only. No usage, no current plan, no secrets, no auth required.","operationId":"billing_catalog_api_v1_billing_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingCatalogResponse"}}}}},"security":[]}},"/api/v1/billing/checkout":{"post":{"tags":["billing"],"summary":"Create Checkout","operationId":"create_checkout_api_v1_billing_checkout_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CheckoutBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"403":{"description":"Forbidden — authenticated, but not permitted to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"409":{"description":"Conflict — the resource is not in a state that allows this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"502":{"description":"Upstream (Stripe) error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"503":{"description":"Service disabled — this capability is not configured on this environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/portal":{"post":{"tags":["billing"],"summary":"Create Portal","description":"Open a Stripe Billing Portal session so the customer can manage their\nsubscription and payment method. Scoped, like checkout, to the caller's\nworkspace via ``require_workspace`` (the dashboard button uses a session; an\nAPI key is also accepted here, matching the checkout sibling). Requires an\nexisting Stripe customer — a workspace with no subscription has nothing to\nmanage.","operationId":"create_portal_api_v1_billing_portal_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalResponse"}}}},"409":{"description":"Conflict — the resource is not in a state that allows this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"502":{"description":"Upstream (Stripe) error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"503":{"description":"Service disabled — this capability is not configured on this environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}}}},"/api/v1/billing/webhook":{"post":{"tags":["billing"],"summary":"Stripe Webhook","operationId":"stripe_webhook_api_v1_billing_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}},"400":{"description":"Bad request — the input or parameters were invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"500":{"description":"Internal/transient error — safe to retry (see error.retryable).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"503":{"description":"Service disabled — this capability is not configured on this environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}},"security":[]}},"/api/v1/billing/status":{"get":{"tags":["billing"],"summary":"Billing Status","operationId":"billing_status_api_v1_billing_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingStatusResponse"}}}}}}},"/":{"get":{"tags":["frontend"],"summary":"Landing","operationId":"landing__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/privacy":{"get":{"tags":["frontend"],"summary":"Privacy","operationId":"privacy_privacy_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/terms":{"get":{"tags":["frontend"],"summary":"Terms","operationId":"terms_terms_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/pricing":{"get":{"tags":["frontend"],"summary":"Pricing","operationId":"pricing_pricing_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/demo":{"get":{"tags":["frontend"],"summary":"Demo Page","operationId":"demo_page_demo_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/product":{"get":{"tags":["frontend"],"summary":"Product","operationId":"product_product_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/features":{"get":{"tags":["frontend"],"summary":"Features","operationId":"features_features_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/developers":{"get":{"tags":["frontend"],"summary":"Developers","operationId":"developers_developers_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/company":{"get":{"tags":["frontend"],"summary":"Company","operationId":"company_company_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/contact":{"get":{"tags":["frontend"],"summary":"Contact","operationId":"contact_contact_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/about":{"get":{"tags":["frontend"],"summary":"About","operationId":"about_about_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/solutions":{"get":{"tags":["frontend"],"summary":"Solutions","operationId":"solutions_solutions_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/security":{"get":{"tags":["frontend"],"summary":"Security Page","operationId":"security_page_security_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/subprocessors":{"get":{"tags":["frontend"],"summary":"Subprocessors","operationId":"subprocessors_subprocessors_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/solutions/{sub}":{"get":{"tags":["frontend"],"summary":"Solutions Sub","operationId":"solutions_sub_solutions__sub__get","parameters":[{"name":"sub","in":"path","required":true,"schema":{"type":"string","title":"Sub"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/app":{"get":{"tags":["frontend"],"summary":"Dashboard","operationId":"dashboard_app_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/{slug}/":{"get":{"tags":["frontend"],"summary":"Localized Home","operationId":"localized_home__slug___get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/{slug}/pricing":{"get":{"tags":["frontend"],"summary":"Localized Pricing","operationId":"localized_pricing__slug__pricing_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}}},"components":{"schemas":{"AdminAuditResponse":{"properties":{"chain":{"$ref":"#/components/schemas/AuditChainStatus"},"erasure":{"$ref":"#/components/schemas/ErasureReconciliation"},"events":{"items":{"$ref":"#/components/schemas/AuditEventRow"},"type":"array","title":"Events"}},"type":"object","required":["chain","erasure","events"],"title":"AdminAuditResponse"},"AdminMetricsResponse":{"properties":{"generated_at":{"type":"string","title":"Generated At"},"recent_days":{"type":"integer","title":"Recent Days"},"funnel":{"$ref":"#/components/schemas/FunnelCounts"},"qualified":{"$ref":"#/components/schemas/FunnelCounts"},"usage":{"$ref":"#/components/schemas/UsageCounts"},"attribution":{"$ref":"#/components/schemas/AttributionCounts"},"recent":{"additionalProperties":{"type":"integer"},"type":"object","title":"Recent"}},"type":"object","required":["generated_at","recent_days","funnel","qualified","usage","attribution"],"title":"AdminMetricsResponse","description":"``metrics.activation_funnel`` shape. ``recent``'s keys are dynamic\n(``f\"...last_{recent_days}d\"``, the query param) — a fixed field name can't\nexpress that, so it stays ``dict[str, int]``."},"AlreadyVerifiedResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"already_verified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Already Verified"}},"type":"object","title":"AlreadyVerifiedResponse"},"AnchorClearResult":{"properties":{"cleared":{"type":"boolean","title":"Cleared"},"state":{"type":"string","title":"State"}},"type":"object","required":["cleared","state"],"title":"AnchorClearResult","description":"SEC-D8-01 audited operator repair: ``cleared`` is False when the anchor\nwas not corrupt (``state`` reports what was found) — an intact anchor is\nnever cleared, that is the tail-truncation laundering move itself."},"ApiKeyMeta":{"properties":{"id":{"type":"string","title":"Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"prefix":{"type":"string","title":"Prefix"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"created_at":{"type":"string","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revoked At"},"sandbox":{"type":"boolean","title":"Sandbox","default":false}},"type":"object","required":["id","workspace_id","prefix","created_at"],"title":"ApiKeyMeta"},"AttributionCounts":{"properties":{"workspaces_by_source":{"additionalProperties":{"type":"integer"},"type":"object","title":"Workspaces By Source"}},"type":"object","title":"AttributionCounts"},"AuditChainStatus":{"properties":{"ok":{"type":"boolean","title":"Ok"},"rows":{"type":"integer","title":"Rows"},"verified_rows":{"type":"integer","title":"Verified Rows"},"first_bad_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"First Bad Id"},"anchor_ok":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Anchor Ok"},"anchor_lag":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Anchor Lag"},"anchor_write_degraded":{"type":"boolean","title":"Anchor Write Degraded","default":false},"full_coverage":{"type":"boolean","title":"Full Coverage","default":true}},"type":"object","required":["ok","rows","verified_rows"],"title":"AuditChainStatus"},"AuditEventRow":{"properties":{"id":{"type":"integer","title":"Id"},"ts_utc":{"type":"string","title":"Ts Utc"},"event":{"type":"string","title":"Event"},"outcome":{"type":"string","title":"Outcome"},"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"subject_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Id"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"chain_hash":{"type":"string","title":"Chain Hash"}},"type":"object","required":["id","ts_utc","event","outcome","chain_hash"],"title":"AuditEventRow"},"AuthConfigResponse":{"properties":{"google_enabled":{"type":"boolean","title":"Google Enabled"}},"type":"object","required":["google_enabled"],"title":"AuthConfigResponse"},"AuthSessionResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"user":{"anyOf":[{"$ref":"#/components/schemas/PublicUser"},{"type":"null"}]},"workspace":{"anyOf":[{"$ref":"#/components/schemas/PublicWorkspace"},{"type":"null"}]},"email_verified":{"type":"boolean","title":"Email Verified"}},"type":"object","required":["email_verified"],"title":"AuthSessionResponse","description":"``login`` / ``signup`` shape."},"BatchItem":{"properties":{"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"status":{"type":"string","title":"Status"},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorInfo"},{"type":"null"}]}},"type":"object","required":["status"],"title":"BatchItem"},"BatchResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/BatchItem"},"type":"array","title":"Results"},"processed":{"type":"integer","title":"Processed"}},"type":"object","required":["results","processed"],"title":"BatchResponse"},"BillingCatalogResponse":{"properties":{"plans":{"items":{"$ref":"#/components/schemas/PlanCatalogEntry"},"type":"array","title":"Plans"},"billing_enabled":{"type":"boolean","title":"Billing Enabled"}},"type":"object","required":["plans","billing_enabled"],"title":"BillingCatalogResponse"},"BillingConfigResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"plans_enabled":{"type":"boolean","title":"Plans Enabled"},"publishable_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publishable Key"},"price_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Id"}},"type":"object","required":["enabled","plans_enabled"],"title":"BillingConfigResponse"},"BillingPlansResponse":{"properties":{"plans":{"items":{"$ref":"#/components/schemas/PlanWithPriceIds"},"type":"array","title":"Plans"},"current_plan":{"type":"string","title":"Current Plan"},"usage":{"$ref":"#/components/schemas/PlansUsage"}},"type":"object","required":["plans","current_plan","usage"],"title":"BillingPlansResponse"},"BillingStatusResponse":{"properties":{"status":{"type":"string","title":"Status"},"price_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Id"},"current_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period End"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"current_plan":{"type":"string","title":"Current Plan"},"usage":{"$ref":"#/components/schemas/PlansUsage"}},"type":"object","required":["status","current_plan","usage"],"title":"BillingStatusResponse"},"Body_batch_api_v1_batch_post":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files"},"tool":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool"},"idempotency_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Key"}},"type":"object","required":["files"],"title":"Body_batch_api_v1_batch_post"},"Body_detect_file_type_api_v1_detect_file_type_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_detect_file_type_api_v1_detect_file_type_post"},"Body_extract_invoice_api_v1_extract_invoice_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_extract_invoice_api_v1_extract_invoice_post"},"Body_normalize_bank_csv_api_v1_normalize_bank_csv_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locale"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"date_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Format"},"column_mapping":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Column Mapping"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"}},"type":"object","required":["file"],"title":"Body_normalize_bank_csv_api_v1_normalize_bank_csv_post"},"Body_repair_csv_api_v1_repair_csv_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_repair_csv_api_v1_repair_csv_post"},"CheckoutBody":{"properties":{"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"},"interval":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Interval"}},"type":"object","title":"CheckoutBody"},"CheckoutResponse":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","title":"CheckoutResponse"},"Correction":{"properties":{"field":{"type":"string","title":"Field"},"original":{"title":"Original"},"corrected":{"title":"Corrected"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["field"],"title":"Correction"},"CorrectionRow":{"properties":{"id":{"type":"string","title":"Id"},"run_id":{"type":"string","title":"Run Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"field":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field"},"original_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Value"},"corrected_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrected Value"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"reviewer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","run_id","workspace_id","created_at"],"title":"CorrectionRow","description":"One stored correction row (``corrections`` table shape), as surfaced on a\nrun detail — field names mirror the DB columns, not the request body's\n``Correction`` (``original``/``corrected``) which is a distinct wire shape."},"CreateKeyBody":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","title":"CreateKeyBody"},"CreateKeyResponse":{"properties":{"key":{"$ref":"#/components/schemas/ApiKeyMeta"},"plaintext":{"type":"string","title":"Plaintext"}},"type":"object","required":["key","plaintext"],"title":"CreateKeyResponse"},"DeleteAccountResponse":{"properties":{"deleted":{"type":"boolean","title":"Deleted","default":true},"workspace":{"type":"string","title":"Workspace"}},"type":"object","required":["workspace"],"title":"DeleteAccountResponse"},"DeleteRunResult":{"properties":{"run_id":{"type":"string","title":"Run Id"},"deleted":{"type":"boolean","title":"Deleted"},"file_deleted":{"type":"boolean","title":"File Deleted"},"jobs_deleted":{"type":"integer","title":"Jobs Deleted"},"corrections_deleted":{"type":"integer","title":"Corrections Deleted"}},"type":"object","required":["run_id","deleted","file_deleted","jobs_deleted","corrections_deleted"],"title":"DeleteRunResult"},"Envelope":{"properties":{"data":{"title":"Data"},"confidence":{"additionalProperties":{"type":"number"},"type":"object","title":"Confidence"},"validation":{"$ref":"#/components/schemas/Validation"},"provenance":{"additionalProperties":true,"type":"object","title":"Provenance"},"uncertain_fields":{"items":{"type":"string"},"type":"array","title":"Uncertain Fields"},"repair_suggestions":{"items":{"type":"string"},"type":"array","title":"Repair Suggestions"},"output_files":{"additionalProperties":{"type":"string"},"type":"object","title":"Output Files"},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorInfo"},{"type":"null"}]},"decision":{"type":"string","enum":["ACCEPTED","REJECTED","NEEDS_REVIEW","RETRY"],"title":"Decision","default":"ACCEPTED"},"output_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Hash"},"next_actions":{"items":{"$ref":"#/components/schemas/NextAction"},"type":"array","title":"Next Actions"}},"type":"object","title":"Envelope","description":"The canonical response envelope. Present on success and failure alike."},"ErasureReconciliation":{"properties":{"ok":{"type":"boolean","title":"Ok"},"audited_deletes":{"type":"integer","title":"Audited Deletes"},"tombstoned":{"type":"integer","title":"Tombstoned"},"missing_tombstones":{"items":{"type":"string"},"type":"array","title":"Missing Tombstones"},"tombstone_write_failures":{"type":"integer","title":"Tombstone Write Failures"},"unrepaired_failures":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Unrepaired Failures"},"ledger_unreadable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ledger Unreadable"},"corrupt_lines":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Corrupt Lines"}},"type":"object","required":["ok","audited_deletes","tombstoned","missing_tombstones","tombstone_write_failures"],"title":"ErasureReconciliation","description":"Audited account deletions cross-checked against erasure tombstones\n(TASK-20260717-011): ``ok: false`` means at least one deleted account has\nno tombstone and would be resurrected by a backup restore."},"ErrorInfo":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"details":{"additionalProperties":true,"type":"object","title":"Details"},"retryable":{"type":"boolean","title":"Retryable","default":false}},"type":"object","required":["code","message"],"title":"ErrorInfo"},"EvidencePackBody":{"properties":{"format":{"type":"string","const":"apodexa-evidence-pack","title":"Format","default":"apodexa-evidence-pack"},"schema_version":{"type":"integer","title":"Schema Version","default":1},"run":{"$ref":"#/components/schemas/EvidenceRunMeta"},"decision":{"anyOf":[{"type":"string","enum":["ACCEPTED","REJECTED","NEEDS_REVIEW","RETRY"]},{"type":"null"}],"title":"Decision"},"output_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Hash"},"output":{"title":"Output"},"validation":{"$ref":"#/components/schemas/Validation"},"confidence":{"additionalProperties":{"type":"number"},"type":"object","title":"Confidence"},"uncertain_fields":{"items":{"type":"string"},"type":"array","title":"Uncertain Fields"},"provenance":{"additionalProperties":true,"type":"object","title":"Provenance"},"corrections":{"items":{"$ref":"#/components/schemas/CorrectionRow"},"type":"array","title":"Corrections"}},"type":"object","required":["run"],"title":"EvidencePackBody","description":"``evidence_pack`` — the deterministic, self-describing bundle for one\nvalidated run (``services/evidence.py``). Every field is lifted verbatim\nfrom the stored envelope / run record / corrections table."},"EvidencePackResponse":{"properties":{"evidence_pack":{"$ref":"#/components/schemas/EvidencePackBody"},"pack_hash":{"type":"string","title":"Pack Hash"}},"type":"object","required":["evidence_pack","pack_hash"],"title":"EvidencePackResponse","description":"``GET /runs/{run_id}/evidence`` — the downloadable bundle plus its\ntamper-evidence hash (sha256 of the canonical ``evidence_pack``; any\npost-export edit invalidates it)."},"EvidenceRunMeta":{"properties":{"run_id":{"type":"string","title":"Run Id"},"tool":{"type":"string","title":"Tool"},"source_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Filename"},"input_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Hash"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"},"records":{"type":"integer","title":"Records","default":0}},"type":"object","required":["run_id","tool","status","created_at"],"title":"EvidenceRunMeta","description":"The ``run`` block of an evidence pack — the run record's identity facts."},"ExportAccountResponse":{"properties":{"exported_at":{"type":"string","title":"Exported At"},"workspace":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Workspace"},"account":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Account"},"runs":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Runs"},"corrections":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Corrections"},"api_keys":{"items":{"$ref":"#/components/schemas/ApiKeyMeta"},"type":"array","title":"Api Keys"},"templates":{"items":{"$ref":"#/components/schemas/TemplatePublic"},"type":"array","title":"Templates"},"billing":{"additionalProperties":true,"type":"object","title":"Billing"}},"type":"object","required":["exported_at"],"title":"ExportAccountResponse","description":"``accounts.export_account`` shape. ``workspace``/``account``/``runs``/\n``corrections``/``api_keys``/``templates`` are each already-shaped by their\nown store module; kept as ``Any`` here so this GDPR/APPI export bundle isn't\nsilently truncated if one of those shapes gains a field."},"ForgotBody":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"ForgotBody"},"FunnelCounts":{"properties":{"signups":{"type":"integer","title":"Signups"},"workspaces":{"type":"integer","title":"Workspaces"},"activated_workspaces":{"type":"integer","title":"Activated Workspaces"},"paid_workspaces":{"type":"integer","title":"Paid Workspaces"},"activation_rate":{"type":"number","title":"Activation Rate"},"paid_conversion":{"type":"number","title":"Paid Conversion"}},"type":"object","required":["signups","workspaces","activated_workspaces","paid_workspaces","activation_rate","paid_conversion"],"title":"FunnelCounts","description":"``activation_funnel``'s ``funnel`` block and its test-excluded twin\n``qualified`` (``metrics._qualified_funnel``) share this exact shape."},"GoogleLoginDisabled":{"properties":{"error":{"$ref":"#/components/schemas/SimpleError"}},"type":"object","required":["error"],"title":"GoogleLoginDisabled"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status"},"version":{"type":"string","title":"Version"}},"type":"object","required":["status","version"],"title":"HealthResponse"},"JobBody":{"properties":{"tool":{"type":"string","title":"Tool"},"idempotency_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Key"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"},"template_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Template Version"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"content_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Base64"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"},"options":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Options"}},"type":"object","required":["tool"],"title":"JobBody"},"JobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"idempotency_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Key"},"workspace_id":{"type":"string","title":"Workspace Id"},"fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fingerprint"},"tool":{"type":"string","title":"Tool"},"input_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Hash"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"},"template_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Template Version"},"status":{"type":"string","title":"Status"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"created_at":{"type":"string","title":"Created At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["job_id","workspace_id","tool","status","created_at"],"title":"JobResponse","description":"A job row (``jobs`` table, ``_row_to_job`` shape) for both\n``POST /jobs`` (create/replay) and ``GET /jobs/{job_id}``."},"ListKeysResponse":{"properties":{"keys":{"items":{"$ref":"#/components/schemas/ApiKeyMeta"},"type":"array","title":"Keys"}},"type":"object","required":["keys"],"title":"ListKeysResponse"},"LoginBody":{"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"username":{"type":"string","title":"Username","default":"admin"},"password":{"type":"string","title":"Password"}},"type":"object","required":["password"],"title":"LoginBody"},"MeResponse":{"properties":{"authenticated":{"type":"boolean","title":"Authenticated"},"user":{"anyOf":[{"$ref":"#/components/schemas/PublicUser"},{"type":"null"}]},"workspace":{"anyOf":[{"$ref":"#/components/schemas/PublicWorkspace"},{"type":"null"}]},"email_verified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email Verified"}},"type":"object","required":["authenticated"],"title":"MeResponse"},"NextAction":{"properties":{"action":{"type":"string","title":"Action"},"detail":{"type":"string","title":"Detail","default":""}},"type":"object","required":["action"],"title":"NextAction"},"OkResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true}},"type":"object","title":"OkResponse"},"PlanCatalogEntry":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"price_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Usd"},"price_annual_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Annual Usd"},"files_per_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Files Per Month"},"templates":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Templates"},"features":{"items":{"type":"string"},"type":"array","title":"Features"},"price_display":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Display"},"contact":{"type":"boolean","title":"Contact","default":false}},"type":"object","required":["id","name"],"title":"PlanCatalogEntry"},"PlanWithPriceIds":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"price_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Usd"},"price_annual_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Annual Usd"},"files_per_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Files Per Month"},"templates":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Templates"},"features":{"items":{"type":"string"},"type":"array","title":"Features"},"price_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Id"},"price_id_annual":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Id Annual"}},"type":"object","required":["id","name"],"title":"PlanWithPriceIds"},"PlansUsage":{"properties":{"files_used":{"type":"integer","title":"Files Used"},"files_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Files Limit"},"templates_used":{"type":"integer","title":"Templates Used"},"templates_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Templates Limit"},"period_start":{"type":"string","title":"Period Start"}},"type":"object","required":["files_used","templates_used","period_start"],"title":"PlansUsage"},"PortalResponse":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","title":"PortalResponse"},"PublicEnvelope":{"properties":{"data":{"title":"Data"},"confidence":{"additionalProperties":{"type":"number"},"type":"object","title":"Confidence"},"validation":{"additionalProperties":true,"type":"object","title":"Validation"},"provenance":{"additionalProperties":true,"type":"object","title":"Provenance"},"uncertain_fields":{"items":{"type":"string"},"type":"array","title":"Uncertain Fields"},"repair_suggestions":{"items":{"type":"string"},"type":"array","title":"Repair Suggestions"},"decision":{"anyOf":[{"type":"string","enum":["ACCEPTED","REJECTED","NEEDS_REVIEW","RETRY"]},{"type":"null"}],"title":"Decision"},"output_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Hash"},"next_actions":{"items":{"$ref":"#/components/schemas/NextAction"},"type":"array","title":"Next Actions"},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorInfo"},{"type":"null"}]}},"type":"object","title":"PublicEnvelope","description":"The whitelisted subset of :class:`Envelope` the public, unauthenticated\ndemo endpoint exposes (``demo._public_envelope``) — no ``output_files``, no\n``run_id``/``storage_name`` (nothing is ever persisted for this route)."},"PublicUser":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email_verified":{"type":"boolean","title":"Email Verified"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","email","email_verified"],"title":"PublicUser"},"PublicWorkspace":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"plan":{"type":"string","title":"Plan"}},"type":"object","required":["id","name","plan"],"title":"PublicWorkspace"},"ReadyResponse":{"properties":{"status":{"type":"string","enum":["ready","not_ready"],"title":"Status"},"checks":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Checks"},"version":{"type":"string","title":"Version"},"erasure_bookkeeping_ok":{"type":"boolean","title":"Erasure Bookkeeping Ok","default":true},"erasure_repurge_state":{"type":"string","enum":["ok","failed","not_run"],"title":"Erasure Repurge State","default":"ok"},"erasure_repurge_marker_ok":{"type":"boolean","title":"Erasure Repurge Marker Ok","default":true}},"type":"object","required":["status","checks","version"],"title":"ReadyResponse"},"RenameBody":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"RenameBody"},"RenameWorkspaceResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"workspace":{"anyOf":[{"$ref":"#/components/schemas/PublicWorkspace"},{"type":"null"}]}},"type":"object","title":"RenameWorkspaceResponse"},"ResetBody":{"properties":{"token":{"type":"string","title":"Token"},"password":{"type":"string","title":"Password"}},"type":"object","required":["token","password"],"title":"ResetBody"},"ResolveBody":{"properties":{"action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"},"reject":{"type":"boolean","title":"Reject","default":false},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"corrections":{"items":{"$ref":"#/components/schemas/Correction"},"type":"array","title":"Corrections","default":[]}},"type":"object","title":"ResolveBody"},"ResolveResult":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"},"corrections":{"items":{"$ref":"#/components/schemas/StoredCorrection"},"type":"array","title":"Corrections"}},"type":"object","required":["run_id","status"],"title":"ResolveResult"},"RetentionLastSweep":{"properties":{"ts_utc":{"type":"string","title":"Ts Utc"},"purged":{"type":"boolean","title":"Purged"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"cutoff":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cutoff"},"retention_days":{"type":"integer","title":"Retention Days"},"runs_deleted":{"type":"integer","title":"Runs Deleted"},"jobs_deleted":{"type":"integer","title":"Jobs Deleted"},"corrections_deleted":{"type":"integer","title":"Corrections Deleted"},"files_deleted":{"type":"integer","title":"Files Deleted"},"audit_events_deleted":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Audit Events Deleted"},"erasure_reconciliation":{"anyOf":[{"$ref":"#/components/schemas/ErasureReconciliation"},{"type":"null"}]}},"type":"object","required":["ts_utc","purged","retention_days","runs_deleted","jobs_deleted","corrections_deleted","files_deleted"],"title":"RetentionLastSweep","description":"Durable record of the most recent successful retention sweep (audit\n2026-07-16: makes a silently-never-running sweep observable)."},"RetentionPolicy":{"properties":{"retention_days":{"type":"integer","title":"Retention Days"},"sweep_seconds":{"type":"integer","title":"Sweep Seconds"},"last_sweep":{"anyOf":[{"$ref":"#/components/schemas/RetentionLastSweep"},{"type":"null"}]}},"type":"object","required":["retention_days","sweep_seconds"],"title":"RetentionPolicy"},"RetentionPurgeResult":{"properties":{"purged":{"type":"boolean","title":"Purged"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"retention_days":{"type":"integer","title":"Retention Days"},"cutoff":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cutoff"},"runs_deleted":{"type":"integer","title":"Runs Deleted"},"jobs_deleted":{"type":"integer","title":"Jobs Deleted"},"corrections_deleted":{"type":"integer","title":"Corrections Deleted"},"files_deleted":{"type":"integer","title":"Files Deleted"},"audit_events_deleted":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Audit Events Deleted"},"erasure_reconciliation":{"anyOf":[{"$ref":"#/components/schemas/ErasureReconciliation"},{"type":"null"}]}},"type":"object","required":["purged","retention_days","runs_deleted","jobs_deleted","corrections_deleted","files_deleted"],"title":"RetentionPurgeResult"},"ReviewItem":{"properties":{"run_id":{"type":"string","title":"Run Id"},"file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File"},"confidence":{"type":"number","title":"Confidence"},"title":{"type":"string","title":"Title"},"value":{"title":"Value"},"detected_formats":{"items":{"type":"string"},"type":"array","title":"Detected Formats"},"suggested":{"title":"Suggested"},"column":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Column"},"row":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Row"},"review_rows":{"items":{"$ref":"#/components/schemas/ReviewRowEntry"},"type":"array","title":"Review Rows"},"pending_review_rows":{"type":"integer","title":"Pending Review Rows"}},"type":"object","required":["run_id","confidence","title","pending_review_rows"],"title":"ReviewItem","description":"One dashboard review-card (``reviews_store._review_item`` shape)."},"ReviewRowEntry":{"properties":{"index":{"type":"integer","title":"Index"},"row":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Row"},"column":{"type":"string","title":"Column"},"value":{"title":"Value"},"ambiguous_date":{"type":"boolean","title":"Ambiguous Date","default":false},"detected_formats":{"items":{"type":"string"},"type":"array","title":"Detected Formats"},"suggested":{"title":"Suggested"}},"type":"object","required":["index","column"],"title":"ReviewRowEntry"},"RunDetail":{"properties":{"data":{"title":"Data"},"confidence":{"additionalProperties":{"type":"number"},"type":"object","title":"Confidence"},"validation":{"$ref":"#/components/schemas/Validation"},"provenance":{"additionalProperties":true,"type":"object","title":"Provenance"},"uncertain_fields":{"items":{"type":"string"},"type":"array","title":"Uncertain Fields"},"repair_suggestions":{"items":{"type":"string"},"type":"array","title":"Repair Suggestions"},"output_files":{"additionalProperties":{"type":"string"},"type":"object","title":"Output Files"},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorInfo"},{"type":"null"}]},"decision":{"type":"string","enum":["ACCEPTED","REJECTED","NEEDS_REVIEW","RETRY"],"title":"Decision","default":"ACCEPTED"},"output_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Hash"},"next_actions":{"items":{"$ref":"#/components/schemas/NextAction"},"type":"array","title":"Next Actions"},"run_id":{"type":"string","title":"Run Id"},"tool":{"type":"string","title":"Tool"},"file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File"},"template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template"},"status":{"type":"string","title":"Status"},"str_rate":{"type":"number","title":"Str Rate"},"records":{"type":"integer","title":"Records"},"created_at":{"type":"string","title":"Created At"},"corrections":{"items":{"$ref":"#/components/schemas/CorrectionRow"},"type":"array","title":"Corrections"}},"type":"object","required":["run_id","tool","status","str_rate","records","created_at"],"title":"RunDetail","description":"``GET /runs/{run_id}`` — the run's envelope with run metadata hoisted\nalongside it at the top level (matches ``platform.get_run``)."},"RunSummary":{"properties":{"run_id":{"type":"string","title":"Run Id"},"tool":{"type":"string","title":"Tool"},"file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File"},"template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template"},"status":{"type":"string","title":"Status"},"str_rate":{"type":"number","title":"Str Rate"},"records":{"type":"integer","title":"Records"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["run_id","tool","status","str_rate","records","created_at"],"title":"RunSummary","description":"One row of ``GET /runs`` (dashboard list shape — matches ``_row_view``)."},"SignupBody":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["email","password"],"title":"SignupBody"},"SimpleError":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"}},"type":"object","required":["code","message"],"title":"SimpleError","description":"The Google-OAuth-disabled 503 shape — deliberately NOT ``ErrorEnvelope``:\nthese two routes (``/auth/google/login``, ``/auth/google/callback``) are\nbrowser redirect flows, not tool calls, and predate the shared envelope."},"StatsDeltas":{"properties":{"files_processed":{"type":"integer","title":"Files Processed"},"straight_through_rate":{"type":"number","title":"Straight Through Rate"},"sent_to_review":{"type":"integer","title":"Sent To Review"},"incorrect_high_confidence":{"type":"integer","title":"Incorrect High Confidence"}},"type":"object","required":["files_processed","straight_through_rate","sent_to_review","incorrect_high_confidence"],"title":"StatsDeltas"},"StatsResponse":{"properties":{"files_processed":{"type":"integer","title":"Files Processed"},"straight_through_rate":{"type":"number","title":"Straight Through Rate"},"sent_to_review":{"type":"integer","title":"Sent To Review"},"incorrect_high_confidence":{"type":"integer","title":"Incorrect High Confidence"},"deltas":{"$ref":"#/components/schemas/StatsDeltas"},"straight_through_sparkline":{"items":{"type":"number"},"type":"array","title":"Straight Through Sparkline"},"window":{"$ref":"#/components/schemas/StatsWindow"}},"type":"object","required":["files_processed","straight_through_rate","sent_to_review","incorrect_high_confidence","deltas","straight_through_sparkline","window"],"title":"StatsResponse"},"StatsWindow":{"properties":{"current_7d":{"$ref":"#/components/schemas/WindowCounts"},"previous_7d":{"$ref":"#/components/schemas/WindowCounts"}},"type":"object","required":["current_7d","previous_7d"],"title":"StatsWindow"},"StoredCorrection":{"properties":{"id":{"type":"string","title":"Id"},"field":{"type":"string","title":"Field"},"original":{"title":"Original"},"corrected":{"title":"Corrected"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["id","field"],"title":"StoredCorrection","description":"A correction as echoed back by ``reviews_store.resolve`` — the request\nshape (``field``/``original``/``corrected``/``reason``) plus its assigned id."},"TemplateBody":{"properties":{"name":{"type":"string","title":"Name"},"workflow":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow"},"configuration":{"additionalProperties":true,"type":"object","title":"Configuration","default":{}},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"}},"type":"object","required":["name"],"title":"TemplateBody"},"TemplateDeleted":{"properties":{"id":{"type":"string","title":"Id"},"deleted":{"type":"boolean","title":"Deleted","default":true}},"type":"object","required":["id"],"title":"TemplateDeleted","description":"``DELETE /templates/{id}`` result."},"TemplatePublic":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"workflow":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow"},"locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locale"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"validation_policy":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Validation Policy"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"active_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Active Version"},"versions":{"items":{"$ref":"#/components/schemas/TemplateVersionOut"},"type":"array","title":"Versions"}},"type":"object","required":["id","name"],"title":"TemplatePublic","description":"``templates_store.public_view`` shape."},"TemplateVersionOut":{"properties":{"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","title":"Created At"},"author":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author"},"active":{"type":"boolean","title":"Active"}},"type":"object","required":["version","created_at","active"],"title":"TemplateVersionOut"},"UsageCounts":{"properties":{"files_processed":{"type":"integer","title":"Files Processed"},"files_validated":{"type":"integer","title":"Files Validated"},"files_in_review":{"type":"integer","title":"Files In Review"},"validated_rate":{"type":"number","title":"Validated Rate"},"active_api_keys":{"type":"integer","title":"Active Api Keys"},"files_by_tool":{"additionalProperties":{"type":"integer"},"type":"object","title":"Files By Tool"},"ttfr_minutes_median":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ttfr Minutes Median"},"first_to_second_run_rate":{"type":"number","title":"First To Second Run Rate"}},"type":"object","required":["files_processed","files_validated","files_in_review","validated_rate","active_api_keys","first_to_second_run_rate"],"title":"UsageCounts"},"Validation":{"properties":{"passed":{"type":"boolean","title":"Passed","default":true},"checks":{"items":{"$ref":"#/components/schemas/ValidationCheck"},"type":"array","title":"Checks"}},"type":"object","title":"Validation"},"ValidationCheck":{"properties":{"name":{"type":"string","title":"Name"},"passed":{"type":"boolean","title":"Passed"},"detail":{"type":"string","title":"Detail","default":""}},"type":"object","required":["name","passed"],"title":"ValidationCheck"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VersionBody":{"properties":{"configuration":{"additionalProperties":true,"type":"object","title":"Configuration"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"}},"type":"object","required":["configuration"],"title":"VersionBody"},"WebhookResponse":{"properties":{"received":{"type":"boolean","title":"Received","default":true},"duplicate":{"type":"boolean","title":"Duplicate"}},"type":"object","required":["duplicate"],"title":"WebhookResponse"},"WindowCounts":{"properties":{"files_processed":{"type":"integer","title":"Files Processed"},"straight_through":{"type":"integer","title":"Straight Through"},"sent_to_review":{"type":"integer","title":"Sent To Review"},"incorrect_high_confidence":{"type":"integer","title":"Incorrect High Confidence"}},"type":"object","required":["files_processed","straight_through","sent_to_review","incorrect_high_confidence"],"title":"WindowCounts"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Per-workspace API key: `Authorization: Bearer apdx_...`. Browser clients may instead use the session cookie."}}},"security":[{"BearerAuth":[]}]}