Load Leads

API: Load Lead


Description

The Load Lead API allows you to register, import, and distribute leads within a call center platform. Its purpose is to centralize the capture of potential customers coming from campaigns, web forms, external databases, or CRM integrations, so they can later be managed by agents, auto dialers, or follow-up workflows.

 

Note: Api user for this function must have modify_leads set to 1 and user_level must be set to 8 or higher

🔗 URL

https://DOMAIN.croco-dial.net/API/lmapi.php

Note: Replace DOMAIN with the specific domain you want to query.

📝 Required Parameters

Parameter Description
phone_number must be all numbers, 6-16 digits.
phone_code must be all numbers, 1-4 digits, defaults to 1 if not set.
list_id must be all numbers, 3-12 digits, defaults to 999 if not set.
source description of what originated the API call (maximum 20 characters).
campaing must be the campaign to load the lead

Opcional Fields

vendor_lead_code 1-20 characters
source_id 1-50 characters
gmt_offset_now overridden by auto-lookup of phone_code and area_code portion of phone number if applicable
title 1-4 characters
first_name 1-30 characters
middle_initial 1 character
last_name 1-30 characters
address1 1-100 characters
address2 1-100 characters
address3 1-100 characters
city 1-50 characters
state 2 characters
province 1-50 characters
postal_code 1-10 characters
country_code 3 characters
gender U, M, F (Undefined, Male, Female) - defaults to 'U'
date_of_birth YYYY-MM-DD
alt_phone 1-12 characters
email 1-70 characters
security_phrase 1-100 characters
comments 1-255 characters
multi_alt_phones 5-1024 characters (see examples for more info)
rank 1-5 digits
owner 1-20 characters (user ID, Territory or user group)
entry_list_id WARNING! ONLY USE IF YOU KNOW WHAT YOU ARE DOING, CAN BREAK CUSTOM FIELDS! (must be all numbers, 3-12 digits, will not work if custom_fields is set to Y)

Settings Fields

dnc_check Y, N or AREACODE, default is N
campaign_dnc_check Y, N or AREACODE, default is N
campaign_id 2-8 Character campaign ID, required if using campaign_dnc_check or callbacks
add_to_hopper Y or N, default is N
hopper_priority 99 to -99, the higher number the higher priority, default is 0
hopper_local_call_time_check Y or N, default is N. Validate the local call time and/or state call time before inserting lead in the hopper
usacan_prefix_check Y or N, default is N. Check for a valid 4th digit for USA and Canada phone numbers (cannot be 0 or 1).
usacan_areacode_check Y or N, default is N. Check for a valid areacode for USA and Canada phone numbers(also checks for 10-digit length).
nanpa_ac_prefix_check Y or N, default is N. Check for a valid NANPA areacode and prefix, if optional NANPA data is on the system.
custom_fields

Y or N, default is N. Defines whether the API will accept custom field data when inserting leads into the vicidial_list table

For custom fields to be inserted, just add the field label as a variable to the URL string

 For example, if the field_label is "favorite_color" you would add "&favorite_color=blue".

tz_method

<empty>, POSTAL, TZCODE or NANPA, default is <empty> which will use the country code and areacode for time zone lookups

POSTAL relies on the postal_code field

TZCODE relies on the owner field being populated with a proper time zone code

 NANPA relies on the optional NANPA areacode prefix data being loaded on your system.

callback Y or N, default is N. Set this lead as a scheduled callback. campaign_id field is REQUIRED for callbacks.
callback_status 1-6 Character, callback status to use, default is CALLBK (vicidial_list status will be set to CBHOLD to lock.
callback_datetime

YYYY-MM-DD+HH:MM:SS, date and time of scheduled callback. REQUIRED if callback is set.

 'NOW' can be used for current datetime. 'xDAYS' can also be used where 'x' is replaced with a number of days in the future.

callback_type USERONLY or ANYONE, default is ANYONE.
callback_user User ID the USERONLY callback is assigned to.
callback_comments Optional comments to appear when the callback is called back.
lookup_state Y or N, default is N. Looks up state field from areacode list. Only works if the 'state' field is not populated.
list_exists_check Y or N, default is N. If the list_id is not a defined list in the system, it will ERROR and not insert the lead.
duplicate_check

Check for duplicate records in the system, can select more than one (duplicate_check=DUPLIST-DUPTITLEALTPHONELIST)

If duplicate is found, will return error, the duplicate data and lead_id and list_id of existing record

Here are the duplicate_check options:

Request Examples:

GET :

curl -X GET "https://DOMAIN.croco-dial.net/API/lmapi.php?user=MyUser&pass=MyPass&function=add_lead&phone_number=number_client&source=MyUser

POST (Form Data):

If you prefer to send the data as form parameters:

curl -X POST "https://DOMAIN.croco-dial.net/API/lmapi.php" \
  --data-urlencode "user=MyUser" \
  --data-urlencode "pass=MyPass" \
  --data-urlencode "function=add_lead" \
  --data-urlencode "phone_number=number_client" \
  --data-urlencode "source=MyUser"

  Example Response

SUCCESS: add_lead LEAD HAS BEEN ADDED - 7275551111|6666|999|193715|-4
NOTICE: add_lead ADDED TO HOPPER - 7275551111|6666|193715|1677922
SUCCESS: add_lead LEAD HAS BEEN ADDED - 7275551111|6666|999|193716|-4
NOTICE: add_lead CUSTOM FIELDS VALUES ADDED - 7275551111|1234|101
NOTICE: add_lead CUSTOM FIELDS NOT ADDED, CUSTOM FIELDS DISABLED - 7275551111|Y|0
NOTICE: add_lead CUSTOM FIELDS NOT ADDED, NO CUSTOM FIELDS DEFINED FOR THIS LIST - 7275551111|1234|101
NOTICE: add_lead CUSTOM FIELDS NOT ADDED, NO FIELDS DEFINED - 7275551111|1234|101
NOTICE: add_lead MULTI-ALT-PHONE NUMBERS LOADED - 3|6666|193716
NOTICE: add_lead NOT ADDED TO HOPPER, OUTSIDE OF LOCAL TIME - 7275551111|6666|193716|-4|0
NOTICE: add_lead SCHEDULED CALLBACK ADDED - 1234|2011-09-29 12:00:01|TESTCAMP|6666|USERONLY|CALLBK
NOTICE: add_lead SCHEDULED CALLBACK NOT ADDED, USER NOT VALID - 1234|TESTCAMP|6|
NOTICE: add_lead SCHEDULED CALLBACK NOT ADDED, CAMPAIGN NOT VALID - 1234|XYZ
NOTICE: add_lead NANPA options disabled, NANPA prefix data not loaded - 0|6666

  Example Error

ERROR: add_lead INVALID PHONE NUMBER LENGTH - 72755|6666 
ERROR: add_lead INVALID PHONE NUMBER PREFIX - 72755|6666 
ERROR: add_lead INVALID PHONE NUMBER AREACODE - 72755|6666 
ERROR: add_lead INVALID PHONE NUMBER NANPA AREACODE PREFIX - 7275551212|6666
ERROR: add_lead USER DOES NOT HAVE PERMISSION TO ADD LEADS TO THE SYSTEM - 6666|0 
ERROR: add_lead NOT AN ALLOWED LIST ID - 7275551212|98762
ERROR: add_lead NOT A DEFINED LIST ID, LIST EXISTS CHECK ENABLED - 7275551212|12344
ERROR: NO FUNCTION SPECIFIED
ERROR: add_lead DUPLICATE PHONE NUMBER IN LIST - 7275551111|101|8765444
ERROR: add_lead DUPLICATE PHONE NUMBER IN CAMPAIGN LISTS - 7275551111|101|8765444|101
ERROR: add_lead DUPLICATE PHONE NUMBER IN SYSTEM - 7275551111|101|8765444|101
ERROR: add_lead DUPLICATE PHONE NUMBER IN LIST - 7275551111|101|8765444|PHONE
ERROR: add_lead DUPLICATE PHONE NUMBER IN CAMPAIGN LISTS - 7275551111|101|8765444|101|ALT
ERROR: add_lead DUPLICATE PHONE NUMBER IN SYSTEM - 7275551111|101|8765444|101|PHONE
ERROR: add_lead DUPLICATE TITLE ALT_PHONE IN LIST - 1234|7275551111|101|8765444
ERROR: add_lead DUPLICATE TITLE ALT_PHONE IN CAMPAIGN LISTS - 1234|7275551111|101|8765444|101
ERROR: add_lead DUPLICATE TITLE ALT_PHONE IN SYSTEM - 1234|7275551111|101|8765444|101
ERROR: add_lead DUPLICATE NAME PHONE IN LIST - Bob|Smith|7275551113|101|8765444|101
ERROR: add_lead DUPLICATE NAME PHONE IN CAMPAIGN LISTS - Bob|Smith|7275551113|101|8765444|101
ERROR: add_lead DUPLICATE NAME PHONE IN SYSTEM - Bob|Smith|7275551113|101|8765444|101

Revision #5
Created 12 May 2026 18:17:16 by Bruno
Updated 12 May 2026 20:49:12 by Bruno