{"name":"Margin Levers","description":"Customer profitability analysis via profit curves. Segments customers into Generators (profitable) vs Destroyers (unprofitable) using cumulative profit curves. Built for B2B SaaS companies at $1-15M ARR.","version":"1.0","url":"https://marginlevers.com","capabilities":[{"name":"analyze_customers","description":"Submit customer revenue and cost data, receive profit curve segmentation (A-F segments), profitability metrics, and ranked customer lists.","endpoint":"/api/v1/analyze","method":"POST","content_types":["application/json","text/csv"]},{"name":"create_analysis","description":"Create and persist a customer profitability analysis for later retrieval.","endpoint":"/api/v1/analyses","method":"POST"},{"name":"list_analyses","description":"List saved profitability analyses with pagination.","endpoint":"/api/v1/analyses","method":"GET"},{"name":"get_analysis","description":"Retrieve a specific saved analysis by ID with full metrics, segments, and customer data.","endpoint":"/api/v1/analyses/{id}","method":"GET"},{"name":"list_actions","description":"List customer action items (reprice, reduce cost, etc.) with status tracking.","endpoint":"/api/v1/actions","method":"GET"},{"name":"record_action","description":"Record a customer action against a saved analysis so agents can close the loop from recommendation to realized ROI.","endpoint":"/api/v1/actions","method":"POST"},{"name":"update_action","description":"Update the status of a customer action item.","endpoint":"/api/v1/actions/{id}","method":"PATCH"},{"name":"read_roi_summary","description":"Read aggregated portfolio ROI across all completed customer actions: total profit impact, win rate, ROI multiple vs subscription cost, per-action-type breakdown, and top wins/losses. Lets an agent answer 'what did I recover this month' in one call.","endpoint":"/api/v1/roi/summary","method":"GET"},{"name":"get_pricing","description":"Retrieve structured pricing tier data including limits, features, and costs. Public endpoint, no authentication required.","endpoint":"/api/v1/pricing","method":"GET"},{"name":"get_benchmarks","description":"Retrieve anonymized industry benchmark statistics (GPM, head concentration, tail drag) from the community pool.","endpoint":"/api/v1/benchmarks","method":"GET"},{"name":"list_api_keys","description":"List API keys for the authenticated user.","endpoint":"/api/v1/api-keys","method":"GET"},{"name":"create_api_key","description":"Generate a new API key. Full key is returned only once.","endpoint":"/api/v1/api-keys","method":"POST"},{"name":"revoke_api_key","description":"Permanently revoke an API key by ID.","endpoint":"/api/v1/api-keys/{id}","method":"DELETE"},{"name":"manage_webhooks","description":"Register, list, and delete webhook subscriptions for real-time event notifications.","endpoint":"/api/v1/webhooks","method":"GET"},{"name":"register_webhook","description":"Create a new webhook subscription with HMAC-SHA256 signing. Signing secret returned once at creation.","endpoint":"/api/v1/webhooks","method":"POST"},{"name":"delete_webhook","description":"Permanently remove a webhook subscription.","endpoint":"/api/v1/webhooks/{id}","method":"DELETE"},{"name":"test_webhook","description":"Fire a synthetic ping to all active webhook subscriptions to verify connectivity.","endpoint":"/api/v1/webhooks/test","method":"POST"},{"name":"webhook_deliveries","description":"View paginated log of webhook delivery attempts with success/failure status and latency.","endpoint":"/api/v1/webhooks/deliveries","method":"GET"},{"name":"run_scenario","description":"Run a what-if scenario simulation on customer profitability data with AI-generated narrative.","endpoint":"/api/v1/scenarios","method":"POST"},{"name":"compare_analyses","description":"Compare two saved analyses by ID (analysisIdA, analysisIdB) and receive an AI-generated narrative describing segment shifts, profitability drivers, and recommended focus areas between periods. Optional 'question' field to focus the narrative.","endpoint":"/api/v1/analyses/compare","method":"POST"},{"name":"get_risk_radar","description":"Generate a weekly risk briefing for an analysis (analysisId required query param, period optional). Returns up to 5 risk items with urgency ('watch'|'act_now'|'investigate'), dollar impact, and a weekSummary. Requires Growth tier.","endpoint":"/api/v1/risk-radar","method":"GET"},{"name":"generate_implementation_kit","description":"Generate an AI-powered implementation kit for a customer (analysisId + customer fields required). Returns email draft, value justification, and action checklist. Optional format 'pdf'|'zip'. Requires Growth tier with execute scope.","endpoint":"/api/v1/implementation-kits","method":"POST"},{"name":"generate_negotiation_kit","description":"Generate an AI-powered negotiation playbook for a tail customer decision (analysisId + customer object + decisionType required). Returns email draft, meeting script, objection handling, and pricing options. decisionType: 'reprice'|'reduce_scope'|'exit'|'accept_strategic'. Requires Growth tier with execute scope.","endpoint":"/api/v1/negotiation-kits","method":"POST"},{"name":"generate_insights","description":"Generate AI-powered insights for a saved analysis. Requires analysisId (integer) and type ('executive_summary'|'segment_deep_dive'|'action_plan'|'custom_question'|'scenario_analysis'). Optional customQuestion (max 500 chars) for custom_question type. Returns { data: { analysisId, type, content } } where content is a JSON string. Requires Growth tier with execute scope.","endpoint":"/api/v1/insights","method":"POST"},{"name":"generate_board_deck","description":"Generate an AI-powered board deck narrative for a saved analysis. Requires analysisId (integer). Optional companyName (max 200 chars) and audience ('board'|'ops_team'|'ceo'|'investors', default 'ceo'). Returns { data: { analysisId, audience, deck } } with a structured board-ready narrative including segment breakdown and strategic recommendations. Requires Growth tier with execute scope.","endpoint":"/api/v1/board-deck","method":"POST"}],"authentication":{"type":"bearer","header":"Authorization","format":"Bearer ml_live_...","description":"API keys are available to Growth tier ($249/mo) subscribers and above.","signup_url":"https://marginlevers.com/pricing"},"llms_txt":"/llms.txt","llms_full_txt":"/llms-full.txt","openapi_spec":"/api/v1/openapi.json","webhook_events":[{"name":"analysis.created","description":"A new analysis was persisted."},{"name":"action.created","description":"A new customer action was recorded."},{"name":"action.status_changed","description":"An action's status was updated (pending/completed/cancelled)."},{"name":"insight.generated","description":"An AI insight was generated for an analysis."},{"name":"scenario.completed","description":"A scenario simulation finished."},{"name":"segment.changed","description":"A customer's profitability segment changed between two consecutive analyses. Payload: { customerId, customerName, previousSegment, currentSegment, direction, profitChange, analysisId, previousAnalysisId }."},{"name":"risk.detected","description":"A head-segment customer (A or B) dropped to a loss-making segment (D, E, or F). Fired alongside segment.changed for the same migration. Payload: { customerId, customerName, previousSegment, currentSegment, profitDrop, analysisId }."},{"name":"goal.missed","description":"A tracked goal flipped from active to missed because its deadline passed without reaching the target. Payload: { goalId, goalType, target, actual, deadline }."},{"name":"ping","description":"Test event triggered by POST /api/v1/webhooks/test."}],"rate_limits":{"requests_per_minute":120,"daily_analysis_limit":100,"headers":["RateLimit","RateLimit-Policy","X-RateLimit-Limit","X-RateLimit-Remaining","X-RateLimit-Reset","Retry-After"]},"data_handling":{"customer_name_hashing":"SHA-256 one-way hash before storage","ai_data_masking":"Customer names masked as [MASK:XXXX] before AI processing","encryption":"AES-256-GCM for client-side session storage","data_residency":"US (Supabase, Vercel)"},"workflows":{"discovery_url":"/api/v1/workflows","beta":"managed-agents-2026-04-01","description":"Multi-step workflow definitions for AI agent orchestration. GET /api/v1/workflows returns available workflows with MCP tool sequences."},"pricing_tier_required":"growth","contact":"https://marginlevers.com/contact"}