cllr Logocllr

External Lead Integration API

Programmatically integrate with the Whiteclad Noble platform for lead injection and campaign management.

Overview

This documentation is intended for vendors, partners, and developers to programmatically integrate with the Whiteclad Noble platform. It allows for lead injection, campaign discovery, and usage monitoring.

Base URL

All API requests should be made to:

https://api-serve.cllr.ai/api/v1/client

Note: Replace with your specific instance domain if using a dedicated deployment.

1. Authentication

The API uses a Dual-Header Authentication system. You must include specific headers provided by your administrator in every request to authorize your client.

Authentication Headers

HeaderValue FormatRequiredDescription
x-client-idwc_client_...YesYour unique API Client ID.
x-client-secretwc_secret_...YesYour private API Client Secret.

Standard Headers

HeaderValueRequired
Content-Typeapplication/jsonYes

Security Note

Keep your x-client-secret secure. Do not expose it in client-side code (browsers/mobile apps). If compromised, contact support immediately to rotate your keys.

2. Endpoints

2.1 Create Campaign Leads

Inject leads directly into a specific campaign. Leads are created with a pending status and are queued for the AI dialer immediately.

  • Endpoint: POST /leads
  • Rate Limit: Default 60 requests/minute.
  • Batch Size: Max 1000 leads per request.

Request Body Parameters:

FieldTypeRequiredDescription
campaignIdStringYesThe 24-character hexadecimal Campaign ID (e.g., 65f2a1...).
leadsArrayYesAn array of lead objects.
leads[].phoneStringYesPhone number in E.164 format (e.g., +14155551234).
leads[].firstNameStringNoSubscriber's first name.
leads[].lastNameStringNoSubscriber's last name.
leads[].emailStringNoSubscriber's email address.
leads[].priorityStringNolow, medium, high, urgent. Default: medium.
leads[].leadSourceStringNoSource identifiers (e.g., facebook-ads, web-form).
leads[].notesStringNoContext notes for the AI agent to be aware of.
leads[].tagsArrayNoArray of strings (Max 20 tags).
leads[].timeZoneStringNoIANA timezone string (e.g., Asia/Kolkata).
leads[].customFieldsObjectNoKey-value pairs for custom data/context.

Example Request:

curl --location 'https://api-serve.cllr.ai/api/v1/client/leads' \
--header 'Content-Type: application/json' \
--header 'x-client-id: wc_client_xxxxxxxxxxxxxxxx' \
--header 'x-client-secret: wc_secret_xxxxxxxxxxxxxxxx' \
--data-raw '{
    "campaignId": "65f2a1b2c3d4e5f6a7b8c9d0",
    "leads": [
        {
            "phone": "+14155551234",
            "firstName": "John",
            "lastName": "Doe",
            "priority": "high",
            "customFields": {
                "interest": "Premium Plan",
                "budget": "$5000"
            }
        }
    ]
}'

Success Response (201 Created):

{
  "success": true,
  "data": {
    "successful": 1,
    "failed": 0,
    "duplicates": 0,
    "creditsDeducted": 0.01,
    "results": {
      "successful": [
        {
          "phone": "+14155551234",
          "leadId": "65f3...",
          "campaignLeadId": "65f3..."
        }
      ],
      "failed": [],
      "duplicates": []
    }
  }
}

2.2 List Active Campaigns

Retrieve a list of campaigns accessible to your client account. Useful for fetching campaignIds dynamically.

  • Endpoint: GET /campaigns

Query Parameters:

  • page (Number): Page number (Default: 1).
  • limit (Number): Items per page (Default: 20, Max: 100).
  • status (String): Filter by status (active, paused, completed).
  • search (String): Search by campaign name.

2.3 Get Campaign Details

Get specific details about a campaign, including current lead statistics.

  • Endpoint: GET /campaigns/:campaignId

2.4 Check API Status & Credits

Check your organization's current connection status, credit balance, and usage history.

  • Endpoint: GET /status

Response:

{
  "success": true,
  "data": {
    "clientId": "wc_client_...",
    "organization": { "id": "org_...", "name": "Acme Corp" },
    "usage": {
      "totalLeadsCreated": 1540,
      "lastUsedAt": "2024-03-20T10:00:00Z"
    },
    "credits": {
      "balance": 540.50
    }
  }
}

2.5 Check Rate Limits

Monitor your current consumption of the API rate-limit quota.

  • Endpoint: GET /rate-limits

3. Error Codes & Troubleshooting

HTTP CodeError TypeDescription & Solution
400ValidationErrorThe request body is malformed or missing required fields.
401AuthenticationErrorInvalid or missing API credentials. Check headers.
402PaymentRequiredErrorInsufficient credit balance. Please recharge your account.
403AuthorizationErrorForbidden access. Often caused by unauthorized IP or missing scopes.
404NotFoundErrorThe requested campaignId does not exist.
429RateLimitErrorToo many requests. Please slow down (Standard: 60/min).
500InternalServerErrorAn unexpected server error occurred.