{"openapi":"3.1.0","info":{"title":"JLFG Auth","version":"1.0"},"paths":{"/healthz":{"get":{"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/register":{"post":{"summary":"Register","operationId":"register_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/login":{"post":{"summary":"Login","operationId":"login_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/me":{"get":{"summary":"Me","operationId":"me_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/logout":{"post":{"summary":"Logout","operationId":"logout_v1_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/request-reset":{"post":{"summary":"Request Reset","operationId":"request_reset_v1_auth_request_reset_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestResetIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/update-profile":{"post":{"summary":"Update Profile","operationId":"update_profile_v1_auth_update_profile_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/change-password":{"post":{"summary":"Change Password","operationId":"change_password_v1_auth_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/account-referrals":{"get":{"summary":"Admin Account Referrals","description":"Operator-scope: recent referrer→referred account-signup relationships + aggregate.\nRenamed from /v1/admin/referrals to avoid colliding with the MCA broker partner system\nserved by a different backend at the /api/admin/referrals CF Pages path.","operationId":"admin_account_referrals_v1_admin_account_referrals_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/activity/firehose":{"get":{"summary":"Activity Firehose","description":"Operator-scope: returns activity across ALL users, not just self.\nRequires role='operator' or 'admin' on the requesting account.","operationId":"activity_firehose_v1_activity_firehose_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/activity/anomalies":{"get":{"summary":"Activity Anomalies","description":"Operator-scope quick anomaly summary — counts last N hours of failed logins,\ndistinct IPs, new accounts, etc. Used by the cron that ntfies the operator.","operationId":"activity_anomalies_v1_activity_anomalies_get","parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","default":24,"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/activity/recent":{"get":{"summary":"Activity Recent","operationId":"activity_recent_v1_activity_recent_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/subscriptions/upsert":{"post":{"summary":"Subscriptions Upsert","description":"Called by jlfg-parent's /api/webhooks/stripe handler when a subscription changes.\nAuth: shared MP_ADMIN_API_KEY (since it's machine-to-machine).","operationId":"subscriptions_upsert_v1_subscriptions_upsert_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionUpsertIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/subscriptions/me":{"get":{"summary":"Subscriptions Me","operationId":"subscriptions_me_v1_subscriptions_me_get","parameters":[{"name":"product","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/stripe/event-dedupe":{"post":{"summary":"Stripe Event Dedupe","description":"Returns {seen: true|false}. Idempotency for Stripe webhook handler:\ncaller passes {event_id, type, livemode}; if event_id was seen in last 7d\nreturns seen=true. Otherwise inserts + returns seen=false (process now).\nAuth: MP_ADMIN_API_KEY.","operationId":"stripe_event_dedupe_v1_stripe_event_dedupe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/referral/register":{"post":{"summary":"Referral Register","description":"Public — partner self-signup OR merchant lead intake (both create a row).","operationId":"referral_register_v1_referral_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerRegisterIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/referral/submit-deal":{"post":{"summary":"Referral Submit Deal","description":"Partner submits a deal. Validates partner_code, inserts referral_lead.","operationId":"referral_submit_deal_v1_referral_submit_deal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDealIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/referral/export":{"get":{"summary":"Referral Export","description":"Read-only export for the HubSpot sync routine. Single-purpose minted token.","operationId":"referral_export_v1_referral_export_get","parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/referral/my-deals":{"get":{"summary":"Referral My Deals","description":"List deals for the logged-in user's partner. An explicit ?partner_code= needs the admin key:\npartner codes travel in referral links, so a code alone must not unlock a partner's deal list.","operationId":"referral_my_deals_v1_referral_my_deals_get","parameters":[{"name":"partner_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partner Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/delete-account":{"post":{"summary":"Delete Account","operationId":"delete_account_v1_auth_delete_account_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/request-verify-email":{"post":{"summary":"Request Verify Email","description":"Mint a verify token for the currently-authenticated user, send via Resend.","operationId":"request_verify_email_v1_auth_request_verify_email_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/verify-email":{"get":{"summary":"Verify Email","description":"Consume a verify token, mark email_verified_at, redirect to /account/?verified=ok.\nReturns 302 redirect (matches the original CF Pages function's interface).","operationId":"verify_email_v1_auth_verify_email_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/reset-password":{"post":{"summary":"Reset Password","operationId":"reset_password_v1_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ChangePasswordIn":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","maxLength":200,"minLength":10,"title":"New Password"}},"type":"object","required":["current_password","new_password"],"title":"ChangePasswordIn"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LoginIn":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginIn"},"PartnerRegisterIn":{"properties":{"path":{"type":"string","pattern":"^(merchant|partner)$","title":"Path"},"contact_name":{"type":"string","maxLength":120,"minLength":2,"title":"Contact Name"},"contact_email":{"type":"string","format":"email","title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"state":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"State"},"monthly_revenue":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Revenue"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}},"type":"object","required":["path","contact_name","contact_email"],"title":"PartnerRegisterIn"},"RegisterIn":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":200,"minLength":10,"title":"Password"},"name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Name"},"referrer_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referrer Code"},"marketing_opt_in":{"type":"boolean","title":"Marketing Opt In","default":false}},"type":"object","required":["email","password"],"title":"RegisterIn"},"RequestResetIn":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"RequestResetIn"},"ResetPasswordIn":{"properties":{"token":{"type":"string","title":"Token"},"password":{"type":"string","maxLength":200,"minLength":10,"title":"Password"}},"type":"object","required":["token","password"],"title":"ResetPasswordIn"},"SubmitDealIn":{"properties":{"partner_code":{"type":"string","title":"Partner Code"},"merchant_name":{"type":"string","maxLength":200,"minLength":2,"title":"Merchant Name"},"merchant_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant Phone"},"merchant_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Merchant Email"},"state":{"type":"string","maxLength":2,"minLength":2,"title":"State"},"monthly_revenue":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Revenue"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"}},"type":"object","required":["partner_code","merchant_name","state"],"title":"SubmitDealIn"},"SubscriptionUpsertIn":{"properties":{"user_id":{"type":"string","title":"User Id"},"product":{"type":"string","title":"Product"},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"},"status":{"type":"string","title":"Status"},"stripe_subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Subscription Id"},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id"},"current_period_end":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Period End"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","default":false}},"type":"object","required":["user_id","product","status"],"title":"SubscriptionUpsertIn"},"UpdateProfileIn":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Name"},"marketing_opt_in":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Marketing Opt In"}},"type":"object","title":"UpdateProfileIn"},"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"}}}}