{"openapi":"3.1.0","info":{"title":"Anvesh API","description":"Lead generation engine that hunts for high-value businesses with zero online presence.","version":"1.0.0"},"servers":[{"url":"http://localhost:8000","description":"API Server"}],"paths":{"/automation/start":{"post":{"tags":["Automation"],"summary":"Start a new automation task","description":"Start a new lead scraping automation task. The task runs in the background\nand scrapes Google Maps for businesses matching your criteria.\n\n**How it works:**\n1. Provide an industry keyword (e.g., \"restaurants\", \"gyms\")\n2. Specify one or more locations to search\n3. Optionally set a limit per location\n\nThe task will run asynchronously and you can monitor its progress\nusing the `/automation/tasks/{task_id}` endpoint.","operationId":"start_automation_automation_start_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScrapeRequest"}}}},"responses":{"201":{"description":"Returns the unique task ID for tracking","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/automation/stop":{"post":{"tags":["Automation"],"summary":"Stop all running tasks","description":"Send a stop signal to all currently running automation tasks.\n\nTasks will gracefully stop after completing their current operation.\nThis is useful when you want to halt all scraping activity at once.","operationId":"stop_all_automation_automation_stop_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Returns the count of tasks that received the stop signal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/automation/tasks/{task_id}/stop":{"post":{"tags":["Automation"],"summary":"Stop a specific task","description":"Send a stop signal to a specific automation task by its ID.","operationId":"stop_task_automation_tasks__task_id__stop_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","description":"The unique task ID to stop","title":"Task Id"},"description":"The unique task ID to stop"},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Confirmation that the stop signal was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/automation/tasks/{task_id}":{"get":{"tags":["Automation"],"summary":"Get task status","description":"Retrieve the current status and details of a specific automation task.\n\n**Possible statuses:**\n- `idle` - Task is queued but not yet started\n- `running` - Task is currently scraping\n- `completed` - Task finished successfully\n- `stopped` - Task was stopped by user\n- `error` - Task encountered an error","operationId":"get_task_status_automation_tasks__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","description":"The unique task ID","title":"Task Id"},"description":"The unique task ID"},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Task details including status, config, and any errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/automation/tasks":{"get":{"tags":["Automation"],"summary":"List all tasks","description":"Retrieve a list of all automation tasks (running and completed).\n\nThis returns the full task history for the current session.\nNote: Tasks are stored in memory and will be cleared on server restart.","operationId":"get_all_tasks_automation_tasks_get","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Dictionary of all tasks keyed by task ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/automation/export":{"get":{"tags":["Automation"],"summary":"Export leads to CSV","description":"Export all scraped leads from the database to a downloadable CSV file.\n\nThe CSV includes all lead data: business name, address, phone, website, etc.","operationId":"export_leads_automation_export_get","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"A CSV file download containing all leads"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/keys":{"post":{"tags":["API Keys"],"summary":"Create a new API key","description":"Create a new API key for authenticating with the Anvesh API.\n\n**Important:** The full API key is only returned once in this response.\nStore it securely - you won't be able to retrieve it again!\n\n**Tiers:**\n- `free` - 1,000 leads/month\n- `pro` - 10,000 leads/month \n- `enterprise` - Unlimited","operationId":"create_key_admin_keys_post","parameters":[{"name":"X-Admin-Secret","in":"header","required":true,"schema":{"type":"string","title":"X-Admin-Secret"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyCreate"}}}},"responses":{"201":{"description":"The newly created API key (store this securely!)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["API Keys"],"summary":"List all API keys","description":"Retrieve a list of all API keys in the system.\n\nKeys are returned with masked values (showing only the prefix) for security.","operationId":"list_keys_admin_keys_get","parameters":[{"name":"X-Admin-Secret","in":"header","required":true,"schema":{"type":"string","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"List of all API keys with masked values","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/keys/{key_id}":{"get":{"tags":["API Keys"],"summary":"Get API key details","description":"Retrieve the details of a specific API key by its ID.","operationId":"get_key_admin_keys__key_id__get","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","description":"The unique ID of the API key","title":"Key Id"},"description":"The unique ID of the API key"},{"name":"X-Admin-Secret","in":"header","required":true,"schema":{"type":"string","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"API key details (value is masked)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["API Keys"],"summary":"Delete an API key","description":"Permanently delete an API key from the system.\n\n**⚠️ Warning:** This action cannot be undone!\nAny applications using this key will immediately lose access.","operationId":"delete_key_admin_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","description":"The unique ID of the API key to delete","title":"Key Id"},"description":"The unique ID of the API key to delete"},{"name":"X-Admin-Secret","in":"header","required":true,"schema":{"type":"string","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"Confirmation of deletion","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/keys/{key_id}/usage":{"get":{"tags":["API Keys"],"summary":"Get API key usage statistics","description":"Retrieve usage statistics for a specific API key.\n\nReturns:\n- Total requests made\n- Total leads scraped\n- Monthly usage vs limit\n- Remaining quota","operationId":"get_key_usage_admin_keys__key_id__usage_get","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","description":"The unique ID of the API key","title":"Key Id"},"description":"The unique ID of the API key"},{"name":"X-Admin-Secret","in":"header","required":true,"schema":{"type":"string","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"Usage statistics for the API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/keys/{key_id}/revoke":{"post":{"tags":["API Keys"],"summary":"Revoke an API key","description":"Revoke (deactivate) an API key without deleting it.\n\nThe key will remain in the database but will no longer authenticate.\nThis is useful for temporarily disabling access while preserving history.","operationId":"revoke_key_admin_keys__key_id__revoke_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","description":"The unique ID of the API key to revoke","title":"Key Id"},"description":"The unique ID of the API key to revoke"},{"name":"X-Admin-Secret","in":"header","required":true,"schema":{"type":"string","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"Confirmation of revocation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/me":{"get":{"tags":["API Keys"],"summary":"Get your API key info","description":"Retrieve information about your own API key.\n\nReturns your key's name, tier, limits, and expiration date.","operationId":"get_my_info_me_get","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Your API key information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/me/usage":{"get":{"tags":["API Keys"],"summary":"Get your usage statistics","description":"Retrieve your own API usage statistics.\n\nReturns:\n- Total requests made\n- Total leads scraped \n- Monthly usage vs your tier's limit\n- Remaining quota for the month","operationId":"get_my_usage_me_usage_get","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Your usage statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/automation/tasks":{"get":{"tags":["Admin - Automation"],"summary":"List all automation tasks (Admin)","description":"View all automation tasks across the entire system.\n\nUnlike the user endpoint, this shows ALL tasks regardless of who created them.\nUseful for monitoring system-wide scraping activity.","operationId":"admin_get_all_tasks_admin_automation_tasks_get","parameters":[{"name":"X-Admin-Secret","in":"header","required":true,"schema":{"type":"string","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"All automation tasks with their current status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/automation/stop-all":{"post":{"tags":["Admin - Automation"],"summary":"Force stop all running tasks (Admin)","description":"Send a stop signal to ALL running automation tasks across the entire system.\n\nThis is a system-wide emergency stop that affects all users' tasks.\nUse with caution!","operationId":"admin_stop_all_tasks_admin_automation_stop_all_post","parameters":[{"name":"X-Admin-Secret","in":"header","required":true,"schema":{"type":"string","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"Count of tasks that received the stop signal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/automation/stats":{"get":{"tags":["Admin - Automation"],"summary":"Get system-wide automation statistics (Admin)","description":"Retrieve system-wide automation statistics.\n\nReturns aggregate data about:\n- Total tasks created\n- Currently running tasks\n- Task completion rates\n- Error counts","operationId":"admin_get_stats_admin_automation_stats_get","parameters":[{"name":"X-Admin-Secret","in":"header","required":true,"schema":{"type":"string","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"System-wide automation statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Admin access required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"APIKeyCreate":{"properties":{"name":{"type":"string","title":"Name","description":"A descriptive name for this API key","examples":["Production Key","Development Key","Client XYZ"]},"tier":{"type":"string","title":"Tier","description":"Pricing tier for rate limiting. Options: free, pro, enterprise","default":"free","examples":["free","pro","enterprise"]},"expires_in_days":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Expires In Days","description":"Number of days until the key expires. Leave empty for no expiration.","examples":[30,90,365]}},"type":"object","required":["name"],"title":"APIKeyCreate","description":"Request model for creating a new API key."},"APIResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the request was successful"},"message":{"type":"string","title":"Message","description":"Human-readable message"},"data":{"anyOf":[{},{"type":"null"}],"title":"Data","description":"Response data"},"error":{"type":"boolean","title":"Error","description":"Whether an error occurred"}},"type":"object","required":["success","message","error"],"title":"APIResponse","description":"Standard API response model for OpenAPI documentation.\n\nAll endpoints return this structure.","examples":[{"data":{"id":1,"name":"Example"},"error":false,"message":"Operation completed successfully","success":true}]},"ErrorResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Always false for errors","default":false},"message":{"type":"string","title":"Message","description":"Error message"},"data":{"anyOf":[{},{"type":"null"}],"title":"Data","description":"Additional error details"},"error":{"type":"boolean","title":"Error","description":"Always true for errors","default":true}},"type":"object","required":["message"],"title":"ErrorResponse","description":"Standard error response model for OpenAPI documentation.","examples":[{"data":{"errors":["field -> error message"]},"error":true,"message":"Validation error","success":false}]},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ScrapeRequest":{"properties":{"industry":{"type":"string","title":"Industry","description":"The industry or business type to search for","examples":["restaurants","gyms","salons","plumbers"]},"locations":{"items":{"type":"string"},"type":"array","title":"Locations","description":"List of locations/cities to scrape leads from","examples":[["Mumbai","Delhi","Bangalore"]]},"limit_per_location":{"type":"integer","minimum":-1.0,"title":"Limit Per Location","description":"Maximum number of leads to scrape per location. Use -1 for unlimited.","default":-1,"examples":[50,100,-1]}},"type":"object","required":["industry","locations"],"title":"ScrapeRequest","description":"Configuration for starting a lead scraping automation task.","examples":[{"industry":"restaurants","limit_per_location":50,"locations":["Mumbai","Delhi"]}]},"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"}}}}