curl --request POST \
--url https://n-api.leadstaker.com/v1/deals/{dealId}/conversions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"event": "<string>",
"pixelId": "<string>",
"testEventCode": "<string>"
}
'import requests
url = "https://n-api.leadstaker.com/v1/deals/{dealId}/conversions"
payload = {
"event": "<string>",
"pixelId": "<string>",
"testEventCode": "<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({event: '<string>', pixelId: '<string>', testEventCode: '<string>'})
};
fetch('https://n-api.leadstaker.com/v1/deals/{dealId}/conversions', 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://n-api.leadstaker.com/v1/deals/{dealId}/conversions",
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([
'event' => '<string>',
'pixelId' => '<string>',
'testEventCode' => '<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://n-api.leadstaker.com/v1/deals/{dealId}/conversions"
payload := strings.NewReader("{\n \"event\": \"<string>\",\n \"pixelId\": \"<string>\",\n \"testEventCode\": \"<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://n-api.leadstaker.com/v1/deals/{dealId}/conversions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"<string>\",\n \"pixelId\": \"<string>\",\n \"testEventCode\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://n-api.leadstaker.com/v1/deals/{dealId}/conversions")
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 \"event\": \"<string>\",\n \"pixelId\": \"<string>\",\n \"testEventCode\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SKIPPED",
"reason": "MISSING_VALUE"
}{
"status": "QUEUED",
"conversionId": "3f2b9c1e-6a7d-4e1f-9b52-0c8d4a7e5f21",
"eventName": "Purchase"
}{
"errorCode": "<string>",
"message": "<string>",
"status": 123,
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"status": 123,
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"status": 123,
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}Send a conversion to an ad platform
Builds the deal’s conversion for the chosen platform: the value comes from the deal price, contact data from its contact, and the click from the deal’s touches (a click-to-WhatsApp ad, a gclid or fbclid on the URL the lead came through) or its chatbot session; a deal from a Meta lead form also sends its lead id. On Meta a CRM or site event goes to the pixel pixelId names, through the project’s Meta Ads connection, and an ad conversation’s event to the dataset of its WhatsApp account; with no pixel named, only the ad conversation’s event goes, through the WhatsApp Business channel, and anything else is skipped (NOT_CONFIGURED, or UNSUPPORTED_EVENT for a lead from an ad). On Google Ads it goes through the project’s Google Ads connection, to the conversion action event names, no sooner than 6 hours after the click it credits (scheduledFor), when Google takes it. Delivery is queued: answers 202 with the conversion id. When there is nothing to send it answers 200 with status: SKIPPED and the reason, e.g. a Purchase on a deal without price, or the same event already sent for this deal. For a lead from a click-to-WhatsApp ad, an event Meta’s messaging list lacks goes out as a CRM event: a custom one always, a site’s standard one unless messagingFallback is SKIP.
curl --request POST \
--url https://n-api.leadstaker.com/v1/deals/{dealId}/conversions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"event": "<string>",
"pixelId": "<string>",
"testEventCode": "<string>"
}
'import requests
url = "https://n-api.leadstaker.com/v1/deals/{dealId}/conversions"
payload = {
"event": "<string>",
"pixelId": "<string>",
"testEventCode": "<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({event: '<string>', pixelId: '<string>', testEventCode: '<string>'})
};
fetch('https://n-api.leadstaker.com/v1/deals/{dealId}/conversions', 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://n-api.leadstaker.com/v1/deals/{dealId}/conversions",
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([
'event' => '<string>',
'pixelId' => '<string>',
'testEventCode' => '<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://n-api.leadstaker.com/v1/deals/{dealId}/conversions"
payload := strings.NewReader("{\n \"event\": \"<string>\",\n \"pixelId\": \"<string>\",\n \"testEventCode\": \"<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://n-api.leadstaker.com/v1/deals/{dealId}/conversions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"<string>\",\n \"pixelId\": \"<string>\",\n \"testEventCode\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://n-api.leadstaker.com/v1/deals/{dealId}/conversions")
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 \"event\": \"<string>\",\n \"pixelId\": \"<string>\",\n \"testEventCode\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SKIPPED",
"reason": "MISSING_VALUE"
}{
"status": "QUEUED",
"conversionId": "3f2b9c1e-6a7d-4e1f-9b52-0c8d4a7e5f21",
"eventName": "Purchase"
}{
"errorCode": "<string>",
"message": "<string>",
"status": 123,
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"status": 123,
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"status": 123,
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}Authorizations
Path Parameters
1Body
The ad platform that receives the conversion.
META, GOOGLE_ADS The platform's standard name or any custom name. Meta's standard names (Lead, Contact, Schedule, Purchase, QualifiedLead…) are matched case-insensitively and sent the way the lead's origin expects: Lead goes out as LeadSubmitted for leads from a click-to-WhatsApp ad. Those leads only take Meta's business messaging names: a site's standard name follows messagingFallback, and a custom name goes out as a CRM event. Purchase takes its value from the deal price. On Google Ads it is the id of a conversion action of the project's account, of the import-from-clicks kind (GET /connections/google-ads/conversion-actions lists them), and any conversion takes the deal price as its value.
1 - 50Meta: the pixel (dataset) a CRM or site event goes to, one the project's Meta Ads connection was granted (GET /connections/meta-ads/pixels lists them). An event of a click-to-WhatsApp ad conversation goes to the dataset of its WhatsApp account instead. Without it, only those go out, through the WhatsApp Business channel.
^\d+$For a lead from a click-to-WhatsApp ad, what to do with a site's standard event, which Meta's business messaging does not take (Schedule, Contact…). CRM, the default, sends it as a CRM event, matched by phone, email and cookies but no longer tied to the ad click. SKIP sends nothing and answers SKIPPED with UNSUPPORTED_EVENT. A custom name always goes out as a CRM event. Meta only.
CRM, SKIP Meta: the code from the Test Events tab in Meta Events Manager; test events still count as real data in Meta. Google Ads: any value has Google only validate the conversion, which it does not record.
1