{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/signup":{"post":{"summary":"Signup","operationId":"signup_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/login":{"post":{"summary":"Login","operationId":"login_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/signout":{"post":{"summary":"Signout","operationId":"signout_signout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/forgot-password":{"post":{"summary":"Forgot Password","description":"Send a password-reset email.\n\nAlways returns success, even if the email doesn't exist, to prevent\nattackers from using this endpoint to enumerate accounts.","operationId":"forgot_password_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analyze":{"post":{"summary":"Analyze","operationId":"analyze_analyze_post","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_analyze_analyze_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/samples":{"get":{"summary":"List Samples","description":"Return metadata for the sample contracts available for testing.","operationId":"list_samples_samples_get","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/samples/{sample_id}":{"get":{"summary":"Download Sample","description":"Serve a sample contract PDF for download/preview.","operationId":"download_sample_samples__sample_id__get","parameters":[{"name":"sample_id","in":"path","required":true,"schema":{"type":"string","title":"Sample Id"}},{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rules":{"get":{"summary":"Get User Rules","operationId":"get_user_rules_rules_get","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Add Rule","operationId":"add_rule_rules_post","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddRuleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rules/{rule_id}":{"put":{"summary":"Update Rule","operationId":"update_rule_rules__rule_id__put","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer","title":"Rule Id"}},{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRuleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Rule","operationId":"delete_rule_rules__rule_id__delete","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer","title":"Rule Id"}},{"name":"authorization","in":"header","required":true,"schema":{"type":"string","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":"Toggle Rule","operationId":"toggle_rule_rules__rule_id__patch","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer","title":"Rule Id"}},{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToggleRuleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rules/samples":{"post":{"summary":"Add Sample Rules","description":"Insert the base sample rules for this user, up to their plan's cap.\n\nSkips any rule whose name already exists for this user, so calling it\ntwice is safe. Respects the tier's active-rule cap.","operationId":"add_sample_rules_rules_samples_post","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/history":{"get":{"summary":"Get History","operationId":"get_history_history_get","parameters":[{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"All","title":"Sort By"}},{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/history/{scan_id}":{"delete":{"summary":"Delete Audit Log","operationId":"delete_audit_log_history__scan_id__delete","parameters":[{"name":"scan_id","in":"path","required":true,"schema":{"type":"integer","title":"Scan Id"}},{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Audit Detail","operationId":"get_audit_detail_history__scan_id__get","parameters":[{"name":"scan_id","in":"path","required":true,"schema":{"type":"integer","title":"Scan Id"}},{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/recurring-risks":{"get":{"summary":"Get Recurring Risks","operationId":"get_recurring_risks_recurring_risks_get","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/export/history":{"get":{"summary":"Export History","operationId":"export_history_export_history_get","parameters":[{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"All","title":"Sort By"}},{"name":"export_format","in":"query","required":false,"schema":{"type":"string","default":"PDF","title":"Export Format"}},{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/export/recurring-risks":{"get":{"summary":"Export Recurring Risks","operationId":"export_recurring_risks_export_recurring_risks_get","parameters":[{"name":"export_format","in":"query","required":false,"schema":{"type":"string","default":"PDF","title":"Export Format"}},{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/export/rules":{"get":{"summary":"Export Rules","operationId":"export_rules_export_rules_get","parameters":[{"name":"export_format","in":"query","required":false,"schema":{"type":"string","default":"PDF","title":"Export Format"}},{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/export/history/{scan_id}":{"get":{"summary":"Export Audit Detail","operationId":"export_audit_detail_export_history__scan_id__get","parameters":[{"name":"scan_id","in":"path","required":true,"schema":{"type":"integer","title":"Scan Id"}},{"name":"export_format","in":"query","required":false,"schema":{"type":"string","default":"PDF","title":"Export Format"}},{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/send-to-team":{"post":{"summary":"Send To Team","operationId":"send_to_team_send_to_team_post","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendToTeamRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/create-checkout-session":{"post":{"tags":["billing"],"summary":"Create Checkout Session","operationId":"create_checkout_session_billing_create_checkout_session_post","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/redeem-beta":{"post":{"tags":["billing"],"summary":"Redeem Beta","operationId":"redeem_beta_billing_redeem_beta_post","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedeemBetaRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/portal":{"post":{"tags":["billing"],"summary":"Create Portal Session","operationId":"create_portal_session_billing_portal_post","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/subscription":{"get":{"tags":["billing"],"summary":"Get Subscription","operationId":"get_subscription_billing_subscription_get","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/features":{"get":{"tags":["billing"],"summary":"Get Features","operationId":"get_features_billing_features_get","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/scan-usage":{"get":{"tags":["billing"],"summary":"Get Scan Usage","operationId":"get_scan_usage_billing_scan_usage_get","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/account/data":{"delete":{"tags":["billing"],"summary":"Delete Account Data","operationId":"delete_account_data_billing_account_data_delete","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/account":{"delete":{"tags":["billing"],"summary":"Delete Account","operationId":"delete_account_billing_account_delete","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/webhook":{"post":{"tags":["billing"],"summary":"Stripe Webhook","operationId":"stripe_webhook_billing_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"summary":"Serve Index","operationId":"serve_index__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/tos":{"get":{"summary":"Serve Tos","operationId":"serve_tos_tos_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/refund":{"get":{"summary":"Serve Refund","operationId":"serve_refund_refund_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/reset-password":{"get":{"summary":"Serve Reset Password","operationId":"serve_reset_password_reset_password_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/hello":{"get":{"summary":"Say Hello","operationId":"say_hello_hello_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/test-db":{"get":{"summary":"Test Db","operationId":"test_db_test_db_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/test-email":{"get":{"summary":"Test Email","operationId":"test_email_test_email_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AddRuleRequest":{"properties":{"rule_name":{"type":"string","title":"Rule Name"},"rule_text":{"type":"string","title":"Rule Text"},"category":{"type":"string","title":"Category"},"severity":{"type":"string","title":"Severity","default":"High"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","default":""},"trigger_keywords":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Keywords","default":""},"redline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redline","default":""}},"type":"object","required":["rule_name","rule_text","category"],"title":"AddRuleRequest"},"Body_analyze_analyze_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"counterparty":{"type":"string","title":"Counterparty","default":""},"contract_type":{"type":"string","title":"Contract Type","default":""}},"type":"object","required":["file"],"title":"Body_analyze_analyze_post"},"CheckoutRequest":{"properties":{"plan":{"type":"string","title":"Plan"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["plan"],"title":"CheckoutRequest"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LoginRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"RedeemBetaRequest":{"properties":{"pin":{"type":"string","title":"Pin"}},"type":"object","required":["pin"],"title":"RedeemBetaRequest"},"RiskItem":{"properties":{"rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rank"},"rule":{"type":"string","title":"Rule"},"percentage":{"type":"number","title":"Percentage","default":0},"total_scans":{"type":"integer","title":"Total Scans","default":0}},"type":"object","required":["rule"],"title":"RiskItem"},"SendToTeamRequest":{"properties":{"kind":{"type":"string","title":"Kind"},"scan_id":{"anyOf":[{"type":"integer"},{"type":"string"},{"type":"null"}],"title":"Scan Id"},"items":{"items":{"$ref":"#/components/schemas/RiskItem"},"type":"array","title":"Items","default":[]},"recipients":{"items":{"type":"string"},"type":"array","title":"Recipients","default":[]},"subject":{"type":"string","title":"Subject","default":""},"message":{"type":"string","title":"Message","default":""}},"type":"object","required":["kind"],"title":"SendToTeamRequest"},"SignupRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"SignupRequest"},"ToggleRuleRequest":{"properties":{"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["is_active"],"title":"ToggleRuleRequest"},"UpdateRuleRequest":{"properties":{"rule_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Name"},"rule_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Text"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"trigger_keywords":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Keywords"},"redline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redline"}},"type":"object","title":"UpdateRuleRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}