API Reference

Complete REST API documentation for integrating with the LeadSalesHub platform. Build powerful lead distribution workflows with our RESTful API.

Getting Started

Base URL: https://api.leadsaleshub.com/v1

The LeadSalesHub API uses REST principles with JSON for data exchange. All API endpoints require HTTPS and authentication via API key.

Quick Example

curl -X POST https://api.leadsaleshub.com/v1/leads \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@example.com",
    "phone": "555-123-4567",
    "zip_code": "90210",
    "vertical": "insurance"
  }'

Authentication

All API requests require authentication using a Bearer token in the Authorization header:

Authorization: Bearer YOUR_API_KEY
Keep your API key secure! Never expose your API key in client-side code or public repositories.

Getting Your API Key

  1. Log into your LeadSalesHub dashboard
  2. Navigate to Settings → API Keys
  3. Generate a new API key or copy your existing key
  4. Use this key in the Authorization header for all requests

API Endpoints

Method Endpoint Description
POST /leads Submit a new lead for distribution
GET /leads/{id} Retrieve lead details and distribution status
GET /leads List leads with filtering and pagination
GET /buyers List all configured buyers
POST /buyers Create a new buyer configuration
PUT /buyers/{id} Update buyer configuration
GET /reports/performance Get performance analytics and metrics
GET /reports/revenue Get revenue reports and summaries

Leads API

Submit Lead

POST /leads

Request Body
{
  "first_name": "John",
  "last_name": "Doe",
  "email": "john@example.com",
  "phone": "555-123-4567",
  "zip_code": "90210",
  "vertical": "insurance",
  "source": "facebook_ads",
  "landing_page": "insurance-quote-form",
  "ip_address": "192.168.1.1",
  "user_agent": "Mozilla/5.0...",
  "custom_fields": {
    "age": 35,
    "coverage_type": "auto"
  }
}
Response
{
  "success": true,
  "lead_id": "lead_12345",
  "message": "Lead submitted successfully",
  "distribution": {
    "accepted": true,
    "buyer_id": "buyer_678",
    "price": 25.00,
    "delivery_status": "delivered"
  }
}

Error Codes

Code Status Description
400 Bad Request Invalid request parameters or missing required fields
401 Unauthorized Invalid or missing API key
403 Forbidden API key doesn't have permission for this operation
429 Too Many Requests Rate limit exceeded
500 Server Error Internal server error

Rate Limits

Standard Plan
  • 100 requests/minute
  • 10,000 requests/day
Enterprise Plan
  • 1,000 requests/minute
  • 100,000 requests/day
Rate Limit Headers: Each response includes headers showing your current rate limit status: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset