Vincular una página de Lead Ads
Vincula una página de Facebook a un número de WhatsApp del workspace, suscribe a Pilot Status a los leads de la página y empieza a traer en segundo plano sus leads de los últimos 90 días.
Cuerpo: pageId (el id numérico de la página de Facebook) y whatsappNumberId. whatsappNumberId solo se puede omitir cuando la credencial está ligada a un número (una key limitada a un número, o x-whatsapp-number-id); un número fuera del alcance de la credencial da 403 NUMBER_NOT_IN_GRANT. Cualquier otro campo se rechaza con 400 UNKNOWN_FIELDS.
La propiedad y los permisos se verifican antes de escribir nada: 409 PAGE_NOT_ELIGIBLE (con reason cuando se conoce: NO_OFFICIAL_NUMBER, PAGE_NOT_SHARED, PAGE_BUSINESS_MISMATCH; sin reason cuando otro workspace ya la vinculó), 409 PAGE_MISSING_PERMISSION (con missingTasks), 409 PAGE_ALREADY_LINKED (con el pageLinkId existente). Si Meta rechaza la suscripción, el vínculo se crea de todos modos y el motivo se devuelve en subscriptionError; resync lo reintenta.
Los tokens OAuth/MCP necesitan integrations:manage (ADMIN u OWNER del workspace) en todos los verbos, incluidas las lecturas. Alcance: una key limitada a un número, o una credencial de toda la cuenta con x-whatsapp-number-id, actúa solo sobre los vínculos de ese número; una credencial de toda la cuenta sin el header ve todo el workspace.
curl --request POST \
--url https://pilotstatus.com.br/v1/lead-pages \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"pageId": "109876543210987",
"whatsappNumberId": "num_01HZX..."
}
'import requests
url = "https://pilotstatus.com.br/v1/lead-pages"
payload = {
"pageId": "109876543210987",
"whatsappNumberId": "num_01HZX..."
}
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({pageId: '109876543210987', whatsappNumberId: 'num_01HZX...'})
};
fetch('https://pilotstatus.com.br/v1/lead-pages', 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://pilotstatus.com.br/v1/lead-pages",
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([
'pageId' => '109876543210987',
'whatsappNumberId' => 'num_01HZX...'
]),
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://pilotstatus.com.br/v1/lead-pages"
payload := strings.NewReader("{\n \"pageId\": \"109876543210987\",\n \"whatsappNumberId\": \"num_01HZX...\"\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://pilotstatus.com.br/v1/lead-pages")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"pageId\": \"109876543210987\",\n \"whatsappNumberId\": \"num_01HZX...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/lead-pages")
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 \"pageId\": \"109876543210987\",\n \"whatsappNumberId\": \"num_01HZX...\"\n}"
response = http.request(request)
puts response.read_body{
"link": {
"pageLinkId": "cmgpl0001ab12cd34ef56",
"pageId": "109876543210987",
"pageName": "MM Design Outlet",
"whatsappNumberId": "num_01HZX...",
"subscribedAt": "2026-10-06T10:15:00.000Z",
"subscriptionError": null,
"linkedAt": "2026-10-06T10:14:58.000Z",
"leadsCount": 0
}
}{
"error": "Validation failed | Falha na validação",
"code": "VALIDATION_FAILED"
}{
"error": "Unauthorized"
}{
"error": "This credential is not granted access to that WhatsApp number | Esta credencial não tem acesso a esse número de WhatsApp",
"code": "NUMBER_NOT_IN_GRANT"
}{
"error": "WhatsApp number not found | Número de WhatsApp não encontrado",
"code": "NUMBER_NOT_FOUND"
}{
"error": "Pilot Status does not have the required permissions on this Page yet. | A Pilot Status ainda não tem as permissões necessárias nesta página.",
"code": "PAGE_MISSING_PERMISSION",
"missingTasks": [
"MANAGE_LEADS"
]
}{
"error": "Internal server error | Erro interno do servidor",
"code": "INTERNAL_ERROR"
}{
"error": "Could not reach Meta right now. Try again. | Não foi possível consultar a Meta agora. Tente novamente.",
"code": "LEADS_LOOKUP_UNAVAILABLE"
}{
"error": "Meta lead capture is not configured on this installation. | Captura de leads da Meta não configurada nesta instalação.",
"code": "LEADS_NOT_CONFIGURED"
}Encabezados
Cuerpo
Respuesta
Página vinculada
¿Esta página le ayudó?
curl --request POST \
--url https://pilotstatus.com.br/v1/lead-pages \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"pageId": "109876543210987",
"whatsappNumberId": "num_01HZX..."
}
'import requests
url = "https://pilotstatus.com.br/v1/lead-pages"
payload = {
"pageId": "109876543210987",
"whatsappNumberId": "num_01HZX..."
}
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({pageId: '109876543210987', whatsappNumberId: 'num_01HZX...'})
};
fetch('https://pilotstatus.com.br/v1/lead-pages', 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://pilotstatus.com.br/v1/lead-pages",
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([
'pageId' => '109876543210987',
'whatsappNumberId' => 'num_01HZX...'
]),
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://pilotstatus.com.br/v1/lead-pages"
payload := strings.NewReader("{\n \"pageId\": \"109876543210987\",\n \"whatsappNumberId\": \"num_01HZX...\"\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://pilotstatus.com.br/v1/lead-pages")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"pageId\": \"109876543210987\",\n \"whatsappNumberId\": \"num_01HZX...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/lead-pages")
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 \"pageId\": \"109876543210987\",\n \"whatsappNumberId\": \"num_01HZX...\"\n}"
response = http.request(request)
puts response.read_body{
"link": {
"pageLinkId": "cmgpl0001ab12cd34ef56",
"pageId": "109876543210987",
"pageName": "MM Design Outlet",
"whatsappNumberId": "num_01HZX...",
"subscribedAt": "2026-10-06T10:15:00.000Z",
"subscriptionError": null,
"linkedAt": "2026-10-06T10:14:58.000Z",
"leadsCount": 0
}
}{
"error": "Validation failed | Falha na validação",
"code": "VALIDATION_FAILED"
}{
"error": "Unauthorized"
}{
"error": "This credential is not granted access to that WhatsApp number | Esta credencial não tem acesso a esse número de WhatsApp",
"code": "NUMBER_NOT_IN_GRANT"
}{
"error": "WhatsApp number not found | Número de WhatsApp não encontrado",
"code": "NUMBER_NOT_FOUND"
}{
"error": "Pilot Status does not have the required permissions on this Page yet. | A Pilot Status ainda não tem as permissões necessárias nesta página.",
"code": "PAGE_MISSING_PERMISSION",
"missingTasks": [
"MANAGE_LEADS"
]
}{
"error": "Internal server error | Erro interno do servidor",
"code": "INTERNAL_ERROR"
}{
"error": "Could not reach Meta right now. Try again. | Não foi possível consultar a Meta agora. Tente novamente.",
"code": "LEADS_LOOKUP_UNAVAILABLE"
}{
"error": "Meta lead capture is not configured on this installation. | Captura de leads da Meta não configurada nesta instalação.",
"code": "LEADS_NOT_CONFIGURED"
}