{"api":{"name":"Autom8 Enterprise API","description":"Production-grade automation and integration platform","version":"2.0.0","environment":"staging","branch":"staging","build_time":"2026-04-26T07:11:09.214477Z","status":"operational","production_mode":false},"system":{"timestamp":"2026-04-26T07:11:09.214486Z","timezone":"UTC","python_version":"3.10.18","platform":"Linux","uptime_check":"/health"},"endpoints":{"authentication":{"login":{"path":"/auth/login","method":"POST","description":"Exchange legacy API key for JWT token","content_type":"application/json"},"logout":{"path":"/auth/logout","method":"POST","description":"Logout and blacklist current token","authentication":"required"},"user_info":{"path":"/auth/me","method":"GET","description":"Get current user information","authentication":"required"},"employee_auth":{"path":"/auth/employees/authenticate","method":"POST","description":"Generate JWT token for employee by email","authentication":"admin permission required"},"employee_info":{"path":"/auth/employees/me","method":"GET","description":"Get current employee information","authentication":"employee token required"},"generate_token":{"path":"/auth/tokens","method":"POST","description":"Generate new authentication token","authentication":"admin permission required"},"generate_employee_token":{"path":"/auth/employees/tokens","method":"POST","description":"Generate employee authentication token","authentication":"admin permission required"},"generate_admin_token":{"path":"/auth/admin/tokens","method":"POST","description":"Generate admin authentication token","authentication":"admin permission required"},"generate_organization_token":{"path":"/auth/organizations/tokens","method":"POST","description":"Generate organization authentication token","authentication":"admin permission required"}},"employee_management":{"list_employees":{"path":"/employees","method":"GET","description":"List employees with optional filtering","authentication":"admin permission required"},"get_employee":{"path":"/employees/{id}","method":"GET","description":"Get specific employee by ID","authentication":"admin permission required"},"update_employee":{"path":"/employees/{id}","method":"PATCH","description":"Update employee information","authentication":"admin permission required"}},"documentation":{"swagger_ui":{"path":"/docs","description":"Interactive API documentation"},"redoc":{"path":"/redoc","description":"Alternative API documentation"},"openapi_spec":{"path":"/openapi.json","description":"OpenAPI JSON specification"}},"business_logic":{"handlers":{"path":"/handler","method":"GET","description":"Auto-discovered handlers via handler registry","authentication":"varies by handler"}},"public_endpoints":{"demo_handler":{"paths":["/handler/demo_handler"],"method":"POST","description":"Demonstration handler showcasing sync/async processing patterns and enterprise features","authentication":"none","version":"2.0"},"capture_lead":{"paths":["/handler/capture_lead","/handler/leads/capture","/handler/lead"],"method":"POST","description":"## Lead Capture Handler (v2.0)\n\nCapture and process lead data from various sources with full support for dynamic form fields.\n\n### Key Features\n- **Dynamic Field Support** - Accepts ANY form fields, no predefined schema required\n- **Intelligent Field Mapping** - Automatically maps common field variations\n- **Separation of Concerns** - Known fields vs dynamic form questions\n- **Phone/Email Normalization** - Automatic formatting and validation\n- **Attribution Tracking** - UTM parameters and campaign tracking\n- **Nested Data Support** - Handles both flat and nested structures\n\n### How It Works\n1. Accepts any JSON payload with arbitrary fields\n2. Normalizes field names (e.g., `phone` → `contact_phone`)\n3. Separates known ClientLead fields from dynamic form questions\n4. Stores dynamic fields as form questions for maximum flexibility\n5. Processes the lead through the standard ClientLead workflow\n\n### Common Use Cases\n1. **Web Forms** - Any form with any fields, no schema restrictions\n2. **Landing Pages** - Dynamic campaigns with varying questions\n3. **Multi-step Forms** - Combine data from multiple form steps\n4. **A/B Testing** - Different form variations without code changes\n","authentication":"none","version":"2.0"},"sync_calendar_event":{"paths":["/handler/sync_calendar_event","/handler/calendar/sync","/handler/webhooks/calendly"],"method":"POST","description":"## Calendar Event Sync Handler (v2.0)\n\nSynchronizes calendar events from Calendly and other sources for Contente's sales pipeline.\n\n### Key Features\n- **Calendly Integration** - Processes webhooks for scheduled sales meetings\n- **Sales Pipeline Support** - Tracks demo calls, discovery sessions, and consultations\n- **Event Tracking** - Captures invitee details and meeting metadata\n- **Flexible Formats** - Handles various webhook payload structures\n- **Skip Logic** - Ignores events without IDs to prevent noise\n\n### How It Works\n1. Receives Calendly webhook notifications\n2. Extracts event ID from various formats (URI, UUID, nested payload)\n3. Processes event through legacy Calendly handler\n4. Returns structured response for tracking\n\n### Important Note\nThis handler is for Contente's own sales meetings, NOT client appointment emails.\nFor client appointments, use the `sync_booking` handler instead.\n","authentication":"none","version":"2.0"},"process_asana_task":{"paths":["/handler/process_asana_task","/handler/asana/process"],"method":"POST","description":"Process Asana tasks with tag-based automation workflows.\n\n## Features\n- **Tag-based Operations**: Execute different actions based on task tags\n- **Optimization Workflows**: Run ad optimizations based on task data\n- **Approval Processes**: Handle ad approvals and launches\n- **Batch Processing**: Process multiple operations on a single task\n- **Audit Trail**: Comprehensive logging and tracking\n\n## Common Use Cases\n1. **Export Insights**: Run ads insights export to csv for reporting or analysis\n2. **Run Optimizations**: Trigger ad optimization algorithms\n3. **Content Generation**: Generate ad copy via copy factory\n4. **Approval Workflows**: Approve ads and launch campaigns\n5. **Reconciliation**: Run financial reconciliation processes\n\n## Automation Tags\n- `run_export`: Export task data\n- `run_optimizations`: Execute optimization algorithms  \n- `run_ad_report`: Generate ad performance reports\n- `run_copy_factory`: Generate ad copy content\n- `approve_ad`: Approve ads for launch\n- `launch`: Launch approved campaigns\n- `optimize`: Optimize campaign w/ new ads\n- `run_reconcile`: Run reconciliation process\n","authentication":"none","version":"2.0"},"lead_handler":{"paths":["/handler/lead_handler"],"method":"POST","description":"Process and store lead data from various sources with automatic format detection","authentication":"none","version":"2.1"},"demo_operations":{"paths":["/handler/demo_operations","/handler/demo","/handler/test"],"method":"POST","description":"## Demo Operations Handler (v2.0)\n\nA demonstration handler showcasing various processing patterns and best practices.\n\n### Key Features\n- **Multiple Operation Types** - Quick, export, analyze, bulk update, and custom\n- **Progress Tracking** - Real-time progress updates for long operations\n- **Error Simulation** - Demonstrates proper error handling patterns\n- **Flexible Duration** - Control operation timing for testing\n- **Rich Responses** - Shows proper response formatting\n\n### Supported Operations\n1. **quick** - Fast synchronous operation (< 2 seconds)\n2. **export** - Data export with progress tracking\n3. **analyze** - Data analysis generating insights\n4. **bulk_update** - Batch processing demonstration\n5. **error_demo** - Error handling showcase\n6. **custom** - Any custom operation name\n\n### Use Cases\n- Testing async vs sync processing\n- Demonstrating handler patterns\n- Performance benchmarking\n- Error handling examples\n- Integration testing\n","authentication":"none","version":"2.0"},"sync_booking":{"paths":["/handler/sync_booking","/handler/bookings/sync","/handler/appointments/sync"],"method":"POST","description":"## Booking Synchronization Handler (v2.0)\n\nProcesses appointment confirmation emails to extract booking data and create marketing leads.\n\n### Key Features\n- **AI-Powered Parsing** - Uses OpenAI to extract appointment details from emails\n- **Multi-Format Support** - Handles various email formats and appointment systems\n- **Automatic Lead Creation** - Creates/updates leads for marketing opportunities\n- **Smart Office Matching** - Fuzzy matches to find the correct chiropractor office\n- **Notification System** - Sends Slack and SMS notifications for new bookings\n\n### How It Works\n1. Receives email webhook data (HTML content)\n2. Extracts chiropractor ID from recipient email\n3. Uses AI to parse appointment details from email content\n4. Matches to office and creates lead with appointment info\n5. Sends notifications to relevant parties\n\n### Common Use Cases\n1. **Email Webhooks** - Process appointment confirmations from email providers\n2. **Appointment Systems** - Sync bookings from Acuity, Calendly, Square, etc.\n3. **Lead Generation** - Create marketing opportunities from appointment data\n4. **Notification Routing** - Alert offices about new patient bookings\n","authentication":"none","version":"2.0"},"discovery":{"path":"/handler/public","method":"GET","description":"List all available public handler endpoints with their aliases","authentication":"none","note":"Use this endpoint to discover all dynamically configured handlers"}},"handlers":{"list_handlers":{"path":"/handler","method":"GET","description":"List all registered handlers with metadata","authentication":"none"},"handler_info":{"path":"/handler/{handler_name}/info","method":"GET","description":"Get detailed information about a specific handler","authentication":"none"},"execute_handler":{"path":"/handler/{handler_name}","method":"POST","description":"Execute any registered handler by name","authentication":"depends on handler (some public, some require auth)"}},"system":{"health":{"path":"/health","method":"GET","description":"System health and status check","authentication":"none"},"root":{"path":"/","method":"GET","description":"API information and discovery","authentication":"none"},"organizations":{"path":"/system/organizations","method":"GET","description":"List all organizations (System Admin Only)","authentication":"system permission required"}}},"authentication":{"types":["JWT Bearer Token"],"token_types":{"user":"Individual user/employee tokens (7 days default)","organization":"Organization-wide tokens (30 days default)","system":"System administration tokens (90 days default)"},"header_format":"Authorization: Bearer <jwt_token>","permissions":{"read":"View basic data and resources","write":"Create and modify general resources","admin":"Organization administration and user management","system":"System-wide administration (highest level)"},"simplified_approach":{"no_rate_limiting":"Removed complex rate limiting for simplicity","longer_expiry":"Default token expiry increased to days/weeks instead of minutes","optional_auth":"Lead handler and other endpoints are public by default","clean_permissions":"Simplified to 4 core permissions instead of complex tiers"}},"security":{"https_enabled":true,"cors_enabled":true,"environment_specific":false,"trusted_hosts":false,"public_endpoints":["lead_handler","health","/"],"token_based":"JWT tokens with industry-standard claims","audit_logging":true},"support":{"contact":"engineering@autom8.com","documentation":"/docs","status_page":"/health","github":"https://github.com/company/autom8"}}