The Lead Zeppelin API allows you access to your lead data from your website or application. Authentication and currently available methods are described below, with examples given in PHP. Responses can be returned as JSON or XML.


Connecting and authentication require your Lead Zeppelin username, password and API key. The following example shows a basic method that can be used to test your credentials as well as a base for all other API calls.

PHP Code Sample

$username = "{username}";
$password = "{password}";
$data     = "api_key={api_key}";
$url      = "";
$curl     = curl_init();

curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password);

$result   = curl_exec($curl);

print $result;

C# .NET Code Sample

string api_key  = "api_key={api_key}";
string username = "{username}";
string password = "{password}";
string auth     = "";
string data     = "&api_key=" + api_key;
Uri wuri        = new Uri("");

auth = "Basic " + Convert.ToBase64String(System.Text.Encoding.Default.GetBytes(username + ":" + password));
HttpWebRequest wrequest = (HttpWebRequest)WebRequest.Create(wuri);

wrequest.Headers.Add("Authorization", auth);

wrequest.Method            = "POST";
wrequest.ContentType       = "application/x-www-form-urlencoded";
StreamWriter requestWriter = new StreamWriter(wrequest.GetRequestStream());


WebResponse requestresponse = wrequest.GetResponse();
Stream dataStream           = requestresponse.GetResponseStream();
StreamReader reader         = new StreamReader(dataStream);
string responseFromServer   = reader.ReadToEnd();


return responseFromServer;

Be sure to replace values in curly brackets {} with your credentials.

A successful XML response will return:


or formatted as JSON:

	"status" : "success"

Invalid API requests will be returned with an error status along with a contextual message. For example:

	"status"  : "error",
	"message" : "No match was found for the provided API key."

Response Format

Responses are returned as XML by default. To change the format, simply append /format/{format} to any request URL. So to return JSON in the first example, the request would be sent as


A description of currently available methods

Leads » Get All

Use to retrieve all lead data (returns both “contacts” & “leads”).

Required POST data

Leads » Get Single

Use to retrieve data associated to a single contact or lead.

Required POST data

Leads » Insert

Use to add a lead to your account. Append lead data (as defined in the web-to-lead documentation) to the $data variable passed via POST. For example:

PHP Code Sample

$data  = "api_key={api_key}";
$data .= "&lead[firstname]=Joe";
$data .= "&lead[lastname]=User";
$data .= "&lead[company]=ACME Blimp Supply";
$data .= "&lead[title]=Pilot";

C# .NET Code Sample

data  = "api_key={api_key}";
data += "&lead[firstname]=Joe";
data += "&lead[lastname]=User";
data += "&lead[company]=ACME Blimp Supply";
data += "&lead[title]=Pilot";
Required POST data
api_key, lead[]