# LeadPilot REST API — Leads & AI Qualification

**Document Version:** 1.0.0 (Phase 12)  
**Authentication:** Bearer Token (API Key)  
**Base URL:** `/api/v1`

---

## 1. Get Lead with AI Qualification

```http
GET /api/v1/leads/{id}
Authorization: Bearer lp_live_YOUR_API_KEY
```

### Response (200 OK)
```json
{
  "success": true,
  "data": {
    "id": "9cb5a045-8fe1-4c48-8df0-202d6fae3b3a",
    "first_name": "Thomas",
    "last_name": "Anderson",
    "email": "neo@matrix.io",
    "company": "Metacortex",
    "ai_score": 86,
    "temperature": "HOT",
    "ai_status": "completed",
    "recommended_action": "Contact within 15 minutes to schedule technical demo.",
    "ai_scores": [
      {
        "score": 86,
        "temperature": "HOT",
        "urgency": "TODAY",
        "confidence": "HIGH",
        "intent": "High Purchase Intent - Enterprise Software",
        "fit_summary": "Prospect is requesting immediate proposal with $25k budget.",
        "reason": "Clear commercial requirement with stated budget.",
        "recommended_action": "Contact within 15 minutes to schedule technical demo.",
        "positive_signals": ["Budget stated ($25,000)", "Timeline specified"],
        "risk_signals": [],
        "created_at": "2026-08-30T12:00:00Z"
      }
    ]
  }
}
```

---

## 2. Trigger Lead Qualification (API)

```http
POST /api/v1/leads/{id}/qualification
Authorization: Bearer lp_live_YOUR_API_KEY
```

Triggers on-demand evaluation or re-analysis of the lead. Rate-limited to 10 requests per minute.
