{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/api/v1/auth/create-setup-intent":{"post":{"tags":["authentication"],"summary":"Create Stripe SetupIntent","description":"Create a setup intent for collecting payment method during signup","operationId":"create_setup_intent_api_v1_auth_create_setup_intent_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Create Setup Intent Api V1 Auth Create Setup Intent Post"}}}}}}},"/api/v1/auth/login":{"post":{"tags":["authentication"],"summary":"User login","description":"Login with email and password to get access token","operationId":"login_api_v1_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/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/check-user":{"post":{"tags":["authentication"],"summary":"Check if user exists","description":"Check if user exists in auth.users table and validate credentials","operationId":"check_user_api_v1_auth_check_user_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckUserRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Check User Api V1 Auth Check User Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/check-email":{"post":{"tags":["authentication"],"summary":"Check if email is already registered","description":"Check if an email address is already registered in the system","operationId":"check_email_api_v1_auth_check_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Check Email Api V1 Auth Check Email Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/signup":{"post":{"tags":["authentication"],"summary":"User registration","description":"Register a new user account with additional profile information","operationId":"signup_api_v1_auth_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Signup Api V1 Auth Signup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/me":{"get":{"tags":["authentication"],"summary":"Get user profile","description":"Get the current user's profile information","operationId":"get_user_profile_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["authentication"],"summary":"Update user profile","description":"Update the current user's profile information","operationId":"update_user_profile_api_v1_auth_me_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/auth/logout":{"post":{"tags":["authentication"],"summary":"User logout","description":"Logout the current user","operationId":"logout_api_v1_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Logout Api V1 Auth Logout Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/auth/change-password":{"post":{"tags":["authentication"],"summary":"Change user password","description":"Change the current user's password","operationId":"change_password_api_v1_auth_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Change Password Api V1 Auth Change Password Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/auth/auth/google":{"get":{"tags":["authentication"],"summary":"Google OAuth callback","description":"Handle Google OAuth callback and create/authenticate user","operationId":"auth_google_callback_api_v1_auth_auth_google_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/dashboards/my":{"get":{"tags":["dashboards"],"summary":"Get user dashboard","description":"Get or create the current user's dashboard","operationId":"get_my_dashboard_api_v1_dashboards_my_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/dashboards/tasks/{task_id}":{"delete":{"tags":["dashboards"],"summary":"Terminate Task","description":"Terminate / cancel a specific task in the queue (admin action).","operationId":"terminate_task_api_v1_dashboards_tasks__task_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/dashboards/{dashboard_id}/reports":{"get":{"tags":["dashboards"],"summary":"Get Dashboard Reports","operationId":"get_dashboard_reports_api_v1_dashboards__dashboard_id__reports_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"dashboard_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dashboard Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sheets/create-sheet":{"post":{"tags":["sheets"],"summary":"Create a new Google Sheet","description":"Creates a new Google Sheet with the provided license records and returns the sheet ID","operationId":"create_sheet_api_v1_sheets_create_sheet_post","requestBody":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/LicenseRecord"},"type":"array","title":"Records"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SheetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sheets/sample-data":{"get":{"tags":["sheets"],"summary":"Get sample data","description":"Returns sample license records for testing purposes","operationId":"get_sample_data_api_v1_sheets_sample_data_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/LicenseRecord"},"type":"array","title":"Response Get Sample Data Api V1 Sheets Sample Data Get"}}}}}}},"/api/v1/sheets/write-to-sheet":{"post":{"tags":["sheets"],"summary":"Write to existing sheet","description":"Append new records to an existing Google Sheet","operationId":"write_records_api_v1_sheets_write_to_sheet_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SheetWriteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SheetOperationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sheets/update-sheet":{"post":{"tags":["sheets"],"summary":"Update existing records","description":"Update existing records in a Google Sheet based on record ID","operationId":"update_records_api_v1_sheets_update_sheet_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SheetUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SheetOperationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/":{"get":{"tags":["reports"],"summary":"Get all reports","description":"Returns all reports for the current user with license statistics","operationId":"get_reports_api_v1_reports__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Report"},"type":"array","title":"Response Get Reports Api V1 Reports  Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["reports"],"summary":"Create a new report","description":"Creates a new report with Google Sheet integration","operationId":"create_report_api_v1_reports__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/reports/{report_id}":{"get":{"tags":["reports"],"summary":"Get report by ID","description":"Returns a specific report by its ID with license statistics","operationId":"get_report_api_v1_reports__report_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["reports"],"summary":"Update report","description":"Updates an existing report","operationId":"update_report_api_v1_reports__report_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["reports"],"summary":"Delete report","description":"Deletes a report and its associated data","operationId":"delete_report_api_v1_reports__report_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Report Api V1 Reports  Report Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/{report_id}/licenses":{"get":{"tags":["reports"],"summary":"Get report licenses","description":"Get all licenses associated with a report","operationId":"get_report_licenses_api_v1_reports__report_id__licenses_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportLicense"},"title":"Response Get Report Licenses Api V1 Reports  Report Id  Licenses Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/my":{"get":{"tags":["reports"],"summary":"Get my reports","description":"Returns all reports for the authenticated user with license statistics","operationId":"get_my_reports_api_v1_reports_my_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Report"},"type":"array","title":"Response Get My Reports Api V1 Reports My Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/reports/{report_id}/status":{"get":{"tags":["reports"],"summary":"Get license status","description":"Returns license status for a report","operationId":"get_license_status_api_v1_reports__report_id__status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/trigger-update":{"post":{"tags":["reports"],"summary":"Trigger manual report update","description":"Manually triggers the update_all_reports function","operationId":"trigger_update_api_v1_reports_trigger_update_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Trigger Update Api V1 Reports Trigger Update Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/reports/count":{"get":{"tags":["reports"],"summary":"Get report count","description":"Returns the current report count and limits for the user","operationId":"get_report_count_api_v1_reports_count_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Report Count Api V1 Reports Count Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/reports/":{"post":{"tags":["reports v2"],"summary":"Create a new report","description":"Creates a new report with Google Sheet integration","operationId":"create_report_api_v2_reports__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/reports/api/create":{"post":{"tags":["reports v2"],"summary":"Create a new report via API","description":"Creates a new report using API key authentication. This endpoint is designed for programmatic access via API keys.","operationId":"create_report_api_api_v2_reports_api_create_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/reports/npi/lookup":{"post":{"tags":["reports v2"],"summary":"Look up provider by NPI number","description":"Looks up a provider's name and credential by their 10-digit NPI number using the NPPES NPI Registry.","operationId":"npi_lookup_api_v2_reports_npi_lookup_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"npi_number","in":"query","required":true,"schema":{"type":"string","minLength":10,"maxLength":10,"description":"10-digit NPI number","title":"Npi Number"},"description":"10-digit NPI number"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NPILookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/npi/search":{"post":{"tags":["reports v2"],"summary":"Search licenses by NPI number","description":"Resolves the provider name from the NPI number, then searches the license database for matching records in the specified state.","operationId":"npi_search_licenses_api_v2_reports_npi_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NPISearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ReportLicense"},"type":"array","title":"Response Npi Search Licenses Api V2 Reports Npi Search Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/reports/npi/all-licenses":{"post":{"tags":["reports v2"],"summary":"List a physician's licenses across ALL states by NPI","description":"Returns every medical license Licensy has on file for a physician, across all states, resolved by NPI. Unlike /npi/search (one state, name-matched), this reads the curated report anchored to the NPI, so it does not over-match same-name physicians. Each record includes status, issue/expiration dates, and (when available) a primary-source screenshot.","operationId":"npi_all_licenses_api_v2_reports_npi_all_licenses_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"npi_number","in":"query","required":true,"schema":{"type":"string","minLength":10,"maxLength":10,"description":"10-digit NPI number","title":"Npi Number"},"description":"10-digit NPI number"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportLicense"},"title":"Response Npi All Licenses Api V2 Reports Npi All Licenses Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/{report_id}/link-npi":{"post":{"tags":["reports v2"],"summary":"Anchor a report to an NPI and re-match its licenses to that physician","description":"Resolves the physician's name (and middle name) from the NPI, sets the report's npi_number, and soft-removes licenses that belong to a DIFFERENT same-name physician (by middle-name mismatch). This is how a customer cleans up a name-matched report that conflated multiple people: supply the correct NPI and the report is reduced to that person's licenses. Pruned licenses are soft-deleted (restorable), never hard-deleted. Safe guards: if NPPES has no middle name, or if 0 licenses match the NPI's name, nothing is pruned (the report is never emptied).","operationId":"link_report_to_npi_api_v2_reports__report_id__link_npi_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkNpiRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkNpiResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/npi/create-report":{"post":{"tags":["reports v2"],"summary":"Create report by NPI number","description":"Resolves the provider name from the NPI number, then creates a license report with the selected states.","operationId":"create_report_by_npi_api_v2_reports_npi_create_report_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NPIReportCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/reports/npi/bulk-create-reports":{"post":{"tags":["reports v2"],"summary":"Bulk: create one report per NPI","description":"Onboard an entire credentialing roster in one call. Accepts up to 200 NPI numbers, resolves each to a provider name, and creates a report per NPI with the same license_type + states settings. NPIs that fail to resolve (or that already have a report under this user) are reported per-row; the rest still get created. Caller is expected to handle partial-success — check `entries[]` for which succeeded.","operationId":"bulk_create_reports_by_npi_api_v2_reports_npi_bulk_create_reports_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkNpiReportCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkNpiReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/reports/nursys/create-by-ncsbn":{"post":{"tags":["reports v2"],"summary":"Create nurse report by NCSBN ID","description":"Creates a nurse license report keyed on the NCSBN ID — the global unique identifier for U.S. nurses. Routes through Nursys e-Notify rather than the state-board scrapers.","operationId":"create_nurse_report_by_ncsbn_api_v2_reports_nursys_create_by_ncsbn_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NursysNCSBNReportCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/reports/nursys/discover-ncsbn":{"post":{"tags":["reports v2"],"summary":"Discover an NCSBN ID from a license number","description":"Submits a Nursys nurselookup keyed on (jurisdiction, license_type, license_number). Returns a transaction_id; the client polls the /nursys/transaction/{id} endpoint until processing_complete=true and reads the NCSBN ID off the response.","operationId":"discover_ncsbn_id_api_v2_reports_nursys_discover_ncsbn_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NursysDiscoverNCSBNRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/reports/nursys/enroll-and-lookup":{"post":{"tags":["reports v2"],"summary":"Enroll a nurse on our Nursys list and queue a follow-up lookup","description":"Submits Nursys managenurselist to add the nurse to our institution's nurse list (required before nurselookup will return any data). Once the enrollment lands, the polling worker auto-chains a nurselookup so the license details flow into the report. First-time enrollment requires last-4 SSN and birth year per Nursys spec A.7 — Nursys verifies these against board-of-nursing data.","operationId":"enroll_and_lookup_api_v2_reports_nursys_enroll_and_lookup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NursysEnrollAndLookupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/reports/nursys/transaction/{transaction_id}":{"get":{"tags":["reports v2"],"summary":"Read a queued Nursys transaction","description":"Returns the persisted nursys_transactions row for the given TransactionId. Status flows: submitted → processing → completed/failed. When status='completed', response_payload holds the result.","operationId":"read_nursys_transaction_api_v2_reports_nursys_transaction__transaction_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","title":"Transaction Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/license/create-report":{"post":{"tags":["reports v2"],"summary":"Create report by license numbers","description":"Create a license report by providing specific license numbers and states. Checks the local DB first, then falls back to the live scraper for each license.","operationId":"create_report_by_license_numbers_api_v2_reports_license_create_report_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseNumberReportCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/reports/{report_id}/refresh":{"post":{"tags":["reports v2"],"summary":"Refresh report — re-scrape all selected states","description":"Triggers a background re-scrape for the report's selected states to pick up any missing licenses.","operationId":"refresh_report_api_v2_reports__report_id__refresh_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/{report_id}":{"delete":{"tags":["reports v2"],"summary":"Delete report","description":"Deletes a report and its associated data","operationId":"delete_report_api_v2_reports__report_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Report Api V2 Reports  Report Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/{report_id}/licenses":{"post":{"tags":["reports v2"],"summary":"Add a license to a report","description":"Manually attach a license to a report. Looks up tbl_medical_license first; if no match, inserts a Pending row in `licenses` for the daily updater to populate.","operationId":"add_license_to_report_api_v2_reports__report_id__licenses_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseAddRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportLicense"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["reports v2"],"summary":"Get report licenses","description":"Get all licenses associated with a report","operationId":"get_report_licenses_api_v2_reports__report_id__licenses_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"include_hidden","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Hidden"}},{"name":"live_and_recent","in":"query","required":false,"schema":{"type":"boolean","description":"When true, return only live licenses plus ones that expired within recent_expired_days","default":false,"title":"Live And Recent"},"description":"When true, return only live licenses plus ones that expired within recent_expired_days"},{"name":"recent_expired_days","in":"query","required":false,"schema":{"type":"integer","maximum":3650,"minimum":0,"description":"How recently (in days) a license must have expired to still be returned when live_and_recent is true","default":30,"title":"Recent Expired Days"},"description":"How recently (in days) a license must have expired to still be returned when live_and_recent is true"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportLicense"},"title":"Response Get Report Licenses Api V2 Reports  Report Id  Licenses Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/licenses/{license_id}/history":{"get":{"tags":["reports v2"],"summary":"Point-in-time snapshots for a single license","description":"Returns the change-history of one license row from license_snapshots, with a 'change_type' field per entry summarizing what flipped from the previous snapshot ('status_change', 'expiry_change', 'unchanged', 'initial'). Used by the report-detail page's history drawer + by credentialing audits — point-in-time answers to 'was this physician licensed on date X'.","operationId":"get_license_history_api_v2_reports_licenses__license_id__history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"string","title":"License Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/{report_id}/licenses.csv":{"get":{"tags":["reports v2"],"summary":"Download a report's licenses as CSV","description":"Same data shape as GET /{report_id}/licenses, formatted as CSV. Common columns: state, license_number, license_type, status, issued, expired, professional. Use ?include_hidden=true to also include attachments the user has hidden.","operationId":"get_report_licenses_csv_api_v2_reports__report_id__licenses_csv_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"include_hidden","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Hidden"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/{report_id}/licenses.xlsx":{"get":{"tags":["reports v2"],"summary":"Download a report's licenses as XLSX (Excel)","description":"Same data shape as the CSV export, served as a native Excel workbook. Credentialing teams asked for this — most of their downstream tooling (e.g. compliance trackers) expects .xlsx rather than CSV. Includes a styled header row + auto-sized columns. Use ?include_hidden=true to also include hidden refs.","operationId":"get_report_licenses_xlsx_api_v2_reports__report_id__licenses_xlsx_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"include_hidden","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Hidden"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/{report_id}/licenses/{license_id}/hide":{"patch":{"tags":["reports v2"],"summary":"Hide license in report","description":"Marks a report-linked license as hidden (per-report)","operationId":"hide_license_in_report_api_v2_reports__report_id__licenses__license_id__hide_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"license_id","in":"path","required":true,"schema":{"type":"string","title":"License Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Hide License In Report Api V2 Reports  Report Id  Licenses  License Id  Hide Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/{report_id}/licenses/{license_id}/delete":{"patch":{"tags":["reports v2"],"summary":"Mark license as deleted in report","description":"Marks a report-linked license as deleted (per-report). Deleted licenses remain in the report but are excluded from PDF, sheet, and counts.","operationId":"delete_license_in_report_api_v2_reports__report_id__licenses__license_id__delete_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"license_id","in":"path","required":true,"schema":{"type":"string","title":"License Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete License In Report Api V2 Reports  Report Id  Licenses  License Id  Delete Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/{report_id}/licenses/{license_id}/restore-deleted":{"patch":{"tags":["reports v2"],"summary":"Restore deleted license in report","description":"Marks a report-linked license as not deleted (per-report)","operationId":"restore_deleted_license_in_report_api_v2_reports__report_id__licenses__license_id__restore_deleted_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"license_id","in":"path","required":true,"schema":{"type":"string","title":"License Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Restore Deleted License In Report Api V2 Reports  Report Id  Licenses  License Id  Restore Deleted Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/{report_id}/licenses/{license_id}/restore":{"patch":{"tags":["reports v2"],"summary":"Restore license in report","description":"Marks a report-linked license as visible again (per-report)","operationId":"restore_license_in_report_api_v2_reports__report_id__licenses__license_id__restore_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"license_id","in":"path","required":true,"schema":{"type":"string","title":"License Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Restore License In Report Api V2 Reports  Report Id  Licenses  License Id  Restore Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/{report_id}/licenses/{license_id}/renewed":{"post":{"tags":["reports v2"],"summary":"Acknowledge a license renewal","description":"Marks a license on this report as 'I renewed this' so reminders stop nagging until either (a) 90 days pass, or (b) the scraper picks up the new expiration on its next sweep. Optional renewed_to body field lets the user record the new expiration date they obtained from the state board, for the credentialing team's records.","operationId":"acknowledge_license_renewal_api_v2_reports__report_id__licenses__license_id__renewed_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"license_id","in":"path","required":true,"schema":{"type":"string","title":"License Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RenewalAckBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Acknowledge License Renewal Api V2 Reports  Report Id  Licenses  License Id  Renewed Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["reports v2"],"summary":"Clear a license renewal acknowledgment","description":"Reverses 'I renewed this' — reminders for this license will resume on the next cron run.","operationId":"clear_license_renewal_api_v2_reports__report_id__licenses__license_id__renewed_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"license_id","in":"path","required":true,"schema":{"type":"string","title":"License Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Clear License Renewal Api V2 Reports  Report Id  Licenses  License Id  Renewed Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/{report_id}/licenses/{license_id}":{"delete":{"tags":["reports v2"],"summary":"Remove license from report","description":"Removes a license from a report; deletes the global license if orphaned","operationId":"remove_license_from_report_api_v2_reports__report_id__licenses__license_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"license_id","in":"path","required":true,"schema":{"type":"string","title":"License Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Remove License From Report Api V2 Reports  Report Id  Licenses  License Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/licenses/{license_id}":{"patch":{"tags":["reports v2"],"summary":"Hide license (legacy)","description":"Legacy endpoint: use /{report_id}/licenses/{license_id}/hide instead","operationId":"update_license_api_v2_reports_licenses__license_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"string","title":"License Id"}},{"name":"report_id","in":"query","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update License Api V2 Reports Licenses  License Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["reports v2"],"summary":"Remove license (legacy)","description":"Legacy endpoint: use /{report_id}/licenses/{license_id} instead","operationId":"remove_license_api_v2_reports_licenses__license_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"string","title":"License Id"}},{"name":"report_id","in":"query","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Remove License Api V2 Reports Licenses  License Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reports/recalculate-all-stats":{"post":{"tags":["reports v2"],"summary":"Recalculate license statistics for all reports","description":"Recalculates total/active/expiring/expired counts for every report owned by the current user using the canonical dedup + 60-day logic.","operationId":"recalculate_all_stats_api_v2_reports_recalculate_all_stats_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Recalculate All Stats Api V2 Reports Recalculate All Stats Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/reports/{report_id}/generate-pdf":{"get":{"tags":["reports v2"],"summary":"Generate license document PDF","description":"Generates a PDF document containing license information for a report","operationId":"generate_license_pdf_endpoint_api_v2_reports__report_id__generate_pdf_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/credentials/":{"get":{"tags":["credentials"],"summary":"Get user credentials and usage limits","description":"Get or create user usage limits information","operationId":"get_credentials_api_v1_credentials__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialResponse"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["credentials"],"summary":"Regenerate credential key","description":"Generate a new unique credential key for the user","operationId":"regenerate_credential_key_api_v1_credentials__patch","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Credential"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/stripe/webhook":{"post":{"tags":["stripe"],"summary":"Stripe Webhook","operationId":"stripe_webhook_api_v1_stripe_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/stripe/create-checkout-session":{"post":{"tags":["stripe"],"summary":"Create Checkout Session","operationId":"create_checkout_session_api_v1_stripe_create_checkout_session_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/stripe/current-plan":{"get":{"tags":["stripe"],"summary":"Get Current Plan","operationId":"get_current_plan_api_v1_stripe_current_plan_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentPlanResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/stripe/setup-free-plan":{"post":{"tags":["stripe"],"summary":"Setup Free Plan","operationId":"setup_free_plan_api_v1_stripe_setup_free_plan_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/sync/usage-limits":{"post":{"tags":["sync v2"],"summary":"Sync usage limits end dates","description":"Synchronizes user_usage_limits end_dates with subscription periods","operationId":"sync_usage_limits_api_v2_sync_usage_limits_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Sync Usage Limits Api V2 Sync Usage Limits Post"}}}}}}},"/api/v2/notifications/send-license-status":{"post":{"tags":["notifications v2"],"summary":"Send consolidated license status notifications","description":"Sends email notifications for all expired and expiring licenses across reports","operationId":"send_license_status_api_v2_notifications_send_license_status_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Send License Status Api V2 Notifications Send License Status Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/notifications/send-license-report":{"post":{"tags":["notifications v2"],"summary":"Send comprehensive license report","description":"Sends detailed report of all licenses across all reports (Premium plan only)","operationId":"send_license_report_api_api_v2_notifications_send_license_report_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Send License Report Api Api V2 Notifications Send License Report Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/notifications/send-all-premium-reports":{"post":{"tags":["notifications v2"],"summary":"Send license reports to all premium users","description":"Sends detailed license reports to all users with premium plans","operationId":"send_all_premium_reports_api_v2_notifications_send_all_premium_reports_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Send All Premium Reports Api V2 Notifications Send All Premium Reports Post"}}}}}}},"/api/v2/notifications/sendgrid-config":{"get":{"tags":["notifications v2"],"summary":"Check SendGrid configuration","description":"Check SendGrid API key and configuration (admin only)","operationId":"check_sendgrid_config_api_v2_notifications_sendgrid_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Check Sendgrid Config Api V2 Notifications Sendgrid Config Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/notifications/test-sendgrid":{"post":{"tags":["notifications v2"],"summary":"Test SendGrid email sending","description":"Send a test email to verify SendGrid configuration","operationId":"test_sendgrid_email_api_v2_notifications_test_sendgrid_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Request"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Test Sendgrid Email Api V2 Notifications Test Sendgrid Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/notifications/send-premium-expiration-notifications":{"post":{"tags":["notifications v2"],"summary":"Send expiration notifications to all users","description":"Sends notifications about expired and soon-to-expire licenses to all users with reports","operationId":"send_premium_expiration_notifications_api_v2_notifications_send_premium_expiration_notifications_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Send Premium Expiration Notifications Api V2 Notifications Send Premium Expiration Notifications Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/notifications/slack-notification":{"post":{"tags":["notifications v2"],"summary":"Send Notification","description":"Send a notification to Slack channel with reCAPTCHA v2 verification","operationId":"send_notification_api_v2_notifications_slack_notification_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackNotificationSchema"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/notifications/{report_id}/send-expired-license-report":{"post":{"tags":["notifications v2"],"summary":"Send license report to user","description":"Sends a license report to the user associated with the report","operationId":"send_license_report_api_api_v2_notifications__report_id__send_expired_license_report_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Send License Report Api Api V2 Notifications  Report Id  Send Expired License Report Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/notifications/{report_id}/send-license-report":{"post":{"tags":["notifications v2"],"summary":"Send license report to user","description":"Sends a license report to the user associated with the report","operationId":"send_license_report_api_api_v2_notifications__report_id__send_license_report_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Send License Report Api Api V2 Notifications  Report Id  Send License Report Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/users":{"get":{"tags":["admin"],"summary":"Get All Users","description":"Get users list (admin = all users; org staff = users within their orgs)","operationId":"get_all_users_api_v2_admin_users_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by email or name","title":"Search"},"description":"Search by email or name"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserDetail"},"title":"Response Get All Users Api V2 Admin Users Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/users/{user_id}":{"delete":{"tags":["admin"],"summary":"Delete User","description":"Delete user and all related entities except licenses (admin only)\n\nDeletion order:\n1. user_usage_limits, user_subscriptions\n2. payment_history\n3. license_update_status (based on user's reports)\n4. reports\n5. profiles and auth.users\n\nNote: Licenses in the licenses table are preserved (not deleted with the user).","operationId":"delete_user_api_v2_admin_users__user_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete User Api V2 Admin Users  User Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["admin"],"summary":"Get User","description":"Get user details (admin = full; org staff = basic info if user is in their org)","operationId":"get_user_api_v2_admin_users__user_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["admin"],"summary":"Update User","description":"Update user data (admin only)","operationId":"update_user_api_v2_admin_users__user_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/users/{user_id}/temp-credits":{"post":{"tags":["admin"],"summary":"Add Temp Report Credits","description":"Add temporary report credits to a user (admin only)","operationId":"add_temp_report_credits_api_v2_admin_users__user_id__temp_credits_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TempCreditsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Add Temp Report Credits Api V2 Admin Users  User Id  Temp Credits Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/users/{user_id}/temp-credits/reduce":{"post":{"tags":["admin"],"summary":"Reduce Temp Report Credits","description":"Reduce temporary report credits from a user (admin only)","operationId":"reduce_temp_report_credits_api_v2_admin_users__user_id__temp_credits_reduce_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TempCreditsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reduce Temp Report Credits Api V2 Admin Users  User Id  Temp Credits Reduce Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/plans":{"get":{"tags":["admin"],"summary":"Get Plans","description":"Get all available plans (admin only)","operationId":"get_plans_api_v2_admin_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{},"type":"array","title":"Response Get Plans Api V2 Admin Plans Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/sentry-debug-test":{"get":{"tags":["admin"],"summary":"Throw a test exception to verify Sentry capture is live (admin only)","description":"Deliberately raises a ZeroDivisionError. If SENTRY_DSN is set and init_sentry() has run, the exception fires to Sentry within ~60s. Use this once after configuring a new DSN to confirm events are flowing. No customer-facing side effects.","operationId":"sentry_debug_test_api_v2_admin_sentry_debug_test_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/users/{user_id}/subscription":{"put":{"tags":["admin"],"summary":"Admin Update Subscription","description":"Admin override to change a user's subscription plan","operationId":"admin_update_subscription_api_v2_admin_users__user_id__subscription_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSubscriptionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Update Subscription Api V2 Admin Users  User Id  Subscription Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/stats":{"get":{"tags":["admin"],"summary":"Get Admin Stats","description":"Get dashboard statistics (admin only)","operationId":"get_admin_stats_api_v2_admin_stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/check-scraper-status":{"post":{"tags":["admin"],"summary":"Check Scraper Status","description":"Trigger scraper status check via License_Scraper_Central.\nThis ensures proper task-to-worker mapping and routing.\nReturns immediately while the check runs in the background.","operationId":"check_scraper_status_api_v2_admin_check_scraper_status_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Check Scraper Status Api V2 Admin Check Scraper Status Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/mcp/usage":{"get":{"tags":["admin"],"summary":"MCP usage stats over the last N hours (admin)","description":"Aggregated counts from mcp_usage_log. Tail the recent calls for live monitoring during a launch announcement. Cached for 30s — pass ?refresh=true to force a fresh aggregation.","operationId":"mcp_usage_api_v2_admin_mcp_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"window_hours","in":"query","required":false,"schema":{"type":"integer","maximum":720,"minimum":1,"description":"Window size in hours.","default":24,"title":"Window Hours"},"description":"Window size in hours."},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean","description":"Bypass cache and re-aggregate.","default":false,"title":"Refresh"},"description":"Bypass cache and re-aggregate."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpUsageSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/users/recent-signups":{"get":{"tags":["admin"],"summary":"Most recent signups + whether they've actually called MCP (admin)","description":"Returns the last N users sorted by signup time. For each, includes whether they've ever made an MCP call, when their first one was, what tool they hit first, and what client (Claude Desktop / curl / etc.) — so you can spot stalled users (signed up never called) and early adopters worth reaching out to.","operationId":"recent_signups_api_v2_admin_users_recent_signups_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"only_stalled","in":"query","required":false,"schema":{"type":"boolean","description":"When true, return ONLY signups that have never made an MCP call yet. Use for outreach to people who got blocked.","default":false,"title":"Only Stalled"},"description":"When true, return ONLY signups that have never made an MCP call yet. Use for outreach to people who got blocked."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RecentSignupEntry"},"title":"Response Recent Signups Api V2 Admin Users Recent Signups Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/users/lookup":{"get":{"tags":["admin"],"summary":"Look up a user by email — full MCP usage detail (admin)","description":"Returns the user's plan + their full MCP usage history (totals, last 24h, last 30d, breakdown by tool / client, last 25 calls). Used when a customer DMs about a problem and you need context.","operationId":"user_lookup_api_v2_admin_users_lookup_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","description":"The user's email address (exact match).","title":"Email"},"description":"The user's email address (exact match)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/feedback":{"get":{"tags":["admin"],"summary":"Customer feedback queue (admin)","description":"Read feedback_log. Filter by kind / status; sorted newest-first. Use this to triage bug reports + feature requests instead of scrolling Slack history.","operationId":"admin_feedback_list_api_v2_admin_feedback_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"bug | feature | question | other","title":"Kind"},"description":"bug | feature | question | other"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"new | acknowledged | done | wontfix","title":"Status"},"description":"new | acknowledged | done | wontfix"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/feedback/{feedback_id}":{"patch":{"tags":["admin"],"summary":"Update feedback row status / notes (admin)","description":"Mark a feedback row as acknowledged / done / wontfix and attach optional notes. Stamps responded_at + responded_by automatically when status flips out of 'new'.","operationId":"admin_feedback_update_api_v2_admin_feedback__feedback_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"feedback_id","in":"path","required":true,"schema":{"type":"integer","title":"Feedback Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackEntry"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/licenses/search":{"get":{"tags":["admin"],"summary":"Search license rows by NPI / state / license_number (admin)","description":"Find license rows matching any combination of (npi, state, license_number, full_name). For each hit, resolves which reports (and which customer email) reference it. Used by support when a customer DMs 'is this license tracked?' without having to navigate through their report.","operationId":"admin_license_search_api_v2_admin_licenses_search_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"npi","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"10-digit NPI — resolves via reports.npi_number","title":"Npi"},"description":"10-digit NPI — resolves via reports.npi_number"},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"State name, exact match","title":"State"},"description":"State name, exact match"},{"name":"license_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"License number (case-insensitive partial match)","title":"License Number"},"description":"License number (case-insensitive partial match)"},{"name":"full_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Full name substring (case-insensitive)","title":"Full Name"},"description":"Full name substring (case-insensitive)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/scraper-health":{"get":{"tags":["admin"],"summary":"Per-state scraper health + recent history (admin)","description":"Reads scraper_health_log written by the daily-scraper-health cron. Returns the most recent run (per-state OK/BAD), a compact history for trend charting, and a per-state consecutive-BAD streak so we can see which states have been broken for a while (not just a one-off blip).","operationId":"admin_scraper_health_api_v2_admin_scraper_health_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Number of recent runs to return","default":30,"title":"Limit"},"description":"Number of recent runs to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScraperHealthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/scraper-smoke":{"get":{"tags":["admin"],"summary":"Daily scraper smoke-suite outcomes (admin)","description":"Reads scraper_smoke_log written by the daily smoke-suite cron. Returns the most-recent per-state outcome + a compact 14-run history per state for sparkline trend charts. Drives the admin view that surfaces 'which state board started failing this morning' before anyone notices in customer support.","operationId":"admin_scraper_smoke_api_v2_admin_scraper_smoke_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"history_per_state","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"Rows per state in the history dict","default":14,"title":"History Per State"},"description":"Rows per state in the history dict"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmokeSuiteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/scraper-smoke/run-now":{"post":{"tags":["admin"],"summary":"Trigger the scraper smoke-suite on demand (admin)","description":"Runs the smoke suite immediately and returns its summary. Useful after deploying a scraper fix.","operationId":"admin_run_scraper_smoke_now_api_v2_admin_scraper_smoke_run_now_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Run Scraper Smoke Now Api V2 Admin Scraper Smoke Run Now Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/system-info":{"get":{"tags":["admin"],"summary":"Build + runtime metadata for this backend process (admin)","operationId":"admin_system_info_api_v2_admin_system_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemInfoResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/cron/jobs":{"get":{"tags":["admin"],"summary":"List background cron jobs + next-run times (admin)","description":"Introspects the APScheduler scheduler that runs inside this uvicorn process. Surfaces job ids, names, next scheduled run, and trigger description so we can spot crons that have silently stopped firing.","operationId":"admin_cron_jobs_api_v2_admin_cron_jobs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CronJobsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/active-users":{"get":{"tags":["admin"],"summary":"DAU / WAU / MAU rollup (admin)","description":"Counts distinct account_id values in mcp_usage_log over the last 24h / 7d / 30d windows, plus total call volumes and 7-day signup count. Useful as the top-line health metric on the admin dashboard. Falls back to zeros if mcp_usage_log is empty.","operationId":"admin_active_users_api_v2_admin_active_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveUsersResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/cron/runs":{"get":{"tags":["admin"],"summary":"Cron run history (admin)","description":"Reads cron_run_log written by the APScheduler EVENT_JOB_EXECUTED / EVENT_JOB_ERROR listeners. Returns the most recent N rows plus a per-job rollup so we can see which crons are persistently failing vs which had a one-off blip. Filterable by job_id.","operationId":"admin_cron_runs_api_v2_admin_cron_runs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":2000,"minimum":1,"default":200,"title":"Limit"}},{"name":"job_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to a single job_id","title":"Job Id"},"description":"Filter to a single job_id"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CronRunHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/audit-log":{"get":{"tags":["admin"],"summary":"Read admin_audit_log (admin)","description":"Returns the most recent admin-action records: who looked up what customer, who suspended/unsuspended whom, who retried which webhook. Filter by admin_email or endpoint substring.","operationId":"admin_audit_log_api_v2_admin_audit_log_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":2000,"minimum":1,"default":200,"title":"Limit"}},{"name":"admin_email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to actions by this admin email","title":"Admin Email"},"description":"Filter to actions by this admin email"},{"name":"endpoint_contains","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Substring filter on the endpoint path","title":"Endpoint Contains"},"description":"Substring filter on the endpoint path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/mcp/errors":{"get":{"tags":["admin"],"summary":"Recent MCP errors with affected user emails (admin)","description":"Reads mcp_usage_log for success=false rows in the window. Joins user_usage_limits for email so you can reply to whoever was affected. Last 200 by default — same surface the per-error Slack cron uses, but on-demand instead of streaming.","operationId":"admin_mcp_errors_api_v2_admin_mcp_errors_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"window_hours","in":"query","required":false,"schema":{"type":"integer","maximum":720,"minimum":1,"default":24,"title":"Window Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpErrorsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/usage/by-customer":{"get":{"tags":["admin"],"summary":"Per-customer MCP usage rankings (admin)","description":"Reads mcp_usage_log over the last N days, groups by account_id, and joins user_usage_limits for email + tier. Sorted by total calls desc. Use to spot top users (champions worth interviewing) and quiet ones (churn risk).","operationId":"usage_by_customer_api_v2_admin_usage_by_customer_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"window_days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":7,"title":"Window Days"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/webhooks/deliveries":{"get":{"tags":["admin"],"summary":"Cross-customer webhook delivery stats (admin)","description":"Aggregates webhook_deliveries over the last N days. Surfaces the URLs that are failing most often (likely customer endpoints that need a heads-up) and the last 25 dead-letters for quick triage.","operationId":"admin_webhook_deliveries_api_v2_admin_webhooks_deliveries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"window_days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":7,"title":"Window Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/webhooks/deliveries/{delivery_id}/retry":{"post":{"tags":["admin"],"summary":"Admin override: re-queue a webhook delivery (any customer)","description":"Same as /me/webhook-deliveries/{id}/retry but without owner check. Use from the cross-customer dashboard to retry a flaky customer's delivery without waiting for them to do it themselves. Audit-logged.","operationId":"admin_retry_delivery_api_v2_admin_webhooks_deliveries__delivery_id__retry_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","title":"Delivery Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/badge/usage":{"get":{"tags":["admin"],"summary":"Embed-badge usage stats over the last N days (admin)","description":"Aggregates badge_request_log. Tells you if any third-party medical groups have actually embedded /badge.js yet. Top referer domains are the most important signal — non-licensy.ai hosts mean the bet is paying off.","operationId":"badge_usage_api_v2_admin_badge_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"window_days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":7,"title":"Window Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadgeUsageSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/users/{user_id}/suspend":{"post":{"tags":["admin"],"summary":"Suspend a user (reversible) — audit-logged, Slack-alerted (admin)","description":"Bans the user via Supabase Auth's banned_until until either the specified duration expires or /unsuspend is called. Records the reason in admin_audit_log and pings Slack so the team knows the action was taken. Reports + license data are preserved — only the user's ability to authenticate is blocked.","operationId":"suspend_user_api_v2_admin_users__user_id__suspend_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuspendUserRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuspendUserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/users/{user_id}/unsuspend":{"post":{"tags":["admin"],"summary":"Unsuspend a previously-suspended user (admin)","description":"Clears the banned_until field and marks is_active=true. Audit-logged.","operationId":"unsuspend_user_api_v2_admin_users__user_id__unsuspend_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuspendUserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/reports/audit":{"get":{"tags":["admin"],"summary":"Audit all reports for orphan-deletes + over-attached license patterns (admin)","description":"Walks every report and surfaces any with (a) attachments marked deleted=true that don't have a real (state, license_number) competitor in the same report, or (b) more visible licenses than the over-attached threshold (likely name-match pollution). Use this BEFORE a customer complains — runs in seconds for the current customer base.","operationId":"audit_reports_api_v2_admin_reports_audit_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"over_attached_threshold","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":10,"description":"Reports with more than N visible licenses get flagged.","default":75,"title":"Over Attached Threshold"},"description":"Reports with more than N visible licenses get flagged."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportAuditResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/webhooks/test-fire":{"post":{"tags":["admin"],"summary":"Test-fire a webhook against a URL + secret (admin)","description":"Synthesizes a license-change event payload, signs it with HMAC-SHA256 using the provided signing_secret, and POSTs it to webhook_url with the same headers the production dispatcher uses. Returns the full round-trip so you can verify the customer endpoint accepted (or rejected) the delivery and whether its signature verification passed. Does not touch webhook_subscriptions or webhook_deliveries — fully isolated from production state.","operationId":"test_fire_webhook_api_v2_admin_webhooks_test_fire_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestFireRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestFireResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/credentials/":{"get":{"tags":["admin"],"summary":"List Credentials","operationId":"list_credentials_api_v2_admin_credentials__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApiCredentialResponse"},"type":"array","title":"Response List Credentials Api V2 Admin Credentials  Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["admin"],"summary":"Create Credential","operationId":"create_credential_api_v2_admin_credentials__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiCredentialCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiCredentialWithSecret"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/credentials/{user_id}/revoke":{"patch":{"tags":["admin"],"summary":"Revoke Credential","operationId":"revoke_credential_api_v2_admin_credentials__user_id__revoke_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/settings/":{"get":{"tags":["admin"],"summary":"Get All Settings","operationId":"get_all_settings_api_v2_admin_settings__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/settings/{key}":{"get":{"tags":["admin"],"summary":"Get Setting","operationId":"get_setting_api_v2_admin_settings__key__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"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":"Update Setting","operationId":"update_setting_api_v2_admin_settings__key__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/subscriptions/":{"get":{"tags":["admin"],"summary":"Get Subscriptions","description":"Admin subscriptions list.\n\nPreviously did 3 N+1 lookups per row (auth.users, plans, payment_methods).\nFor 50 subs that was 151 round-trips. Now: 1 query for the subs + 1\nbatched lookup per related table = 4 total trips regardless of fleet size.","operationId":"get_subscriptions_api_v2_admin_subscriptions__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/workers":{"get":{"tags":["admin"],"summary":"Get Workers","description":"Get all workers (admin only)","operationId":"get_workers_api_v2_admin_workers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["admin"],"summary":"Create Worker","description":"Add a new worker (admin only)","operationId":"create_worker_api_v2_admin_workers_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/workers/health":{"get":{"tags":["admin"],"summary":"Check Workers Health","description":"Check health of all workers (admin only)","operationId":"check_workers_health_api_v2_admin_workers_health_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"enabled_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only check enabled workers","default":false,"title":"Enabled Only"},"description":"Only check enabled workers"},{"name":"include_disabled","in":"query","required":false,"schema":{"type":"boolean","description":"Include disabled workers in results","default":true,"title":"Include Disabled"},"description":"Include disabled workers in results"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/test-search":{"get":{"tags":["admin"],"summary":"Test Search","description":"Proxy search_by_name request to central scraper server for testing (admin only).\nBackend handles polling and returns final result.","operationId":"test_search_api_v2_admin_test_search_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"state_name","in":"query","required":true,"schema":{"type":"string","description":"US state name","title":"State Name"},"description":"US state name"},{"name":"last_name","in":"query","required":true,"schema":{"type":"string","description":"Licensee's last name","title":"Last Name"},"description":"Licensee's last name"},{"name":"first_name","in":"query","required":false,"schema":{"type":"string","description":"Licensee's first name","default":"","title":"First Name"},"description":"Licensee's first name"},{"name":"middle_name","in":"query","required":false,"schema":{"type":"string","description":"Licensee's middle name","default":"","title":"Middle Name"},"description":"Licensee's middle name"},{"name":"license_type","in":"query","required":false,"schema":{"type":"string","description":"Type of medical license","default":"MD","title":"License Type"},"description":"Type of medical license"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/workers/{worker_id}":{"get":{"tags":["admin"],"summary":"Get Worker","description":"Get a specific worker (admin only)","operationId":"get_worker_api_v2_admin_workers__worker_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"worker_id","in":"path","required":true,"schema":{"type":"string","title":"Worker Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin"],"summary":"Update Worker","description":"Update a worker (admin only)","operationId":"update_worker_api_v2_admin_workers__worker_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"worker_id","in":"path","required":true,"schema":{"type":"string","title":"Worker Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin"],"summary":"Delete Worker","description":"Delete a worker (admin only)","operationId":"delete_worker_api_v2_admin_workers__worker_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"worker_id","in":"path","required":true,"schema":{"type":"string","title":"Worker Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/workers/{worker_id}/deploy":{"post":{"tags":["admin"],"summary":"Deploy Worker","description":"Deploy updates to a specific worker (admin only).\nExecutes git pull and pm2 restart on the remote worker.","operationId":"deploy_worker_api_v2_admin_workers__worker_id__deploy_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"worker_id","in":"path","required":true,"schema":{"type":"string","title":"Worker Id"}},{"name":"git_branch","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Git branch to pull","default":"main","title":"Git Branch"},"description":"Git branch to pull"},{"name":"pm2_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"PM2 process ID to restart","title":"Pm2 Id"},"description":"PM2 process ID to restart"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/workers/{worker_id}/restart":{"post":{"tags":["admin"],"summary":"Restart Worker","description":"Restart a specific worker process (admin only).\nExecutes pm2 restart on the remote worker.","operationId":"restart_worker_api_v2_admin_workers__worker_id__restart_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"worker_id","in":"path","required":true,"schema":{"type":"string","title":"Worker Id"}},{"name":"pm2_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"PM2 process ID to restart","title":"Pm2 Id"},"description":"PM2 process ID to restart"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/workers/{worker_id}/logs":{"get":{"tags":["admin"],"summary":"Get Worker Logs","description":"Get application logs from a specific worker (admin only).\nRetrieves the last N lines of logs from the worker.","operationId":"get_worker_logs_api_v2_admin_workers__worker_id__logs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"worker_id","in":"path","required":true,"schema":{"type":"string","title":"Worker Id"}},{"name":"lines","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"description":"Number of log lines to retrieve","default":1000,"title":"Lines"},"description":"Number of log lines to retrieve"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/restart":{"post":{"tags":["admin"],"summary":"Restart Central Server","description":"Restart the License_Scraper_Central server (admin only).\nProxies to the central scraper's POST /api/v1/restart endpoint.","operationId":"restart_central_server_api_v2_admin_restart_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/central_server/logs":{"get":{"tags":["admin"],"summary":"Get Central Server Logs","description":"Get application logs from the central scraping server (admin only).\nRetrieves the last N lines of application logs.","operationId":"get_central_server_logs_api_v2_admin_central_server_logs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lines","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"description":"Number of log lines to retrieve","default":1000,"title":"Lines"},"description":"Number of log lines to retrieve"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/workers/{worker_id}/resource_usage":{"get":{"tags":["admin"],"summary":"Get Worker Resource Usage","description":"Get resource usage (CPU, RAM, disk) from a specific worker (admin only).\nReturns real-time system resource metrics.","operationId":"get_worker_resource_usage_api_v2_admin_workers__worker_id__resource_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"worker_id","in":"path","required":true,"schema":{"type":"string","title":"Worker Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/workers/{worker_id}/statistics":{"get":{"tags":["admin"],"summary":"Get Worker Statistics","description":"Get request statistics for a specific worker (admin only).\nReturns both daily and total statistics.","operationId":"get_worker_statistics_api_v2_admin_workers__worker_id__statistics_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"worker_id","in":"path","required":true,"schema":{"type":"string","title":"Worker Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/workers/statistics/all":{"get":{"tags":["admin"],"summary":"Get All Workers Statistics","description":"Get request statistics for all workers (admin only).\nReturns both daily and total statistics for each worker.","operationId":"get_all_workers_statistics_api_v2_admin_workers_statistics_all_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/workers/{worker_id}/statistics/history":{"get":{"tags":["admin"],"summary":"Get Worker Statistics History","description":"Get historical statistics for a specific worker from database (admin only).","operationId":"get_worker_statistics_history_api_v2_admin_workers__worker_id__statistics_history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"worker_id","in":"path","required":true,"schema":{"type":"string","title":"Worker Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"description":"Number of days to retrieve","default":30,"title":"Days"},"description":"Number of days to retrieve"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/workers/{worker_id}/execute_command":{"post":{"tags":["admin"],"summary":"Execute Worker Command","description":"Execute a shell command on a specific worker (admin only).\nReturns the command output (stdout, stderr, return code).","operationId":"execute_worker_command_api_v2_admin_workers__worker_id__execute_command_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"worker_id","in":"path","required":true,"schema":{"type":"string","title":"Worker Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteCommandRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/workers/statistics/flush":{"post":{"tags":["admin"],"summary":"Flush Statistics","description":"Manually trigger flush of statistics to database (admin only).","operationId":"flush_statistics_api_v2_admin_workers_statistics_flush_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"worker_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Worker ID to flush (optional)","title":"Worker Id"},"description":"Worker ID to flush (optional)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/workers/statistics/clear":{"post":{"tags":["admin"],"summary":"Clear Statistics","description":"Clear request statistics for workers (admin only).\nClears in-memory and database counts for the given worker or all workers.","operationId":"clear_statistics_api_v2_admin_workers_statistics_clear_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"worker_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Worker ID to clear (optional, clears all if not provided)","title":"Worker Id"},"description":"Worker ID to clear (optional, clears all if not provided)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/workers/capacity":{"get":{"tags":["admin"],"summary":"Get Workers Capacity","description":"Get real-time capacity information for all workers (admin only).\nReturns current browser usage and available slots for each worker.","operationId":"get_workers_capacity_api_v2_admin_workers_capacity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/license-submissions/":{"get":{"tags":["admin","admin-license-submissions"],"summary":"List License Submissions","description":"List license submissions (admin only)","operationId":"list_license_submissions_api_v2_admin_license_submissions__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"Number of records to return","default":50,"title":"Limit"},"description":"Number of records to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","description":"Offset for pagination","default":0,"title":"Offset"},"description":"Offset for pagination"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LicenseSubmissionDetail"},"title":"Response List License Submissions Api V2 Admin License Submissions  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/license-submissions/{submission_id}":{"get":{"tags":["admin","admin-license-submissions"],"summary":"Get License Submission","description":"Get details of a specific license submission with PDF URL (admin only)","operationId":"get_license_submission_api_v2_admin_license_submissions__submission_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"submission_id","in":"path","required":true,"schema":{"type":"string","title":"Submission Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get License Submission Api V2 Admin License Submissions  Submission Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/license-submissions/{submission_id}/pdf-url":{"get":{"tags":["admin","admin-license-submissions"],"summary":"Get Pdf Url","description":"Get signed URL for PDF (admin only)","operationId":"get_pdf_url_api_v2_admin_license_submissions__submission_id__pdf_url_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"submission_id","in":"path","required":true,"schema":{"type":"string","title":"Submission Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Get Pdf Url Api V2 Admin License Submissions  Submission Id  Pdf Url Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/license-submissions/{submission_id}/approve":{"post":{"tags":["admin","admin-license-submissions"],"summary":"Approve License Submission","description":"Approve a license submission and upsert to database (admin only)","operationId":"approve_license_submission_api_v2_admin_license_submissions__submission_id__approve_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"submission_id","in":"path","required":true,"schema":{"type":"string","title":"Submission Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionApprovalRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Approve License Submission Api V2 Admin License Submissions  Submission Id  Approve Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/license-submissions/{submission_id}/reject":{"post":{"tags":["admin","admin-license-submissions"],"summary":"Reject License Submission","description":"Reject a license submission (admin only)","operationId":"reject_license_submission_api_v2_admin_license_submissions__submission_id__reject_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"submission_id","in":"path","required":true,"schema":{"type":"string","title":"Submission Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionApprovalRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reject License Submission Api V2 Admin License Submissions  Submission Id  Reject Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/npi/seed":{"post":{"tags":["admin","admin-npi"],"summary":"Trigger full NPI seed","description":"Downloads the full NPPES dissemination file (~1.1GB) and imports all individual providers. Runs in the background. If a previous seed was interrupted, it resumes from where it left off.","operationId":"trigger_seed_api_v2_admin_npi_seed_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/npi/weekly-update":{"post":{"tags":["admin","admin-npi"],"summary":"Trigger weekly NPI update","description":"Downloads the latest weekly NPPES delta file (~6MB) and upserts changed records.","operationId":"trigger_weekly_update_api_v2_admin_npi_weekly_update_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/npi/status":{"get":{"tags":["admin","admin-npi"],"summary":"Get latest NPI update status","description":"Returns the most recent entry from npi_weekly_update_status.","operationId":"get_npi_status_api_v2_admin_npi_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/npi/stats":{"get":{"tags":["admin","admin-npi"],"summary":"Get NPI table statistics","description":"Returns the total row count and latest updated_at from npi_providers.","operationId":"get_npi_stats_api_v2_admin_npi_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/nursys/connectivity":{"get":{"tags":["admin","admin-nursys"],"summary":"Smoke-test Nursys API connectivity","description":"Issues a no-op nurselookup with a deliberately invalid request to verify NURSYS_BASE_URL is reachable and the credentials are accepted. The submission will register as 'failed' on the Nursys side, but the round-trip proves auth works.","operationId":"nursys_connectivity_api_v2_admin_nursys_connectivity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectivityResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/nursys/rotate-password":{"post":{"tags":["admin","admin-nursys"],"summary":"Rotate the Nursys API password","description":"Calls /changepassword and returns the result. On success the caller MUST update NURSYS_PASSWORD in .env.local with the same new value (the server-side rotation is canonical, but the running process keeps using the old password until env is reloaded).","operationId":"rotate_nursys_password_api_v2_admin_nursys_rotate_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotatePasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/nursys/queue":{"get":{"tags":["admin","admin-nursys"],"summary":"Snapshot of the Nursys transaction queue","description":"Counts of nursys_transactions rows by status for monitoring.","operationId":"nursys_queue_stats_api_v2_admin_nursys_queue_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueStatsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/admin/nursys/poll-once":{"post":{"tags":["admin","admin-nursys"],"summary":"Trigger one Nursys polling pass","description":"Drains a batch of due transactions immediately rather than waiting for the every-2-min scheduler. Useful for testing after submitting a smoke-test transaction.","operationId":"nursys_poll_once_api_v2_admin_nursys_poll_once_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/auth/me":{"get":{"tags":["auth"],"summary":"Get Current User Info","operationId":"get_current_user_info_api_v2_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/auth/check-trial":{"get":{"tags":["auth"],"summary":"Check Trial Status","description":"Check if a user is eligible for trial access to a specific plan\n\nArgs:\n    plan_type: The type of plan (e.g., 'individual', 'business')\n    plan_name: The name of the plan (e.g., 'basic', 'premium')\n    \nReturns:\n    Dict containing trial eligibility status","operationId":"check_trial_status_api_v2_auth_check_trial_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"plan_type","in":"query","required":true,"schema":{"type":"string","title":"Plan Type"}},{"name":"plan_name","in":"query","required":true,"schema":{"type":"string","title":"Plan Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Check Trial Status Api V2 Auth Check Trial Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/auth/verify-reset-token":{"post":{"tags":["auth"],"summary":"Verify Reset Token","description":"Verify a password reset token and return the associated email\n\nArgs:\n    code: The password reset code\n    \nReturns:\n    Dict containing email and token validity","operationId":"verify_reset_token_api_v2_auth_verify_reset_token_post","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/auth/reset-password":{"post":{"tags":["auth"],"summary":"Reset Password","description":"Reset a user's password using a valid reset code\n\nArgs:\n    request: ResetPasswordRequest containing code, email, and new password\n    \nReturns:\n    Dict containing success status","operationId":"reset_password_api_v2_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/mcp-usage":{"get":{"tags":["me"],"summary":"My MCP usage (logged-in user)","operationId":"my_mcp_usage_api_v2_me_mcp_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyMcpUsageResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/me/mcp-usage.csv":{"get":{"tags":["me"],"summary":"Download my MCP call history as CSV","description":"Returns a CSV of every MCP call we have for the authenticated user. Use `days` to limit the window (default 90, max matches retention window). One row per call: timestamp, tool, client hint, tier at time of call, success boolean, latency_ms, error_code.","operationId":"my_mcp_usage_csv_api_v2_me_mcp_usage_csv_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":90,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/webhook-subscriptions":{"get":{"tags":["me"],"summary":"My webhook subscriptions","operationId":"my_webhook_subscriptions_api_v2_me_webhook_subscriptions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WebhookSubscriptionView"},"type":"array","title":"Response My Webhook Subscriptions Api V2 Me Webhook Subscriptions Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/me/webhook-subscriptions/{subscription_id}":{"patch":{"tags":["me"],"summary":"Edit one of my webhook subscriptions (npis + events)","description":"Replace the NPI watchlist or event-type filter on a subscription. Owner-checked. webhook_url and signing_secret are NOT editable here — rotate the secret via the dedicated endpoint, or cancel + re-subscribe to change the URL.","operationId":"patch_my_webhook_subscription_api_v2_me_webhook_subscriptions__subscription_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["me"],"summary":"Cancel one of my webhook subscriptions","operationId":"cancel_my_webhook_subscription_api_v2_me_webhook_subscriptions__subscription_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/webhook-subscriptions/{subscription_id}/deliveries":{"get":{"tags":["me"],"summary":"Recent webhook deliveries for one of my subscriptions","operationId":"my_webhook_deliveries_api_v2_me_webhook_subscriptions__subscription_id__deliveries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryView"},"title":"Response My Webhook Deliveries Api V2 Me Webhook Subscriptions  Subscription Id  Deliveries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/allowed-ips":{"get":{"tags":["me"],"summary":"Get the IP allowlist on my REST API key","operationId":"my_allowed_ips_api_v2_me_allowed_ips_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedIpsResponse"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["me"],"summary":"Set the IP allowlist on my REST API key","description":"Pass an empty array to disable the allowlist (all IPs allowed). Pass IP literals or CIDR ranges to restrict. Note: this only applies to REST API requests authenticated via the credential_key header. MCP server requests are unaffected.","operationId":"my_set_allowed_ips_api_v2_me_allowed_ips_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedIpsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedIpsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/me/email-preferences":{"get":{"tags":["me"],"summary":"Get my email-channel opt-ins","operationId":"my_email_preferences_api_v2_me_email_preferences_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailPreferences"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["me"],"summary":"Set my email-channel opt-ins","description":"Toggle non-transactional email channels. Transactional emails (account-security, account-deletion confirmations) are not affected — they always send.","operationId":"set_my_email_preferences_api_v2_me_email_preferences_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailPreferences"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailPreferences"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/me/audit":{"get":{"tags":["me"],"summary":"Recent security + preference events on my account","description":"Returns the customer's most recent self-serve actions: IP allowlist edits, email-preference changes, webhook signing-key rotations, license-renewal acknowledgments, account exports + deletion attempts. Useful for credentialing-team compliance reviews — gives the account owner a paper trail of who changed what on the account.","operationId":"my_audit_log_api_v2_me_audit_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/reports/health":{"get":{"tags":["me"],"summary":"My report-portfolio health summary","description":"Bird's-eye view of every license on every report this user owns: totals + counts at 7/30/60-day expiration horizons + count of already-expired licenses + count of records we haven't refreshed in >14 days. Powers the Overview-page health widget so customers see their portfolio's state without clicking through every report.","operationId":"my_reports_health_api_v2_me_reports_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyReportsHealth"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/me/feedback":{"post":{"tags":["me"],"summary":"Submit feedback (free-text → Slack)","description":"Customers can drop a bug report, feature request, or question from anywhere in the app. Always succeeds — failures to ping Slack are logged but the user gets a 200 either way.","operationId":"submit_feedback_api_v2_me_feedback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/me/account/export":{"get":{"tags":["me"],"summary":"Download a JSON bundle of all my account data (GDPR-style)","description":"Returns a single JSON document with the authenticated user's profile, plan, MCP usage history (last 365 days), webhook subscriptions, recent webhook deliveries, and reports they own. Streamed with Content-Disposition so it downloads to disk. The complement to /account/delete — gives customers a copy before they leave.","operationId":"export_my_account_api_v2_me_account_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/me/account/delete":{"post":{"tags":["me"],"summary":"Self-serve account deletion (irreversible)","description":"Delete the authenticated user's account + all associated data. Required: `confirm_email` body field must exactly match the authenticated user's email — this is the confirm-by-typing guard. Reports, subscriptions, payment history, webhook subscriptions, and the auth user itself are deleted. Licenses (shared data) are preserved. Irreversible.","operationId":"delete_my_account_api_v2_me_account_delete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/me/webhook-subscriptions/{subscription_id}/test-fire":{"post":{"tags":["me"],"summary":"Fire a test webhook at my subscription's registered URL","description":"Synthesizes a license-change event payload, signs it with this subscription's current signing_secret, and POSTs it at the subscription's registered webhook_url. Lets customers verify their signature-verification + payload-parsing code end-to-end without waiting for a real license change. Owner-checked. Doesn't touch webhook_deliveries — completely isolated.","operationId":"test_fire_my_webhook_api_v2_me_webhook_subscriptions__subscription_id__test_fire_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestFireResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/webhook-subscriptions/{subscription_id}/pause":{"post":{"tags":["me"],"summary":"Pause one of my webhook subscriptions (manual)","description":"Sets status to 'paused' — the dispatcher stops enqueuing new deliveries against this subscription, but all configuration (URL, secret, NPIs, events) is preserved. Use during scheduled maintenance windows; call /resume to bring it back. Owner-checked.","operationId":"pause_my_webhook_api_v2_me_webhook_subscriptions__subscription_id__pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/webhook-subscriptions/{subscription_id}/resume":{"post":{"tags":["me"],"summary":"Resume a paused webhook subscription","description":"Sets status back to 'active'. Resets consecutive_probe_failures to 0 so the auto-pause threshold starts fresh. Owner-checked.","operationId":"resume_my_webhook_api_v2_me_webhook_subscriptions__subscription_id__resume_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/webhook-subscriptions/{subscription_id}/rotate-secret":{"post":{"tags":["me"],"summary":"Rotate the signing secret on one of my webhook subscriptions","description":"Generates a new signing_secret for the subscription and returns it ONCE in the response — you won't see it again. Update your endpoint's signature-verification code with the new secret before the next webhook fires, otherwise deliveries will fail signature check. Owner-checked.","operationId":"rotate_my_webhook_secret_api_v2_me_webhook_subscriptions__subscription_id__rotate_secret_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/webhook-deliveries/{delivery_id}/retry":{"post":{"tags":["me"],"summary":"Re-queue a failed or dead-lettered webhook delivery","description":"Resets the delivery to status=pending and schedules immediate retry. Use this when you've fixed the upstream issue (eg restored your endpoint) and want to recover events that were dead-lettered. Owner-checked: you can only retry deliveries on subscriptions you own.","operationId":"retry_my_webhook_delivery_api_v2_me_webhook_deliveries__delivery_id__retry_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","title":"Delivery Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/public/badge/{npi}":{"get":{"tags":["public"],"summary":"Public NPI badge data — embed-friendly, no auth","description":"Returns minimal license-status data for an NPI: full name + active states + last-checked date. Used by the /badge.js embed loader. Cached 10 minutes; rate-limited per IP. Returns tracked=false when the NPI is not in any Licensy report yet.","operationId":"public_badge_api_v2_public_badge__npi__get","parameters":[{"name":"npi","in":"path","required":true,"schema":{"type":"string","title":"Npi"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadgeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/public/stats":{"get":{"tags":["public"],"summary":"Public aggregate stats — no PII, embed-safe","description":"Aggregate transparency stats for the Licensy platform: total licenses being tracked, total reports run, states covered, and 30-day scraper uptime. Cached 5 minutes; no auth required. Powers the public /stats marketing page.","operationId":"public_stats_api_v2_public_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicStats"}}}}}}},"/api/v2/playground/tools-catalog":{"get":{"tags":["playground"],"summary":"Public MCP tools catalog (no auth)","description":"Returns the list of Licensy MCP tools with input schemas, tier requirements, and example prompts. Designed for SDK code-gen and AI-agent discovery. Update by editing the catalog array in app/api/v2/playground.py; documented as part of the API surface.","operationId":"public_tools_catalog_api_v2_playground_tools_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/playground/verify_license":{"post":{"tags":["playground"],"summary":"Playground: verify_license tool","operationId":"play_verify_license_api_v2_playground_verify_license_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyLicenseRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyLicenseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/playground/list_physician_licenses":{"post":{"tags":["playground"],"summary":"Playground: list_physician_licenses tool","operationId":"play_list_licenses_api_v2_playground_list_physician_licenses_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListLicensesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListLicensesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/playground/get_license_status":{"post":{"tags":["playground"],"summary":"Playground: get_license_status tool (minimal output)","operationId":"play_get_status_api_v2_playground_get_license_status_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetStatusRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/playground/postman-collection.json":{"get":{"tags":["playground"],"summary":"Downloadable Postman v2.1 collection — every public API endpoint","description":"One-click Postman import for the Licensy API. No auth required. Always reflects the current production endpoints.","operationId":"postman_collection_api_v2_playground_postman_collection_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/healthz":{"get":{"tags":["health"],"summary":"Health check with subsystem status (public)","description":"Returns 200 + status='ok' when every subsystem reports healthy, 503 + status='degraded' otherwise. Wire this into UptimeRobot / BetterUptime — they'll alert on the 503.","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthzResponse"}}}}}}},"/status/uptime":{"get":{"tags":["health"],"summary":"Historical uptime % from healthcheck_log (public)","description":"Aggregates healthcheck_log rows over the last N days to power a status page. Returns overall uptime % plus per-day breakdown.","operationId":"status_uptime_status_uptime_get","parameters":[{"name":"window_days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Window Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UptimeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/stripe/current-plan":{"post":{"tags":["stripe"],"summary":"Get Current Plan","operationId":"get_current_plan_api_v2_stripe_current_plan_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentPlanResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/stripe/update-trial-plan":{"post":{"tags":["stripe"],"summary":"Update Trial Plan","operationId":"update_trial_plan_api_v2_stripe_update_trial_plan_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/stripe/payment-method":{"get":{"tags":["stripe"],"summary":"Get user's payment method on file","description":"Return the default payment method (card) for the current user, if any.","operationId":"get_payment_method_api_v2_stripe_payment_method_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/stripe/setup-intent":{"post":{"tags":["stripe"],"summary":"Create a Stripe SetupIntent for adding a card","description":"Create a SetupIntent so the frontend can collect card details via Stripe Elements.","operationId":"create_setup_intent_api_v2_stripe_setup_intent_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/stripe/set-default-payment-method":{"post":{"tags":["stripe"],"summary":"Set a payment method as default for the customer","description":"After a SetupIntent succeeds, set the payment method as the customer default.","operationId":"set_default_payment_method_api_v2_stripe_set_default_payment_method_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/update/states":{"post":{"tags":["data update"],"summary":"Update States","description":"Update states data from the API as a background task\nReturns a task ID that can be used to check the status","operationId":"update_states_api_v2_update_states_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/update/states/single":{"post":{"tags":["data update"],"summary":"Update States Single","description":"Update states data from the API as a background task for a single state\nReturns a task ID that can be used to check the status\n\nYou can call this endpoint in two ways:\n1. With a JSON body (recommended for Swagger): {\"state\": \"Maryland\"}\n2. With query parameters: ?state=Maryland\n\nArgs:\n    request: Request body with state (use this OR query parameters)\n    state: State name to update (query parameter, use this OR request body)\n\nNote: If both request body and query parameters are provided, request body takes precedence.","operationId":"update_states_single_api_v2_update_states_single_post","parameters":[{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"State name to update (used if not provided in request body)","title":"State"},"description":"State name to update (used if not provided in request body)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStateRequest","description":"Request body with state. If state is empty, query parameters will be used."}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/update/task/{task_id}":{"get":{"tags":["data update"],"summary":"Get Task Status","description":"Get the status of a background task by task ID","operationId":"get_task_status_api_v2_update_task__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/cleanup/licenses/duplicates":{"post":{"tags":["data cleanup"],"summary":"DISABLED — caused the 2026-06-17 orphan-ref incident","description":"This endpoint mass-deleted licenses without scrubbing the matching reports.license_ids back-references, producing 443 orphan refs across 27 reports. Permanently disabled. If you need duplicate removal, use the canonical helper at app.utils.license_deletion.delete_licenses_with_ref_scrub.","operationId":"remove_duplicate_licenses_api_v2_cleanup_licenses_duplicates_post","responses":{"410":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/states/available":{"get":{"tags":["states"],"summary":"Get available states","description":"Returns list of states available for license search","operationId":"get_available_states_api_v2_states_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response Get Available States Api V2 States Available Get"}}}}}}},"/api/v2/states/update-status/{report_id}":{"get":{"tags":["states"],"summary":"Check license update status and progress","description":"Returns the status and progress of the license update process","operationId":"check_update_status_api_v2_states_update_status__report_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/states/status":{"get":{"tags":["states"],"summary":"Get states status","description":"Returns status for all states. Status is false if either md_status or do_status is false.","operationId":"get_states_status_api_v2_states_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StateStatusResponse"}}}}}}},"/api/v2/states/check-all-crawlers":{"get":{"tags":["states"],"summary":"Check All State Crawlers Health","description":"Check the health of all state crawlers by running a test search.\n    \n    This endpoint calls the License_Scraper service to test all state crawlers\n    with predefined test parameters:\n    - firstname: Steven\n    - lastname: Winiarski\n    - license_type: DO\n    \n    Returns OK if result is received, BAD otherwise.\n    \n    The endpoint has a default timeout of 300 seconds (5 minutes) for health checks.\n    You can customize the timeout per state by passing the timeout_per_state parameter.","operationId":"check_all_crawlers_api_v2_states_check_all_crawlers_get","parameters":[{"name":"timeout_per_state","in":"query","required":false,"schema":{"type":"integer","description":"Timeout in seconds for each state crawler (default: 60)","default":60,"title":"Timeout Per State"},"description":"Timeout in seconds for each state crawler (default: 60)"},{"name":"request_timeout","in":"query","required":false,"schema":{"type":"integer","description":"Total timeout for the entire request in seconds (default: 300 = 5 minutes)","default":300,"title":"Request Timeout"},"description":"Total timeout for the entire request in seconds (default: 300 = 5 minutes)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/customer/message":{"post":{"tags":["customer"],"summary":"Process custom message and extract customer information with license data and user-friendly message","description":"Processes a natural language message, extracts structured customer information (name, degree, state) using AI, returns matching license data, and generates a user-friendly message with bold formatting for key information","operationId":"process_message_api_v2_customer_message_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerExtractionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerExtractionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/tracking/latest-update-time":{"get":{"tags":["tracking"],"summary":"Get Latest Update Time Endpoint","description":"Get the latest completion time for a specific task\n\nArgs:\n    task_name: Name of the task to check (default: daily_license_update)\n    \nReturns:\n    JSON object with the latest completion time","operationId":"get_latest_update_time_endpoint_api_v2_tracking_latest_update_time_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_name","in":"query","required":false,"schema":{"type":"string","default":"daily_license_update","title":"Task Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/mcp":{"post":{"tags":["mcp"],"summary":"Mcp Endpoint","description":"Main MCP endpoint that handles JSON-RPC requests.\n\nSupports both standard JSON-RPC requests and SSE streaming.","operationId":"mcp_endpoint_api_v2_mcp_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/mcp/health":{"get":{"tags":["mcp"],"summary":"Mcp Health","description":"Health check endpoint for MCP server.","operationId":"mcp_health_api_v2_mcp_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/mcp/chat":{"post":{"tags":["mcp"],"summary":"Mcp Chat","description":"Chat endpoint for natural language queries.\n\nThis endpoint processes natural language queries and returns\nresponses using Anthropic API and MCP tools.","operationId":"mcp_chat_api_v2_mcp_chat_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/blog/posts":{"get":{"tags":["blog"],"summary":"Get Blog Posts","description":"Get all published blog posts from Notion.\n\nArgs:\n    category: Optional category filter\n    include_drafts: Include draft posts (for admin management)\n\nReturns:\n    List of blog posts","operationId":"get_blog_posts_api_v2_blog_posts_get","parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by category","title":"Category"},"description":"Filter by category"},{"name":"include_drafts","in":"query","required":false,"schema":{"type":"boolean","description":"Include draft posts (admin only)","default":false,"title":"Include Drafts"},"description":"Include draft posts (admin only)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/blog/posts/{slug}":{"get":{"tags":["blog"],"summary":"Get Blog Post By Slug","description":"Get a single blog post by slug, including full content.\n\nArgs:\n    slug: Post slug\n    \nReturns:\n    Blog post with content","operationId":"get_blog_post_by_slug_api_v2_blog_posts__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/blog/sync":{"post":{"tags":["blog"],"summary":"Sync Blog Posts","description":"Force refresh blog posts from Notion (admin only).\nClears cache and fetches fresh data.\n\nReturns:\n    Success message","operationId":"sync_blog_posts_api_v2_blog_sync_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/blog/posts/{page_id}/status":{"patch":{"tags":["blog"],"summary":"Update Post Status","description":"Update the status of a blog post in Notion (admin only).\nChecks if Status property exists before attempting update.\n\nArgs:\n    page_id: Notion page ID\n    status: New status value\n    \nReturns:\n    Updated post data","operationId":"update_post_status_api_v2_blog_posts__page_id__status_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"string","title":"Page Id"}},{"name":"status","in":"query","required":true,"schema":{"type":"string","description":"New status (Published, Draft, Archived)","title":"Status"},"description":"New status (Published, Draft, Archived)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/blog/database-url":{"get":{"tags":["blog"],"summary":"Get Database Url","description":"Get the Notion database URL for creating new posts (admin only).\n\nReturns:\n    Database URL","operationId":"get_database_url_api_v2_blog_database_url_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/blog/test-connection":{"get":{"tags":["blog"],"summary":"Test Notion Connection","description":"Test the Notion API connection and database access (admin only).\n\nReturns:\n    Connection test results","operationId":"test_notion_connection_api_v2_blog_test_connection_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/blog/images/{filename}":{"get":{"tags":["blog"],"summary":"Get Blog Image","description":"Stable proxy for a post's featured image.\n\nWhy: Notion serves featured images as S3 presigned URLs that expire after\n60 minutes. AI crawlers (Perplexity, ChatGPT) cache the rendered HTML and\ncite the image URL inside it — when that URL expires, citations become\nbroken-image links. This endpoint resolves the slug → current Notion URL\non every cache miss, fetches the bytes, and serves them with a 24h\nCache-Control so CDNs amortize the upstream fetch.\n\nThe URL `/api/v2/blog/images/<slug>.<ext>` is stable forever (slug is\nimmutable per post), so citations never rot.","operationId":"get_blog_image_api_v2_blog_images__filename__get","parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/orgs/{slug}/physicians":{"get":{"tags":["organizations"],"summary":"Get Org Physicians","description":"Get list of physicians for an organization (admin or org staff only)","operationId":"get_org_physicians_api_v2_orgs__slug__physicians_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgPhysiciansResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/orgs/{slug}/members/{user_id}":{"patch":{"tags":["organizations"],"summary":"Update Org Membership","description":"Add or remove organization membership (admin only)","operationId":"update_org_membership_api_v2_orgs__slug__members__user_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Org Membership Api V2 Orgs  Slug  Members  User Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/orgs/{slug}/invite":{"post":{"tags":["organizations"],"summary":"Invite Or Add Physician To Org","description":"Org staff can invite a physician by email (or add an existing user) to their org roster.\nThis creates an auth user if needed and ensures an organization_memberships row exists.","operationId":"invite_or_add_physician_to_org_api_v2_orgs__slug__invite_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitePhysicianRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Invite Or Add Physician To Org Api V2 Orgs  Slug  Invite Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/orgs/":{"get":{"tags":["organizations"],"summary":"List Organizations","description":"List all organizations (public endpoint)","operationId":"list_organizations_api_v2_orgs__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Organizations Api V2 Orgs  Get"}}}}}}},"/api/v2/orgs/me":{"get":{"tags":["organizations"],"summary":"Get My Organizations","description":"List the current user's organization memberships (org name/slug + membership role)","operationId":"get_my_organizations_api_v2_orgs_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/MyOrgMembership"},"type":"array","title":"Response Get My Organizations Api V2 Orgs Me Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/inbound/sendgrid/licenses/{token}":{"post":{"tags":["inbound-email"],"summary":"Receive License Email","description":"Receive license PDFs via SendGrid Inbound Parse webhook","operationId":"receive_license_email_api_v2_inbound_sendgrid_licenses__token__post","parameters":[{"name":"token","in":"path","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"}}}}}}},"/api/v2/email-poll/check":{"post":{"tags":["email-poll"],"summary":"Check Emails","description":"Manually trigger email polling\nChecks for new emails and processes PDF attachments","operationId":"check_emails_api_v2_email_poll_check_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/public/try-it/search-license/":{"post":{"tags":["public"],"summary":"Try It Search License","description":"Public, non-beta endpoint for the /try-it-free page.\nReturns results directly from Supabase `tbl_medical_license` (no scraping).","operationId":"try_it_search_license_api_v2_public_try_it_search_license__post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_try_it_search_license_api_v2_public_try_it_search_license__post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TryItFreeLicenseResponse"},"type":"array","title":"Response Try It Search License Api V2 Public Try It Search License  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/public/try-it/npi/search-license/":{"post":{"tags":["public"],"summary":"Try It Npi Search License","description":"Public NPI search for the /try-it-free page.\nResolves NPI to provider name, then queries Supabase `tbl_medical_license`.","operationId":"try_it_npi_search_license_api_v2_public_try_it_npi_search_license__post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_try_it_npi_search_license_api_v2_public_try_it_npi_search_license__post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TryItFreeLicenseResponse"},"type":"array","title":"Response Try It Npi Search License Api V2 Public Try It Npi Search License  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/preferences/":{"get":{"tags":["preferences"],"summary":"Get user preferences","operationId":"get_preferences_api_v2_preferences__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPreferences"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["preferences"],"summary":"Update user preferences","operationId":"update_preferences_api_v2_preferences__patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPreferences"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v2/licenses/":{"get":{"tags":["licenses"],"summary":"Look up licenses by NPI or (license_number + state)","description":"Returns a list of licenses matching the query criteria, freshest first. Designed to be a stable, thin read endpoint for downstream callers (LicensyAI frontend, MCP server, customer API integrations).\n\nProvide EITHER:\n  - npi (10 digits), OR\n  - license_number + state\n\nOptionally filter by state, license_type, and whether to include expired/inactive licenses.","operationId":"get_licenses_api_v2_licenses__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"npi","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{10}$"},{"type":"null"}],"description":"10-digit NPI","title":"Npi"},"description":"10-digit NPI"},{"name":"license_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"State-issued license number","title":"License Number"},"description":"State-issued license number"},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Two-letter code or full state name","title":"State"},"description":"Two-letter code or full state name"},{"name":"license_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"MD, DO, PA, APRN, RN, CNP, CRNA, CNS, CNM, etc.","title":"License Type"},"description":"MD, DO, PA, APRN, RN, CNP, CRNA, CNS, CNM, etc."},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","description":"Include expired/inactive licenses","default":false,"title":"Include Inactive"},"description":"Include expired/inactive licenses"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max rows","default":50,"title":"Limit"},"description":"Max rows"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Licenses Api V2 Licenses  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Index","operationId":"index__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"tags":["health"],"summary":"Health Check","description":"Health check endpoint to verify API and database connectivity","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"APIUsageInfo":{"properties":{"purpose_of_use":{"type":"string","title":"Purpose Of Use"},"estimated_monthly_calls":{"type":"integer","title":"Estimated Monthly Calls"},"preferred_data_format":{"$ref":"#/components/schemas/DataFormat"}},"type":"object","required":["purpose_of_use","estimated_monthly_calls","preferred_data_format"],"title":"APIUsageInfo"},"ActiveUsersResponse":{"properties":{"dau":{"type":"integer","title":"Dau","description":"Distinct accounts that called MCP in the last 24h"},"wau":{"type":"integer","title":"Wau","description":"Distinct accounts in the last 7 days"},"mau":{"type":"integer","title":"Mau","description":"Distinct accounts in the last 30 days"},"calls_24h":{"type":"integer","title":"Calls 24H"},"calls_7d":{"type":"integer","title":"Calls 7D"},"calls_30d":{"type":"integer","title":"Calls 30D"},"new_signups_7d":{"type":"integer","title":"New Signups 7D","description":"New user_usage_limits rows created in last 7 days"}},"type":"object","required":["dau","wau","mau","calls_24h","calls_7d","calls_30d","new_signups_7d"],"title":"ActiveUsersResponse"},"AdminSubscriptionUpdate":{"properties":{"plan_id":{"type":"string","title":"Plan Id"}},"type":"object","required":["plan_id"],"title":"AdminSubscriptionUpdate"},"AllowedIpsRequest":{"properties":{"allowed_ips":{"items":{"type":"string"},"type":"array","title":"Allowed Ips","description":"List of IPs or CIDR ranges. Empty list disables the allowlist. Examples: '203.0.113.42', '10.0.0.0/24', '2001:db8::/32'."}},"type":"object","title":"AllowedIpsRequest"},"AllowedIpsResponse":{"properties":{"allowed_ips":{"items":{"type":"string"},"type":"array","title":"Allowed Ips"},"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"AllowedIpsResponse"},"ApiCredentialCreate":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"name":{"type":"string","title":"Name"},"expires_in_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In Days","default":365},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions","default":[]}},"type":"object","required":["user_id","name"],"title":"ApiCredentialCreate"},"ApiCredentialResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"credential_key":{"type":"string","title":"Credential Key"},"key_name":{"type":"string","title":"Key Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"key_expiration":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Key Expiration"},"is_active":{"type":"boolean","title":"Is Active"},"key_permissions":{"items":{"type":"string"},"type":"array","title":"Key Permissions","default":[]}},"type":"object","required":["id","user_id","credential_key","key_name","created_at","is_active"],"title":"ApiCredentialResponse"},"ApiCredentialWithSecret":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"credential_key":{"type":"string","title":"Credential Key"},"key_name":{"type":"string","title":"Key Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"key_expiration":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Key Expiration"},"is_active":{"type":"boolean","title":"Is Active"},"key_permissions":{"items":{"type":"string"},"type":"array","title":"Key Permissions","default":[]},"secret":{"type":"string","title":"Secret"}},"type":"object","required":["id","user_id","credential_key","key_name","created_at","is_active","secret"],"title":"ApiCredentialWithSecret"},"ApiUsageData":{"properties":{"endpoint":{"type":"string","title":"Endpoint"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["endpoint","count"],"title":"ApiUsageData"},"AuditEvent":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"description":{"type":"string","title":"Description"},"details":{"additionalProperties":true,"type":"object","title":"Details"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","type","description","created_at"],"title":"AuditEvent"},"AuditListResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/AuditEvent"},"type":"array","title":"Events"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["events","count"],"title":"AuditListResponse"},"AuditLogEntry":{"properties":{"id":{"type":"integer","title":"Id"},"occurred_at":{"type":"string","title":"Occurred At"},"admin_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Email"},"admin_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin User Id"},"endpoint":{"type":"string","title":"Endpoint"},"target":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target"},"query_params":{"additionalProperties":true,"type":"object","title":"Query Params"}},"type":"object","required":["id","occurred_at","endpoint"],"title":"AuditLogEntry"},"AuditLogResponse":{"properties":{"total":{"type":"integer","title":"Total"},"entries":{"items":{"$ref":"#/components/schemas/AuditLogEntry"},"type":"array","title":"Entries"}},"type":"object","required":["total","entries"],"title":"AuditLogResponse"},"BadgeResponse":{"properties":{"npi":{"type":"string","title":"Npi"},"tracked":{"type":"boolean","title":"Tracked"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"active_states":{"items":{"type":"string"},"type":"array","title":"Active States","default":[]},"last_checked_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Checked At"},"upgrade_url":{"type":"string","title":"Upgrade Url","default":"https://licensy.ai/pricing"},"hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hint"}},"type":"object","required":["npi","tracked"],"title":"BadgeResponse"},"BadgeUsageSummary":{"properties":{"window_days":{"type":"integer","title":"Window Days"},"total_requests":{"type":"integer","title":"Total Requests"},"unique_npis":{"type":"integer","title":"Unique Npis"},"unique_referers":{"type":"integer","title":"Unique Referers"},"tracked_share":{"type":"number","title":"Tracked Share","description":"0..1 — share of requests where tracked=true"},"by_day":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"By Day"},"top_npis":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Top Npis"},"top_referers":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Top Referers"}},"type":"object","required":["window_days","total_requests","unique_npis","unique_referers","tracked_share"],"title":"BadgeUsageSummary"},"Body_try_it_npi_search_license_api_v2_public_try_it_npi_search_license__post":{"properties":{"npi_number":{"type":"string","title":"Npi Number"},"License_Type":{"type":"string","title":"License Type","default":"MD"},"State":{"type":"string","title":"State"},"recaptcha_token":{"type":"string","title":"Recaptcha Token"},"limit":{"type":"integer","title":"Limit","default":50}},"type":"object","required":["npi_number","State","recaptcha_token"],"title":"Body_try_it_npi_search_license_api_v2_public_try_it_npi_search_license__post"},"Body_try_it_search_license_api_v2_public_try_it_search_license__post":{"properties":{"First_Name":{"type":"string","title":"First Name"},"Last_Name":{"type":"string","title":"Last Name"},"Middle_Name":{"type":"string","title":"Middle Name","default":""},"License_Type":{"type":"string","title":"License Type","default":"MD"},"State":{"type":"string","title":"State"},"recaptcha_token":{"type":"string","title":"Recaptcha Token"},"limit":{"type":"integer","title":"Limit","default":50}},"type":"object","required":["First_Name","Last_Name","State","recaptcha_token"],"title":"Body_try_it_search_license_api_v2_public_try_it_search_license__post"},"BulkNpiReportCreate":{"properties":{"npi_numbers":{"items":{"type":"string"},"type":"array","maxItems":200,"minItems":1,"title":"Npi Numbers"},"license_type":{"type":"string","title":"License Type","default":"MD"},"states":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"States"}},"type":"object","required":["npi_numbers"],"title":"BulkNpiReportCreate","description":"Bulk create one report per NPI. License type + states apply to every\nNPI in the batch — credentialing teams onboarding a roster typically\nhave one common license type (MD/DO) and the standard state coverage.\nNPIs that fail to resolve are reported per-row; the others still get\ntheir reports created."},"BulkNpiReportEntry":{"properties":{"npi_number":{"type":"string","title":"Npi Number"},"ok":{"type":"boolean","title":"Ok"},"report_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Id"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["npi_number","ok"],"title":"BulkNpiReportEntry"},"BulkNpiReportResponse":{"properties":{"requested":{"type":"integer","title":"Requested"},"created":{"type":"integer","title":"Created"},"failed":{"type":"integer","title":"Failed"},"entries":{"items":{"$ref":"#/components/schemas/BulkNpiReportEntry"},"type":"array","title":"Entries"}},"type":"object","required":["requested","created","failed","entries"],"title":"BulkNpiReportResponse"},"ChangePasswordRequest":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["current_password","new_password"],"title":"ChangePasswordRequest"},"CheckEmailRequest":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"CheckEmailRequest"},"CheckUserRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"CheckUserRequest"},"ConnectivityResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"base_url_configured":{"type":"boolean","title":"Base Url Configured"},"credentials_configured":{"type":"boolean","title":"Credentials Configured"},"test_transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Test Transaction Id"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["ok","base_url_configured","credentials_configured","detail"],"title":"ConnectivityResponse"},"ConversationMessage":{"properties":{"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"}},"type":"object","required":["role","content"],"title":"ConversationMessage","description":"Conversation message model for history.\n\nAttributes:\n    role (str): Role of the message sender (\"user\" or \"assistant\")\n    content (str): Content of the message"},"Credential":{"properties":{"id":{"type":"string","title":"Id"},"credential_key":{"type":"string","title":"Credential Key"},"user_id":{"type":"string","title":"User Id"},"amount":{"type":"integer","title":"Amount"}},"type":"object","required":["id","credential_key","user_id","amount"],"title":"Credential"},"CredentialResponse":{"properties":{"credential_key":{"type":"string","title":"Credential Key"},"amount":{"type":"integer","title":"Amount"},"reports_plan":{"$ref":"#/components/schemas/ReportsPlan"}},"type":"object","required":["credential_key","amount","reports_plan"],"title":"CredentialResponse"},"CronJobEntry":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"next_run_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Run At"},"trigger":{"type":"string","title":"Trigger"},"misfire_grace_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Misfire Grace Seconds"}},"type":"object","required":["id","name","trigger"],"title":"CronJobEntry"},"CronJobsResponse":{"properties":{"scheduler_running":{"type":"boolean","title":"Scheduler Running"},"total_jobs":{"type":"integer","title":"Total Jobs"},"jobs":{"items":{"$ref":"#/components/schemas/CronJobEntry"},"type":"array","title":"Jobs"}},"type":"object","required":["scheduler_running","total_jobs","jobs"],"title":"CronJobsResponse"},"CronRunEntry":{"properties":{"id":{"type":"integer","title":"Id"},"job_id":{"type":"string","title":"Job Id"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"finished_at":{"type":"string","title":"Finished At"},"scheduled_run_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled Run At"},"status":{"type":"string","title":"Status"},"runtime_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Runtime Seconds"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["id","job_id","finished_at","status"],"title":"CronRunEntry"},"CronRunHistoryResponse":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/CronRunEntry"},"type":"array","title":"Runs"},"summary":{"additionalProperties":true,"type":"object","title":"Summary","description":"Per-job rollup: { job_id: { ok: N, error: N, last_status, last_finished_at } }"}},"type":"object","title":"CronRunHistoryResponse"},"CurrentPlanResponse":{"properties":{"plan_type":{"type":"string","title":"Plan Type"},"plan_name":{"type":"string","title":"Plan Name"},"next_billing_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Billing Date"},"amount":{"type":"number","title":"Amount"},"status":{"type":"string","title":"Status"},"plan_details":{"anyOf":[{"$ref":"#/components/schemas/PlanDetails"},{"type":"null"}]},"is_trial":{"type":"boolean","title":"Is Trial"}},"type":"object","required":["plan_type","plan_name","next_billing_date","amount","status","plan_details","is_trial"],"title":"CurrentPlanResponse","examples":[{"amount":200.0,"is_trial":true,"next_billing_date":"2025-03-21T00:00:00","plan_name":"Basic","plan_type":"individual","status":"active"}]},"CustomerExtractionRequest":{"properties":{"message":{"type":"string","title":"Message"},"conversation_history":{"anyOf":[{"items":{"$ref":"#/components/schemas/ConversationMessage"},"type":"array"},{"type":"null"}],"title":"Conversation History","default":[]}},"type":"object","required":["message"],"title":"CustomerExtractionRequest","description":"Request model for custom message processing.\n\nAttributes:\n    message (str): Natural language message containing customer information\n    conversation_history (Optional[List[ConversationMessage]]): Previous conversation messages for context"},"CustomerExtractionResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"customer_info":{"anyOf":[{"$ref":"#/components/schemas/CustomerInfo"},{"type":"null"}]},"licenses":{"items":{"$ref":"#/components/schemas/LicenseData"},"type":"array","title":"Licenses","default":[]},"total_licenses":{"type":"integer","title":"Total Licenses","default":0},"states_found":{"items":{"type":"string"},"type":"array","title":"States Found","default":[]},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"CustomerExtractionResponse","description":"Response model for customer information extraction with license data.\n\nAttributes:\n    success (bool): Whether the extraction was successful\n    customer_info (CustomerInfo): Extracted customer information\n    licenses (List[LicenseData]): Found license data\n    total_licenses (int): Total number of licenses found\n    states_found (List[str]): List of states where licenses were found\n    message (str): User-friendly message with bold formatting summarizing the results"},"CustomerInfo":{"properties":{"first_name":{"type":"string","minLength":1,"title":"First Name","description":"Customer's first name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Customer's last name (optional)"},"middle_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Middle Name","description":"Customer's middle name (optional)"},"degree":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Degree","description":"Medical degree (MD or DO)"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"State where the customer is licensed"}},"type":"object","required":["first_name"],"title":"CustomerInfo","description":"Customer information extracted from text data.\n\nAttributes:\n    first_name (str): Customer's first name\n    last_name (Optional[str]): Customer's last name (optional)\n    middle_name (Optional[str]): Customer's middle name (optional)\n    degree (str): Medical degree (MD or DO)\n    state (Optional[str]): State where the customer is licensed (optional)"},"CustomerUsageEntry":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"},"total_calls":{"type":"integer","title":"Total Calls"},"last_call_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Call At"},"days_active":{"type":"integer","title":"Days Active","description":"Distinct calendar days with at least one call in the window"},"top_tool":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Top Tool"}},"type":"object","required":["user_id","total_calls","days_active"],"title":"CustomerUsageEntry"},"CustomerUsageResponse":{"properties":{"window_days":{"type":"integer","title":"Window Days"},"customers":{"items":{"$ref":"#/components/schemas/CustomerUsageEntry"},"type":"array","title":"Customers"}},"type":"object","required":["window_days","customers"],"title":"CustomerUsageResponse"},"DashboardResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"task_queue":{"anyOf":[{"$ref":"#/components/schemas/TaskQueueInfo"},{"type":"null"}]}},"type":"object","required":["id","user_id"],"title":"DashboardResponse"},"DataFormat":{"type":"string","enum":["json","csv"],"title":"DataFormat"},"DeleteAccountRequest":{"properties":{"confirm_email":{"type":"string","title":"Confirm Email","description":"Type your own account email here. Must match exactly — guards against accidental deletion."}},"type":"object","required":["confirm_email"],"title":"DeleteAccountRequest"},"EmailPreferences":{"properties":{"expiration_reminders":{"type":"boolean","title":"Expiration Reminders","default":true},"trial_reminders":{"type":"boolean","title":"Trial Reminders","default":true},"onboarding_nudges":{"type":"boolean","title":"Onboarding Nudges","default":true},"product_announcements":{"type":"boolean","title":"Product Announcements","default":true}},"type":"object","title":"EmailPreferences"},"ExecuteCommandRequest":{"properties":{"command":{"type":"string","title":"Command"},"timeout":{"type":"integer","title":"Timeout","default":30}},"type":"object","required":["command"],"title":"ExecuteCommandRequest"},"FeedbackEntry":{"properties":{"id":{"type":"integer","title":"Id"},"submitted_at":{"type":"string","title":"Submitted At"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Email"},"kind":{"type":"string","title":"Kind"},"body":{"type":"string","title":"Body"},"surface":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Surface"},"status":{"type":"string","title":"Status"},"responded_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Responded At"},"responded_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Responded By"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["id","submitted_at","kind","body","status"],"title":"FeedbackEntry"},"FeedbackListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"new_count":{"type":"integer","title":"New Count"},"entries":{"items":{"$ref":"#/components/schemas/FeedbackEntry"},"type":"array","title":"Entries"}},"type":"object","required":["total","new_count","entries"],"title":"FeedbackListResponse"},"FeedbackRequest":{"properties":{"kind":{"type":"string","title":"Kind","description":"One of: bug, feature, question, other"},"body":{"type":"string","maxLength":5000,"minLength":4,"title":"Body"},"surface":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Surface","description":"Where in the app the feedback was submitted from (e.g. '/dashboard')"}},"type":"object","required":["kind","body"],"title":"FeedbackRequest"},"FeedbackUpdate":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"new | acknowledged | done | wontfix"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","title":"FeedbackUpdate"},"GetStatusRequest":{"properties":{"npi":{"type":"string","title":"Npi"},"state":{"type":"string","title":"State"}},"type":"object","required":["npi","state"],"title":"GetStatusRequest"},"GetStatusResponse":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"GetStatusResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthzResponse":{"properties":{"status":{"type":"string","title":"Status","description":"ok or degraded"},"uptime_seconds":{"type":"integer","title":"Uptime Seconds"},"checked_at":{"type":"string","title":"Checked At"},"checks":{"items":{"$ref":"#/components/schemas/SubsystemCheck"},"type":"array","title":"Checks"}},"type":"object","required":["status","uptime_seconds","checked_at","checks"],"title":"HealthzResponse"},"InvitePhysicianRequest":{"properties":{"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"}},"type":"object","required":["email"],"title":"InvitePhysicianRequest"},"LicenseAddRequest":{"properties":{"state":{"type":"string","minLength":1,"title":"State","description":"Full state name (e.g. 'California')."},"license_number":{"type":"string","minLength":1,"title":"License Number","description":"License number string."},"license_type":{"type":"string","minLength":1,"title":"License Type","description":"License type (MD, DO, RN, etc.)."},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name","description":"Optional full name override."},"professional":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Professional","description":"Optional profession label."}},"type":"object","required":["state","license_number","license_type"],"title":"LicenseAddRequest","description":"Request body for adding a single license to an existing report.\n\nLookup-first: backend checks tbl_medical_license for an existing match\nby (state, license_number, license_type) and copies fields if found.\nOtherwise inserts a Pending row in `licenses` for the daily updater to fill.","examples":[{"license_number":"C52209","license_type":"MD","state":"California"}]},"LicenseData":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Id"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"license_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Type"},"license_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Number"},"professional":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Professional"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"issued":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issued"},"expired":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expired"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},"type":"object","title":"LicenseData","description":"License data model for API response.\n\nAttributes:\n    id (Optional[Union[str, int]]): License record ID (can be string or integer)\n    full_name (Optional[str]): Full name on license\n    license_type (Optional[str]): Type of license\n    license_number (Optional[str]): License number\n    professional (Optional[str]): Professional designation\n    status (Optional[str]): License status\n    issued (Optional[str]): Issue date\n    expired (Optional[str]): Expiration date\n    state (Optional[str]): State of license"},"LicenseHistoryEntry":{"properties":{"snapshotted_at":{"type":"string","title":"Snapshotted At"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"expired":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expired"},"license_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Number"},"license_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Type"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"change_type":{"type":"string","title":"Change Type","description":"What changed at this snapshot relative to the previous one: 'initial', 'status_change', 'expiry_change', 'unchanged'."},"changed_fields":{"items":{"type":"string"},"type":"array","title":"Changed Fields"}},"type":"object","required":["snapshotted_at","change_type"],"title":"LicenseHistoryEntry"},"LicenseHistoryResponse":{"properties":{"license_id":{"type":"string","title":"License Id"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"license_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Number"},"license_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Type"},"snapshot_count":{"type":"integer","title":"Snapshot Count"},"history":{"items":{"$ref":"#/components/schemas/LicenseHistoryEntry"},"type":"array","title":"History"}},"type":"object","required":["license_id","snapshot_count","history"],"title":"LicenseHistoryResponse"},"LicenseNumberEntry":{"properties":{"state":{"type":"string","minLength":1,"title":"State","description":"Full state name (e.g. 'California')"},"license_number":{"type":"string","minLength":1,"title":"License Number","description":"License number string"}},"type":"object","required":["state","license_number"],"title":"LicenseNumberEntry","description":"A single license number + state pair."},"LicenseNumberReportCreate":{"properties":{"licenseType":{"type":"string","title":"Licensetype","description":"License type (MD, DO, or PA)","default":"MD"},"licenses":{"items":{"$ref":"#/components/schemas/LicenseNumberEntry"},"type":"array","minItems":1,"title":"Licenses","description":"List of license entries (state + license number)"},"name":{"type":"string","title":"Name","description":"Optional report name","default":""}},"type":"object","required":["licenses"],"title":"LicenseNumberReportCreate","description":"Request body for creating a report using license numbers.","examples":[{"licenseType":"MD","licenses":[{"license_number":"C52209","state":"California"},{"license_number":"NY12345","state":"New York"}],"name":"Dr. Dutton License Report"}]},"LicenseRecord":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","default":""},"license_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Number","default":""},"license_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Date","default":""},"expire_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expire Date","default":""}},"type":"object","required":["id","name"],"title":"LicenseRecord"},"LicenseSearchHit":{"properties":{"license_id":{"type":"string","title":"License Id"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"license_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Number"},"license_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Type"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"expired":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expired"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"referencing_reports":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Referencing Reports","description":"Reports that hold a non-deleted reference to this license, with the owner's email when available."}},"type":"object","required":["license_id"],"title":"LicenseSearchHit"},"LicenseSearchResponse":{"properties":{"query":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object","title":"Query"},"total":{"type":"integer","title":"Total"},"hits":{"items":{"$ref":"#/components/schemas/LicenseSearchHit"},"type":"array","title":"Hits"}},"type":"object","required":["query","total","hits"],"title":"LicenseSearchResponse"},"LicenseSubmissionDetail":{"properties":{"id":{"type":"string","title":"Id"},"received_at":{"type":"string","title":"Received At"},"from_email":{"type":"string","title":"From Email"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"storage_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Storage Path"},"extracted_json":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extracted Json"},"status":{"type":"string","title":"Status"},"errors":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Errors"},"linked_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked User Id"},"license_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Number"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","received_at","from_email","status","created_at","updated_at"],"title":"LicenseSubmissionDetail"},"LicenseSummary":{"properties":{"state":{"type":"string","title":"State"},"status":{"type":"string","title":"Status"},"license_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Number"},"expiration_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expiration Date"},"license_active":{"type":"boolean","title":"License Active"}},"type":"object","required":["state","status","license_active"],"title":"LicenseSummary"},"LinkNpiRequest":{"properties":{"npi_number":{"type":"string","maxLength":10,"minLength":10,"title":"Npi Number","description":"The physician's 10-digit NPI number."}},"type":"object","required":["npi_number"],"title":"LinkNpiRequest","description":"Request body for anchoring an existing report to a physician's NPI and\nre-matching its licenses to that specific person."},"LinkNpiResponse":{"properties":{"report_id":{"type":"string","title":"Report Id"},"npi_number":{"type":"string","title":"Npi Number"},"provider_name":{"type":"string","title":"Provider Name"},"credential":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credential"},"kept":{"type":"integer","title":"Kept","description":"Licenses retained as belonging to this physician."},"pruned":{"type":"integer","title":"Pruned","description":"Licenses soft-removed as belonging to a different same-name physician (restorable)."},"total_before":{"type":"integer","title":"Total Before"},"note":{"type":"string","title":"Note"}},"type":"object","required":["report_id","npi_number","provider_name","kept","pruned","total_before","note"],"title":"LinkNpiResponse","description":"Result of linking a report to an NPI + pruning wrong-person licenses."},"ListLicensesRequest":{"properties":{"npi":{"type":"string","title":"Npi"},"include_inactive":{"type":"boolean","title":"Include Inactive","default":false}},"type":"object","required":["npi"],"title":"ListLicensesRequest"},"ListLicensesResponse":{"properties":{"npi":{"type":"string","title":"Npi"},"licenses":{"items":{"$ref":"#/components/schemas/LicenseSummary"},"type":"array","title":"Licenses"}},"type":"object","required":["npi","licenses"],"title":"ListLicensesResponse"},"LoginRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest","examples":[{"email":"user@example.com","password":"your_password"}]},"LoginStat":{"properties":{"date":{"type":"string","title":"Date"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["date","count"],"title":"LoginStat"},"McpErrorEntry":{"properties":{"called_at":{"type":"string","title":"Called At"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"client_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Hint"},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency Ms"}},"type":"object","required":["called_at"],"title":"McpErrorEntry"},"McpErrorsResponse":{"properties":{"window_hours":{"type":"integer","title":"Window Hours"},"total_errors":{"type":"integer","title":"Total Errors"},"error_rate":{"type":"number","title":"Error Rate"},"by_tool":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Tool"},"by_error_code":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Error Code"},"recent":{"items":{"$ref":"#/components/schemas/McpErrorEntry"},"type":"array","title":"Recent"}},"type":"object","required":["window_hours","total_errors","error_rate"],"title":"McpErrorsResponse"},"McpUsageSummary":{"properties":{"window_hours":{"type":"integer","title":"Window Hours"},"total_calls":{"type":"integer","title":"Total Calls"},"unique_accounts":{"type":"integer","title":"Unique Accounts"},"error_rate":{"type":"number","title":"Error Rate","description":"0.0 to 1.0"},"p50_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"P50 Latency Ms"},"p95_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"P95 Latency Ms"},"by_tool":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Tool"},"by_tier":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Tier"},"by_client":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Client"},"recent_calls":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Recent Calls","description":"Last 10 calls for live tail"}},"type":"object","required":["window_hours","total_calls","unique_accounts","error_rate","by_tool","by_tier","by_client","recent_calls"],"title":"McpUsageSummary"},"MembershipUpdate":{"properties":{"action":{"type":"string","title":"Action"},"membership_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Membership Role","default":"physician"}},"type":"object","required":["action"],"title":"MembershipUpdate"},"MyMcpUsageResponse":{"properties":{"tier":{"type":"string","title":"Tier"},"limits":{"$ref":"#/components/schemas/TierLimits"},"calls_today":{"type":"integer","title":"Calls Today"},"calls_this_month":{"type":"integer","title":"Calls This Month"},"calls_last_24h":{"type":"integer","title":"Calls Last 24H"},"by_tool":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Tool"},"by_client":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Client"},"last_call_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Call At"},"first_call_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Call At","description":"When you first used the API. Useful for 'using Licensy for N days' messaging."}},"type":"object","required":["tier","limits","calls_today","calls_this_month","calls_last_24h","by_tool","by_client"],"title":"MyMcpUsageResponse"},"MyOrgMembership":{"properties":{"organization_id":{"type":"string","title":"Organization Id"},"organization_slug":{"type":"string","title":"Organization Slug"},"organization_name":{"type":"string","title":"Organization Name"},"membership_role":{"type":"string","title":"Membership Role"}},"type":"object","required":["organization_id","organization_slug","organization_name","membership_role"],"title":"MyOrgMembership"},"MyReportsHealth":{"properties":{"total_reports":{"type":"integer","title":"Total Reports"},"total_licenses_tracked":{"type":"integer","title":"Total Licenses Tracked"},"active_licenses":{"type":"integer","title":"Active Licenses"},"expiring_60d":{"type":"integer","title":"Expiring 60D"},"expiring_30d":{"type":"integer","title":"Expiring 30D"},"expiring_7d":{"type":"integer","title":"Expiring 7D"},"already_expired":{"type":"integer","title":"Already Expired"},"stale_records":{"type":"integer","title":"Stale Records","description":"Licenses we haven't refreshed in >14 days (background scrapers may be lagging)"},"ambiguous_reports":{"type":"integer","title":"Ambiguous Reports","description":"Reports with >75 attached licenses — usually means the search name matched multiple physicians (e.g. \"John Smith\" with no middle name). Customer can disambiguate by editing the report to add a middle name.","default":0},"ambiguous_report_ids":{"items":{"type":"string"},"type":"array","title":"Ambiguous Report Ids","description":"UUIDs of the ambiguous_reports. Lets the dashboard widget link directly to the offending reports with a 'Fix it' CTA."},"last_refreshed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Refreshed At"}},"type":"object","required":["total_reports","total_licenses_tracked","active_licenses","expiring_60d","expiring_30d","expiring_7d","already_expired","stale_records"],"title":"MyReportsHealth"},"NPILookupResponse":{"properties":{"npi_number":{"type":"string","title":"Npi Number"},"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"middle_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Middle Name"},"credential":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credential"}},"type":"object","required":["npi_number","first_name","last_name"],"title":"NPILookupResponse","description":"Response from NPI number lookup.","examples":[{"credential":"M.D.","first_name":"Ardalan","last_name":"Enkeshafi","npi_number":"1003000126"}]},"NPIReportCreate":{"properties":{"npi_number":{"type":"string","maxLength":10,"minLength":10,"title":"Npi Number","description":"10-digit NPI number"},"licenseType":{"type":"string","title":"Licensetype","description":"License type (MD or DO)","default":"MD"},"states":{"items":{"type":"string"},"type":"array","minItems":1,"title":"States","description":"List of state names to search in"},"name":{"type":"string","title":"Name","description":"Optional report name","default":""}},"type":"object","required":["npi_number","states"],"title":"NPIReportCreate","description":"Request body for creating a report using NPI number.","examples":[{"licenseType":"MD","name":"","npi_number":"1003000126","states":["California","New York"]}]},"NPISearchRequest":{"properties":{"npi_number":{"type":"string","maxLength":10,"minLength":10,"title":"Npi Number","description":"10-digit NPI number"},"state_name":{"type":"string","maxLength":100,"minLength":1,"title":"State Name","description":"State name to search in"},"license_type":{"type":"string","title":"License Type","description":"License type (MD or DO)","default":"MD"}},"type":"object","required":["npi_number","state_name"],"title":"NPISearchRequest","description":"Request body for searching licenses by NPI number.","examples":[{"license_type":"MD","npi_number":"1003000126","state_name":"California"}]},"NewOrganization":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"}},"type":"object","required":["slug","name"],"title":"NewOrganization"},"NursysDiscoverNCSBNRequest":{"properties":{"state_name":{"type":"string","title":"State Name","description":"State name (e.g. 'Kansas')."},"license_type":{"type":"string","title":"License Type","description":"Nurse license type: RN, PN, CNP, CNM, CRNA, CNS."},"license_number":{"type":"string","maxLength":15,"minLength":1,"title":"License Number"}},"type":"object","required":["state_name","license_type","license_number"],"title":"NursysDiscoverNCSBNRequest","description":"Look up an NCSBN ID from a single (state, license_type, license_number).\n\nUseful as a discovery step: the user knows their license details but\nnot their NCSBN ID, so the UI submits this and polls /transaction/<id>\nfor the result.","examples":[{"license_number":"1234567890","license_type":"RN","state_name":"Kansas"}]},"NursysEnrollAndLookupRequest":{"properties":{"state_name":{"type":"string","title":"State Name","description":"State name (e.g. 'Virginia')."},"license_type":{"type":"string","title":"License Type","description":"Nurse license type: RN, PN, CNP, CNM, CRNA, CNS."},"license_number":{"type":"string","maxLength":15,"minLength":1,"title":"License Number"},"last_four_ssn":{"type":"string","maxLength":4,"minLength":4,"title":"Last Four Ssn","description":"Last 4 digits of SSN."},"birth_year":{"type":"integer","maximum":2100.0,"minimum":1900.0,"title":"Birth Year","description":"4-digit birth year."},"address1":{"type":"string","maxLength":50,"minLength":1,"title":"Address1"},"address2":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Address2"},"city":{"type":"string","maxLength":50,"minLength":1,"title":"City"},"address_state":{"type":"string","maxLength":2,"minLength":2,"title":"Address State","description":"USPS abbreviation. Must match state_name's compact group or the license state."},"zip_code":{"type":"string","maxLength":10,"minLength":5,"title":"Zip Code"},"email":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Email"},"notifications_enabled":{"type":"boolean","title":"Notifications Enabled","default":true},"report_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Id"}},"type":"object","required":["state_name","license_type","license_number","last_four_ssn","birth_year","address1","city","address_state","zip_code"],"title":"NursysEnrollAndLookupRequest","description":"Enroll a nurse on our Nursys e-Notify nurse list and queue a\nfollow-up nurselookup so their license details land in `licenses`.\n\nWhy this is necessary: Nursys nurselookup (spec 3.4.2) only returns\ndata for licenses already enrolled on your institution's nurse list.\nFirst-time enrollment via managenurselist (spec 2.2.2 / A.7) requires\nlast-4 SSN and birth year for verification against the source-of-truth\nboard of nursing data.","examples":[{"address1":"735 Ridgecrest Ln","address_state":"VA","birth_year":1967,"city":"Roanoke","last_four_ssn":"0000","license_number":"0024172315","license_type":"CNP","state_name":"Virginia","zip_code":"24019"}]},"NursysNCSBNReportCreate":{"properties":{"ncsbn_id":{"type":"string","maxLength":10,"minLength":1,"title":"Ncsbn Id","description":"NCSBN ID — up to 10 digits."},"licenseType":{"type":"string","title":"Licensetype","description":"Nurse license type: RN, PN, CNP, CNM, CRNA, or CNS.","default":"RN"},"states":{"items":{"type":"string"},"type":"array","minItems":1,"title":"States","description":"States to include in the report."},"first_name":{"type":"string","title":"First Name","description":"First name (for the report title; optional).","default":""},"last_name":{"type":"string","title":"Last Name","description":"Last name (for the report title; optional).","default":""},"middle_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Middle Name"},"name":{"type":"string","title":"Name","description":"Optional report name.","default":""}},"type":"object","required":["ncsbn_id","states"],"title":"NursysNCSBNReportCreate","description":"Request body for creating a nurse report by NCSBN ID.\n\nThe NCSBN ID is the global, public unique identifier for every U.S.\nnurse maintained by NCSBN (https://www.ncsbn.org/) — analogous to\nNPI for physicians, but covering all licensure regardless of state.\nOnce we have an NCSBN ID we can ask Nursys e-Notify for every license\nthat nurse holds in any participating jurisdiction without needing\nlicense numbers.","examples":[{"first_name":"Jane","last_name":"Public","licenseType":"RN","name":"","ncsbn_id":"99960959","states":["Kansas","Texas"]}]},"OrgPhysiciansResponse":{"properties":{"organization_slug":{"type":"string","title":"Organization Slug"},"organization_name":{"type":"string","title":"Organization Name"},"physicians":{"items":{"$ref":"#/components/schemas/PhysicianInfo"},"type":"array","title":"Physicians"},"total_count":{"type":"integer","title":"Total Count"}},"type":"object","required":["organization_slug","organization_name","physicians","total_count"],"title":"OrgPhysiciansResponse"},"PhysicianInfo":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"report_count":{"type":"integer","title":"Report Count","default":0},"latest_update":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Update"},"membership_role":{"type":"string","title":"Membership Role","default":"physician"}},"type":"object","required":["user_id","email"],"title":"PhysicianInfo"},"PlanDetails":{"properties":{"id":{"type":"string","title":"Id"},"plan_type":{"type":"string","title":"Plan Type"},"plan_name":{"type":"string","title":"Plan Name"},"price":{"type":"number","title":"Price"},"report_credit":{"type":"integer","title":"Report Credit"},"api_credit":{"type":"integer","title":"Api Credit"}},"type":"object","required":["id","plan_type","plan_name","price","report_credit","api_credit"],"title":"PlanDetails"},"PreferencesUpdate":{"properties":{"weekly_email_report":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Weekly Email Report"},"expiration_alerts":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Expiration Alerts"},"urgent_alerts":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Urgent Alerts"},"default_license_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default License Type"},"default_states":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Default States"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"show_only_active_licenses":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Show Only Active Licenses"},"auto_archive_expired_after_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Auto Archive Expired After Days"}},"type":"object","title":"PreferencesUpdate"},"ProfileUpdate":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"}},"type":"object","title":"ProfileUpdate"},"PublicStats":{"properties":{"total_licenses_tracked":{"type":"integer","title":"Total Licenses Tracked"},"total_reports_run":{"type":"integer","title":"Total Reports Run"},"states_covered":{"type":"integer","title":"States Covered"},"scraper_uptime_30d_pct":{"type":"number","title":"Scraper Uptime 30D Pct"},"mcp_calls_30d":{"type":"integer","title":"Mcp Calls 30D","default":0},"pypi_downloads_30d":{"type":"integer","title":"Pypi Downloads 30D","default":0},"npm_downloads_30d":{"type":"integer","title":"Npm Downloads 30D","default":0},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["total_licenses_tracked","total_reports_run","states_covered","scraper_uptime_30d_pct","generated_at"],"title":"PublicStats"},"QueueStatsResponse":{"properties":{"submitted":{"type":"integer","title":"Submitted"},"processing":{"type":"integer","title":"Processing"},"completed":{"type":"integer","title":"Completed"},"failed":{"type":"integer","title":"Failed"}},"type":"object","required":["submitted","processing","completed","failed"],"title":"QueueStatsResponse"},"RecentSignupEntry":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"created_at":{"type":"string","title":"Created At"},"first_mcp_call_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Mcp Call At"},"mcp_call_count":{"type":"integer","title":"Mcp Call Count","default":0},"first_tool":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Tool"},"first_client":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Client"},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"}},"type":"object","required":["user_id","created_at"],"title":"RecentSignupEntry"},"RenewalAckBody":{"properties":{"renewed_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Renewed To"}},"type":"object","title":"RenewalAckBody"},"Report":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"middle_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Middle Name"},"license_type":{"type":"string","title":"License Type"},"states":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"States"},"npi_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Npi Number"},"report_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Type","default":"name"},"google_sheet_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Sheet Url"},"airtable_base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Airtable Base Url"},"created_at":{"type":"string","title":"Created At"},"user_id":{"type":"string","title":"User Id"},"license_ids":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"License Ids"},"total_license":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total License","default":0},"active_license":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Active License","default":0},"expiring_license":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expiring License","default":0},"expired_license":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expired License","default":0},"inactive_license":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inactive License","default":0},"update_excuted_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Update Excuted Date"},"update_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Update Status"},"needs_disambiguation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Needs Disambiguation","default":false},"disambiguation_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disambiguation Reason"}},"type":"object","required":["id","name","first_name","last_name","middle_name","license_type","google_sheet_url","airtable_base_url","created_at","user_id"],"title":"Report"},"ReportAuditEntry":{"properties":{"report_id":{"type":"string","title":"Report Id"},"person":{"type":"string","title":"Person"},"license_type":{"type":"string","title":"License Type"},"total_attached":{"type":"integer","title":"Total Attached"},"visible_count":{"type":"integer","title":"Visible Count"},"hidden_count":{"type":"integer","title":"Hidden Count"},"deleted_count":{"type":"integer","title":"Deleted Count"},"orphan_deleted_count":{"type":"integer","title":"Orphan Deleted Count","description":"Attachments marked deleted=true where the underlying license is still Active and has no competing same-(state, license_number) attachment. These are the exact Steven Winiarski bug pattern."},"over_attached":{"type":"boolean","title":"Over Attached","description":"True if visible_count exceeds the over-attached threshold (~75 by default). Suggests name-match pollution and/or remaining format-variant duplicates."},"orphan_ref_count":{"type":"integer","title":"Orphan Ref Count","description":"Visible attachments whose license_id has NO matching row in the licenses table — dead pointers that inflate the visible count. Surfaces the 2026-06-17 incident pattern where 27 reports had 443 such refs after some upstream cleanup deleted licenses rows without scrubbing the back-references.","default":0}},"type":"object","required":["report_id","person","license_type","total_attached","visible_count","hidden_count","deleted_count","orphan_deleted_count","over_attached"],"title":"ReportAuditEntry"},"ReportAuditResponse":{"properties":{"total_reports_examined":{"type":"integer","title":"Total Reports Examined"},"flagged":{"items":{"$ref":"#/components/schemas/ReportAuditEntry"},"type":"array","title":"Flagged"},"summary":{"additionalProperties":{"type":"integer"},"type":"object","title":"Summary"}},"type":"object","required":["total_reports_examined","flagged","summary"],"title":"ReportAuditResponse"},"ReportCreate":{"properties":{"name":{"type":"string","title":"Name"},"firstName":{"type":"string","title":"Firstname"},"lastName":{"type":"string","title":"Lastname"},"middleName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Middlename"},"licenseType":{"type":"string","title":"Licensetype"},"states":{"items":{"type":"string"},"type":"array","title":"States"}},"type":"object","required":["name","firstName","lastName","licenseType","states"],"title":"ReportCreate","examples":[{"firstName":"John","lastName":"Smith","licenseType":"MD","middleName":"","name":"Sample Report","states":["Alaska","Arizona"]}]},"ReportLicense":{"properties":{"id":{"type":"string","title":"Id"},"state":{"type":"string","title":"State"},"license_number":{"type":"string","title":"License Number"},"license_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Type"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"issued":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issued"},"expired":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expired"},"hidden":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hidden","default":false},"deleted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Deleted","default":false},"renewed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Renewed At"},"renewed_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Renewed To"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"professional":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Professional"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"screenshot_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Screenshot Url"}},"type":"object","required":["id","state","license_number","issued","expired"],"title":"ReportLicense"},"ReportUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"middle_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Middle Name"},"license_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Type"},"google_sheet_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Sheet Url"}},"type":"object","title":"ReportUpdate"},"ReportsPlan":{"properties":{"id":{"type":"string","title":"Id"},"current_report_count":{"type":"integer","title":"Current Report Count"},"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"type":"string","format":"date","title":"End Date"},"current_report_number":{"type":"integer","title":"Current Report Number"},"remain_report_number":{"type":"integer","title":"Remain Report Number"}},"type":"object","required":["id","current_report_count","start_date","end_date","current_report_number","remain_report_number"],"title":"ReportsPlan"},"ResetPasswordRequest":{"properties":{"email":{"type":"string","title":"Email"},"code":{"type":"string","title":"Code"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["email","code","new_password"],"title":"ResetPasswordRequest"},"RotatePasswordRequest":{"properties":{"new_password":{"type":"string","maxLength":50,"minLength":8,"title":"New Password","description":"New API password. Per Nursys spec 3.3: 8-50 chars, ≥1 upper, ≥1 lower, ≥1 digit, must differ from current."}},"type":"object","required":["new_password"],"title":"RotatePasswordRequest"},"ScraperHealthEntry":{"properties":{"checked_at":{"type":"string","title":"Checked At"},"worker_url":{"type":"string","title":"Worker Url"},"total":{"type":"integer","title":"Total"},"ok_count":{"type":"integer","title":"Ok Count"},"bad_count":{"type":"integer","title":"Bad Count"},"states":{"additionalProperties":{"type":"string"},"type":"object","title":"States"}},"type":"object","required":["checked_at","worker_url","total","ok_count","bad_count"],"title":"ScraperHealthEntry"},"ScraperHealthResponse":{"properties":{"latest":{"anyOf":[{"$ref":"#/components/schemas/ScraperHealthEntry"},{"type":"null"}]},"history":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"History"},"per_state_bad_streak":{"additionalProperties":{"type":"integer"},"type":"object","title":"Per State Bad Streak","description":"State name → consecutive runs reported BAD (sorted desc). Persistent BAD = real outage."}},"type":"object","title":"ScraperHealthResponse"},"SettingUpdate":{"properties":{"value":{"title":"Value"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["value"],"title":"SettingUpdate"},"SheetOperationResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"SheetOperationResponse"},"SheetResponse":{"properties":{"sheet_id":{"type":"string","title":"Sheet Id"},"message":{"type":"string","title":"Message"}},"type":"object","required":["sheet_id","message"],"title":"SheetResponse"},"SheetUpdateRequest":{"properties":{"sheet_id":{"type":"string","title":"Sheet Id"},"records":{"items":{"$ref":"#/components/schemas/LicenseRecord"},"type":"array","title":"Records"}},"type":"object","required":["sheet_id","records"],"title":"SheetUpdateRequest"},"SheetWriteRequest":{"properties":{"sheet_id":{"type":"string","title":"Sheet Id"},"records":{"items":{"$ref":"#/components/schemas/LicenseRecord"},"type":"array","title":"Records"}},"type":"object","required":["sheet_id","records"],"title":"SheetWriteRequest"},"SignupRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"},"full_name":{"type":"string","title":"Full Name"},"organization":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization"},"organizations":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Organizations"},"new_organizations":{"anyOf":[{"items":{"$ref":"#/components/schemas/NewOrganization"},"type":"array"},{"type":"null"}],"title":"New Organizations"},"user_type":{"$ref":"#/components/schemas/UserType"},"api_usage_info":{"anyOf":[{"$ref":"#/components/schemas/APIUsageInfo"},{"type":"null"}]},"setup_intent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Setup Intent Id"}},"type":"object","required":["email","password","full_name","user_type"],"title":"SignupRequest"},"SlackNotificationSchema":{"properties":{"full_name":{"type":"string","title":"Full Name"},"email":{"type":"string","format":"email","title":"Email"},"subject":{"type":"string","title":"Subject"},"message":{"type":"string","title":"Message"},"recaptcha_token":{"type":"string","title":"Recaptcha Token"}},"type":"object","required":["full_name","email","subject","message","recaptcha_token"],"title":"SlackNotificationSchema"},"SmokeRunRow":{"properties":{"state":{"type":"string","title":"State"},"license_type":{"type":"string","title":"License Type"},"run_at":{"type":"string","title":"Run At"},"success":{"type":"boolean","title":"Success"},"latency_ms":{"type":"integer","title":"Latency Ms"},"result_count":{"type":"integer","title":"Result Count"},"name_matched":{"type":"boolean","title":"Name Matched"},"license_number_present":{"type":"boolean","title":"License Number Present"},"screenshot_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Screenshot Url"},"screenshot_reachable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Screenshot Reachable"},"raw_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Raw Status"},"error_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Class"},"was_expected_fail":{"type":"boolean","title":"Was Expected Fail","default":false}},"type":"object","required":["state","license_type","run_at","success","latency_ms","result_count","name_matched","license_number_present"],"title":"SmokeRunRow"},"SmokeSuiteResponse":{"properties":{"latest_run_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Run At"},"states_total":{"type":"integer","title":"States Total","default":0},"states_failed":{"type":"integer","title":"States Failed","default":0},"known_broken":{"type":"integer","title":"Known Broken","default":0},"p95_latency_ms":{"type":"integer","title":"P95 Latency Ms","default":0},"latest_rows":{"items":{"$ref":"#/components/schemas/SmokeRunRow"},"type":"array","title":"Latest Rows"},"per_state_history":{"additionalProperties":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"type":"object","title":"Per State History","description":"State → last N rows (oldest→newest) for sparkline charts."}},"type":"object","title":"SmokeSuiteResponse"},"StateStatus":{"properties":{"state_name":{"type":"string","title":"State Name"},"status":{"type":"boolean","title":"Status"}},"type":"object","required":["state_name","status"],"title":"StateStatus"},"StateStatusResponse":{"properties":{"states":{"items":{"$ref":"#/components/schemas/StateStatus"},"type":"array","title":"States"}},"type":"object","required":["states"],"title":"StateStatusResponse"},"StatsResponse":{"properties":{"totalUsers":{"type":"integer","title":"Totalusers"},"activeSubscriptions":{"type":"integer","title":"Activesubscriptions"},"totalCredentials":{"type":"integer","title":"Totalcredentials"},"dailyRequests":{"type":"integer","title":"Dailyrequests"},"userSignups":{"items":{"$ref":"#/components/schemas/UserSignupData"},"type":"array","title":"Usersignups"},"apiUsage":{"items":{"$ref":"#/components/schemas/ApiUsageData"},"type":"array","title":"Apiusage"},"recentActivities":{"items":{"$ref":"#/components/schemas/UserActivity"},"type":"array","title":"Recentactivities"},"loginStats":{"items":{"$ref":"#/components/schemas/LoginStat"},"type":"array","title":"Loginstats"}},"type":"object","required":["totalUsers","activeSubscriptions","totalCredentials","dailyRequests","userSignups","apiUsage","recentActivities","loginStats"],"title":"StatsResponse"},"SubmissionApprovalRequest":{"properties":{"action":{"type":"string","title":"Action"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["action"],"title":"SubmissionApprovalRequest"},"SubsystemCheck":{"properties":{"name":{"type":"string","title":"Name"},"ok":{"type":"boolean","title":"Ok"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["name","ok"],"title":"SubsystemCheck"},"SuspendUserRequest":{"properties":{"reason":{"type":"string","maxLength":500,"minLength":3,"title":"Reason","description":"Why we're suspending — appears in audit log + Slack alert."},"duration_days":{"anyOf":[{"type":"integer","maximum":3650.0,"minimum":1.0},{"type":"null"}],"title":"Duration Days","description":"Auto-unsuspend after N days. Omit for indefinite suspension."}},"type":"object","required":["reason"],"title":"SuspendUserRequest"},"SuspendUserResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"banned_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Banned Until"},"reason":{"type":"string","title":"Reason"},"audit_logged":{"type":"boolean","title":"Audit Logged"}},"type":"object","required":["user_id","reason","audit_logged"],"title":"SuspendUserResponse"},"SystemInfoResponse":{"properties":{"backend_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Backend Sha","description":"Git commit SHA the backend was deployed from"},"backend_started_at":{"type":"string","title":"Backend Started At"},"backend_uptime_seconds":{"type":"integer","title":"Backend Uptime Seconds"},"python_version":{"type":"string","title":"Python Version"},"process_pid":{"type":"integer","title":"Process Pid"},"hostname":{"type":"string","title":"Hostname"},"scheduler_running":{"type":"boolean","title":"Scheduler Running"},"scheduler_job_count":{"type":"integer","title":"Scheduler Job Count"},"sentry_enabled":{"type":"boolean","title":"Sentry Enabled","description":"Whether SENTRY_DSN is configured","default":false},"backup_last_completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Backup Last Completed At","description":"Most recent Supabase daily-backup timestamp (UTC)"},"backup_count_retained":{"type":"integer","title":"Backup Count Retained","description":"Number of retained snapshots","default":0},"backup_pitr_enabled":{"type":"boolean","title":"Backup Pitr Enabled","description":"Point-in-Time Recovery (paid add-on)","default":false}},"type":"object","required":["backend_started_at","backend_uptime_seconds","python_version","process_pid","hostname","scheduler_running","scheduler_job_count"],"title":"SystemInfoResponse"},"TaskQueueInfo":{"properties":{"available":{"type":"boolean","title":"Available"},"stats":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Stats"},"remaining_tasks":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Remaining Tasks"},"daily_update":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Daily Update"}},"type":"object","required":["available"],"title":"TaskQueueInfo"},"TempCreditsUpdate":{"properties":{"credits":{"type":"integer","title":"Credits"}},"type":"object","required":["credits"],"title":"TempCreditsUpdate"},"TestFireResponse":{"properties":{"delivered":{"type":"boolean","title":"Delivered"},"status_code":{"type":"integer","title":"Status Code"},"latency_ms":{"type":"integer","title":"Latency Ms"},"response_body_snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Body Snippet"},"signature_sent":{"type":"string","title":"Signature Sent"},"payload_sent":{"additionalProperties":true,"type":"object","title":"Payload Sent"}},"type":"object","required":["delivered","status_code","latency_ms","signature_sent","payload_sent"],"title":"TestFireResponse"},"TierLimits":{"properties":{"day":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Day"},"month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Month"}},"type":"object","title":"TierLimits"},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"}},"type":"object","required":["access_token"],"title":"Token"},"TryItFreeLicenseResponse":{"properties":{"Full_Name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"License_Type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Type"},"License_Number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Number"},"Status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"Issued":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issued"},"Expired":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expired"},"State":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},"type":"object","title":"TryItFreeLicenseResponse"},"UpdateStateRequest":{"properties":{"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},"type":"object","title":"UpdateStateRequest"},"UpdateStatus":{"properties":{"is_completed":{"type":"boolean","title":"Is Completed"},"status":{"type":"string","title":"Status"},"progress":{"type":"number","title":"Progress"},"total_states":{"type":"integer","title":"Total States"},"processed_states":{"type":"integer","title":"Processed States"}},"type":"object","required":["is_completed","status","progress","total_states","processed_states"],"title":"UpdateStatus"},"UptimePoint":{"properties":{"day":{"type":"string","title":"Day"},"ok":{"type":"integer","title":"Ok"},"fail":{"type":"integer","title":"Fail"},"uptime_pct":{"type":"number","title":"Uptime Pct"}},"type":"object","required":["day","ok","fail","uptime_pct"],"title":"UptimePoint"},"UptimeResponse":{"properties":{"window_days":{"type":"integer","title":"Window Days"},"overall_uptime_pct":{"type":"number","title":"Overall Uptime Pct"},"by_day":{"items":{"$ref":"#/components/schemas/UptimePoint"},"type":"array","title":"By Day"}},"type":"object","required":["window_days","overall_uptime_pct","by_day"],"title":"UptimeResponse"},"UserActivity":{"properties":{"type":{"type":"string","title":"Type"},"description":{"type":"string","title":"Description"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"user":{"anyOf":[{"$ref":"#/components/schemas/UserActivityDetail"},{"type":"null"}]},"details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Details"}},"type":"object","required":["type","description","timestamp"],"title":"UserActivity"},"UserActivityDetail":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["id"],"title":"UserActivityDetail"},"UserDetail":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_sign_in_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sign In At"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"is_active":{"type":"boolean","title":"Is Active","default":true},"reports":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Reports","default":[]},"subscription":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Subscription"},"usage_limits":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Usage Limits"},"report_stats":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Report Stats"}},"type":"object","required":["id","email","created_at"],"title":"UserDetail"},"UserLookupResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"plan_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Type"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"total_mcp_calls":{"type":"integer","title":"Total Mcp Calls","default":0},"mcp_calls_last_24h":{"type":"integer","title":"Mcp Calls Last 24H","default":0},"mcp_calls_last_30d":{"type":"integer","title":"Mcp Calls Last 30D","default":0},"last_call_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Call At"},"last_call_tool":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Call Tool"},"last_call_client":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Call Client"},"by_tool":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Tool"},"by_client":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Client"},"recent_calls":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Recent Calls","description":"Last 25 calls, newest first."}},"type":"object","required":["user_id"],"title":"UserLookupResponse"},"UserPreferences":{"properties":{"weekly_email_report":{"type":"boolean","title":"Weekly Email Report","default":true},"expiration_alerts":{"type":"boolean","title":"Expiration Alerts","default":true},"urgent_alerts":{"type":"boolean","title":"Urgent Alerts","default":true},"default_license_type":{"type":"string","title":"Default License Type","default":"MD"},"default_states":{"items":{},"type":"array","title":"Default States","default":[]},"timezone":{"type":"string","title":"Timezone","default":"America/New_York"},"show_only_active_licenses":{"type":"boolean","title":"Show Only Active Licenses","default":false},"auto_archive_expired_after_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Auto Archive Expired After Days"}},"type":"object","title":"UserPreferences"},"UserProfile":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"}},"type":"object","required":["id","email"],"title":"UserProfile"},"UserSignupData":{"properties":{"date":{"type":"string","title":"Date"},"count":{"type":"integer","title":"Count"},"users":{"items":{"$ref":"#/components/schemas/UserSignupDetail"},"type":"array","title":"Users"}},"type":"object","required":["date","count","users"],"title":"UserSignupData"},"UserSignupDetail":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"}},"type":"object","required":["name","email"],"title":"UserSignupDetail"},"UserType":{"type":"string","enum":["individual_physician","clinic_or_practice","enterprise_admin","developer"],"title":"UserType"},"UserUpdate":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"UserUpdate"},"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"},"VerifyLicenseRequest":{"properties":{"npi":{"type":"string","title":"Npi","description":"10-digit NPI"},"state":{"type":"string","title":"State","description":"State name, e.g. 'California'"}},"type":"object","required":["npi","state"],"title":"VerifyLicenseRequest"},"VerifyLicenseResponse":{"properties":{"npi":{"type":"string","title":"Npi"},"state":{"type":"string","title":"State"},"status":{"type":"string","title":"Status"},"license_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Number"},"expiration_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expiration Date"},"license_active":{"type":"boolean","title":"License Active"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["npi","state","status","license_active"],"title":"VerifyLicenseResponse"},"VerifyTokenResponse":{"properties":{"email":{"type":"string","title":"Email"},"is_valid":{"type":"boolean","title":"Is Valid"}},"type":"object","required":["email","is_valid"],"title":"VerifyTokenResponse"},"WebhookDeliveryStats":{"properties":{"window_days":{"type":"integer","title":"Window Days"},"total":{"type":"integer","title":"Total"},"delivered":{"type":"integer","title":"Delivered"},"pending":{"type":"integer","title":"Pending"},"dead_lettered":{"type":"integer","title":"Dead Lettered"},"success_rate":{"type":"number","title":"Success Rate"},"p50_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"P50 Latency Ms"},"p95_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"P95 Latency Ms"},"by_status_code":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Status Code"},"top_failing_urls":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Top Failing Urls"},"recent_dead_letters":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Recent Dead Letters"}},"type":"object","required":["window_days","total","delivered","pending","dead_lettered","success_rate"],"title":"WebhookDeliveryStats"},"WebhookDeliveryView":{"properties":{"id":{"type":"string","title":"Id"},"subscription_id":{"type":"string","title":"Subscription Id"},"event_type":{"type":"string","title":"Event Type"},"status":{"type":"string","title":"Status"},"attempt_count":{"type":"integer","title":"Attempt Count"},"last_response_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Response Status"},"last_attempted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Attempted At"},"delivered_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivered At"},"next_attempt_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Attempt At"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"last_response_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Response Body"}},"type":"object","required":["id","subscription_id","event_type","status","attempt_count"],"title":"WebhookDeliveryView"},"WebhookSubscriptionPatch":{"properties":{"npis":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Npis","description":"Full replacement list of NPIs to watch (omit to leave unchanged)."},"events":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Events","description":"Event types to receive. Allowed: status_change, expiration_warning_60d, expiration_warning_30d."}},"type":"object","title":"WebhookSubscriptionPatch"},"WebhookSubscriptionView":{"properties":{"id":{"type":"string","title":"Id"},"npis":{"items":{"type":"string"},"type":"array","title":"Npis"},"webhook_url":{"type":"string","title":"Webhook Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"delivery_count":{"type":"integer","title":"Delivery Count","default":0},"last_delivery_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Delivery At"},"last_delivery_success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Last Delivery Success"},"signing_secret_rotated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signing Secret Rotated At"}},"type":"object","required":["id","npis","webhook_url","events","status","created_at"],"title":"WebhookSubscriptionView"},"WebhookTestFireRequest":{"properties":{"webhook_url":{"type":"string","title":"Webhook Url"},"signing_secret":{"type":"string","title":"Signing Secret"},"event_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type","default":"status_change"},"npi":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Npi","default":"1700013174"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","default":"California"},"license_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Number","default":"C12345"},"license_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Type","default":"MD"},"new_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Status","default":"expired"},"expiration_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expiration Date","default":"2026-06-08"},"custom_payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Custom Payload"},"timeout_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Timeout Seconds","default":15}},"type":"object","required":["webhook_url","signing_secret"],"title":"WebhookTestFireRequest"},"WebhookTestFireResponse":{"properties":{"delivered":{"type":"boolean","title":"Delivered"},"status_code":{"type":"integer","title":"Status Code"},"response_body":{"type":"string","title":"Response Body"},"payload_sent":{"additionalProperties":true,"type":"object","title":"Payload Sent"},"signature_sent":{"type":"string","title":"Signature Sent"},"headers_sent":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers Sent"},"latency_ms":{"type":"integer","title":"Latency Ms"}},"type":"object","required":["delivered","status_code","response_body","payload_sent","signature_sent","headers_sent","latency_ms"],"title":"WebhookTestFireResponse"},"WorkerCreate":{"properties":{"id":{"type":"string","title":"Id"},"url":{"type":"string","title":"Url"},"states":{"items":{"type":"string"},"type":"array","title":"States"},"enabled":{"type":"boolean","title":"Enabled","default":true},"worker_name":{"type":"string","title":"Worker Name","default":""},"worker_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Worker Type"},"git_branch":{"type":"string","title":"Git Branch","default":"main"},"pm2_id":{"type":"string","title":"Pm2 Id","default":"1"}},"type":"object","required":["id","url","states"],"title":"WorkerCreate"},"WorkerUpdate":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"states":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"States"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"worker_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Worker Name"},"worker_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Worker Type"},"git_branch":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Git Branch"},"pm2_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pm2 Id"}},"type":"object","title":"WorkerUpdate"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}