{"openapi":"3.1.0","info":{"title":"PII Redaction API","description":"Extract text from documents, detect and redact PII across multiple languages, and summarize the clean output.","version":"2.0.0"},"paths":{"/admin/tiers":{"get":{"tags":["Admin"],"summary":"List subscription tiers","operationId":"list_tiers_admin_tiers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TierResponse"},"type":"array","title":"Response List Tiers Admin Tiers Get"}}}}}}},"/admin/orgs":{"get":{"tags":["Admin"],"summary":"List all organizations","operationId":"list_orgs_admin_orgs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgListResponse"}}}}}},"post":{"tags":["Admin"],"summary":"Create organization","operationId":"create_org_admin_orgs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrgRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/orgs/{org_id}":{"get":{"tags":["Admin"],"summary":"Get organization","operationId":"get_org_admin_orgs__org_id__get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/orgs/{org_id}/tier":{"patch":{"tags":["Admin"],"summary":"Change organization tier","operationId":"change_tier_admin_orgs__org_id__tier_patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeTierRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TierChangeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/orgs/{org_id}/suspend":{"post":{"tags":["Admin"],"summary":"Suspend organization","operationId":"suspend_org_admin_orgs__org_id__suspend_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/orgs/{org_id}/cancel":{"post":{"tags":["Admin"],"summary":"Cancel organization","operationId":"cancel_org_admin_orgs__org_id__cancel_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/orgs/{org_id}/reactivate":{"post":{"tags":["Admin"],"summary":"Reactivate organization","operationId":"reactivate_org_admin_orgs__org_id__reactivate_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/orgs/{org_id}/keys":{"post":{"tags":["Admin"],"summary":"Issue API key for an organization","operationId":"issue_key_admin_orgs__org_id__keys_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueKeyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Admin"],"summary":"List API keys for an organization","operationId":"list_keys_admin_orgs__org_id__keys_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: active | revoked | expired","title":"Status"},"description":"Filter by status: active | revoked | expired"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/keys/expired":{"delete":{"tags":["Admin"],"summary":"Bulk-delete all expired and revoked keys","operationId":"delete_expired_keys_admin_keys_expired_delete","parameters":[{"name":"org_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Limit cleanup to a specific org. Omit to clean all orgs.","title":"Org Id"},"description":"Limit cleanup to a specific org. Omit to clean all orgs."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteExpiredResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/keys/{key_id}":{"delete":{"tags":["Admin"],"summary":"Revoke an API key","operationId":"revoke_key_admin_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/orgs/{org_id}/users":{"post":{"tags":["Admin"],"summary":"Create a portal user for an organization","operationId":"create_user_admin_orgs__org_id__users_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"tags":["auth"],"summary":"Exchange email+password for a JWT","operationId":"login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["auth"],"summary":"Current session info","operationId":"me_auth_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me/usage":{"get":{"tags":["Portal"],"summary":"Usage for the logged-in org","operationId":"my_usage_me_usage_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me/keys":{"get":{"tags":["Portal"],"summary":"List my org's API keys","operationId":"list_my_keys_me_keys_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter: active | revoked | expired","title":"Status"},"description":"Filter: active | revoked | expired"},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Portal"],"summary":"Issue a new API key for my org","operationId":"issue_my_key_me_keys_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueKeyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me/keys/{key_id}":{"delete":{"tags":["Portal"],"summary":"Revoke one of my org's keys","operationId":"revoke_my_key_me_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me/tier":{"patch":{"tags":["Portal"],"summary":"Change my org's tier","operationId":"change_my_tier_me_tier_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeTierRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TierChangeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me/invoices":{"get":{"tags":["Portal"],"summary":"Invoices (coming soon — billing not yet integrated)","operationId":"my_invoices_me_invoices_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}}}},"/entities":{"get":{"summary":"List Entities","operationId":"list_entities_entities_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitiesResponse"}}}}}}},"/languages":{"get":{"summary":"List Languages","operationId":"list_languages_languages_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LanguagesResponse"}}}}}}},"/usage":{"get":{"summary":"Get usage summary","description":"Return today's and this month's request/token usage for the calling org.\n\nIncludes tier limits so clients can calculate remaining budget without\nneeding admin access.","operationId":"usage_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}}}}},"/redact":{"post":{"summary":"Redact","operationId":"redact_redact_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedactRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedactResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/process":{"post":{"summary":"Process File","operationId":"process_file_process_post","parameters":[{"name":"language","in":"query","required":false,"schema":{"type":"string","default":"auto","title":"Language"}},{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_process_file_process_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/summarize":{"post":{"summary":"Summarize","description":"Summarize PII-free text via OpenAI.\n\nRate limited by slowapi (hourly burst) and, when AUTH_MODE=api_key, the\norg's daily/monthly request quota (enforced in verify_auth before this\nhandler runs).\n\nQuota headers are included on every response so clients can self-throttle.","operationId":"summarize_summarize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummarizeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummarizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/patterns":{"get":{"tags":["patterns"],"summary":"List Patterns","operationId":"list_patterns_patterns_get","parameters":[{"name":"unit","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatternListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["patterns"],"summary":"Create Pattern","operationId":"create_pattern_patterns_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatternCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatternResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/patterns/units":{"get":{"tags":["patterns"],"summary":"List Units","operationId":"list_units_patterns_units_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessUnitsResponse"}}}}}}},"/patterns/{pattern_id}":{"delete":{"tags":["patterns"],"summary":"Delete Pattern","operationId":"delete_pattern_patterns__pattern_id__delete","parameters":[{"name":"pattern_id","in":"path","required":true,"schema":{"type":"string","title":"Pattern Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/patterns/test":{"post":{"tags":["patterns"],"summary":"Test Pattern","operationId":"test_pattern_patterns_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatternTestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatternTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat":{"post":{"summary":"Chat","operationId":"chat_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/extract":{"post":{"summary":"Extract","operationId":"extract_extract_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_extract_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ocr":{"post":{"summary":"Ocr","operationId":"ocr_ocr_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_ocr_ocr_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OCRResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/extract/batch":{"post":{"summary":"Extract Batch","operationId":"extract_batch_extract_batch_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_batch_extract_batch_post"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAcceptedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ocr/batch":{"post":{"summary":"Ocr Batch","operationId":"ocr_batch_ocr_batch_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_ocr_batch_ocr_batch_post"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAcceptedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}":{"get":{"summary":"Get Job Status","operationId":"get_job_status_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/transcribe":{"post":{"summary":"Transcribe","operationId":"transcribe_transcribe_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_transcribe_transcribe_post"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAcceptedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/transcribe/batch":{"post":{"summary":"Transcribe Batch","operationId":"transcribe_batch_transcribe_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscribeBatchRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAcceptedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ApiKeyResponse":{"properties":{"id":{"type":"string","title":"Id"},"key_prefix":{"type":"string","title":"Key Prefix"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","key_prefix","name","status","created_at"],"title":"ApiKeyResponse","description":"Safe key representation — never includes hash or raw key."},"BatchItemResponse":{"properties":{"filename":{"type":"string","title":"Filename"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"page_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Count"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["filename"],"title":"BatchItemResponse","description":"One item in a batch response — either a successful extraction or an error."},"Body_extract_batch_extract_batch_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_extract_batch_extract_batch_post"},"Body_extract_extract_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_extract_extract_post"},"Body_ocr_batch_ocr_batch_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_ocr_batch_ocr_batch_post"},"Body_ocr_ocr_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_ocr_ocr_post"},"Body_process_file_process_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_process_file_process_post"},"Body_transcribe_transcribe_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"locale":{"type":"string","title":"Locale","default":"en-US"}},"type":"object","required":["file"],"title":"Body_transcribe_transcribe_post"},"BusinessUnitsResponse":{"properties":{"units":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Units"}},"type":"object","required":["units"],"title":"BusinessUnitsResponse"},"ChangeTierRequest":{"properties":{"tier":{"type":"string","pattern":"^(free|starter|pro|enterprise)$","title":"Tier"}},"type":"object","required":["tier"],"title":"ChangeTierRequest"},"ChatMessage":{"properties":{"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"}},"type":"object","required":["role","content"],"title":"ChatMessage"},"ChatRequest":{"properties":{"message":{"type":"string","title":"Message"},"history":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","title":"History","default":[]},"document_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Context"}},"type":"object","required":["message"],"title":"ChatRequest"},"ChatResponse":{"properties":{"reply":{"type":"string","title":"Reply"}},"type":"object","required":["reply"],"title":"ChatResponse"},"CreateOrgRequest":{"properties":{"name":{"type":"string","maxLength":200,"minLength":2,"title":"Name"},"email":{"type":"string","maxLength":255,"minLength":5,"title":"Email"},"tier":{"type":"string","pattern":"^(free|starter|pro|enterprise)$","title":"Tier","default":"free"}},"type":"object","required":["name","email"],"title":"CreateOrgRequest"},"CreateUserRequest":{"properties":{"email":{"type":"string","maxLength":255,"minLength":5,"title":"Email"},"password":{"type":"string","maxLength":200,"minLength":8,"title":"Password"},"role":{"type":"string","pattern":"^(owner|member)$","title":"Role","default":"owner"}},"type":"object","required":["email","password"],"title":"CreateUserRequest"},"DeleteExpiredResponse":{"properties":{"deleted":{"type":"integer","title":"Deleted"},"message":{"type":"string","title":"Message"}},"type":"object","required":["deleted","message"],"title":"DeleteExpiredResponse"},"EntitiesResponse":{"properties":{"entities":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Entities"}},"type":"object","required":["entities"],"title":"EntitiesResponse"},"ExtractResponse":{"properties":{"text":{"type":"string","title":"Text"},"filename":{"type":"string","title":"Filename"},"file_type":{"type":"string","title":"File Type"},"page_count":{"type":"integer","title":"Page Count"},"model":{"type":"string","title":"Model"}},"type":"object","required":["text","filename","file_type","page_count","model"],"title":"ExtractResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IssueKeyRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","default":"Default"},"expires_in_days":{"anyOf":[{"type":"integer","maximum":3650.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Days","description":"Key lifetime in days. Omit for a non-expiring key."}},"type":"object","title":"IssueKeyRequest"},"IssueKeyResponse":{"properties":{"raw_key":{"type":"string","title":"Raw Key"},"key_prefix":{"type":"string","title":"Key Prefix"},"key_id":{"type":"string","title":"Key Id"},"org_id":{"type":"string","title":"Org Id"},"name":{"type":"string","title":"Name"},"created_at":{"type":"string","title":"Created At"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["raw_key","key_prefix","key_id","org_id","name","created_at"],"title":"IssueKeyResponse","description":"raw_key is shown exactly once — it cannot be retrieved again."},"JobAcceptedResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"kind":{"type":"string","title":"Kind"},"status":{"type":"string","title":"Status"},"file_count":{"type":"integer","title":"File Count"}},"type":"object","required":["job_id","kind","status","file_count"],"title":"JobAcceptedResponse","description":"Returned by POST /extract/batch and POST /ocr/batch (HTTP 202)."},"JobStatusResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"kind":{"type":"string","title":"Kind"},"status":{"type":"string","title":"Status"},"file_count":{"type":"integer","title":"File Count"},"completed_count":{"type":"integer","title":"Completed Count"},"results":{"anyOf":[{"items":{"$ref":"#/components/schemas/BatchItemResponse"},"type":"array"},{"type":"null"}],"title":"Results"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["job_id","kind","status","file_count","completed_count","created_at","updated_at"],"title":"JobStatusResponse","description":"Returned by GET /jobs/{job_id}.\n\n`results` is null while the job is pending/processing and populated once\nstatus is `completed`. `error` is populated only if the job itself failed\n(per-file errors live inside `results[].error`)."},"KeyListResponse":{"properties":{"keys":{"items":{"$ref":"#/components/schemas/ApiKeyResponse"},"type":"array","title":"Keys"}},"type":"object","required":["keys"],"title":"KeyListResponse"},"LanguagesResponse":{"properties":{"languages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Languages"}},"type":"object","required":["languages"],"title":"LanguagesResponse"},"LoginRequest":{"properties":{"email":{"type":"string","maxLength":255,"minLength":5,"title":"Email"},"password":{"type":"string","maxLength":200,"minLength":8,"title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"LoginResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"}},"type":"object","required":["access_token"],"title":"LoginResponse"},"MeResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"org_id":{"type":"string","title":"Org Id"},"org_name":{"type":"string","title":"Org Name"},"org_email":{"type":"string","title":"Org Email"},"org_status":{"type":"string","title":"Org Status"},"tier":{"type":"string","title":"Tier"},"tier_display_name":{"type":"string","title":"Tier Display Name"}},"type":"object","required":["user_id","email","role","org_id","org_name","org_email","org_status","tier","tier_display_name"],"title":"MeResponse","description":"Current session — user + org + tier in one payload."},"OCRResponse":{"properties":{"text":{"type":"string","title":"Text"},"filename":{"type":"string","title":"Filename"},"file_type":{"type":"string","title":"File Type"},"page_count":{"type":"integer","title":"Page Count"},"model":{"type":"string","title":"Model"}},"type":"object","required":["text","filename","file_type","page_count","model"],"title":"OCRResponse"},"OrgListResponse":{"properties":{"organizations":{"items":{"$ref":"#/components/schemas/OrgResponse"},"type":"array","title":"Organizations"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["organizations","total"],"title":"OrgListResponse"},"OrgResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"tier":{"type":"string","title":"Tier"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","name","email","tier","status","created_at"],"title":"OrgResponse"},"PatternCreateRequest":{"properties":{"entity_type":{"type":"string","minLength":2,"pattern":"^[A-Z][A-Z0-9_]{1,}$","title":"Entity Type","description":"Uppercase entity type identifier, e.g. MY_CUSTOM_ID"},"label":{"type":"string","maxLength":80,"minLength":2,"title":"Label","description":"Human-readable label"},"description":{"type":"string","maxLength":200,"title":"Description","description":"Optional description","default":""},"unit":{"type":"string","pattern":"^(construction|agriculture|geospatial|hr_legal)$","title":"Unit","description":"Business unit: construction | agriculture | geospatial | hr_legal"},"patterns":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Patterns","description":"List of regex patterns"},"context":{"items":{"type":"string"},"type":"array","title":"Context","description":"Context keywords that boost match confidence"},"score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Score","description":"Base confidence score (0–1)","default":0.8}},"type":"object","required":["entity_type","label","unit","patterns"],"title":"PatternCreateRequest"},"PatternListResponse":{"properties":{"patterns":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Patterns"}},"type":"object","required":["patterns"],"title":"PatternListResponse"},"PatternResponse":{"properties":{"id":{"type":"string","title":"Id"},"entity_type":{"type":"string","title":"Entity Type"},"label":{"type":"string","title":"Label"},"description":{"type":"string","title":"Description","default":""},"unit":{"type":"string","title":"Unit"},"patterns":{"items":{"type":"string"},"type":"array","title":"Patterns"},"context":{"items":{"type":"string"},"type":"array","title":"Context"},"score":{"type":"number","title":"Score"},"builtin":{"type":"boolean","title":"Builtin"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","entity_type","label","unit","patterns","context","score","builtin"],"title":"PatternResponse"},"PatternTestRequest":{"properties":{"patterns":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Patterns","description":"Regex patterns to test"},"sample_text":{"type":"string","minLength":1,"title":"Sample Text","description":"Text to run the patterns against"}},"type":"object","required":["patterns","sample_text"],"title":"PatternTestRequest"},"PatternTestResponse":{"properties":{"matches":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Matches"},"match_count":{"type":"integer","title":"Match Count"}},"type":"object","required":["matches","match_count"],"title":"PatternTestResponse"},"ProcessResponse":{"properties":{"original_text":{"type":"string","title":"Original Text"},"redacted_text":{"type":"string","title":"Redacted Text"},"entities_found":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Entities Found"},"entity_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Entity Counts"},"detected_language":{"type":"string","title":"Detected Language"},"filename":{"type":"string","title":"Filename"},"file_type":{"type":"string","title":"File Type"},"session_id":{"type":"string","title":"Session Id"}},"type":"object","required":["original_text","redacted_text","entities_found","entity_counts","detected_language","filename","file_type","session_id"],"title":"ProcessResponse"},"RedactRequest":{"properties":{"text":{"type":"string","minLength":1,"title":"Text","description":"Plain text to redact"},"language":{"type":"string","title":"Language","description":"ISO 639-1 code or 'auto' for auto-detection","default":"auto"},"entities":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Entities","description":"Entity IDs to scan for; omit for all"},"operator":{"type":"string","pattern":"^(replace|redact|mask|hash)$","title":"Operator","description":"Anonymization operator: replace | redact | mask | hash","default":"replace"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Groups related trace events in Log Analytics"}},"type":"object","required":["text"],"title":"RedactRequest"},"RedactResponse":{"properties":{"original_text":{"type":"string","title":"Original Text"},"redacted_text":{"type":"string","title":"Redacted Text"},"entities_found":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Entities Found"},"entity_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Entity Counts"},"detected_language":{"type":"string","title":"Detected Language"}},"type":"object","required":["original_text","redacted_text","entities_found","entity_counts","detected_language"],"title":"RedactResponse"},"RevokeKeyResponse":{"properties":{"key_id":{"type":"string","title":"Key Id"},"revoked":{"type":"boolean","title":"Revoked"}},"type":"object","required":["key_id","revoked"],"title":"RevokeKeyResponse"},"SummarizeRequest":{"properties":{"redacted_text":{"type":"string","minLength":1,"title":"Redacted Text","description":"PII-free text to summarize"},"length":{"type":"string","pattern":"^(short|medium|detailed)$","title":"Length","description":"Summary length: short | medium | detailed","default":"short"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Groups related trace events in Log Analytics"}},"type":"object","required":["redacted_text"],"title":"SummarizeRequest"},"SummarizeResponse":{"properties":{"summary":{"type":"string","title":"Summary"}},"type":"object","required":["summary"],"title":"SummarizeResponse"},"TierChangeResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"tier":{"type":"string","title":"Tier"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"},"daily_requests_used":{"type":"integer","title":"Daily Requests Used"},"monthly_requests_used":{"type":"integer","title":"Monthly Requests Used"},"new_daily_limit":{"type":"integer","title":"New Daily Limit"},"new_monthly_limit":{"type":"integer","title":"New Monthly Limit"},"over_daily_limit":{"type":"boolean","title":"Over Daily Limit"},"over_monthly_limit":{"type":"boolean","title":"Over Monthly Limit"}},"type":"object","required":["id","name","email","tier","status","created_at","daily_requests_used","monthly_requests_used","new_daily_limit","new_monthly_limit","over_daily_limit","over_monthly_limit"],"title":"TierChangeResponse","description":"Response for PATCH /admin/orgs/{id}/tier.\n\nIncludes current daily/monthly usage so the admin can immediately see\nif the org is now over the new tier's limits."},"TierResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"display_name":{"type":"string","title":"Display Name"},"requests_per_day":{"type":"integer","title":"Requests Per Day"},"requests_per_month":{"type":"integer","title":"Requests Per Month"},"tokens_per_month":{"type":"integer","title":"Tokens Per Month"},"max_file_size_mb":{"type":"integer","title":"Max File Size Mb"},"price_usd_cents":{"type":"integer","title":"Price Usd Cents"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["id","name","display_name","requests_per_day","requests_per_month","tokens_per_month","max_file_size_mb","price_usd_cents","is_active"],"title":"TierResponse"},"TranscribeBatchRequest":{"properties":{"sources":{"items":{"$ref":"#/components/schemas/TranscribeBatchSource"},"type":"array","minItems":1,"title":"Sources"},"locale":{"type":"string","title":"Locale","default":"en-US"}},"type":"object","required":["sources"],"title":"TranscribeBatchRequest"},"TranscribeBatchSource":{"properties":{"source_type":{"type":"string","pattern":"^(file_upload)$","title":"Source Type"},"data":{"type":"string","minLength":1,"title":"Data"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"}},"type":"object","required":["source_type","data"],"title":"TranscribeBatchSource","description":"One input to the bulk transcription endpoint.\n\n`source_type` must be \"file_upload\" — `data` is base64-encoded media bytes.\nWhisper does not accept remote URLs, so the previous \"blob_url\" / container\nexpansion paths were removed when we migrated off Azure Speech."},"UsagePeriod":{"properties":{"requests":{"type":"integer","title":"Requests"},"tokens_input":{"type":"integer","title":"Tokens Input"},"tokens_output":{"type":"integer","title":"Tokens Output"}},"type":"object","required":["requests","tokens_input","tokens_output"],"title":"UsagePeriod"},"UsageResponse":{"properties":{"org_id":{"type":"string","title":"Org Id"},"org_name":{"type":"string","title":"Org Name"},"tier":{"type":"string","title":"Tier"},"today":{"type":"string","title":"Today"},"billing_month":{"type":"string","title":"Billing Month"},"reset_day":{"type":"string","title":"Reset Day"},"reset_month":{"type":"string","title":"Reset Month"},"daily":{"$ref":"#/components/schemas/UsagePeriod"},"monthly":{"$ref":"#/components/schemas/UsagePeriod"},"limits":{"additionalProperties":true,"type":"object","title":"Limits","description":"Tier limits: requests_per_day, requests_per_month, tokens_per_month"}},"type":"object","required":["org_id","org_name","tier","today","billing_month","reset_day","reset_month","daily","monthly"],"title":"UsageResponse"},"UserResponse":{"properties":{"id":{"type":"string","title":"Id"},"org_id":{"type":"string","title":"Org Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"},"last_login_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Login At"}},"type":"object","required":["id","org_id","email","role","status","created_at"],"title":"UserResponse"},"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"}}}}