{"openapi":"3.1.0","info":{"title":"Drift Inventory Service API","description":"Backend API for dealership inventory scraping and synchronization","version":"1.0.0"},"paths":{"/auth/login":{"post":{"tags":["Authentication"],"summary":"Login Endpoint","description":"Login with email and password\n\n- **email**: Must be danielgardner@sellwithdrift.com\n- **password**: Xano password\n\nReturns auth and refresh tokens","operationId":"login_endpoint_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/LoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["Authentication"],"summary":"Get Me","description":"Get current user info (requires valid Bearer token)\n\nHeaders:\n    Authorization: Bearer <token>","operationId":"get_me_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/auth/verify":{"get":{"tags":["Authentication"],"summary":"Verify Token","description":"Verify if token is valid (returns 200 if valid, 401 if not)\n\nHeaders:\n    Authorization: Bearer <token>","operationId":"verify_token_auth_verify_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/dealerships":{"get":{"tags":["dealerships"],"summary":"Get Dealerships","description":"Get all dealerships from Xano","operationId":"get_dealerships_api_dealerships_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Dealership"},"type":"array","title":"Response Get Dealerships Api Dealerships Get"}}}}}},"post":{"tags":["dealerships"],"summary":"Create Dealership","description":"Create a new dealership in Xano","operationId":"create_dealership_api_dealerships_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealershipCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dealership"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dealerships/{dealership_id}":{"get":{"tags":["dealerships"],"summary":"Get Dealership","description":"Get a specific dealership by ID from Xano","operationId":"get_dealership_api_dealerships__dealership_id__get","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"integer","title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dealership"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["dealerships"],"summary":"Update Dealership","description":"Update an existing dealership in Xano","operationId":"update_dealership_api_dealerships__dealership_id__put","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"integer","title":"Dealership Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealershipCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dealership"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["dealerships"],"summary":"Delete Dealership","description":"Delete a dealership from Xano","operationId":"delete_dealership_api_dealerships__dealership_id__delete","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"integer","title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dealerships/{dealership_id}/toggle":{"post":{"tags":["dealerships"],"summary":"Toggle Dealership","description":"Toggle dealership active status in Xano","operationId":"toggle_dealership_api_dealerships__dealership_id__toggle_post","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"integer","title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dealerships/cache/clear":{"post":{"tags":["dealerships"],"summary":"Clear Cache","description":"Clear the dealership cache","operationId":"clear_cache_api_dealerships_cache_clear_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/dealerships/{dealership_id}/refresh-detection":{"post":{"tags":["dealerships"],"summary":"Refresh Detection","description":"Re-run provider detection and merge new capability fields into the\ndealer's existing config. Hand-tuned operational fields are preserved.\n\nSUPABASE-ONLY. This endpoint is part of the AutoSnap AI Origin product —\nit reads from and writes to Supabase `inventory_import_configuration`\nEXCLUSIVELY. It does NOT touch Xano. Xano-only dealerships (legacy admin-\nUI dealers that have not been onboarded to the Origin product) return\n404 here.\n\nThe `dealership_id` path parameter is the Supabase `dealership.id`\nprimary key — NOT a Xano config id.\n\nReturns a diff showing exactly which capability subtrees changed. Fires\n`dealer.config_auto_updated` on capability changes and\n`dealer.provider_changed` on provider-mismatch (parity with the daily\nhealth-check webhook contract).","operationId":"refresh_detection_api_dealerships__dealership_id__refresh_detection_post","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"integer","title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/scraper/{dealership_id}/run":{"post":{"tags":["scraper"],"summary":"Run Scraper","description":"Manually trigger scraper for a dealership via Celery high-priority queue.\nReturns immediately — the scrape runs in a separate worker process.\n\n**Admin-only.** Each call queues a real scrape that spends BrightData /\nScraperAPI budget and writes to Xano, and dealership ids are small\nenumerable integers. This was anonymously callable until 2026-08-20 — see\nthe note on purge_cached_images for why the X-Origin-Auth middleware does\nnot authenticate the caller. The ops dashboard reaches it through the\nfrontend's server-side proxy (frontend/app/api/scraper/[...path]/route.ts),\nwhich injects ADMIN_API_KEY.","operationId":"run_scraper_api_scraper__dealership_id__run_post","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"integer","title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/scraper/dry-run":{"post":{"tags":["scraper"],"summary":"Scraper Dry Run Start","description":"Start a dry-run scrape. Returns a job_id immediately; the actual\nscrape runs in a background task. Poll the result via\nGET /api/scraper/dry-run/{job_id}.\n\n**Admin-only.** The endpoint fires the same paid proxy cascade\n(BrightData / ScraperAPI / IPRoyal) as a real scrape, so anonymous\naccess was a money-leak risk -- a 7d Sentry sweep showed 559 events\nfrom a single unauthenticated curl client probing dealers we cannot\nscrape (Sentry AUTOSNAP-AI-3H). Gating to ``tier='admin'`` matches\nthe pattern already used by ``/api/detection/detect-provider`` and\nthe IMS feed CRUD routes.\n\nBody:\n    provider: registered provider name (e.g. \"DEP\", \"DealerOn\")\n    config:   dict matching the provider's Pydantic config model\n    session_id: optional string for log correlation (auto-generated\n                if omitted)\n    image_probe_attempts: how many times to probe each proxy method\n                          against the sampled image URL (default 3)\n\nThe config is validated against the provider's Pydantic model\nBEFORE returning the job_id, so a malformed body fails fast at\nHTTP 400 instead of burning proxy credits in the background.\n\nThe scrape itself does NOT:\n    - write to Supabase or Xano\n    - INSERT into import_log\n    - touch is_scraping\n    - acquire the Redis import lock","operationId":"scraper_dry_run_start_api_scraper_dry_run_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DryRunRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/scraper/dry-run/{job_id}":{"get":{"tags":["scraper"],"summary":"Scraper Dry Run Status","description":"Poll for a dry-run job's status. Returns the dry-run result when\ncomplete, or status info while running.\n\n**Admin-only.** The response includes a full dry-run scrape result\n(raw vehicle data, image probe details), so anonymous read access\nwould leak the same information the POST endpoint produces. Matches\nthe gate on POST /dry-run.","operationId":"scraper_dry_run_status_api_scraper_dry_run__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"api_key","in":"query","required":true,"schema":{"type":"string","title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/scraper/{dealership_id}/unlock":{"post":{"tags":["scraper"],"summary":"Unlock Scraper","description":"Release the Redis distributed lock for this dealer if a prior run crashed\nand left it stuck. Otherwise every subsequent trigger returns immediately\nwith `{'skipped': True, 'reason': 'concurrent_lock'}` until the 1-hour TTL\nexpires.\n\n**Admin-only.** Releasing the lease lets two scrapes run the same dealer\nconcurrently, which is exactly the condition the lock exists to prevent.\nAnonymously callable until 2026-08-20.","operationId":"unlock_scraper_api_scraper__dealership_id__unlock_post","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"integer","title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/scraper/{dealership_id}/status":{"get":{"tags":["scraper"],"summary":"Get Scraper Status","description":"Get scraper status for a dealership","operationId":"get_scraper_status_api_scraper__dealership_id__status_get","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"integer","title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/scraper/reset-stuck-jobs":{"post":{"tags":["scraper"],"summary":"Reset Stuck Jobs","description":"Reset dealerships stuck in 'is_scraping=True' state for > 2 hours\n\nThis endpoint detects and fixes dealerships that got stuck in a scraping state\ndue to crashed jobs, timeouts, or other failures. It's safe to call at any time.\n\n**Admin-only.** Mass-mutates is_scraping across the fleet. \"Safe to call at\nany time\" was written when it was assumed to be internal; it was in fact\nanonymously callable until 2026-08-20, and clearing the flag out from under\na live scrape lets a second one start on the same dealer.","operationId":"reset_stuck_jobs_api_scraper_reset_stuck_jobs_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/scraper/purge-cached-images":{"post":{"tags":["scraper"],"summary":"Purge Cached Images","description":"Delete cached/rehosted images from R2 and database.\nSupports filtering by:\n  - original_url_contains: only deletes images whose original_url contains that string\n  - vin: only deletes images for a specific VIN\nIf no filter is provided, rejects the request to prevent accidental full purge.\n\n**Admin-only.** This is a destructive primitive: it deletes hosted vehicle\nimages from R2 AND their database rows, and `original_url_contains` accepts\na substring broad enough (\"https\") to match the entire table. It was\nreachable anonymously until 2026-08-20.\n\nThe X-Origin-Auth middleware in api/main.py does NOT authenticate the\ncaller -- it only proves the request transited Cloudflare, and Cloudflare's\nTransform Rule stamps that header onto every request from anyone. So the\npublic hostname was the only thing an attacker needed. Verified: a request\nto https://api.autosnap.com/api/scraper/... with no auth header at all\nreturns 404 (routed), while the same request straight to the Railway origin\nreturns 403. Same reasoning that already made /dry-run admin-only.","operationId":"purge_cached_images_api_scraper_purge_cached_images_post","parameters":[{"name":"original_url_contains","in":"query","required":false,"schema":{"type":"string","title":"Original Url Contains"}},{"name":"vin","in":"query","required":false,"schema":{"type":"string","title":"Vin"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/images/{vin}/{filename}":{"get":{"tags":["images"],"summary":"Serve Image","description":"Redirect to vehicle image on R2.\n\nBackwards-compatible: existing URLs like /images/{vin}/img_0.jpg\nredirect (302) to the R2 public URL.\n\nArgs:\n    vin: Vehicle Identification Number\n    filename: Image filename (e.g., img_0.jpg)","operationId":"serve_image_images__vin___filename__get","parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}},{"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"}}}}}}},"/images/health":{"get":{"tags":["images"],"summary":"Images Health","description":"Health check for image serving.\n\nReturns:\n    Status and storage info from database","operationId":"images_health_images_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/images/test-r2":{"post":{"tags":["images"],"summary":"Test R2 Upload","description":"Quick smoke test: download one image, upload to R2, verify URL, cleanup.\nTests the full ImageRehostService flow on production.","operationId":"test_r2_upload_images_test_r2_post","parameters":[{"name":"image_url","in":"query","required":false,"schema":{"type":"string","default":"https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png","title":"Image Url"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/images/cleanup/stats":{"get":{"tags":["images"],"summary":"Cleanup Stats","description":"Get statistics about images eligible for cleanup.\n\nReturns:\n    Stats about orphaned images","operationId":"cleanup_stats_images_cleanup_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/images/cleanup":{"post":{"tags":["images"],"summary":"Run Cleanup","description":"Manually trigger image cleanup.\n\nArgs:\n    retention_hours: Delete images not seen in this many hours (default: 24)\n\nReturns:\n    Cleanup results","operationId":"run_cleanup_images_cleanup_post","parameters":[{"name":"retention_hours","in":"query","required":false,"schema":{"type":"integer","default":24,"title":"Retention Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/database/health":{"get":{"tags":["database"],"summary":"Database Health","description":"Comprehensive PostgreSQL connection health check.\n\nTests:\n- Environment variable presence\n- Connection pool creation\n- Simple query execution\n- Connection pool stats\n\nReturns detailed diagnostics for troubleshooting.","operationId":"database_health_api_database_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Database Health Api Database Health Get"}}}}}}},"/api/results/task/{task_id}":{"get":{"tags":["Task Results"],"summary":"Get Task Result","description":"Get result for a specific task ID\n\nReturns both Celery standard result and enhanced metadata","operationId":"get_task_result_api_results_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/results/query":{"get":{"tags":["Task Results"],"summary":"Query Task Results","description":"Query task results with filters","operationId":"query_task_results_api_results_query_get","parameters":[{"name":"task_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by task name","title":"Task Name"},"description":"Filter by task name"},{"name":"task_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by task type","title":"Task Type"},"description":"Filter by task type"},{"name":"success","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by success status","title":"Success"},"description":"Filter by success status"},{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by dealership ID","title":"Dealership Id"},"description":"Filter by dealership ID"},{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by session ID","title":"Session Id"},"description":"Filter by session ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"description":"Maximum results to return","default":100,"title":"Limit"},"description":"Maximum results to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/results/statistics":{"get":{"tags":["Task Results"],"summary":"Get Task Statistics","description":"Get task execution statistics for a given date","operationId":"get_task_statistics_api_results_statistics_get","parameters":[{"name":"date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Date in YYYY-MM-DD format","title":"Date"},"description":"Date in YYYY-MM-DD format"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/results/dlq":{"get":{"tags":["Task Results"],"summary":"Get Dead Letter Queue","description":"Get tasks from the Dead Letter Queue","operationId":"get_dead_letter_queue_api_results_dlq_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"description":"Maximum results to return","default":100,"title":"Limit"},"description":"Maximum results to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/results/dlq/{task_id}/requeue":{"post":{"tags":["Task Results"],"summary":"Requeue Failed Task","description":"Requeue a task from the Dead Letter Queue","operationId":"requeue_failed_task_api_results_dlq__task_id__requeue_post","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/results/dlq/clear":{"delete":{"tags":["Task Results"],"summary":"Clear Dead Letter Queue","description":"Clear all tasks from the Dead Letter Queue\n\nWARNING: This is a destructive operation","operationId":"clear_dead_letter_queue_api_results_dlq_clear_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/results/cleanup":{"post":{"tags":["Task Results"],"summary":"Cleanup Expired Results","description":"Trigger manual cleanup of expired results\n\nNote: Redis TTL handles most expiration automatically","operationId":"cleanup_expired_results_api_results_cleanup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/results/health":{"get":{"tags":["Task Results"],"summary":"Check Result Backend Health","description":"Check health of the result backend","operationId":"check_result_backend_health_api_results_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/health":{"get":{"tags":["Monitoring"],"summary":"Comprehensive Health Check","description":"Health check endpoint. Railway hits this on deploy to verify the app is alive.\n\nBy default returns a fast 200 so deploys don't time out waiting for\nRedis/Celery/Xano/scraper checks. Pass ?deep=true for the full check.","operationId":"comprehensive_health_check_api_monitoring_health_get","parameters":[{"name":"deep","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Deep"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/monitoring/health/redis":{"get":{"tags":["Monitoring"],"summary":"Redis Health","description":"Check Redis health only","operationId":"redis_health_api_monitoring_health_redis_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/health/celery":{"get":{"tags":["Monitoring"],"summary":"Celery Health","description":"Check Celery workers and queues health","operationId":"celery_health_api_monitoring_health_celery_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/health/xano":{"get":{"tags":["Monitoring"],"summary":"Xano Health","description":"Check Xano API health","operationId":"xano_health_api_monitoring_health_xano_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/health/scrapers":{"get":{"tags":["Monitoring"],"summary":"Scraper Apis Health","description":"Check external scraper APIs health","operationId":"scraper_apis_health_api_monitoring_health_scrapers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/health/database":{"get":{"tags":["Monitoring"],"summary":"Database Health","description":"Supabase Postgres reachability + connection-pool saturation.\n\nReturns **503** when the database is unreachable or the pool is saturated,\nso a plain HTTP-status monitor can watch it. /health?deep=true cannot be\nwatched that way -- it answers 200 even when degraded.\n\nThis is the store holding every vehicle, dealer config and import log, and\nuntil 2026-08-12 nothing monitored it at all.","operationId":"database_health_api_monitoring_health_database_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/health/provider-funding":{"get":{"tags":["Monitoring"],"summary":"Provider Funding Health","description":"Credit/quota headroom for the paid providers (ScraperAPI, OpenRouter, Brevo).\n\nBrightData's balance rides along with /health/scrapers instead -- see\nmonitoring/provider_funding.py.\n\nReturns **503** when a provider is critically low, so this endpoint can be\nwatched by a plain HTTP-status monitor. /health?deep=true deliberately\ncannot do that: it answers 200 even when degraded, which makes it useless\nto anything that only reads status codes.","operationId":"provider_funding_health_api_monitoring_health_provider_funding_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/health/system":{"get":{"tags":["Monitoring"],"summary":"System Health","description":"Check system resources (disk, memory)","operationId":"system_health_api_monitoring_health_system_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/liveness":{"get":{"tags":["Monitoring"],"summary":"Liveness","description":"Kubernetes liveness probe\n\nReturns 200 if application is alive, 503 if not\nUsed by k8s to determine if pod should be restarted","operationId":"liveness_api_monitoring_liveness_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/readiness":{"get":{"tags":["Monitoring"],"summary":"Readiness","description":"Kubernetes readiness probe\n\nReturns 200 if application is ready to serve traffic, 503 if not\nUsed by k8s to determine if pod should receive traffic","operationId":"readiness_api_monitoring_readiness_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/startup":{"get":{"tags":["Monitoring"],"summary":"Startup","description":"Kubernetes startup probe\n\nReturns 200 if application has started successfully, 503 if not\nUsed by k8s during initial container startup","operationId":"startup_api_monitoring_startup_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/coverage/history_reports":{"get":{"tags":["Monitoring"],"summary":"History Report Coverage","description":"Per-dealer coverage of vehicle history reports (AutoCheck/CARFAX).\n\nReturns two percentages per dealer:\n  - url_detection_pct: how many active vehicles had a history_report_url\n    populated by the scraper (the SRP badge was found)\n  - enrichment_pct: of those with a URL, how many have a parsed\n    vehicle_history_data row in vin_enrichment (the enrichment task\n    successfully fetched + parsed the report)\n\nA dealer with high url_detection but low enrichment = parser or fetch\npipeline is failing for them. A dealer with low url_detection = their\nscraper isn't capturing the signal (maybe they don't subscribe).","operationId":"history_report_coverage_api_monitoring_coverage_history_reports_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/health/configs":{"get":{"tags":["Monitoring"],"summary":"Config Health","description":"Report broken/incomplete scraper configurations.\n\nValidates that every active config has the required fields for its provider.\nBroken configs cause scrapes to return 0 vehicles.","operationId":"config_health_api_monitoring_health_configs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/health/imports":{"get":{"tags":["Monitoring"],"summary":"Import Health","description":"Comprehensive import health check for all active dealers.\n\nReturns per-dealer status and overall health assessment.\nAlert conditions:\n- CRITICAL: dealer has 0 successful imports within its cadence-based\n  staleness threshold (2 cycles + 1h, capped at 26h)\n- CRITICAL: import received vehicles but wrote 0 (silent failure)\n- WARNING: import had errors > 0\n- WARNING: pool exhaustion retry was triggered\n- WARNING: dealer stuck in 'running' for > 15 minutes","operationId":"import_health_api_monitoring_health_imports_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/setup-trend":{"get":{"tags":["Monitoring"],"summary":"Setup Trend","description":"Time-bucketed import success/failure trend from `import_log`.\n\nQuery params:\n  - `window`: time range to look back (`1h`, `4h`, `6h`, `24h`)\n  - `bucket`: bucket size for the time series (`1m`, `5m`, `15m`, `1h`)\n  - `provider`: optional filter (`CDK`, `DealerOn`, `CarsCommerce`,\n    `DealerInspire`, `Algolia`, etc). Omit for overall (all providers).\n\n`bucket` must evenly divide `window`.\n\nA row is counted as `completed` iff `status='completed'`. Anything\nelse (`failed`, `partial`, `error`, etc.) is treated as `failed`.\nRows with `status='running'` are EXCLUDED from both — they're not\nyet a terminal outcome. This matches the rate-alerts dedupe logic.\n\nPlain dict response. ISO-8601 timestamps. Percentages rounded to 2\ndecimal places.","operationId":"setup_trend_api_monitoring_setup_trend_get","parameters":[{"name":"window","in":"query","required":false,"schema":{"type":"string","default":"1h","title":"Window"}},{"name":"bucket","in":"query","required":false,"schema":{"type":"string","default":"5m","title":"Bucket"}},{"name":"provider","in":"query","required":false,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/monitoring/ping":{"get":{"tags":["Monitoring"],"summary":"Ping","description":"Simple ping endpoint for uptime monitoring","operationId":"ping_api_monitoring_ping_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/monitoring/version":{"get":{"tags":["Monitoring"],"summary":"Version","description":"Get application version and deployment information","operationId":"version_api_monitoring_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/detect-provider":{"post":{"tags":["detection"],"summary":"Detect Provider","description":"Auto-detect the inventory provider for a dealership website.\n\nIf async_mode=true, returns a job_id immediately. Poll\nGET /api/detect-provider/{job_id} for results.\n\nIf async_mode=false (default), blocks until detection completes\nand returns the full result inline. Typically 15-30 seconds.","operationId":"detect_provider_api_detect_provider_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectProviderRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/detect-provider/{job_id}":{"get":{"tags":["detection"],"summary":"Get Detect Provider Status","description":"Poll for async detect-provider job status.\n\nPhase 4 (Step 3): reads from the Redis-backed detection_job_store.\n`_jobs` continues to receive writes via the Phase 3 dual-write\npath but is no longer the read source. The store.get() return\nshape is byte-identical to the legacy `_jobs[job_id]` shape (see\nservices/detection_job_store.py:get for the contract).","operationId":"get_detect_provider_status_api_detect_provider__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai-confirm-config":{"post":{"tags":["detection"],"summary":"Ai Confirm Config","description":"Use AI to confirm the provider and return a validated config.\n\nUses Anthropic Opus 4.6 with tool use (test scrape + MarketCheck validation)\nby default. Falls back to OpenRouter single-shot if ANTHROPIC_API_KEY is not\nset or AI_CONFIRM_PROVIDER=openrouter.\n\nWorks in two modes:\n- With detection_results: verifies and corrects auto-detected config\n- Without detection_results (Ask AI): identifies provider from raw network data","operationId":"ai_confirm_config_api_ai_confirm_config_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIConfirmRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/detect-and-confirm":{"post":{"tags":["detection"],"summary":"Detect And Confirm","description":"Start async detection + AI confirmation pipeline.\n\nReturns a job_id immediately. Poll GET /api/detect-and-confirm/{job_id} for results.\nPipeline: detect provider -> AI confirm with tool-use validation.\nTypical runtime: 30-150s depending on provider and Cloudflare status.","operationId":"detect_and_confirm_api_detect_and_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectAndConfirmRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/detect-and-confirm/{job_id}":{"get":{"tags":["detection"],"summary":"Get Detect And Confirm Status","description":"Poll for detect-and-confirm job status.\n\nReturns status, current stage, elapsed time, and result when complete.\n\nPhase 4 (Step 3): reads from the Redis-backed detection_job_store.\n`_jobs` continues to receive writes via the Phase 3 dual-write\npath but is no longer the read source. The store.get() return\nshape is byte-identical to the legacy `_jobs[job_id]` shape; see\ntest_detection_phase4_read.py for the shape-equivalence pin.\n\nThe win this phase unlocks: post-deploy 404 ghost-jobs go away.\nPre-Phase-4, every redeploy wiped the in-process `_jobs` dict and\nfrontends polling in-flight job_ids would 404 indefinitely. Now\nstate survives in Redis with a 1h TTL.","operationId":"get_detect_and_confirm_status_api_detect_and_confirm__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ipacket/auth":{"post":{"tags":["ipacket"],"summary":"Ipacket Auth","description":"Verify iPacket page access password.","operationId":"ipacket_auth_api_ipacket_auth_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPacketAuthRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ipacket/vdp/{vin}":{"get":{"tags":["ipacket"],"summary":"Get Ipacket Vdp","description":"Fetch iPacket VDP data for a VIN.\n\nReturns service receipts, MSRP/window stickers, CARFAX links,\nCPO docs, warranty info, brochures — whatever iPacket has for this VIN.\nReturns empty modules array if VIN is not in iPacket's system.","operationId":"get_ipacket_vdp_api_ipacket_vdp__vin__get","parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/dealers/resolve":{"post":{"tags":["origin"],"summary":"Resolve Dealer","description":"Resolve a dealership identity.\n\nSupports 5 input modes:\n- dealership_url only (DB lookup, then SERP fallback)\n- dealership_url + vin (DB lookup, then VIN fallback, then SERP fallback)\n- vin only (MarketCheck lookup)\n- dealer_name + vin (MarketCheck + name scoring)\n- dealer_name + dealer_address (address-based resolution)","operationId":"resolve_dealer_v1_dealers_resolve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inventory/fetch":{"post":{"tags":["origin"],"summary":"Fetch Inventory","description":"Fetch paginated vehicle inventory for a known dealership URL.\n\nDealership must already be resolved and in the system.","operationId":"fetch_inventory_v1_inventory_fetch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routes__origin__FetchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/dealers/setup":{"post":{"tags":["origin"],"summary":"Setup Dealer","description":"Detect provider, generate config, subscribe client, start billing.\n\nASYNC-ONLY (Layer-1, 2026-06-09). Every setup returns HTTP 202 with a\n``setup_id`` immediately; the detection pipeline executes on the\ndedicated worker_setup service (setup_priority queue), NOT on this API\nprocess. Clients poll ``GET /v1/dealers/setup/{setup_id}`` until\n``status`` is \"completed\" or \"failed\" (recommended interval: 5s), or\nsubscribe to the ``setup.complete`` webhook.\n\nThe synchronous inline-response path was removed entirely -- it ran\n60-500s of Playwright + proxy egress on the API process (degrading\nunrelated traffic; see MAX_CONCURRENT_DETECTIONS below) and Railway's\nedge proxy disconnected sync clients at ~60s anyway. ``body.async_mode``\nis accepted but ignored (deprecated; see SetupRequest).\n\nThe reactivation path (inactive subscription exists for the URL) is\nunchanged: it does no detection, completes inline in milliseconds, and\nstill returns HTTP 200 with the reactivation shape.","operationId":"setup_dealer_v1_dealers_setup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/dealers/setup/{setup_id}":{"get":{"tags":["origin"],"summary":"Get Setup Status","description":"Poll the status of an async setup job.","operationId":"get_setup_status_v1_dealers_setup__setup_id__get","parameters":[{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","title":"Setup Id"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/dealers":{"get":{"tags":["origin"],"summary":"List Dealers","description":"List all dealerships under this account.","operationId":"list_dealers_v1_dealers_get","parameters":[{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/dealers/{dealership_id}":{"get":{"tags":["origin"],"summary":"Get Dealer","description":"Get a single dealership's details and config.","operationId":"get_dealer_v1_dealers__dealership_id__get","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"string","title":"Dealership Id"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["origin"],"summary":"Update Dealer","description":"Update a dealership's inventory type or import schedule.","operationId":"update_dealer_v1_dealers__dealership_id__patch","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"string","title":"Dealership Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealerPatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["origin"],"summary":"Delete Dealer","description":"Remove a dealership subscription. Deactivates the subscription and stops imports.","operationId":"delete_dealer_v1_dealers__dealership_id__delete","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"string","title":"Dealership Id"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/live-health":{"get":{"tags":["origin"],"summary":"Get Live Health","description":"Per-provider and per-dealer live rate, cached reasons, circuit state, p50.","operationId":"get_live_health_v1_admin_live_health_get","parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","default":24,"title":"Hours"}},{"name":"min_dealer_calls","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Min Dealer Calls"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/usage":{"get":{"tags":["origin"],"summary":"Get Usage","description":"Account usage stats: request counts, imports, errors.","operationId":"get_usage_v1_usage_get","parameters":[{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealership Id"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks":{"post":{"tags":["origin"],"summary":"Create Webhook","description":"Register webhook subscriptions for one or more event types.\n\nCreates one DB row per event type, all sharing the same URL and secret.\nReturns all created subscription IDs.","operationId":"create_webhook_v1_webhooks_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["origin"],"summary":"List Webhooks","description":"List all webhook subscriptions for the authenticated client.","operationId":"list_webhooks_v1_webhooks_get","parameters":[{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{webhook_id}":{"delete":{"tags":["origin"],"summary":"Delete Webhook","description":"Deactivate a webhook subscription.","operationId":"delete_webhook_v1_webhooks__webhook_id__delete","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"integer","title":"Webhook Id"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{webhook_id}/reactivate":{"patch":{"tags":["origin"],"summary":"Reactivate Webhook","description":"Re-enable an auto-disabled webhook subscription and reset failure count.\n\nAlso clears first_failure_at: it is the clock for the 24 h auto-disable in\ndb/webhook_outbox.py, and left set it would disable the webhook again on\nthe next dispatcher run.","operationId":"reactivate_webhook_v1_webhooks__webhook_id__reactivate_patch","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"integer","title":"Webhook Id"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/reactivate-all":{"patch":{"tags":["origin"],"summary":"Reactivate All Webhooks","description":"Re-enable ALL auto-disabled webhook subscriptions for this client.","operationId":"reactivate_all_webhooks_v1_webhooks_reactivate_all_patch","parameters":[{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{webhook_id}/deliveries":{"get":{"tags":["origin"],"summary":"List Deliveries","description":"List recent delivery logs for a webhook subscription.","operationId":"list_deliveries_v1_webhooks__webhook_id__deliveries_get","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"integer","title":"Webhook Id"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/live/vehicles/{vin}":{"get":{"tags":["origin"],"summary":"Get Vehicle Live By Vin","description":"Live per-VIN VDP fetch.\n\n`dealership_id` is OPTIONAL: omitted, the VIN is resolved across the caller's\nactive dealers and EVERY match is returned — one VIN can legitimately sit at two\nrooftops of one group. No match is a 404.\n\n`dealer_url` is OPTIONAL and is the un-onboarded entry point. Resolution order:\n`dealership_id` if given; else, when `dealer_url`'s host is one of the caller's\nactive dealers WITH an active import configuration, the stored-row path above;\nelse the un-onboarded path (services/live_vdp/any_dealer.py): region gate,\nper-host Redis cache, homepage discovery, synthetic config into the existing\nadapter. That path charges CLASS_LIVE_ANY in addition to this route's class,\nwrites nothing to `dealership` or `inventory_import_configuration`, and answers\n`live` / `gone` / `unavailable` / `unsupported`, or 422 DEALER_NOT_DETECTED,\nDEALER_UNREACHABLE, REGION_NOT_COVERED.\n\nAlways HTTP 200 on a resolved VIN. A dealer-site failure surfaces as\n`source: \"cached\"` with a `cached_reason`, never as our 5xx.\n\nA record warmed by POST /v1/live/prewarm inside its TTL is returned as\n`source: \"prewarmed\"` carrying the warm record's OWN `observed_at` -- never a\nfresh timestamp -- and spends no fetch. `fresh=true` bypasses that store.","operationId":"get_vehicle_live_by_vin_v1_live_vehicles__vin__get","parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}},{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"}},{"name":"dealer_url","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealer Url"}},{"name":"source","in":"query","required":false,"schema":{"type":"string","default":"dealer_website","title":"Source"}},{"name":"fresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Fresh"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/live/prewarm":{"post":{"tags":["origin"],"summary":"Create Prewarm Session","description":"Start a prewarm session. Returns 202 immediately; fetches run in the\nbackground, so a slow dealer never holds the caller's connection open.","operationId":"create_prewarm_session_v1_live_prewarm_post","parameters":[{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrewarmSessionRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/live/prewarm/{prewarm_id}":{"get":{"tags":["origin"],"summary":"Get Prewarm Session","description":"Per-VIN status and outcome for a prewarm session.","operationId":"get_prewarm_session_v1_live_prewarm__prewarm_id__get","parameters":[{"name":"prewarm_id","in":"path","required":true,"schema":{"type":"string","title":"Prewarm Id"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/search":{"post":{"tags":["search"],"summary":"Semantic Search","description":"Semantic vehicle search.\n\nEmbeds the query string, searches Qdrant with optional metadata filters,\nhydrates full vehicle records from Supabase.","operationId":"semantic_search_v2_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vehicles/{vehicle_id}/similar":{"get":{"tags":["search"],"summary":"Find Similar","description":"Find vehicles similar to a given vehicle by its Supabase ID.\n\nBy default scoped to the same dealership. Set cross_dealer=true to search\nacross every dealership this key may see, never beyond them.","operationId":"find_similar_v2_vehicles__vehicle_id__similar_get","parameters":[{"name":"vehicle_id","in":"path","required":true,"schema":{"type":"integer","title":"Vehicle Id"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"cross_dealer","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Cross Dealer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vehicles/vin/{vin}/similar":{"get":{"tags":["search"],"summary":"Find Similar By Vin","description":"Find vehicles similar to a given vehicle by VIN.","operationId":"find_similar_by_vin_v2_vehicles_vin__vin__similar_get","parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"}},{"name":"cross_dealer","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Cross Dealer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/match-score":{"post":{"tags":["search"],"summary":"Match Score","description":"Score an LLM-supplied shopper intent against a caller-supplied list\nof VINs using each vehicle's already-stored Qdrant vector — no\nre-embedding of vehicles. One embedding call (the intent), one Qdrant\nretrieve, cosine similarity in Python.\n\nScores are in the natural-language low range (~0.2–0.4), NOT the 0.9+\nof /similar (which compares two rich vehicle vectors). That's expected:\nshort intent vs full vehicle vector. Do not normalize or inflate.","operationId":"match_score_v2_match_score_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchScoreRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vehicles/vin/{vin}":{"get":{"tags":["search"],"summary":"Get Vehicle By Vin","description":"Get full vehicle details by exact VIN match.\n\nNot a semantic search — exact VIN lookup. Returns full specs,\npricing, features, photos, and iPacket document availability.","operationId":"get_vehicle_by_vin_v2_vehicles_vin__vin__get","parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vehicles/vin/{vin}/documents":{"get":{"tags":["search"],"summary":"Get Vehicle Documents","description":"Get vehicle documentation by VIN: service history, window stickers,\nCARFAX, warranties, CPO inspections, brochures, market value.\n\nOptional document_type filter: service_history, window_sticker, carfax,\nwarranty, cpo_inspection, brochure, market_value, financing.","operationId":"get_vehicle_documents_v2_vehicles_vin__vin__documents_get","parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"}},{"name":"document_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vehicles/vin/{vin}/history-report":{"get":{"tags":["search"],"summary":"Vehicle History Report","description":"Return the vehicle history report for a VIN.\n\nData source depends on the dealer's platform: AutoCheck (Experian) for\nCarsCommerce/DealerInspire dealers, CARFAX for CDK dealers. Includes the\nparsed report and, where available, the parsed OEM window sticker. Consumers\ncan also render the raw report/sticker from the `source_*_url` fields on\neach sub-object for a faithful original view.","operationId":"vehicle_history_report_v2_vehicles_vin__vin__history_report_get","parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vehicles/vin/{vin}/marketing-context":{"get":{"tags":["search"],"summary":"Vehicle Marketing Context","description":"Return dealer-curated marketing context for a VIN.\n\nSurfaces marketing-tag insights (e.g. low-mileage flags), local-market\ncomparison baggage, dealership branding, and CARFAX summary strings\nwhen present. Sourced from the dealer's own merchandising stack;\navailable only for dealerships subscribed to that integration.","operationId":"vehicle_marketing_context_v2_vehicles_vin__vin__marketing_context_get","parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vehicles/vin/{vin}/market-comparables":{"get":{"tags":["search"],"summary":"Market Comparables","description":"Compare a vehicle's price against similar vehicles at the dealerships this key may see.","operationId":"market_comparables_v2_vehicles_vin__vin__market_comparables_get","parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vehicles/vin/{vin}/decode":{"get":{"tags":["search"],"summary":"Vin Decode","description":"Decode a VIN via NHTSA.","operationId":"vin_decode_v2_vehicles_vin__vin__decode_get","parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/recalls":{"get":{"tags":["search"],"summary":"Recalls","description":"Check NHTSA safety recalls.","operationId":"recalls_v2_recalls_get","parameters":[{"name":"make","in":"query","required":true,"schema":{"type":"string","title":"Make"}},{"name":"model","in":"query","required":true,"schema":{"type":"string","title":"Model"}},{"name":"year","in":"query","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/safety-ratings":{"get":{"tags":["search"],"summary":"Safety Ratings","description":"Get NHTSA crash test safety ratings.","operationId":"safety_ratings_v2_safety_ratings_get","parameters":[{"name":"make","in":"query","required":true,"schema":{"type":"string","title":"Make"}},{"name":"model","in":"query","required":true,"schema":{"type":"string","title":"Model"}},{"name":"year","in":"query","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/complaints":{"get":{"tags":["search"],"summary":"Complaints","description":"Get NHTSA consumer complaints.","operationId":"complaints_v2_complaints_get","parameters":[{"name":"make","in":"query","required":true,"schema":{"type":"string","title":"Make"}},{"name":"model","in":"query","required":true,"schema":{"type":"string","title":"Model"}},{"name":"year","in":"query","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/fuel-economy":{"get":{"tags":["search"],"summary":"Fuel Economy","description":"Get EPA fuel economy data.","operationId":"fuel_economy_v2_fuel_economy_get","parameters":[{"name":"make","in":"query","required":true,"schema":{"type":"string","title":"Make"}},{"name":"model","in":"query","required":true,"schema":{"type":"string","title":"Model"}},{"name":"year","in":"query","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/window-sticker":{"get":{"tags":["search"],"summary":"Window Sticker","description":"Get factory window sticker PDF.","operationId":"window_sticker_v2_window_sticker_get","parameters":[{"name":"vin","in":"query","required":true,"schema":{"type":"string","title":"Vin"}},{"name":"make","in":"query","required":true,"schema":{"type":"string","title":"Make"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"year","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Year"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/calculate-payment":{"post":{"tags":["search"],"summary":"Calculate Payment","description":"Calculate monthly finance or lease payment.","operationId":"calculate_payment_v2_calculate_payment_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/embeddings/status":{"get":{"tags":["search"],"summary":"Embeddings Status","description":"Get vector collection stats and embedding coverage.\n\nPer-dealer `embedded_vehicles` is sourced from Qdrant (ground truth) — the\nSupabase `embedding_version` flag is bumped optimistically by vector_sync\nand historically disagreed with actual Qdrant state, producing a coverage\nfigure that lied about missing vectors.","operationId":"embeddings_status_v2_embeddings_status_get","parameters":[{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vault/stats":{"get":{"tags":["search"],"summary":"Vault Stats","description":"Get Vault summary stats for the dashboard cards.","operationId":"vault_stats_v2_vault_stats_get","parameters":[{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vault/collections":{"get":{"tags":["search"],"summary":"Vault Collections","description":"Get vector collections for the client.","operationId":"vault_collections_v2_vault_collections_get","parameters":[{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vault/storage-history":{"get":{"tags":["search"],"summary":"Vault Storage History","description":"Get daily storage usage history for charts.","operationId":"vault_storage_history_v2_vault_storage_history_get","parameters":[{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/dashboard/stats":{"get":{"tags":["search"],"summary":"Dashboard Stats","description":"Get all dashboard stats in a single call.\n\nReplaces 6+ individual queries. Returns dealership counts, vehicle counts,\nrequest stats, rate limits, recent activity — everything the dashboard needs.","operationId":"dashboard_stats_v2_dashboard_stats_get","parameters":[{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/dashboard/requests":{"get":{"tags":["search"],"summary":"Dashboard Requests","description":"Get paginated API request log with cursor-based pagination.\n\nPass the last row's ID as cursor to get the next page.\nMuch faster than offset pagination for large tables.","operationId":"dashboard_requests_v2_dashboard_requests_get","parameters":[{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cursor"}},{"name":"endpoint_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint Filter"}},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/dealerships/{dealership_id}/reviews":{"get":{"tags":["search"],"summary":"Dealership Reviews","description":"Get Google reviews for a dealership.","operationId":"dealership_reviews_v2_dealerships__dealership_id__reviews_get","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"integer","title":"Dealership Id"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vehicles/vin/{vin}/incentives":{"get":{"tags":["search"],"summary":"Vehicle Incentives","description":"Get active OEM incentive programs for a specific vehicle (cash back, finance APR, lease offers).\n\nLooks up the dealer's cached incentives for the vehicle's make and filters\nto programs that match the vehicle's year/model/trim. Returns active programs\nthat are valid in the dealer's region (MSA).","operationId":"vehicle_incentives_v2_vehicles_vin__vin__incentives_get","parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}},{"name":"dealership_id","in":"query","required":true,"schema":{"type":"integer","title":"Dealership Id"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vehicles/vin/{vin}/history":{"get":{"tags":["search"],"summary":"Vehicle History Endpoint","description":"Get a vehicle's days-on-lot and price drop history.\n\nReturns when we first saw the vehicle, how many days it has been on the lot,\nevery price change since first listing, and aggregate stats (lowest price ever,\ntotal drop amount, etc.).","operationId":"vehicle_history_endpoint_v2_vehicles_vin__vin__history_get","parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vehicles/safety-score":{"get":{"tags":["search"],"summary":"Vehicle Safety Score Endpoint","description":"Get a unified 1-10 safety score for a vehicle.\n\nSynthesizes NHTSA crash test ratings, recalls, complaints, and (if VIN\nprovided) decoded safety features into a single weighted score with\na qualitative rating (Excellent, Very Good, Good, Average, etc.).","operationId":"vehicle_safety_score_endpoint_v2_vehicles_safety_score_get","parameters":[{"name":"make","in":"query","required":true,"schema":{"type":"string","title":"Make"}},{"name":"model","in":"query","required":true,"schema":{"type":"string","title":"Model"}},{"name":"year","in":"query","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"vin","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vin"}},{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vehicles/trade-in-estimate":{"get":{"tags":["search"],"summary":"Trade In Estimate Endpoint","description":"Estimate the trade-in value for a customer's current vehicle.\n\nReturns a low/fair/high range based on asking prices for similar vehicles\nat the dealerships this key may see, adjusted for mileage and condition.","operationId":"trade_in_estimate_endpoint_v2_vehicles_trade_in_estimate_get","parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"make","in":"query","required":true,"schema":{"type":"string","title":"Make"}},{"name":"model","in":"query","required":true,"schema":{"type":"string","title":"Model"}},{"name":"mileage","in":"query","required":true,"schema":{"type":"integer","title":"Mileage"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"condition","in":"query","required":false,"schema":{"type":"string","default":"good","title":"Condition"}},{"name":"trim","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trim"}},{"name":"zip_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zip Code"}},{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/vehicles/vin/{vin}/pricing-breakdown":{"get":{"tags":["search"],"summary":"Vehicle Pricing Breakdown","description":"Get the structured pricing breakdown for a vehicle.\n\nReturns the dealer's full pricing components — starting price, individual\ndiscounts (cash, bonus, loyalty, military, etc.), fees, and the bottom-line\nfinal price. Available when the dealer's source provider exposes structured\npricing data (currently DealerInspire dealers).","operationId":"vehicle_pricing_breakdown_v2_vehicles_vin__vin__pricing_breakdown_get","parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ims/feeds":{"get":{"tags":["ims"],"summary":"List Feeds","description":"List ALL feed configs in the system.\n\nAdmin-only: feed CRUD is an AutoSnap-internal operation. Admins manage\nevery feed regardless of which admin client originally created it\n(`ims_feed_config.client_id` is audit metadata, not an authorization\ngate). Customer-facing visibility into \"which dealers have IMS\" is\nexposed through dealership metadata + the ims_read entitlement, not\nthrough this endpoint.","operationId":"list_feeds_v1_ims_feeds_get","parameters":[{"name":"api_key","in":"query","required":true,"schema":{"type":"string","title":"Api Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["ims"],"summary":"Create Feed","description":"Create a new IMS feed configuration.\n\nAdmin-only. Tekion (and any other enterprise-tier client) is denied\nhere regardless of ims_read grants — read access does not imply write.","operationId":"create_feed_v1_ims_feeds_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedConfigCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ims/feeds/{feed_id}":{"patch":{"tags":["ims"],"summary":"Update Feed","description":"Update any IMS feed configuration. Admin-only.\n\nAdmins have authority over every feed regardless of which admin client\noriginally created it — `ims_feed_config.client_id` is audit metadata,\nnot an authorization gate.","operationId":"update_feed_v1_ims_feeds__feed_id__patch","parameters":[{"name":"feed_id","in":"path","required":true,"schema":{"type":"string","title":"Feed Id"}},{"name":"api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ims/vehicles":{"get":{"tags":["ims"],"summary":"List Vehicles","description":"List active IMS vehicles for a dealership. Requires ims_read entitlement\non the (client, dealership) pair. Tekion-readable.","operationId":"list_vehicles_v1_ims_vehicles_get","parameters":[{"name":"api_key","in":"query","required":true,"schema":{"type":"string","title":"Api Key"}},{"name":"dealership_id","in":"query","required":true,"schema":{"type":"string","description":"Dealership public_id or internal id","title":"Dealership Id"},"description":"Dealership public_id or internal id"},{"name":"condition","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by condition (New, Used, Certified)","title":"Condition"},"description":"Filter by condition (New, Used, Certified)"},{"name":"make","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Make"}},{"name":"model","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},{"name":"year_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year Min"}},{"name":"year_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year Max"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Per Page"}},{"name":"format","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Response format: 'default' (IMS native) or 'normalized' (matches website vehicle schema)","default":"default","title":"Format"},"description":"Response format: 'default' (IMS native) or 'normalized' (matches website vehicle schema)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ims/feeds/{feed_id}/history":{"get":{"tags":["ims"],"summary":"Feed History","description":"Get import history for a feed config.\n\nCustomer-facing: lets Tekion (or any client with ims_read on the\nfeed's dealership) audit \"did the feed update today?\". The gate\nresolves feed_id -> dealership_id and enforces ims_read on the\nresolved pair, plus multi-tenant ownership of the feed config.","operationId":"feed_history_v1_ims_feeds__feed_id__history_get","parameters":[{"name":"feed_id","in":"path","required":true,"schema":{"type":"string","title":"Feed Id"}},{"name":"api_key","in":"query","required":true,"schema":{"type":"string","title":"Api Key"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/auth-event":{"post":{"tags":["account"],"summary":"Log Auth Event","description":"Record a signup/login attempt + outcome from the web app, WITH the email,\nso per-user auth issues are queryable (the anonymized GoTrue logs + empty\naudit table left us blind on a real signup problem, 2026-07-29). Fire-and-\nforget: always returns 202, never surfaces an error to the browser.","operationId":"log_auth_event_v2_account_auth_event_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthEventRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/me":{"get":{"tags":["account"],"summary":"Get Profile","description":"Get the authenticated user's profile, role, and client info.\n\nReturns client_id: null for users who haven't joined a workspace yet.","operationId":"get_profile_v2_account_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v2/account/join-workspace":{"post":{"tags":["account"],"summary":"Join Workspace","description":"Join an existing client workspace using an organization invite key.","operationId":"join_workspace_v2_account_join_workspace_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinWorkspaceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/create-workspace":{"post":{"tags":["account"],"summary":"Create Workspace","description":"Create a new workspace for an independent user.\n\nAuto-creates a client record, user_client membership (admin), and a test API key.","operationId":"create_workspace_v2_account_create_workspace_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/api-keys":{"get":{"tags":["account"],"summary":"List Api Keys","description":"List all API keys for this client.","operationId":"list_api_keys_v2_account_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["account"],"summary":"Create Api Key","description":"Create a new API key for this client. Hashed-at-rest format —\nplaintext is returned once in the response and never recoverable after.\n\nEnvironment vocabulary is \"live\" | \"test\" (\"production\" accepted as a legacy\nalias for \"live\"). A LIVE key bypasses the monthly test-request hard cap, so\nit is only minted for a billing-enabled client; everyone else transparently\ngets a test key (the action still succeeds). The stored column value is\n\"production\" (DB CHECK constraint), but the API always speaks \"live\".","operationId":"create_api_key_v2_account_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/api-keys/{key_id}/toggle":{"patch":{"tags":["account"],"summary":"Toggle Api Key","description":"Toggle an API key active/inactive.","operationId":"toggle_api_key_v2_account_api_keys__key_id__toggle_patch","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/api-keys/{key_id}/reveal":{"get":{"tags":["account"],"summary":"Reveal Api Key","description":"Return the key's masked prefix only. Full keys are shown exactly once\nat creation and are NOT stored in plaintext (Phase 5), so they cannot be\nrecovered — to get a working key again, revoke and re-issue. `key_value`\nis kept in the response (as null) for backward compatibility.","operationId":"reveal_api_key_v2_account_api_keys__key_id__reveal_get","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/api-keys/{key_id}":{"delete":{"tags":["account"],"summary":"Delete Api Key","description":"Permanently delete an API key.","operationId":"delete_api_key_v2_account_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/dealerships":{"get":{"tags":["account"],"summary":"List Dealerships","description":"List all dealerships linked to this client.","operationId":"list_dealerships_v2_account_dealerships_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v2/account/dealerships/{dealership_id}/schedule":{"patch":{"tags":["account"],"summary":"Update Dealership Schedule","description":"Update the import schedule for a dealership.","operationId":"update_dealership_schedule_v2_account_dealerships__dealership_id__schedule_patch","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"integer","title":"Dealership Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateScheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/dealerships/{dealership_id}/toggle":{"patch":{"tags":["account"],"summary":"Toggle Dealership","description":"Toggle a dealership subscription active/inactive.","operationId":"toggle_dealership_v2_account_dealerships__dealership_id__toggle_patch","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"integer","title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/analytics":{"get":{"tags":["account"],"summary":"Get Analytics","description":"Get request/import analytics for this client.","operationId":"get_analytics_v2_account_analytics_get","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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/chat/threads":{"get":{"tags":["account"],"summary":"List Threads","description":"List all chat threads for this user.","operationId":"list_threads_v2_account_chat_threads_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["account"],"summary":"Create Thread","description":"Create a new chat thread.","operationId":"create_thread_v2_account_chat_threads_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateThreadRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/chat/threads/{thread_id}":{"patch":{"tags":["account"],"summary":"Update Thread","description":"Update a chat thread (title or active status).","operationId":"update_thread_v2_account_chat_threads__thread_id__patch","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"integer","title":"Thread Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["account"],"summary":"Delete Thread","description":"Soft-delete a chat thread (sets active=false).","operationId":"delete_thread_v2_account_chat_threads__thread_id__delete","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"integer","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/chat/threads/{thread_id}/messages":{"get":{"tags":["account"],"summary":"List Messages","description":"List all messages in a thread.","operationId":"list_messages_v2_account_chat_threads__thread_id__messages_get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"integer","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/chat/messages":{"post":{"tags":["account"],"summary":"Create Message","description":"Add a message to a chat thread.","operationId":"create_message_v2_account_chat_messages_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMessageRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/health-check":{"post":{"tags":["account"],"summary":"Run Health Check","description":"Run dealer health checks. If dealership_id is provided, check only that dealer.\nIf null/omitted, check all dealers for this client.","operationId":"run_health_check_v2_account_health_check_post","parameters":[{"name":"dealership_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealership Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/dashboard/stats":{"get":{"tags":["account"],"summary":"Account Dashboard Stats","description":"Dashboard stats — JWT-authenticated version of /v2/dashboard/stats.","operationId":"account_dashboard_stats_v2_account_dashboard_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v2/account/dashboard/requests":{"get":{"tags":["account"],"summary":"Account Dashboard Requests","description":"Paginated request log — JWT-authenticated version of /v2/dashboard/requests.","operationId":"account_dashboard_requests_v2_account_dashboard_requests_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cursor"}},{"name":"endpoint_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint Filter"}},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/account/vault/stats":{"get":{"tags":["account"],"summary":"Account Vault Stats","description":"Vault stats — JWT-authenticated version of /v2/vault/stats.","operationId":"account_vault_stats_v2_account_vault_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v2/account/vault/collections":{"get":{"tags":["account"],"summary":"Account Vault Collections","description":"Vault collections — JWT-authenticated version of /v2/vault/collections.","operationId":"account_vault_collections_v2_account_vault_collections_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v2/account/vault/storage-history":{"get":{"tags":["account"],"summary":"Account Vault Storage History","description":"Vault storage history — JWT-authenticated version of /v2/vault/storage-history.","operationId":"account_vault_storage_history_v2_account_vault_storage_history_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/billing/invoices/generate":{"post":{"tags":["billing"],"summary":"Generate Invoice","description":"Generate a draft invoice for a client + billing period.","operationId":"generate_invoice_v2_billing_invoices_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateInvoiceRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/billing/invoices":{"get":{"tags":["billing"],"summary":"List Invoices","description":"List invoices. Optionally filter by client_id and/or status.","operationId":"list_invoices_v2_billing_invoices_get","parameters":[{"name":"client_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/billing/invoices/{invoice_id}":{"get":{"tags":["billing"],"summary":"Get Invoice","description":"Get full invoice detail with line items.","operationId":"get_invoice_v2_billing_invoices__invoice_id__get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"integer","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/billing/invoices/{invoice_id}/send":{"post":{"tags":["billing"],"summary":"Send Invoice","description":"Generate PDF and send invoice via Brevo email.","operationId":"send_invoice_v2_billing_invoices__invoice_id__send_post","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"integer","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/billing/invoices/{invoice_id}/paid":{"patch":{"tags":["billing"],"summary":"Mark Paid","description":"Mark an invoice as paid.","operationId":"mark_paid_v2_billing_invoices__invoice_id__paid_patch","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"integer","title":"Invoice Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkPaidRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/billing/invoices/{invoice_id}/pdf":{"get":{"tags":["billing"],"summary":"Download Pdf","description":"Generate and return invoice PDF as base64.","operationId":"download_pdf_v2_billing_invoices__invoice_id__pdf_get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"integer","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/provider-regression/run":{"post":{"tags":["admin"],"summary":"Run Provider Regression","description":"Enqueue an on-demand provider-regression run on a worker (full prod\nproxy/cred stack — the only place its verdicts have fidelity).\n\n``force=True`` bypasses the PROVIDER_REGRESSION_ENABLED gate so a BASELINE\ncan be taken before the weekly schedule is switched on. Returns 202\nimmediately; per-provider verdicts (PASS/SLOW/FAIL) are logged at INFO on\nthe worker and any real break emails an ops alert. Read the worker logs\nfor the full baseline.\n\nOptional body, for reproducing a hang rather than taking a baseline:\n  - ``providers``: run only these (e.g. the slow tail) instead of all 23.\n    A subset run SUPPRESSES ops-alert email — it is a hand-run diagnostic\n    with an operator on the logs, and a partial picture must not land in\n    the ops inbox.\n  - ``diag_dumps``: enable the faulthandler all-thread stack sampler, the\n    one instrument that still reports under full GIL starvation.\n\nEither way the run logs a ``provider-regression diag[loop]`` and a\n``provider-regression diag[thread]`` heartbeat: if both go silent the\nprocess is GIL-starved; if only ``[loop]`` does, the event loop is blocked\nbut the GIL is free.","operationId":"run_provider_regression_api_admin_provider_regression_run_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ProviderRegressionRunRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/backfill-history-reports":{"post":{"tags":["admin"],"summary":"Backfill History Reports","description":"Trigger vehicle-history-report enrichment for VINs that have a\ncaptured `history_report_url` but no (or stale) enrichment data.\n\nSafety:\n  - Must supply either `dealership_id` or `vins` (no wildcard run).\n    For a wildcard sweep use the scheduled daily cron instead.\n  - Only VINs with `history_report_url` set are eligible — this is\n    the same per-VIN signal that gates the at-import dispatch. VINs\n    that never got the signal from their SRP scraper are NEVER\n    fetched, no matter what this endpoint is called with.\n  - Respects the staleness window unless `force=true`: already-fetched\n    VINs are skipped if fetched within the last 60 days.\n  - Caps per-dealer volume at `max_vins_per_dealer` (default 50).\n\nCost: each eligible VIN costs ~1 BrightData Web Unlocker credit\n(~$0.0015). A 50-VIN dealer run is ~$0.08.","operationId":"backfill_history_reports_api_admin_backfill_history_reports_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackfillHistoryReportsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/detect-tradepending":{"post":{"tags":["admin"],"summary":"Detect Tradepending Endpoint","description":"Force-run the TradePending detection probe for a single dealer.\n\nTwo modes:\n  - `dealership_id` → looks up the dealer's website, runs detection,\n    writes the result to the dealership row (tradepending_status/dealer_id/snap_id).\n  - `url` → runs detection against an arbitrary URL without touching the\n    database. Useful for probing prospective dealers before we add them.\n\nMust supply exactly one of `dealership_id` or `url`.\n\nCost: $0 for plain-fetchable homepages, ~$0.0015 if BrightData Web\nUnlocker is needed (CF-protected dealer sites).","operationId":"detect_tradepending_endpoint_api_admin_detect_tradepending_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectTradePendingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/backfill-tradepending":{"post":{"tags":["admin"],"summary":"Backfill Tradepending","description":"Trigger TradePending enrichment for VINs at active-TP dealers.\n\nSafety:\n  - Must supply either `dealership_id` or `vins` (no wildcard run).\n    For a wildcard sweep, rely on the daily retry cron.\n  - Only VINs at a dealer with `tradepending_status='active'` and a\n    cached `tradepending_dealer_id` are eligible. Dealers at any other\n    status are skipped (their per-VIN data will be stale forever until\n    the weekly re-probe flips them back to active).\n  - Respects 60-day staleness window unless `force=true`.\n  - Caps per-dealer volume at `max_vins_per_dealer` (default 200).\n\nCost: $0 — TradePending's bootstrap API is free, Heroku-hosted, and\nnot rate-limited at the volumes we hit.","operationId":"backfill_tradepending_api_admin_backfill_tradepending_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackfillTradePendingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/reparse-history-reports":{"post":{"tags":["admin"],"summary":"Reparse History Reports","description":"Run reparse_all_stale() — re-parses every vin_enrichment row whose\nparser_version doesn't match the current combined version for its source.\n\nZero BrightData cost: reads archived HTML from R2 and runs it through the\ncurrent parser code. Intended for parser-version bumps (e.g., after an\nAutoCheck v1 -> v2 or CARFAX v1 -> v2 ship).\n\nSafe to run repeatedly. Idempotent: rows already at a current version\nare filtered out by the SQL query.\n\nPass `force=true` to bypass the version-match filter and reparse every\nnon-null row. Use when a parser ships behavior changes without a\nversion bump (classifier/rule updates with shape unchanged).","operationId":"reparse_history_reports_api_admin_reparse_history_reports_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReparseRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/backfill-ipacket":{"post":{"tags":["admin"],"summary":"Backfill Ipacket","description":"Trigger iPacket enrichment for VINs at iPacket-enabled dealers that\nhave NULL `vin_enrichment.ipacket_modules` (never enriched, or initial\nfetch failed).\n\nUses the same code path as the daily 06:00 UTC retry sweep — but\ncallable on demand. Useful when the daily sweep was failing for some\nreason (e.g., the cross-loop scheduler bug fixed in commit d2e9fc9 —\niPacket retries had been silently broken since 2026-04-23).\n\nSafety:\n  - Only acts on dealers where dealership.ipacket_available=true.\n    Carl Black-class dealers without iPacket are unaffected.\n  - Caps per-dealer at `max_vins_per_dealer` (default 50). Run again\n    to continue. The daily sweep does the same.\n\nCost: each VIN = 1 free GET to iPacket's djapi endpoint. No proxy\nfees, no BrightData. Just iPacket API rate.","operationId":"backfill_ipacket_api_admin_backfill_ipacket_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackfillIpacketRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/detection-runs/{run_id}":{"get":{"tags":["admin"],"summary":"Get Detection Run","description":"Return one detection_run row including operator-only diagnostics.","operationId":"get_detection_run_api_admin_detection_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/detection-runs":{"get":{"tags":["admin"],"summary":"List Detection Runs","description":"List recent detection_run rows. Filterable by dealership_url\n(substring match), provider, and whether diagnostics blob is populated.\n\nUse cases:\n  ?has_diagnostics=true                — only post-2026-05-19 runs (when diagnostics shipped)\n  ?dealership_url=freemantoyota        — all runs for one dealer\n  ?provider=CDK&has_diagnostics=true   — recent CDK runs with diagnostics","operationId":"list_detection_runs_api_admin_detection_runs_get","parameters":[{"name":"dealership_url","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealership Url"}},{"name":"has_diagnostics","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Diagnostics"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/recipe-review/ad-hoc":{"get":{"tags":["admin","recipe-review"],"summary":"Ad Hoc Review Payload","description":"JSON review payload for an arbitrary dealer (no Supabase row required).\n\nExample:\n  /api/admin/recipe-review/ad-hoc?provider=Sokal&url=windsornissan.com\n    &used_path=preownedvehicles&new_path=newvehicles&n=4&include_recipe=true\n\nFor providers that need extra config (FoxDealer dealer_id, CC site_id,\nDI Algolia creds), pass `extra_config` as URL-encoded JSON:\n  /api/admin/recipe-review/ad-hoc?provider=FoxDealer&url=automaxx.com\n    &extra_config=%7B%22dealer_id%22%3A930%7D","operationId":"ad_hoc_review_payload_api_admin_recipe_review_ad_hoc_get","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"url","in":"query","required":true,"schema":{"type":"string","title":"Url"}},{"name":"n","in":"query","required":false,"schema":{"type":"integer","default":6,"title":"N"}},{"name":"condition","in":"query","required":false,"schema":{"type":"string","default":"both","title":"Condition"}},{"name":"used_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Used Path"}},{"name":"new_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Path"}},{"name":"include_recipe","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Recipe"}},{"name":"extra_config","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extra Config"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/recipe-review/ad-hoc/html":{"get":{"tags":["admin","recipe-review"],"summary":"Ad Hoc Review Html","description":"HTML review page for an arbitrary dealer — same UI as\n/dealer/{id}/html, but driven by query params instead of dealership_id.\n\nLets a human reviewer:\n  1. See the extractor output for N sampled VINs side-by-side with VDP links\n  2. Open each VDP in a new tab and visually compare against the rendered card\n  3. Optionally include a fresh LLM-derived recipe column for byte-exact\n     comparison against the legacy extractor (set include_recipe=true)\n\nExample URL (paste in browser, signed in as admin):\n  /api/admin/recipe-review/ad-hoc/html?provider=Sokal\n    &url=windsornissan.com&used_path=preownedvehicles\n    &new_path=newvehicles&n=4&include_recipe=true\n\nFor providers that need extra config (FoxDealer dealer_id, CC site_id,\nDI Algolia creds), pass `extra_config` as URL-encoded JSON.","operationId":"ad_hoc_review_html_api_admin_recipe_review_ad_hoc_html_get","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"url","in":"query","required":true,"schema":{"type":"string","title":"Url"}},{"name":"n","in":"query","required":false,"schema":{"type":"integer","default":6,"title":"N"}},{"name":"condition","in":"query","required":false,"schema":{"type":"string","default":"both","title":"Condition"}},{"name":"used_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Used Path"}},{"name":"new_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Path"}},{"name":"include_recipe","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Recipe"}},{"name":"extra_config","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extra Config"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/recipe-review/dealer/{dealership_id}":{"get":{"tags":["admin","recipe-review"],"summary":"Get Review Payload","description":"Return JSON for human review of recipe extraction at this dealer.\n\nPulls a random sample of N active VINs, fetches each one's BuyContent-\nequivalent HTML on demand (when a recipe is saved on the dealer's\nconfig), and returns a side-by-side comparison: recipe extraction +\nproduction-stored price_components + VDP link.\n\nWhen no recipe is saved yet, the payload still returns the production\nbreakdown for each VIN so the reviewer can spot-check the EXISTING\nextractor against the live VDPs.","operationId":"get_review_payload_api_admin_recipe_review_dealer__dealership_id__get","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"integer","title":"Dealership Id"}},{"name":"n","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"N"}},{"name":"condition","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Condition"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/recipe-review/feedback":{"post":{"tags":["admin","recipe-review"],"summary":"Submit Feedback","description":"Record a human verdict for one VIN.","operationId":"submit_feedback_api_admin_recipe_review_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"}}}}}}},"/api/admin/recipe-review/quality-dashboard":{"get":{"tags":["admin","recipe-review"],"summary":"Quality Dashboard","description":"Tekion-facing quality dashboard: per-provider recipe coverage and\nhuman-review verdict counts.\n\nReturns:\n  {\n    providers: [\n      { provider, n_dealers_supported, n_dealers_with_recipe,\n        n_dealers_runtime_enabled, recipe_coverage_pct,\n        human_verdicts: { recipe_correct, existing_correct, both_correct, both_wrong } }\n    ],\n    global: {\n      total_dealers, total_with_recipe, total_runtime_enabled,\n      total_human_reviews\n    },\n    runtime_fallback: { spent_usd, fallback_calls, budget_usd }\n  }","operationId":"quality_dashboard_api_admin_recipe_review_quality_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/recipe-review/stats/summary":{"get":{"tags":["admin","recipe-review"],"summary":"Feedback Summary","description":"Aggregate human-review verdicts grouped by provider.","operationId":"feedback_summary_api_admin_recipe_review_stats_summary_get","parameters":[{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/recipe-review/dealer/{dealership_id}/html":{"get":{"tags":["admin","recipe-review"],"summary":"Review Html","description":"Bare-bones HTML view of the review payload for ad-hoc browser use.\n\nRenders side-by-side recipe vs production for each sampled VIN with\na clickable VDP link. No JS framework — just <table>. Submit feedback\nvia the JSON POST endpoint manually for now (or wire to a real UI).","operationId":"review_html_api_admin_recipe_review_dealer__dealership_id__html_get","parameters":[{"name":"dealership_id","in":"path","required":true,"schema":{"type":"integer","title":"Dealership Id"}},{"name":"n","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"N"}},{"name":"condition","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Condition"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tradepending/fetch":{"post":{"tags":["tradepending"],"summary":"Tradepending Fetch","description":"Fetch TradePending bootstrap data for a (dealer_id, vin) pair.\n\n- If `dealer_id` is provided, it must belong to one of the caller's\n  dealerships.\n- If `dealer_id` is omitted, we resolve it from the VIN's row at one of the\n  caller's dealerships (requires `dealership.tradepending_dealer_id` to be\n  cached — populated by the detection pipeline in Part B).\n- Responses are cached 15 minutes in Redis to reduce TP-side load and\n  protect against future rate limiting.\n\nReturns the full bootstrap payload (`dealership`, `vehicle`,\n`superlativeResults`, `carfaxData`, `overallSafetyRatings`,\n`likeVehicles`, etc.). Raises 404 when the dealer_id can't be resolved\nor TP returns no usable data.","operationId":"tradepending_fetch_api_tradepending_fetch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routes__tradepending__FetchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/oem-corpus/sweep":{"post":{"tags":["oem-corpus"],"summary":"Trigger Sweep","description":"Queue a sweep.\n\nTwo guarantees callers depend on:\n\n* **Idempotent.** `idempotency_key` is unique-indexed, so a replayed trigger\n  returns the run that already exists rather than starting a second one.\n* **Never concurrent.** A partial unique index allows one non-terminal run\n  per mode. A `full` triggered while one is in flight returns **409 with the\n  running run_id** — it does NOT queue, because two concurrent sweeps would\n  double the per-domain request rate and breach the 1 req/5s ceiling every\n  adapter assumes.","operationId":"trigger_sweep_internal_oem_corpus_sweep_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SweepRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SweepAccepted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/oem-corpus/sweep/{run_id}":{"get":{"tags":["oem-corpus"],"summary":"Sweep Status","description":"Progress for one run. A multi-hour sweep with no output is\nindistinguishable from a hung one, so per-brand progress is written\nincrementally and surfaced here.","operationId":"sweep_status_internal_oem_corpus_sweep__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Sweep Status Internal Oem Corpus Sweep  Run Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/oem-corpus/completeness":{"get":{"tags":["oem-corpus"],"summary":"Completeness","description":"Gap counts by brand and reason, straight from oem_corpus_completeness.","operationId":"completeness_internal_oem_corpus_completeness_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Completeness Internal Oem Corpus Completeness Get"}}}}}}},"/":{"get":{"summary":"Root","description":"API root endpoint","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","description":"Health check endpoint.\n\nReports `degraded` when an optional-but-mounted subsystem failed to start.\nThe MCP server is the first: it can fail on its own (a dependency bump broke\nits import on 2026-09-28) while every other route is fine, and before this\nthe only trace was a single WARNING line nobody read.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/scheduler/status":{"get":{"summary":"Scheduler Status","description":"Get scheduler status","operationId":"scheduler_status_api_scheduler_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/scheduler/diagnostics":{"get":{"summary":"Scheduler Diagnostics","description":"Get comprehensive scheduler diagnostics.\n\nReturns:\n- Scheduler running status\n- Number of scheduled jobs\n- List of stuck dealerships (is_scraping=True for >30 minutes)\n- Job details including next run times","operationId":"scheduler_diagnostics_api_scheduler_diagnostics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AIConfirmRequest":{"properties":{"url":{"type":"string","title":"Url"},"detection_results":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Detection Results","default":[]},"inventory_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Url"},"network_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Network Summary"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"tolerance_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tolerance Pct","default":20.0}},"type":"object","required":["url"],"title":"AIConfirmRequest"},"AuthEventRequest":{"properties":{"event":{"type":"string","title":"Event"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["event"],"title":"AuthEventRequest"},"BackfillHistoryReportsRequest":{"properties":{"dealership_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"},"vins":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Vins"},"max_vins_per_dealer":{"type":"integer","title":"Max Vins Per Dealer","default":50},"force":{"type":"boolean","title":"Force","default":false}},"type":"object","title":"BackfillHistoryReportsRequest"},"BackfillIpacketRequest":{"properties":{"dealership_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"},"max_vins_per_dealer":{"type":"integer","title":"Max Vins Per Dealer","default":50}},"type":"object","title":"BackfillIpacketRequest"},"BackfillTradePendingRequest":{"properties":{"dealership_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"},"vins":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Vins"},"max_vins_per_dealer":{"type":"integer","title":"Max Vins Per Dealer","default":200},"force":{"type":"boolean","title":"Force","default":false}},"type":"object","title":"BackfillTradePendingRequest"},"CreateApiKeyRequest":{"properties":{"name":{"type":"string","title":"Name"},"environment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Environment"}},"type":"object","required":["name"],"title":"CreateApiKeyRequest"},"CreateMessageRequest":{"properties":{"thread_id":{"type":"integer","title":"Thread Id"},"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"},"parts":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Parts"},"tool_invocations":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Invocations"}},"type":"object","required":["thread_id","role","content"],"title":"CreateMessageRequest"},"CreateThreadRequest":{"properties":{"dealership_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"},"dealership_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealership Name"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","default":"New conversation"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","default":"claude-sonnet-4-6"}},"type":"object","title":"CreateThreadRequest"},"CreateWorkspaceRequest":{"properties":{"workspace_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Name"}},"type":"object","title":"CreateWorkspaceRequest"},"DealerPatchRequest":{"properties":{"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"inventory_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Type"},"schedule":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule"}},"type":"object","title":"DealerPatchRequest"},"Dealership":{"properties":{"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"xano_dealership_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Xano Dealership Id"},"supabase_dealership_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Supabase Dealership Id"},"provider":{"type":"string","title":"Provider"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"schedule":{"type":"string","title":"Schedule"},"active":{"type":"boolean","title":"Active","default":true},"is_scraping":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Scraping","default":false},"last_scraped":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Scraped"},"last_vehicle_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Vehicle Count"},"last_xano_import_status":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Last Xano Import Status"},"last_xano_import_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Xano Import At"}},"type":"object","required":["name","provider","config","schedule"],"title":"Dealership"},"DealershipCreate":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"xano_dealership_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Xano Dealership Id"},"provider":{"type":"string","title":"Provider"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"schedule":{"type":"string","title":"Schedule"}},"type":"object","required":["name","provider","config","schedule"],"title":"DealershipCreate"},"DetectAndConfirmRequest":{"properties":{"url":{"type":"string","title":"Url"},"hint_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hint Provider"},"inventory_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Url"},"tolerance_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tolerance Pct","default":20.0},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"}},"type":"object","required":["url"],"title":"DetectAndConfirmRequest"},"DetectProviderRequest":{"properties":{"url":{"type":"string","title":"Url"},"hint_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hint Provider"},"inventory_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Url"},"async_mode":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Async Mode","default":false},"client_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id"}},"type":"object","required":["url"],"title":"DetectProviderRequest"},"DetectTradePendingRequest":{"properties":{"dealership_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"force":{"type":"boolean","title":"Force","default":true}},"type":"object","title":"DetectTradePendingRequest"},"FeedConfigCreate":{"properties":{"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"dealership_id":{"type":"string","title":"Dealership Id"},"provider":{"type":"string","title":"Provider"},"ftp_path":{"type":"string","title":"Ftp Path"},"file_name":{"type":"string","title":"File Name"},"dealer_identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealer Identifier"},"staleness_threshold_hours":{"type":"integer","title":"Staleness Threshold Hours","default":48}},"type":"object","required":["dealership_id","provider","ftp_path","file_name"],"title":"FeedConfigCreate"},"FeedConfigUpdate":{"properties":{"ftp_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ftp Path"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"dealer_identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealer Identifier"},"staleness_threshold_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Staleness Threshold Hours"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}},"type":"object","title":"FeedConfigUpdate"},"FeedbackRequest":{"properties":{"dealership_id":{"type":"integer","title":"Dealership Id"},"vin":{"type":"string","title":"Vin"},"verdict":{"type":"string","title":"Verdict"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"reviewer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer"}},"type":"object","required":["dealership_id","vin","verdict"],"title":"FeedbackRequest"},"GenerateInvoiceRequest":{"properties":{"client_id":{"type":"integer","title":"Client Id"},"billing_period_start":{"type":"string","title":"Billing Period Start"},"billing_period_end":{"type":"string","title":"Billing Period End"}},"type":"object","required":["client_id","billing_period_start","billing_period_end"],"title":"GenerateInvoiceRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IPacketAuthRequest":{"properties":{"password":{"type":"string","title":"Password"}},"type":"object","required":["password"],"title":"IPacketAuthRequest"},"JoinWorkspaceRequest":{"properties":{"org_key":{"type":"string","title":"Org Key"}},"type":"object","required":["org_key"],"title":"JoinWorkspaceRequest"},"LoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"LoginResponse":{"properties":{"authToken":{"type":"string","title":"Authtoken"},"refreshToken":{"type":"string","title":"Refreshtoken"}},"type":"object","required":["authToken","refreshToken"],"title":"LoginResponse"},"MarkPaidRequest":{"properties":{"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"MarkPaidRequest"},"MatchScoreRequest":{"properties":{"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"intent":{"type":"string","title":"Intent"},"vins":{"items":{"type":"string"},"type":"array","title":"Vins"},"dealership_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"},"price_min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Min"},"price_max":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Max"}},"type":"object","required":["intent","vins"],"title":"MatchScoreRequest"},"PaymentRequest":{"properties":{"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"vehicle_price":{"type":"number","title":"Vehicle Price"},"down_payment":{"type":"number","title":"Down Payment","default":0},"trade_value":{"type":"number","title":"Trade Value","default":0},"apr":{"type":"number","title":"Apr","default":6.9},"term_months":{"type":"integer","title":"Term Months","default":60},"tax_rate":{"type":"number","title":"Tax Rate","default":0.0},"payment_type":{"type":"string","title":"Payment Type","default":"finance"},"msrp":{"type":"number","title":"Msrp","default":0}},"type":"object","required":["vehicle_price"],"title":"PaymentRequest"},"PrewarmSessionRequest":{"properties":{"dealership_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"},"vins":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Vins"},"conversation_id":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Conversation Id","description":"Opaque caller tag, echoed back and recorded for metering."},"watch_minutes":{"anyOf":[{"type":"integer","maximum":120.0,"minimum":1.0},{"type":"null"}],"title":"Watch Minutes","description":"Re-warm the set until this many minutes have passed (1-120)."}},"type":"object","title":"PrewarmSessionRequest","description":"PR 2 (design §5.2). Everything except the shape of the call is optional.\n\n`dealership_id` became OPTIONAL here. It was required, and the VIN list was\nfiltered to that one dealer -- which is how the live-VIN audit produced 45\nspurious `error` states by passing one dealership_id with VINs from ten\ndealers. Omitted, each VIN now resolves across the caller's active dealers\nexactly as GET /v1/live/vehicles/{vin} resolves it."},"ProviderRegressionRunRequest":{"properties":{"providers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Providers"},"diag_dumps":{"type":"boolean","title":"Diag Dumps","default":false}},"type":"object","title":"ProviderRegressionRunRequest"},"ReparseRequest":{"properties":{"batch_limit":{"type":"integer","title":"Batch Limit","default":1000},"force":{"type":"boolean","title":"Force","default":false}},"type":"object","title":"ReparseRequest"},"ResolveRequest":{"properties":{"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"dealership_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealership Url"},"dealer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealer Name"},"vin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vin"},"dealer_address":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Dealer Address"}},"type":"object","title":"ResolveRequest"},"SearchRequest":{"properties":{"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"query":{"type":"string","title":"Query"},"dealership_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dealership Id"},"dealership_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealership Url"},"condition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Condition"},"make":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Make"},"year_min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year Min"},"year_max":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year Max"},"price_min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Min"},"price_max":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Max"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","default":10},"score_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score Threshold","default":0.3}},"type":"object","required":["query"],"title":"SearchRequest"},"SetupRequest":{"properties":{"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"dealership_url":{"type":"string","title":"Dealership Url"},"schedule":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule","default":"0 */12 * * *"},"condition_filter":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Condition Filter"},"dealer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealer Name"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"street_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street Address"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"async_mode":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Async Mode"}},"type":"object","required":["dealership_url"],"title":"SetupRequest"},"SweepAccepted":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["run_id","status"],"title":"SweepAccepted"},"SweepRequest":{"properties":{"mode":{"type":"string","enum":["canary","full","brand"],"title":"Mode","default":"canary"},"brands":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Brands"},"idempotency_key":{"type":"string","maxLength":64,"minLength":8,"title":"Idempotency Key"}},"type":"object","required":["idempotency_key"],"title":"SweepRequest"},"UpdateScheduleRequest":{"properties":{"schedule":{"type":"string","title":"Schedule"}},"type":"object","required":["schedule"],"title":"UpdateScheduleRequest"},"UpdateThreadRequest":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}},"type":"object","title":"UpdateThreadRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookCreateRequest":{"properties":{"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"url":{"type":"string","title":"Url"},"event_types":{"items":{"type":"string"},"type":"array","title":"Event Types"},"secret":{"type":"string","title":"Secret"},"dealership_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealership Id"},"max_failures":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Failures","default":10}},"type":"object","required":["url","event_types","secret"],"title":"WebhookCreateRequest"},"_DryRunRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"image_probe_attempts":{"type":"integer","title":"Image Probe Attempts","default":3},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},"additionalProperties":false,"type":"object","required":["provider","config"],"title":"_DryRunRequest"},"api__routes__origin__FetchRequest":{"properties":{"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"dealership_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealership Url"},"dealership_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealership Id"},"page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page","default":1},"per_page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Per Page","default":50},"condition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Condition","default":"all"}},"type":"object","title":"FetchRequest"},"api__routes__tradepending__FetchRequest":{"properties":{"vin":{"type":"string","title":"Vin"},"dealer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealer Id"},"report_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Type","default":"normal"},"force_refresh":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Force Refresh","default":false}},"type":"object","required":["vin"],"title":"FetchRequest"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}