Unlink a Lead Ads Page
Unlinks the Page. ⚠️ Irreversible for the data: every lead captured through this link is erased (personal data deleted; the lead stops being listed and counted) and the link’s form configurations are deleted. deletedLeads says how many leads were erased. The Page can be linked again later, but the erased leads do not come back — not even through a resync.
Pilot Status also unsubscribes from the Page’s leads on Meta, best effort: if Meta fails, the unlink still goes through and no further lead is stored. OAuth/MCP tokens need integrations:manage (workspace ADMIN or OWNER) on every verb, reads included. Scope: a number-scoped key, or an account-wide credential with x-whatsapp-number-id, acts only on that number’s links; an account-wide credential without the header sees the whole workspace.
curl --request DELETE \
--url https://pilotstatus.com.br/v1/lead-pages/{pageLinkId} \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/lead-pages/{pageLinkId}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/lead-pages/{pageLinkId}', 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/{pageLinkId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/lead-pages/{pageLinkId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://pilotstatus.com.br/v1/lead-pages/{pageLinkId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/lead-pages/{pageLinkId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"unlinked": true,
"pageLinkId": "cmgpl0001ab12cd34ef56",
"deletedLeads": 42
}{
"error": "Provide x-whatsapp-number-id for a per-number connection | Envie o header x-whatsapp-number-id para uma conexão por número",
"code": "NUMBER_REQUIRED"
}{
"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": "Page link not found | Vínculo de página não encontrado",
"code": "NOT_FOUND"
}{
"error": "Internal server error | Erro interno do servidor",
"code": "INTERNAL_ERROR"
}Authorizations
Your ps_ API key
Headers
Narrows an account-wide credential to one number (its id or instance id from GET /v1/numbers). Without it, an account-wide credential sees the whole workspace; a number-scoped key always sees only its own number.
Path Parameters
The link id (linked[].pageLinkId from GET /v1/lead-pages), not the Facebook Page id.
Response
Page unlinked; its leads erased
Was this page helpful?
curl --request DELETE \
--url https://pilotstatus.com.br/v1/lead-pages/{pageLinkId} \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/lead-pages/{pageLinkId}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/lead-pages/{pageLinkId}', 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/{pageLinkId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/lead-pages/{pageLinkId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://pilotstatus.com.br/v1/lead-pages/{pageLinkId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/lead-pages/{pageLinkId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"unlinked": true,
"pageLinkId": "cmgpl0001ab12cd34ef56",
"deletedLeads": 42
}{
"error": "Provide x-whatsapp-number-id for a per-number connection | Envie o header x-whatsapp-number-id para uma conexão por número",
"code": "NUMBER_REQUIRED"
}{
"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": "Page link not found | Vínculo de página não encontrado",
"code": "NOT_FOUND"
}{
"error": "Internal server error | Erro interno do servidor",
"code": "INTERNAL_ERROR"
}