Lead Management API

A powerful REST API for managing leads with affiliate-specific access control and real-time notifications.

RESTful API API Key Authentication Telegram Notifications

Quick Start

Get started with the Lead Management API in just a few steps:

  1. Get your API Key: Contact the administrator to obtain your unique API key
  2. Set the X-API-KEY header: Include your API key in all requests
  3. Start sending leads: Use the POST /lead endpoint to submit new leads

Authentication

All API requests require authentication using an API key. Include your API key in the X-API-KEY header with every request.

Example:
curl -X POST https://bridgecapital.pro/lead \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your-api-key-here" \
  -d '{"name": "John Doe", "email": "[email protected]", "phone": "+1234567890"}'
Keep your API key secure! Never share it publicly or commit it to version control.

API Endpoints

POST Create Lead

Endpoint:
POST https://bridgecapital.pro/lead
Headers:
  • Content-Type: application/json
  • X-API-KEY: your-api-key
Required Fields:
  • name: Full name of the lead
  • email: Email address
  • phone: Phone number with country code
Optional Fields:
  • country: Country name (e.g., "United States")
  • funnel: Marketing funnel name (see Funnel Reference below)
Request Body Examples:

Minimal (required fields only):

{
  "name": "John Doe",
  "email": "[email protected]",
  "phone": "+1234567890"
}

Complete (all fields):

{
  "name": "John Doe",
  "email": "[email protected]",
  "phone": "+1234567890",
  "country": "United States",
  "funnel": "Facebook"
}
Response (201 Created):
{
  "success": true,
  "lead_id": 123,
  "message": "Lead created successfully"
}
Example Request:
curl -X POST https://bridgecapital.pro/lead \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your-api-key" \
  -d '{
    "name": "John Doe",
    "email": "[email protected]",
    "phone": "+1234567890",
    "country": "United States",
    "funnel": "Facebook"
  }'

GET Get All Your Leads

Endpoint:
GET https://bridgecapital.pro/leads
Headers:
  • X-API-KEY: your-api-key
Optional Query Parameters:
  • status: Filter by status (NEW, NO_ANSWER, etc.)
  • country: Filter by country
  • funnel: Filter by funnel name (Facebook, Google Ads, etc.)
  • from: Start date filter (format: YYYY-MM-DD)
  • to: End date filter (format: YYYY-MM-DD)
  • limit: Number of leads to return
  • offset: Number of leads to skip (for pagination)
Response (200 OK):
{
  "success": true,
  "affiliate_id": 1,
  "affiliate_name": "Your Company",
  "total_leads": 25,
  "leads": [
    {
      "id": 123,
      "name": "John Doe",
      "email": "[email protected]",
      "phone": "+1234567890",
      "country": "United States",
      "funnel_name": "Facebook",
      "status": "NEW",
      "created_at": "2025-07-30T13:57:21.816485",
      "affiliate_id": 1,
      "affiliate_name": "Your Company"
    }
  ]
}
Example Requests:
# Get all leads
curl -X GET https://bridgecapital.pro/leads \
  -H "X-API-KEY: your-api-key"

# Get only NEW leads, 10 at a time
curl -X GET "https://bridgecapital.pro/leads?status=NEW&limit=10" \
  -H "X-API-KEY: your-api-key"

# Get leads from Facebook funnel
curl -X GET "https://bridgecapital.pro/leads?funnel=Facebook" \
  -H "X-API-KEY: your-api-key"

# Get leads from specific country
curl -X GET "https://bridgecapital.pro/leads?country=United%20States" \
  -H "X-API-KEY: your-api-key"

# Get leads from date range
curl -X GET "https://bridgecapital.pro/leads?from=2025-01-01&to=2025-01-31" \
  -H "X-API-KEY: your-api-key"

# Combined filters: NEW leads from Facebook in January 2025
curl -X GET "https://bridgecapital.pro/leads?status=NEW&funnel=Facebook&from=2025-01-01&to=2025-01-31&limit=50" \
  -H "X-API-KEY: your-api-key"

GET Get Available Funnels

Endpoint:
GET https://bridgecapital.pro/funnels
Headers:
  • X-API-KEY: your-api-key
Response (200 OK):
{
  "funnels": [
    {
      "name": "Facebook",
      "description": "Facebook advertising campaigns"
    },
    {
      "name": "Google Ads",
      "description": "Google advertising campaigns"
    },
    {
      "name": "Organic Search",
      "description": "Organic Google search traffic"
    }
  ],
  "total": 3
}
Example Request:
curl -X GET https://bridgecapital.pro/funnels \
  -H "X-API-KEY: your-api-key"
Note: Use these funnel names when creating leads to ensure proper tracking.

GET Get Specific Lead by ID

Endpoint:
GET https://bridgecapital.pro/lead-status/{lead_id}
Headers:
  • X-API-KEY: your-api-key
Response (200 OK):
{
  "lead_id": 123,
  "status": "NEW",
  "name": "John Doe",
  "email": "[email protected]",
  "phone": "+1234567890",
  "country": "United States",
  "funnel_name": "Facebook",
  "created_at": "2025-07-30T13:57:21.816485",
  "affiliate_id": 1
}
Example Request:
curl -X GET https://bridgecapital.pro/lead-status/123 \
  -H "X-API-KEY: your-api-key"
Note: You can only access leads that belong to your affiliate account.

Available Funnels

When creating leads, use one of these funnel names to track the marketing source:

  • Facebook Facebook advertising campaigns
  • Google Ads Google advertising campaigns
  • Organic Search Organic Google search traffic
  • Direct Direct website traffic
  • Email Marketing Email campaign traffic
  • Social Media Social media campaigns
  • Referral Referral traffic from other websites
Note: If you use a funnel name that doesn't exist, it will be automatically created in the system.

Lead Status Values

  • NEW Newly created lead
  • NO_ANSWER Lead contacted but no answer
  • NEVER_ANSWER Lead never answers calls
  • CALL_BACK Lead requested callback
  • NOT_INTERESTED Lead not interested
  • DEPOSITED Lead converted to customer

Error Responses

Status Code Error Type Description
400 Bad Request Missing required fields or invalid data format
401 Unauthorized Missing or invalid API key
404 Not Found Lead not found or doesn't belong to your account
500 Internal Server Error Server error occurred
Example Error Response:
{
  "error": "X-API-KEY header is required"
}

Best Practices

Security
  • Keep your API key confidential
  • Use HTTPS for all requests
  • Implement proper error handling
  • Validate data before sending
Performance
  • Batch requests when possible
  • Handle timeouts gracefully
  • Implement retry logic for failures
  • Cache lead status when appropriate

Need Help?

If you need assistance with the API or want to request an API key, please contact the administrator through the admin panel.