{"openapi":"3.1.0","info":{"title":"SCRIBETOOLS","description":"Intelligent OCR API with multiple engines and smart routing","version":"1.0.0"},"paths":{"/health":{"get":{"summary":"Health Check","description":"Health check endpoint","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/":{"get":{"summary":"Root","description":"Root endpoint with API information","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/providers":{"get":{"summary":"List Providers","description":"List all available OCR/VLM providers with their capabilities and pricing.\n\nReturns providers from the database with:\n- provider_key: Unique identifier for API calls\n- display_name: Human-readable name\n- credits_per_page: Cost per page processed\n- supported_step_types: What operations the provider can perform\n- supported_output_formats: What output formats are supported","operationId":"list_providers_api_v1_providers_get","parameters":[{"name":"step_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by supported step type","title":"Step Type"},"description":"Filter by supported step type"},{"name":"provider_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by provider type (vlm or traditional_ocr)","title":"Provider Type"},"description":"Filter by provider type (vlm or traditional_ocr)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/detect-pdf-type":{"post":{"summary":"Detect Pdf Type","description":"Classify a PDF as digital, scanned, or mixed.\n\nUsed by the editable-document Auto mode to pick between Standard\n(Gemini only) and Difficult scan (DocAI + Gemini) without forcing the\nuser to guess. Heuristic, not a model call — runs in ~50ms via\nPyMuPDF text/image extraction. Requires auth so we don't get\ndrive-by classification of arbitrary PDFs.","operationId":"detect_pdf_type_api_v1_detect_pdf_type_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_detect_pdf_type_api_v1_detect_pdf_type_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sync/jobs":{"post":{"summary":"Create Sync Jobs","description":"Synchronous OCR for up to 10 image files, capped at 15MB total.\n\nReturns extracted text per file and a credit summary.","operationId":"create_sync_jobs_api_v1_sync_jobs_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_sync_jobs_api_v1_sync_jobs_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncOCRResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/upload-urls":{"post":{"summary":"Get Upload Urls","description":"Generate signed URLs for direct GCS uploads. Session or API key.","operationId":"get_upload_urls_api_v1_upload_urls_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadUrlsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadUrlsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, or revoked credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Not allowed for this caller or plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/jobs":{"get":{"summary":"List Jobs","description":"List all jobs for the authenticated user with pagination.","operationId":"list_jobs_api_v1_jobs_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":20,"title":"Page Size"},"description":"Items per page"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListJobsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Async Job","operationId":"create_async_job_api_v1_jobs_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/outcome-jobs":{"post":{"summary":"Create Outcome Job","description":"Create a job by outcome name. The server builds the pipeline.","operationId":"create_outcome_job_api_v1_outcome_jobs_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOutcomeJobRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeJobCreated"}}}},"200":{"description":"Replay of an earlier request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeJobCreated"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, or revoked credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Not allowed for this caller or plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found (or not yours)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"summary":"List Outcome Jobs","description":"Your jobs, newest first.","operationId":"list_outcome_jobs_api_v1_outcome_jobs_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Page Size"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeJobList"}}}},"401":{"description":"Missing, invalid, or revoked credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/me":{"get":{"summary":"Get Account","description":"Who this credential belongs to, its plan and pages (plan 017).\n\nIntegrations use it to test a connection and label it.","operationId":"get_account_api_v1_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"Missing, invalid, or revoked credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/outcome-jobs/{job_id}":{"get":{"summary":"Get Outcome Job","description":"Compact status. While not terminal, Retry-After says when to poll again.","operationId":"get_outcome_job_api_v1_outcome_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeJobStatus"}}}},"401":{"description":"Missing, invalid, or revoked credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found (or not yours)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/outcome-jobs/{job_id}/results":{"get":{"summary":"List Outcome Job Results","description":"One result per completed file. Listing never renders or charges.","operationId":"list_outcome_job_results_api_v1_outcome_jobs__job_id__results_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeJobResults"}}}},"401":{"description":"Missing, invalid, or revoked credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found (or not yours)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/outcome-jobs/{job_id}/results/{result_id}/download":{"get":{"summary":"Download Outcome Job Result","description":"A short-lived signed URL for one result.\n\nDOCX/XLSX/CSV are rendered on the first download and reused after that;\non plans with a free-export allowance the first download of each such\nresult uses one export.","operationId":"download_outcome_job_result_api_v1_outcome_jobs__job_id__results__result_id__download_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}},{"name":"result_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Result Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResultDownload"}}}},"401":{"description":"Missing, invalid, or revoked credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found (or not yours)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/outcome-jobs/{job_id}/results/{result_id}/content":{"get":{"summary":"Read Outcome Job Result Content","description":"A TXT or JSON result's content, up to 1 MiB (plan 017).\n\nFor automation steps that map extracted text or fields directly. Other\nformats and larger results are download-only.","operationId":"read_outcome_job_result_content_api_v1_outcome_jobs__job_id__results__result_id__content_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}},{"name":"result_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Result Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResultContent"}}}},"401":{"description":"Missing, invalid, or revoked credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found (or not yours)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Too large to return inline","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/outcome-jobs/{job_id}/cancel":{"post":{"summary":"Cancel Outcome Job","description":"Cancel a running job. Completed steps' output stays and is charged;\nunused holds are released. Cancelling a finished job changes nothing.","operationId":"cancel_outcome_job_api_v1_outcome_jobs__job_id__cancel_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeJobStatus"}}}},"401":{"description":"Missing, invalid, or revoked credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found (or not yours)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/jobs/{job_id}/items":{"post":{"summary":"Add Job Items","operationId":"add_job_items_api_v1_jobs__job_id__items_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddJobItemsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Job Items","operationId":"get_job_items_api_v1_jobs__job_id__items_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"include","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Include"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}":{"get":{"summary":"Get Job Summary","operationId":"get_job_summary_api_v1_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Job","description":"Update editable fields on a job (currently: name).","operationId":"update_job_api_v1_jobs__job_id__patch","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateJobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/artifacts":{"get":{"summary":"Get Job Artifacts","operationId":"get_job_artifacts_api_v1_jobs__job_id__artifacts_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/items/{item_id}/source":{"get":{"summary":"Get Job Item Source","description":"Return a short-lived signed URL for a job item's source upload.\n\nUsed by the editable-document editor to show the original PDF/image\nalongside the structured artifact. Source URIs aren't exposed by the\nplain `/items` listing because most callers don't need them and\nsigning per-item adds latency.","operationId":"get_job_item_source_api_v1_jobs__job_id__items__item_id__source_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/artifacts/download-all":{"get":{"summary":"Download All Artifacts","description":"Download final outputs, rendering editable documents as Word files.","operationId":"download_all_artifacts_api_v1_jobs__job_id__artifacts_download_all_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/cancel":{"post":{"summary":"Cancel Job","operationId":"cancel_job_api_v1_jobs__job_id__cancel_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/stripe":{"post":{"summary":"Stripe Webhook","description":"Handle Stripe webhook events.\n\nEvents handled:\n- checkout.session.completed: Subscription or credit purchase completed\n- customer.subscription.created/updated/deleted: Subscription lifecycle\n- invoice.paid: Monthly subscription renewal (grants credits)\n- invoice.payment_failed: Payment failure notification","operationId":"stripe_webhook_api_v1_webhooks_stripe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/pricing":{"get":{"summary":"Get Pricing","description":"Public price list for the visitor's region (no auth).","operationId":"get_pricing_api_v1_pricing_get","parameters":[{"name":"x-scribetools-country","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Scribetools-Country"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/checkout/subscription":{"post":{"summary":"Create Subscription Checkout","description":"Create a Stripe checkout session for subscription.","operationId":"create_subscription_checkout_api_v1_checkout_subscription_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-scribetools-country","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Scribetools-Country"}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_create_subscription_checkout_api_v1_checkout_subscription_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/checkout/credits":{"post":{"summary":"Create Credit Checkout","description":"Create a Stripe checkout session for one-time credit purchase.","operationId":"create_credit_checkout_api_v1_checkout_credits_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-scribetools-country","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Scribetools-Country"}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_create_credit_checkout_api_v1_checkout_credits_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/portal":{"post":{"summary":"Create Billing Portal","description":"Create a Stripe customer portal session for subscription management.","operationId":"create_billing_portal_api_v1_billing_portal_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/user/tier":{"get":{"summary":"Get User Tier","description":"Get current user's subscription tier and limits.","operationId":"get_user_tier_api_v1_user_tier_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/capabilities":{"get":{"summary":"Get Capabilities","operationId":"get_capabilities_api_v1_capabilities_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/user/premium-export/consume":{"post":{"summary":"Consume Premium Export","description":"Consume one premium export allowance (client-side DOCX / table copy).","operationId":"consume_premium_export_api_v1_user_premium_export_consume_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/user/reconcile-entitlements":{"post":{"summary":"Reconcile User Entitlements","description":"Idempotently migrate first-login entitlements for priority users.","operationId":"reconcile_user_entitlements_api_v1_user_reconcile_entitlements_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/me":{"get":{"tags":["admin"],"summary":"Me","description":"Bootstrap endpoint the frontend calls to confirm admin access.","operationId":"me_api_v1_admin_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/stuck-summary":{"get":{"tags":["admin"],"summary":"Stuck Summary","operationId":"stuck_summary_api_v1_admin_stuck_summary_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/audit":{"get":{"tags":["admin"],"summary":"Audit Log","operationId":"audit_log_api_v1_admin_audit_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/jobs":{"get":{"tags":["admin"],"summary":"List Jobs","operationId":"list_jobs_api_v1_admin_jobs_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated statuses","title":"Status"},"description":"Comma-separated statuses"},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated providers","title":"Provider"},"description":"Comma-separated providers"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"has_stale_lease","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Has Stale Lease"}},{"name":"has_failed_step","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Has Failed Step"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created After"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created Before"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Page Size"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/jobs/{job_id}":{"get":{"tags":["admin"],"summary":"Get Job Detail","operationId":"get_job_detail_api_v1_admin_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/jobs/outputs/download":{"post":{"tags":["admin"],"summary":"Download Outputs","description":"Download selected jobs' outputs as one file or one server-built ZIP.","operationId":"download_outputs_api_v1_admin_jobs_outputs_download_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadOutputsBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/jobs/{job_id}/cancel":{"post":{"tags":["admin"],"summary":"Cancel Job","operationId":"cancel_job_api_v1_admin_jobs__job_id__cancel_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/jobs/{job_id}/fail":{"post":{"tags":["admin"],"summary":"Fail Job","operationId":"fail_job_api_v1_admin_jobs__job_id__fail_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForceFailBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/jobs/{job_id}/replay":{"post":{"tags":["admin"],"summary":"Replay Job","operationId":"replay_job_api_v1_admin_jobs__job_id__replay_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/steps/{step_id}/retry":{"post":{"tags":["admin"],"summary":"Retry Step","operationId":"retry_step_api_v1_admin_steps__step_id__retry_post","parameters":[{"name":"step_id","in":"path","required":true,"schema":{"type":"string","title":"Step Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/steps/{step_id}/expire-lease":{"post":{"tags":["admin"],"summary":"Expire Lease","operationId":"expire_lease_api_v1_admin_steps__step_id__expire_lease_post","parameters":[{"name":"step_id","in":"path","required":true,"schema":{"type":"string","title":"Step Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/steps/{step_id}/cancel":{"post":{"tags":["admin"],"summary":"Cancel Step","operationId":"cancel_step_api_v1_admin_steps__step_id__cancel_post","parameters":[{"name":"step_id","in":"path","required":true,"schema":{"type":"string","title":"Step Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/steps/{step_id}/force-fail":{"post":{"tags":["admin"],"summary":"Force Fail Step","operationId":"force_fail_step_api_v1_admin_steps__step_id__force_fail_post","parameters":[{"name":"step_id","in":"path","required":true,"schema":{"type":"string","title":"Step Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForceFailBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/reaper/run":{"post":{"tags":["admin"],"summary":"Run Reaper","operationId":"run_reaper_api_v1_admin_reaper_run_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/workers":{"get":{"tags":["admin"],"summary":"Workers","operationId":"workers_api_v1_admin_workers_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/providers/stats":{"get":{"tags":["admin"],"summary":"Provider Stats","operationId":"provider_stats_api_v1_admin_providers_stats_get","parameters":[{"name":"window_hours","in":"query","required":false,"schema":{"type":"integer","maximum":168,"minimum":1,"default":24,"title":"Window Hours"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/providers/{provider_key}":{"patch":{"tags":["admin"],"summary":"Set Provider Active","operationId":"set_provider_active_api_v1_admin_providers__provider_key__patch","parameters":[{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetProviderActiveBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/emails/overview":{"get":{"tags":["admin"],"summary":"Lifecycle Overview","operationId":"lifecycle_overview_api_v1_admin_emails_overview_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/emails/settings":{"patch":{"tags":["admin"],"summary":"Update Lifecycle Settings","operationId":"update_lifecycle_settings_api_v1_admin_emails_settings_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleSettingsBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/emails/templates/{trigger_key}":{"patch":{"tags":["admin"],"summary":"Update Lifecycle Template","operationId":"update_lifecycle_template_api_v1_admin_emails_templates__trigger_key__patch","parameters":[{"name":"trigger_key","in":"path","required":true,"schema":{"type":"string","title":"Trigger Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleTemplateBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users":{"get":{"tags":["admin"],"summary":"Search Users","operationId":"search_users_api_v1_admin_users_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}":{"get":{"tags":["admin"],"summary":"User Detail","operationId":"user_detail_api_v1_admin_users__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/jobs":{"get":{"tags":["admin"],"summary":"User Jobs","operationId":"user_jobs_api_v1_admin_users__user_id__jobs_get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Page Size"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/credits":{"post":{"tags":["admin"],"summary":"Grant Credits","operationId":"grant_credits_api_v1_admin_users__user_id__credits_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantCreditsBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/artifacts/{artifact_id}/content":{"get":{"tags":["admin"],"summary":"Artifact Content","operationId":"artifact_content_api_v1_admin_artifacts__artifact_id__content_get","parameters":[{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string","title":"Artifact Id"}},{"name":"bytes","in":"query","required":false,"schema":{"type":"integer","maximum":2000000,"minimum":1,"default":51200,"title":"Bytes"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/search":{"get":{"tags":["admin"],"summary":"Global Search","operationId":"global_search_api_v1_admin_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":1,"default":5,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/tiers":{"get":{"tags":["admin"],"summary":"List Tiers","operationId":"list_tiers_api_v1_admin_tiers_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/profile":{"patch":{"tags":["admin"],"summary":"Update User Profile","operationId":"update_user_profile_api_v1_admin_users__user_id__profile_patch","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/subscription":{"post":{"tags":["admin"],"summary":"Set Subscription","operationId":"set_subscription_api_v1_admin_users__user_id__subscription_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSubscriptionBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["admin"],"summary":"Patch Subscription","operationId":"patch_subscription_api_v1_admin_users__user_id__subscription_patch","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSubscriptionBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/subscription/cancel":{"post":{"tags":["admin"],"summary":"Cancel Subscription","operationId":"cancel_subscription_api_v1_admin_users__user_id__subscription_cancel_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSubscriptionBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/subscription/grant-monthly-credits":{"post":{"tags":["admin"],"summary":"Grant Monthly Credits","operationId":"grant_monthly_credits_api_v1_admin_users__user_id__subscription_grant_monthly_credits_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/subscription/correct-plan":{"post":{"tags":["admin"],"summary":"Correct Plan","operationId":"correct_plan_api_v1_admin_users__user_id__subscription_correct_plan_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorrectPlanBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/reset-monthly-usage":{"post":{"tags":["admin"],"summary":"Reset Monthly Usage","operationId":"reset_monthly_usage_api_v1_admin_users__user_id__reset_monthly_usage_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/api-keys":{"post":{"tags":["api-keys"],"summary":"Create Api Key","operationId":"create_api_key_api_v1_api_keys_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedApiKey"}}}},"401":{"description":"Missing, invalid, or revoked credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Not allowed for this caller or plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["api-keys"],"summary":"List Api Keys","operationId":"list_api_keys_api_v1_api_keys_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Page Size"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}}},"401":{"description":"Missing, invalid, or revoked credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Not allowed for this caller or plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/api-keys/{key_id}":{"delete":{"tags":["api-keys"],"summary":"Revoke Api Key","description":"Revoke a key. Idempotent; the row is kept as an audit record.","operationId":"revoke_api_key_api_v1_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeySummary"}}}},"401":{"description":"Missing, invalid, or revoked credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Not allowed for this caller or plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found (or not yours)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/outcomes":{"get":{"tags":["outcomes"],"summary":"List Outcomes","operationId":"list_outcomes_api_v1_outcomes_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeCatalog"}}}},"401":{"description":"Missing, invalid, or revoked credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/extraction-templates/predefined":{"get":{"tags":["extraction-templates"],"summary":"List Predefined","operationId":"list_predefined_api_v1_extraction_templates_predefined_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/extraction-templates":{"get":{"tags":["extraction-templates"],"summary":"List Templates","operationId":"list_templates_api_v1_extraction_templates_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["extraction-templates"],"summary":"Create Template","operationId":"create_template_api_v1_extraction_templates_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTemplateBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionTemplate"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/extraction-templates/{template_id}":{"get":{"tags":["extraction-templates"],"summary":"Get Template","operationId":"get_template_api_v1_extraction_templates__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionTemplate"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["extraction-templates"],"summary":"Update Template","operationId":"update_template_api_v1_extraction_templates__template_id__patch","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTemplateBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionTemplate"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["extraction-templates"],"summary":"Delete Template","operationId":"delete_template_api_v1_extraction_templates__template_id__delete","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/extraction-schemas/validate":{"post":{"tags":["extraction-schemas"],"summary":"Validate Schema","operationId":"validate_schema_api_v1_extraction_schemas_validate_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateSchemaBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/extraction-schemas/generate":{"post":{"tags":["extraction-schemas"],"summary":"Generate Schema","operationId":"generate_schema_api_v1_extraction_schemas_generate_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateSchemaBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/extraction-schemas/simplify":{"post":{"tags":["extraction-schemas"],"summary":"Simplify Schema","operationId":"simplify_schema_api_v1_extraction_schemas_simplify_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimplifySchemaBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/artifacts/{artifact_id}/export":{"get":{"tags":["artifacts"],"summary":"Export Artifact","operationId":"export_artifact_api_v1_jobs__job_id__artifacts__artifact_id__export_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string","title":"Artifact Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","description":"Export format: xlsx, docx, or csv.","default":"xlsx","title":"Format"},"description":"Export format: xlsx, docx, or csv."},{"name":"expected_artifact_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional semantic artifact type guard, e.g. table_extraction.","title":"Expected Artifact Type"},"description":"Optional semantic artifact type guard, e.g. table_extraction."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/artifacts/{artifact_id}/draft":{"put":{"tags":["artifacts"],"summary":"Update Editable Document Draft","operationId":"update_editable_document_draft_api_v1_jobs__job_id__artifacts__artifact_id__draft_put","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string","title":"Artifact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/items/{item_id}/grounding":{"get":{"tags":["grounding"],"summary":"Get Item Grounding","operationId":"get_item_grounding_api_v1_jobs__job_id__items__item_id__grounding_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/items/{item_id}/original":{"get":{"tags":["item-original"],"summary":"Get Item Original","description":"Serve the item's uploaded file to its owner, honouring byte ranges.","operationId":"get_item_original_api_v1_jobs__job_id__items__item_id__original_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"range","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Range"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/artifacts/{artifact_id}/bilingual-draft":{"get":{"tags":["translation"],"summary":"Get Bilingual Draft","description":"Return the latest owned bilingual document (draft or original).\n\nLoading through the authenticated backend keeps the workspace independent\nof bucket CORS configuration and reuses the same ownership/type checks as\nevery translation mutation.","operationId":"get_bilingual_draft_api_v1_jobs__job_id__artifacts__artifact_id__bilingual_draft_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string","title":"Artifact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["translation"],"summary":"Update Bilingual Draft","description":"Patch target blocks of a bilingual document draft by segment id.\n\n``machine_target`` blocks are immutable — only ``target`` is written, so\nrevert-to-MT always has the frozen original to return to.","operationId":"update_bilingual_draft_api_v1_jobs__job_id__artifacts__artifact_id__bilingual_draft_put","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string","title":"Artifact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BilingualDraftRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/segments/{segment_id}/retranslate":{"post":{"tags":["translation"],"summary":"Retranslate Segment","description":"Stream an improved translation for one segment (1 credit).\n\nDoes NOT write server-side — the client reviews the streamed proposal\nand, on accept, persists it through the bilingual-draft PUT with\n``origin=\"retranslate\"``. Flash-class model; context is one segment\nplus conventions and glossary, so it is fast and cheap.","operationId":"retranslate_segment_api_v1_jobs__job_id__segments__segment_id__retranslate_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetranslateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/glossary/extract":{"post":{"tags":["translation"],"summary":"Extract Glossary Terms","description":"Propose glossary terms from the bilingual document (agent).\n\nInserts ``status='proposed'``, ``created_by='agent'`` rows for the user\nto approve in the sidebar. Creates and links a glossary when none is\nsupplied. Credits: 2 + 1 per 100 segments.","operationId":"extract_glossary_terms_api_v1_jobs__job_id__glossary_extract_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlossaryExtractRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/chat":{"post":{"tags":["translation"],"summary":"Translation Chat","description":"Ask-mode chat over the bilingual document (1 credit per message).\n\nStreams the AI SDK v4 data-stream protocol; the first data part carries\n``{\"thread_id\": ...}`` so a new conversation can be persisted client-side.\nMessages are stored in chat_threads/chat_messages (migration 030) so\nconversations survive reloads.","operationId":"translation_chat_api_v1_jobs__job_id__chat_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/agent":{"post":{"tags":["translation"],"summary":"Translation Agent","description":"Agent mode: propose segment edits across the document.\n\nReturns structured proposals ``[{segment_id, new_target_text,\nrationale}]`` — the server NEVER mutates the artifact from agent output;\nthe human accept in the workspace is the only write path (via the\nbilingual-draft PUT with origin=\"agent\"). Credits: 2 + 1 per 25\nproposed segments.","operationId":"translation_agent_api_v1_jobs__job_id__agent_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/manuscript-pilot/session":{"post":{"tags":["manuscript-pilot"],"summary":"Browser Session","operationId":"browser_session_api_v1_manuscript_pilot_session_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/manuscript-pilot/access":{"get":{"tags":["manuscript-pilot"],"summary":"Access","operationId":"access_api_v1_manuscript_pilot_access_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/manuscript-pilot/workspace":{"get":{"tags":["manuscript-pilot"],"summary":"Workspace","operationId":"workspace_api_v1_manuscript_pilot_workspace_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/manuscript-pilot/uploads":{"post":{"tags":["manuscript-pilot"],"summary":"Upload","operationId":"upload_api_v1_manuscript_pilot_uploads_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_api_v1_manuscript_pilot_uploads_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/manuscript-pilot/pages/{page_id}/image":{"get":{"tags":["manuscript-pilot"],"summary":"Image","operationId":"image_api_v1_manuscript_pilot_pages__page_id__image_get","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"string","title":"Page Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/manuscript-pilot/pages/{page_id}/process":{"post":{"tags":["manuscript-pilot"],"summary":"Process","operationId":"process_api_v1_manuscript_pilot_pages__page_id__process_post","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"string","title":"Page Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/manuscript-pilot/pages/{page_id}/lines/{line_id}":{"patch":{"tags":["manuscript-pilot"],"summary":"Edit","operationId":"edit_api_v1_manuscript_pilot_pages__page_id__lines__line_id__patch","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"string","title":"Page Id"}},{"name":"line_id","in":"path","required":true,"schema":{"type":"string","title":"Line Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Edit"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/manuscript-pilot/feedback":{"post":{"tags":["manuscript-pilot"],"summary":"Feedback","operationId":"feedback_api_v1_manuscript_pilot_feedback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feedback"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/manuscript-pilot/export/{format}":{"get":{"tags":["manuscript-pilot"],"summary":"Export","operationId":"export_api_v1_manuscript_pilot_export__format__get","parameters":[{"name":"format","in":"path","required":true,"schema":{"type":"string","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/manuscript-pilot/pages/{page_id}":{"delete":{"tags":["manuscript-pilot"],"summary":"Delete Page","operationId":"delete_page_api_v1_manuscript_pilot_pages__page_id__delete","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"string","title":"Page Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/artifacts/{artifact_id}/structured-result":{"get":{"tags":["structured-results"],"summary":"Get Structured Result","operationId":"get_structured_result_api_v1_jobs__job_id__artifacts__artifact_id__structured_result_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string","title":"Artifact Id"}},{"name":"version","in":"query","required":false,"schema":{"enum":["current","original"],"type":"string","default":"current","title":"Version"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/artifacts/{artifact_id}/structured-result/reviewed":{"patch":{"tags":["structured-results"],"summary":"Patch Structured Result","operationId":"patch_structured_result_api_v1_jobs__job_id__artifacts__artifact_id__structured_result_reviewed_patch","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string","title":"Artifact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewedPatchBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/artifacts/{artifact_id}/structured-result/mark-reviewed":{"post":{"tags":["structured-results"],"summary":"Mark Structured Result Reviewed","operationId":"mark_structured_result_reviewed_api_v1_jobs__job_id__artifacts__artifact_id__structured_result_mark_reviewed_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string","title":"Artifact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkReviewedBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/artifacts/{artifact_id}/structured-result/download":{"get":{"tags":["structured-results"],"summary":"Download Structured Result","operationId":"download_structured_result_api_v1_jobs__job_id__artifacts__artifact_id__structured_result_download_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string","title":"Artifact Id"}},{"name":"version","in":"query","required":false,"schema":{"enum":["current","original"],"type":"string","default":"current","title":"Version"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/structured-results/download-all":{"get":{"tags":["structured-results"],"summary":"Download All Structured Results","operationId":"download_all_structured_results_api_v1_jobs__job_id__structured_results_download_all_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"APIType":{"type":"string","enum":["openai","anthropic","google","custom"],"title":"APIType","description":"API types for provider categorization."},"Account":{"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"The account's sign-in email, for labelling connections."},"plan":{"type":"string","title":"Plan"},"tier_key":{"type":"string","title":"Tier Key"},"pages":{"$ref":"#/components/schemas/AccountPages"},"auth_method":{"type":"string","title":"Auth Method","description":"How this request authenticated: session, api_key or oauth."}},"type":"object","required":["plan","tier_key","pages","auth_method"],"title":"Account"},"AccountPages":{"properties":{"available":{"type":"integer","title":"Available","description":"Pages you can spend now."},"reserved":{"type":"integer","title":"Reserved","description":"Pages held by running jobs."},"balance":{"type":"integer","title":"Balance"}},"type":"object","required":["available","reserved","balance"],"title":"AccountPages"},"AddJobItemsRequest":{"properties":{"gcs_uris":{"items":{"type":"string"},"type":"array","title":"Gcs Uris","description":"List of GCS URIs to add"},"file_pages":{"anyOf":[{"additionalProperties":{"type":"integer","maximum":2000.0,"minimum":1.0},"type":"object"},{"type":"null"}],"title":"File Pages","description":"Per-URI source page counts used for completeness checks"},"pipeline":{"anyOf":[{"$ref":"#/components/schemas/PipelineDefinition"},{"type":"null"}],"description":"Optional pipeline override for these items"}},"type":"object","required":["gcs_uris"],"title":"AddJobItemsRequest"},"AgentRequest":{"properties":{"artifact_id":{"type":"string","title":"Artifact Id"},"instruction":{"type":"string","maxLength":4000,"minLength":1,"title":"Instruction"},"segment_ids":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":500},{"type":"null"}],"title":"Segment Ids"}},"type":"object","required":["artifact_id","instruction"],"title":"AgentRequest"},"ApiKeyList":{"properties":{"keys":{"items":{"$ref":"#/components/schemas/ApiKeySummary"},"type":"array","title":"Keys"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"enabled":{"type":"boolean","title":"Enabled","description":"False while API keys are switched off."},"max_active":{"type":"integer","title":"Max Active"}},"type":"object","required":["keys","total","page","page_size","enabled","max_active"],"title":"ApiKeyList"},"ApiKeySummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix","description":"Non-secret start of the key, for recognizing it."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","name","prefix","created_at"],"title":"ApiKeySummary"},"BilingualDraftRequest":{"properties":{"segments":{"items":{"$ref":"#/components/schemas/BilingualSegmentUpdate"},"type":"array","maxItems":500,"minItems":1,"title":"Segments"}},"type":"object","required":["segments"],"title":"BilingualDraftRequest"},"BilingualSegmentUpdate":{"properties":{"id":{"type":"string","title":"Id"},"target":{"type":"object","title":"Target"},"origin":{"type":"string","pattern":"^(manual|retranslate|agent)$","title":"Origin","default":"manual"}},"type":"object","required":["id","target"],"title":"BilingualSegmentUpdate"},"Body_create_credit_checkout_api_v1_checkout_credits_post":{"properties":{"price_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Id"},"product":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product"},"quantity":{"type":"integer","title":"Quantity","default":1},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"}},"type":"object","title":"Body_create_credit_checkout_api_v1_checkout_credits_post"},"Body_create_subscription_checkout_api_v1_checkout_subscription_post":{"properties":{"price_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Id"},"product":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"}},"type":"object","title":"Body_create_subscription_checkout_api_v1_checkout_subscription_post"},"Body_create_sync_jobs_api_v1_sync_jobs_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files","description":"Up to 10 image files"},"language":{"type":"string","title":"Language","default":"eng"},"provider":{"type":"string","title":"Provider","default":"gemini_2.5_flash"},"detail":{"type":"string","title":"Detail","default":"standard"},"output_formats":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Formats"},"output_artifact_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Artifact Type"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"total_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Bytes"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome","description":"Product outcome id, persisted on jobs.job_type"},"idempotency_key":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Idempotency Key","description":"Client-generated submission id. Replays return the original job."}},"type":"object","required":["files"],"title":"Body_create_sync_jobs_api_v1_sync_jobs_post"},"Body_detect_pdf_type_api_v1_detect_pdf_type_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"Single PDF to classify"}},"type":"object","required":["file"],"title":"Body_detect_pdf_type_api_v1_detect_pdf_type_post"},"Body_upload_api_v1_manuscript_pilot_uploads_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"source_note":{"type":"string","title":"Source Note","default":""},"permission":{"type":"boolean","title":"Permission","default":false},"external_ai":{"type":"boolean","title":"External Ai","default":false}},"type":"object","required":["file"],"title":"Body_upload_api_v1_manuscript_pilot_uploads_post"},"CancelSubscriptionBody":{"properties":{"at_period_end":{"type":"boolean","title":"At Period End","default":true}},"type":"object","title":"CancelSubscriptionBody"},"ChatRequest":{"properties":{"artifact_id":{"type":"string","title":"Artifact Id"},"message":{"type":"string","maxLength":8000,"minLength":1,"title":"Message"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"segment_ids":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":100},{"type":"null"}],"title":"Segment Ids"}},"type":"object","required":["artifact_id","message"],"title":"ChatRequest"},"CorrectPlanBody":{"properties":{"tier_key":{"type":"string","minLength":1,"title":"Tier Key"},"grant_monthly_credits":{"type":"boolean","title":"Grant Monthly Credits","default":true}},"type":"object","required":["tier_key"],"title":"CorrectPlanBody"},"CreateApiKeyRequest":{"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name","description":"Label shown in the key list, e.g. 'Laptop CLI'."}},"additionalProperties":false,"type":"object","required":["name"],"title":"CreateApiKeyRequest"},"CreateJobRequest":{"properties":{"pipeline":{"anyOf":[{"$ref":"#/components/schemas/PipelineDefinition"},{"type":"null"}],"description":"Pipeline definition. Defaults to OCR only."},"gcs_uris":{"items":{"type":"string"},"type":"array","title":"Gcs Uris","description":"List of GCS URIs to process (files must exist)"},"file_pages":{"anyOf":[{"additionalProperties":{"type":"integer","maximum":2000.0,"minimum":1.0},"type":"object"},{"type":"null"}],"title":"File Pages","description":"Per-URI page counts used for upfront credit estimation. The worker re-counts pages and charges actual usage, so this is an authorization gate, not a billing source of truth."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Human-readable job name. Auto-generated from filenames if omitted."},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome","description":"Product outcome id chosen in the create flow (e.g. 'editable_document', 'translation'). Persisted on jobs.job_type for outcome-level analytics; inferred from the pipeline when omitted. Unknown values are ignored."},"idempotency_key":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Idempotency Key","description":"Client-generated submission id. Replays with the same user/key return the original job instead of creating another."},"custom_data_beta_acknowledged":{"type":"boolean","title":"Custom Data Beta Acknowledged","description":"Explicit opt-in required only while custom-data rollout mode is beta.","default":false}},"additionalProperties":false,"type":"object","required":["gcs_uris"],"title":"CreateJobRequest"},"CreateJobResponse":{"properties":{"status":{"type":"string","title":"Status"},"job_id":{"type":"string","title":"Job Id"},"items":{"items":{"$ref":"#/components/schemas/JobItemResponse"},"type":"array","title":"Items"}},"type":"object","required":["status","job_id","items"],"title":"CreateJobResponse"},"CreateOutcomeJobRequest":{"properties":{"outcome":{"type":"string","title":"Outcome","description":"An id from GET /api/v1/outcomes."},"gcs_uris":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50,"minItems":1},{"type":"null"}],"title":"Gcs Uris","description":"gs:// URIs returned by POST /api/v1/upload-urls. Send this or sources, not both."},"sources":{"anyOf":[{"items":{"$ref":"#/components/schemas/SourceURL"},"type":"array","maxItems":50,"minItems":1},{"type":"null"}],"title":"Sources","description":"Files to fetch from public https URLs instead of uploading them. Send this or gcs_uris."},"source_job_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Source Job Id","description":"Reuse the files of an earlier job of yours instead of uploading again, e.g. to process the whole book after a sample. Send this, gcs_uris or sources."},"pages":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Pages","description":"Process only these pages of a single PDF: \"1-20, 45\", or \"sample\" for a few dense pages from the body of the book. Only the selected pages are processed and charged. Omit to process every page."},"format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Format","description":"Result format; one of the outcome's formats. Defaults to its default_format."},"options":{"type":"object","title":"Options","description":"Outcome options; see the outcome's options_schema."},"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name"},"idempotency_key":{"type":"string","format":"uuid","title":"Idempotency Key","description":"Client-generated id for this submission. Retrying with the same key and request returns the same job; the same key with a different request is a 409."},"callback_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Callback Url","description":"Public https URL to POST to once when the job finishes (completed, partial, failed or cancelled). Signed with callback_secret; carries ids and state only."}},"additionalProperties":false,"type":"object","required":["outcome","idempotency_key"],"title":"CreateOutcomeJobRequest"},"CreateTemplateBody":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"category":{"type":"string","enum":["transactions","form_fields","job_records","document_structure","custom"],"title":"Category","default":"custom"},"schema":{"type":"object","title":"Schema"}},"type":"object","required":["name","schema"],"title":"CreateTemplateBody"},"CreatedApiKey":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix","description":"Non-secret start of the key, for recognizing it."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"secret":{"type":"string","title":"Secret","description":"The full key. Returned only in this response; store it now."}},"type":"object","required":["id","name","prefix","created_at","secret"],"title":"CreatedApiKey"},"DownloadOutputsBody":{"properties":{"job_ids":{"items":{"type":"string"},"type":"array","title":"Job Ids"},"output_format":{"type":"string","pattern":"^(original|docx)$","title":"Output Format","default":"original"}},"type":"object","required":["job_ids"],"title":"DownloadOutputsBody"},"Edit":{"properties":{"revision":{"type":"integer","minimum":0.0,"title":"Revision"},"text":{"type":"string","maxLength":4000,"title":"Text"},"reviewed":{"type":"boolean","title":"Reviewed"},"resolutions":{"additionalProperties":{"type":"string"},"type":"object","title":"Resolutions"}},"additionalProperties":false,"type":"object","required":["revision","text","reviewed"],"title":"Edit"},"ErrorDetail":{"properties":{"code":{"type":"string","title":"Code","description":"Stable identifier, e.g. 'insufficient_credits'."},"message":{"type":"string","title":"Message","description":"Human-readable explanation."}},"additionalProperties":true,"type":"object","required":["code","message"],"title":"ErrorDetail","description":"Machine-readable error. Extra fields depend on ``code``."},"ErrorResponse":{"properties":{"detail":{"$ref":"#/components/schemas/ErrorDetail"}},"type":"object","required":["detail"],"title":"ErrorResponse"},"ExtractionTemplate":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"category":{"type":"string","enum":["transactions","form_fields","job_records","document_structure","custom"],"title":"Category"},"schema":{"type":"object","title":"Schema"},"is_system":{"type":"boolean","title":"Is System","default":false},"is_active":{"type":"boolean","title":"Is Active","default":true},"contract_version":{"type":"string","title":"Contract Version","default":"legacy"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","name","category","schema"],"title":"ExtractionTemplate"},"Feedback":{"properties":{"page_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Id"},"line_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Line Id"},"text":{"type":"string","maxLength":3000,"minLength":1,"title":"Text"}},"additionalProperties":false,"type":"object","required":["text"],"title":"Feedback"},"ForceFailBody":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","title":"ForceFailBody"},"GenerateSchemaBody":{"properties":{"description":{"type":"string","maxLength":4000,"minLength":3,"title":"Description"},"starter":{"anyOf":[{"type":"string","enum":["document_structure","specific_fields","blank"]},{"type":"null"}],"title":"Starter"},"locale":{"type":"string","enum":["en","ar"],"title":"Locale","default":"en"},"granularity":{"type":"string","enum":["document","page"],"title":"Granularity","default":"document"}},"type":"object","required":["description"],"title":"GenerateSchemaBody"},"GlossaryExtractRequest":{"properties":{"artifact_id":{"type":"string","title":"Artifact Id"},"glossary_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Glossary Id"}},"type":"object","required":["artifact_id"],"title":"GlossaryExtractRequest"},"GrantCreditsBody":{"properties":{"amount":{"type":"integer","title":"Amount"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["amount"],"title":"GrantCreditsBody"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Service health status"},"version":{"type":"string","title":"Version","description":"API version"},"available_services":{"items":{"type":"string"},"type":"array","title":"Available Services","description":"Available OCR services"},"timestamp":{"type":"string","title":"Timestamp","description":"Health check timestamp"}},"type":"object","required":["status","version","available_services","timestamp"],"title":"HealthResponse"},"JobItemResponse":{"properties":{"item_id":{"type":"integer","title":"Item Id"},"steps":{"additionalProperties":{"type":"string"},"type":"object","title":"Steps"}},"type":"object","required":["item_id","steps"],"title":"JobItemResponse"},"JobSummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"status":{"type":"string","title":"Status"},"job_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Type"},"created_at":{"type":"string","title":"Created At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"items_count":{"type":"integer","title":"Items Count"},"completed_items":{"type":"integer","title":"Completed Items"},"cost_credits":{"type":"integer","title":"Cost Credits"},"settings":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Settings"}},"type":"object","required":["id","status","created_at","items_count","completed_items","cost_credits"],"title":"JobSummary","description":"Summary of a job for list views"},"LifecycleSettingsBody":{"properties":{"live":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Live"},"from_address":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"From Address"},"reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reply To"}},"type":"object","title":"LifecycleSettingsBody"},"LifecycleTemplateBody":{"properties":{"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Html"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"LifecycleTemplateBody"},"ListJobsResponse":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/JobSummary"},"type":"array","title":"Jobs"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["jobs","total","page","page_size"],"title":"ListJobsResponse","description":"Response for listing user jobs"},"ListResponse":{"properties":{"templates":{"items":{"$ref":"#/components/schemas/ExtractionTemplate"},"type":"array","title":"Templates"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["templates","total"],"title":"ListResponse"},"MarkReviewedBody":{"properties":{"expected_revision":{"type":"integer","minimum":0.0,"title":"Expected Revision"}},"type":"object","required":["expected_revision"],"title":"MarkReviewedBody"},"OCRService":{"type":"string","enum":["document_ai","vision_llm","auto"],"title":"OCRService"},"OutcomeCatalog":{"properties":{"outcomes":{"items":{"$ref":"#/components/schemas/OutcomeSummary"},"type":"array","title":"Outcomes","description":"Outcomes available to the caller's plan. A fixed, small list."}},"type":"object","required":["outcomes"],"title":"OutcomeCatalog"},"OutcomeJobCreated":{"properties":{"job_id":{"type":"string","title":"Job Id"},"created":{"type":"boolean","title":"Created","description":"False when an earlier request with this idempotency key made the job."},"state":{"type":"string","title":"State"},"outcome":{"type":"string","title":"Outcome"},"format":{"type":"string","title":"Format"},"credits_reserved":{"type":"integer","title":"Credits Reserved","description":"Credits held for this job; charged only for work that completes."},"page_selection":{"anyOf":[{"$ref":"#/components/schemas/PageSelectionInfo"},{"type":"null"}],"description":"Set when the job processes only some pages of its file."},"callback_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callback Secret","description":"Only with callback_url: verify each callback's ScribeTools-Signature header (t=<unix>,v1=<hex HMAC-SHA256 of '<t>.' + body>) with this secret."}},"type":"object","required":["job_id","created","state","outcome","format","credits_reserved"],"title":"OutcomeJobCreated"},"OutcomeJobError":{"properties":{"item_id":{"type":"integer","title":"Item Id"},"message":{"type":"string","title":"Message"}},"type":"object","required":["item_id","message"],"title":"OutcomeJobError"},"OutcomeJobItem":{"properties":{"item_id":{"type":"integer","title":"Item Id"},"filename":{"type":"string","title":"Filename"},"state":{"type":"string","title":"State"},"pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pages"},"credits_reserved":{"type":"integer","title":"Credits Reserved"},"credits_charged":{"type":"integer","title":"Credits Charged"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["item_id","filename","state","credits_reserved","credits_charged"],"title":"OutcomeJobItem"},"OutcomeJobList":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/OutcomeJobSummary"},"type":"array","title":"Jobs"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["jobs","total","page","page_size"],"title":"OutcomeJobList"},"OutcomeJobProgress":{"properties":{"total":{"type":"integer","title":"Total"},"queued":{"type":"integer","title":"Queued"},"processing":{"type":"integer","title":"Processing"},"completed":{"type":"integer","title":"Completed"},"failed":{"type":"integer","title":"Failed"},"cancelled":{"type":"integer","title":"Cancelled"}},"type":"object","required":["total","queued","processing","completed","failed","cancelled"],"title":"OutcomeJobProgress"},"OutcomeJobResult":{"properties":{"result_id":{"type":"string","title":"Result Id","description":"Pass to the download endpoint."},"item_id":{"type":"integer","title":"Item Id"},"source_filename":{"type":"string","title":"Source Filename","description":"The input file this result came from."},"format":{"type":"string","title":"Format"},"kind":{"type":"string","title":"Kind","description":"'file': stored as produced. 'export': rendered from the job's structured output on first download."},"filename":{"type":"string","title":"Filename","description":"Suggested local filename."},"media_type":{"type":"string","title":"Media Type"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes","description":"Unknown for an export until its first download."}},"type":"object","required":["result_id","item_id","source_filename","format","kind","filename","media_type"],"title":"OutcomeJobResult"},"OutcomeJobResults":{"properties":{"job_id":{"type":"string","title":"Job Id"},"state":{"type":"string","title":"State"},"terminal":{"type":"boolean","title":"Terminal"},"results":{"items":{"$ref":"#/components/schemas/OutcomeJobResult"},"type":"array","title":"Results","description":"One per completed file, in submission order."},"pending_items":{"type":"integer","title":"Pending Items","description":"Files still queued or processing."}},"type":"object","required":["job_id","state","terminal","results","pending_items"],"title":"OutcomeJobResults"},"OutcomeJobStatus":{"properties":{"job_id":{"type":"string","title":"Job Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"outcome":{"type":"string","title":"Outcome"},"format":{"type":"string","title":"Format"},"state":{"type":"string","title":"State","description":"queued, processing, completed, partial, failed, or cancelled."},"terminal":{"type":"boolean","title":"Terminal"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"progress":{"$ref":"#/components/schemas/OutcomeJobProgress"},"items":{"items":{"$ref":"#/components/schemas/OutcomeJobItem"},"type":"array","title":"Items"},"credits_reserved":{"type":"integer","title":"Credits Reserved","description":"Credits still held for unfinished items."},"credits_charged":{"type":"integer","title":"Credits Charged"},"errors":{"items":{"$ref":"#/components/schemas/OutcomeJobError"},"type":"array","title":"Errors","description":"Up to 20 item errors."},"total_error_count":{"type":"integer","title":"Total Error Count"},"page_selection":{"anyOf":[{"$ref":"#/components/schemas/PageSelectionInfo"},{"type":"null"}],"description":"Set when the job processes only some pages of its file."}},"type":"object","required":["job_id","outcome","format","state","terminal","progress","items","credits_reserved","credits_charged","errors","total_error_count"],"title":"OutcomeJobStatus"},"OutcomeJobSummary":{"properties":{"job_id":{"type":"string","title":"Job Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"outcome":{"type":"string","title":"Outcome"},"format":{"type":"string","title":"Format"},"state":{"type":"string","title":"State","description":"completed, partial, failed, or cancelled; every unfinished job is listed as processing. GET /api/v1/outcome-jobs/{id} distinguishes queued from processing."},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["job_id","outcome","format","state"],"title":"OutcomeJobSummary"},"OutcomeSummary":{"properties":{"id":{"type":"string","title":"Id","description":"Pass this as `outcome` when creating a job."},"description":{"type":"string","title":"Description"},"accepted_mime_types":{"items":{"type":"string"},"type":"array","title":"Accepted Mime Types","description":"Input file types this outcome accepts."},"default_format":{"type":"string","title":"Default Format","description":"Result format used when none is requested."},"formats":{"items":{"type":"string"},"type":"array","title":"Formats","description":"Result formats this outcome can produce."},"credits_per_page":{"type":"number","title":"Credits Per Page","description":"Credits per input page with default options. Each file's total is rounded up; some options (EPUB embed_pdf_pages) raise it."},"options_schema":{"type":"object","title":"Options Schema","description":"JSON Schema of `options` for this outcome, exactly as enforced."}},"type":"object","required":["id","description","accepted_mime_types","default_format","formats","credits_per_page","options_schema"],"title":"OutcomeSummary"},"OutputFormat":{"type":"string","enum":["text","json","markdown","pdf","csv","hocr","alto","image","epub"],"title":"OutputFormat","description":"Output formats supported by providers."},"PageSelectionInfo":{"properties":{"pages":{"type":"string","title":"Pages","description":"The pages processed, in the source file's numbering, e.g. \"12-14\"."},"page_count":{"type":"integer","title":"Page Count","description":"How many pages are processed and charged."},"source_pages":{"type":"integer","title":"Source Pages","description":"Pages in the whole source file."}},"type":"object","required":["pages","page_count","source_pages"],"title":"PageSelectionInfo"},"PipelineDefinition":{"properties":{"steps":{"items":{"$ref":"#/components/schemas/StepDefinition"},"type":"array","minItems":1,"title":"Steps"}},"type":"object","required":["steps"],"title":"PipelineDefinition","description":"Complete pipeline with dependency validation."},"ProviderInfo":{"properties":{"id":{"type":"string","title":"Id"},"provider_key":{"type":"string","title":"Provider Key"},"display_name":{"type":"string","title":"Display Name"},"provider_type":{"$ref":"#/components/schemas/ProviderType"},"credits_per_page":{"type":"number","title":"Credits Per Page"},"api_type":{"$ref":"#/components/schemas/APIType"},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"},"supported_step_types":{"items":{"$ref":"#/components/schemas/StepType"},"type":"array","title":"Supported Step Types"},"supported_output_formats":{"items":{"$ref":"#/components/schemas/OutputFormat"},"type":"array","title":"Supported Output Formats"},"supports_vision":{"type":"boolean","title":"Supports Vision","default":true},"supports_structured_output":{"type":"boolean","title":"Supports Structured Output","default":false},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["id","provider_key","display_name","provider_type","credits_per_page","api_type","supported_step_types","supported_output_formats"],"title":"ProviderInfo","description":"Provider information returned by /api/v1/providers endpoint."},"ProviderListResponse":{"properties":{"providers":{"items":{"$ref":"#/components/schemas/ProviderInfo"},"type":"array","title":"Providers"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["providers","total"],"title":"ProviderListResponse","description":"Response for listing available providers."},"ProviderType":{"type":"string","enum":["vlm","traditional_ocr"],"title":"ProviderType","description":"Types of OCR/VLM providers."},"ResultContent":{"properties":{"result_id":{"type":"string","title":"Result Id"},"format":{"type":"string","title":"Format"},"media_type":{"type":"string","title":"Media Type"},"size_bytes":{"type":"integer","title":"Size Bytes"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"The result's text, for TXT results."},"data":{"anyOf":[{},{"type":"null"}],"title":"Data","description":"The parsed result, for JSON results."}},"type":"object","required":["result_id","format","media_type","size_bytes"],"title":"ResultContent"},"ResultDownload":{"properties":{"result_id":{"type":"string","title":"Result Id"},"filename":{"type":"string","title":"Filename"},"format":{"type":"string","title":"Format"},"media_type":{"type":"string","title":"Media Type"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes"},"url":{"type":"string","title":"Url","description":"Short-lived signed URL. GET it without an Authorization header."},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["result_id","filename","format","media_type","url","expires_at"],"title":"ResultDownload"},"RetranslateRequest":{"properties":{"artifact_id":{"type":"string","title":"Artifact Id"},"instruction":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Instruction"}},"type":"object","required":["artifact_id"],"title":"RetranslateRequest"},"ReviewOperation":{"properties":{"action":{"type":"string","enum":["edit","accept","restore"],"title":"Action"},"pointer":{"type":"string","maxLength":1000,"minLength":1,"title":"Pointer"},"value":{"title":"Value"}},"type":"object","required":["action","pointer"],"title":"ReviewOperation"},"ReviewedPatchBody":{"properties":{"expected_revision":{"type":"integer","minimum":0.0,"title":"Expected Revision"},"operations":{"items":{"$ref":"#/components/schemas/ReviewOperation"},"type":"array","maxItems":100,"minItems":1,"title":"Operations"}},"type":"object","required":["expected_revision","operations"],"title":"ReviewedPatchBody"},"SetProviderActiveBody":{"properties":{"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["is_active"],"title":"SetProviderActiveBody"},"SetSubscriptionBody":{"properties":{"tier_key":{"type":"string","minLength":1,"title":"Tier Key"},"status":{"type":"string","title":"Status","default":"active"},"current_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period End"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","default":false},"stripe_subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Subscription Id"},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id"},"grant_monthly_credits":{"type":"boolean","title":"Grant Monthly Credits","default":true}},"type":"object","required":["tier_key"],"title":"SetSubscriptionBody"},"SimplifySchemaBody":{"properties":{"schema":{"type":"object","title":"Schema"},"locale":{"type":"string","enum":["en","ar"],"title":"Locale","default":"en"}},"type":"object","required":["schema"],"title":"SimplifySchemaBody"},"SourceURL":{"properties":{"url":{"type":"string","maxLength":2048,"title":"Url","description":"Public https URL of a PDF or image. Fetched once, when the job is created."},"filename":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Filename","description":"Name to give the file. Defaults to the server's filename or the URL's last path segment."}},"additionalProperties":false,"type":"object","required":["url"],"title":"SourceURL"},"StepDefinition":{"properties":{"name":{"type":"string","title":"Name","description":"Unique step name (e.g., 'extract_text')"},"provider":{"type":"string","title":"Provider","description":"Provider to execute step (e.g., 'google_docai')"},"depends_on":{"items":{"type":"string"},"type":"array","title":"Depends On","description":"List of step names this depends on"},"settings":{"type":"object","title":"Settings","description":"Provider-specific settings"}},"type":"object","required":["name","provider"],"title":"StepDefinition","description":"Definition of a single pipeline step."},"StepType":{"type":"string","enum":["ocr","translate","summarize","extract","custom","create_searchable_pdf","create_epub"],"title":"StepType","description":"Types of processing steps supported by providers."},"SyncOCRFileResult":{"properties":{"text":{"type":"string","title":"Text","description":"Extracted text content"},"confidence":{"type":"number","title":"Confidence","description":"Confidence score (0-1)"},"service_used":{"$ref":"#/components/schemas/OCRService","description":"OCR service that produced this result"},"processing_time":{"type":"number","title":"Processing Time","description":"Processing time in seconds"},"metadata":{"type":"object","title":"Metadata","description":"Additional metadata"},"filename":{"type":"string","title":"Filename"},"pages":{"type":"integer","title":"Pages"},"artifact_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Artifact Url"},"artifact_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Artifact Id"},"job_item_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Job Item Id"},"step_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Step Id"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["text","confidence","service_used","processing_time","filename","pages"],"title":"SyncOCRFileResult"},"SyncOCRResponse":{"properties":{"status":{"type":"string","title":"Status"},"results":{"items":{"$ref":"#/components/schemas/SyncOCRFileResult"},"type":"array","title":"Results"},"credits_required":{"type":"integer","title":"Credits Required"},"user_id":{"type":"string","title":"User Id"},"job_id":{"type":"string","title":"Job Id"}},"type":"object","required":["status","results","credits_required","user_id","job_id"],"title":"SyncOCRResponse"},"UpdateJobRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"New job name"}},"type":"object","title":"UpdateJobRequest"},"UpdateProfileBody":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"is_admin":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Admin"}},"type":"object","title":"UpdateProfileBody"},"UpdateSubscriptionBody":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"current_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period End"},"cancel_at_period_end":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cancel At Period End"},"stripe_subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Subscription Id"},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id"}},"type":"object","title":"UpdateSubscriptionBody"},"UpdateTemplateBody":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"category":{"anyOf":[{"type":"string","enum":["transactions","form_fields","job_records","document_structure","custom"]},{"type":"null"}],"title":"Category"},"schema":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Schema"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"UpdateTemplateBody"},"UploadFileInfo":{"properties":{"id":{"type":"string","title":"Id"},"filename":{"type":"string","title":"Filename"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes"},"pages":{"anyOf":[{"type":"integer","maximum":2000.0,"minimum":1.0},{"type":"null"}],"title":"Pages"}},"type":"object","required":["id","filename"],"title":"UploadFileInfo"},"UploadUrlInfo":{"properties":{"filename":{"type":"string","title":"Filename"},"signed_url":{"type":"string","title":"Signed Url"},"gcs_uri":{"type":"string","title":"Gcs Uri"},"mime_type":{"type":"string","title":"Mime Type"},"file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Id"},"index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Index"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Headers"}},"type":"object","required":["filename","signed_url","gcs_uri","mime_type"],"title":"UploadUrlInfo"},"UploadUrlsRequest":{"properties":{"files":{"items":{"type":"string"},"type":"array","title":"Files","description":"List of filenames to upload"},"file_infos":{"anyOf":[{"items":{"$ref":"#/components/schemas/UploadFileInfo"},"type":"array"},{"type":"null"}],"title":"File Infos","description":"Per-file upload metadata. Preferred over files/file_pages because it is stable when multiple files have the same filename."},"file_pages":{"anyOf":[{"additionalProperties":{"type":"integer","maximum":2000.0,"minimum":1.0},"type":"object"},{"type":"null"}],"title":"File Pages","description":"Map of filename to page count"},"file_sizes":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"File Sizes","description":"Map of filename to file size in bytes"},"idempotency_key":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Idempotency Key","description":"Client-generated submission id. Reusing it returns stable upload paths and allows job creation to collapse request replays."}},"type":"object","title":"UploadUrlsRequest"},"UploadUrlsResponse":{"properties":{"urls":{"items":{"$ref":"#/components/schemas/UploadUrlInfo"},"type":"array","title":"Urls"},"batch_id":{"type":"string","title":"Batch Id"}},"type":"object","required":["urls","batch_id"],"title":"UploadUrlsResponse"},"ValidateSchemaBody":{"properties":{"schema":{"type":"object","title":"Schema"}},"type":"object","required":["schema"],"title":"ValidateSchemaBody"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}