Create lead
curl --request POST \
--url https://api.truthlocks.com/v1/platform/leads \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"email": "<string>",
"name": "<string>",
"company": "<string>",
"message": "<string>",
"source": "<string>"
}
'import requests
url = "https://api.truthlocks.com/v1/platform/leads"
payload = {
"email": "<string>",
"name": "<string>",
"company": "<string>",
"message": "<string>",
"source": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '<string>',
name: '<string>',
company: '<string>',
message: '<string>',
source: '<string>'
})
};
fetch('https://api.truthlocks.com/v1/platform/leads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.truthlocks.com/v1/platform/leads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '<string>',
'name' => '<string>',
'company' => '<string>',
'message' => '<string>',
'source' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/platform/leads"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"name\": \"<string>\",\n \"company\": \"<string>\",\n \"message\": \"<string>\",\n \"source\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.truthlocks.com/v1/platform/leads")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"name\": \"<string>\",\n \"company\": \"<string>\",\n \"message\": \"<string>\",\n \"source\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truthlocks.com/v1/platform/leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"name\": \"<string>\",\n \"company\": \"<string>\",\n \"message\": \"<string>\",\n \"source\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Leads
Create lead
Add a single lead to the inbound pipeline from the API.
POST
/
v1
/
platform
/
leads
Create lead
curl --request POST \
--url https://api.truthlocks.com/v1/platform/leads \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"email": "<string>",
"name": "<string>",
"company": "<string>",
"message": "<string>",
"source": "<string>"
}
'import requests
url = "https://api.truthlocks.com/v1/platform/leads"
payload = {
"email": "<string>",
"name": "<string>",
"company": "<string>",
"message": "<string>",
"source": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '<string>',
name: '<string>',
company: '<string>',
message: '<string>',
source: '<string>'
})
};
fetch('https://api.truthlocks.com/v1/platform/leads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.truthlocks.com/v1/platform/leads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '<string>',
'name' => '<string>',
'company' => '<string>',
'message' => '<string>',
'source' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/platform/leads"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"name\": \"<string>\",\n \"company\": \"<string>\",\n \"message\": \"<string>\",\n \"source\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.truthlocks.com/v1/platform/leads")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"name\": \"<string>\",\n \"company\": \"<string>\",\n \"message\": \"<string>\",\n \"source\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truthlocks.com/v1/platform/leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"name\": \"<string>\",\n \"company\": \"<string>\",\n \"message\": \"<string>\",\n \"source\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Creates a new lead in the inbound leads pipeline. Use this endpoint to add leads from sources that are not connected to the website contact form, such as CRM imports, partner referrals, or internal tooling.
The new lead enters the pipeline with a status of
new and is immediately visible on the Leads page in the platform console.
This endpoint requires platform administrator authentication. To capture leads from a public-facing contact form without authentication, use the public lead-capture endpoint instead.
Parameters
string
required
Contact email address. Must be a valid email format.
string
required
Contact first name.
string
required
Contact last name.
string
Organization name associated with the lead.
string
Job title of the contact.
string
Industry the lead’s organization operates in (for example,
finance, healthcare, government).
