Link an ad account
The Meta ad accounts this workspace has connected, so Pilot Status can resolve the ad, ad set and campaign names of your Click-to-WhatsApp traffic, plus the accounts you can still connect.
There is no Meta login step: the advertiser adds the Pilot Status business portfolio (partnerBusinessId) as a partner of the ad account in Meta Business Manager, and Pilot Status reads with its own system user.
Account-wide credential only (a number-scoped key is refused with 403 NUMBER_SCOPE_NOT_ALLOWED): an ad account belongs to the workspace, not to a number. OAuth/MCP tokens need integrations:manage (workspace ADMIN or OWNER) on every verb, reads included.
Body: { "adAccountId": "act_<digits>" } and nothing else — any other field is refused with 400 UNKNOWN_FIELDS. Before anything is written, Pilot Status checks that the account is this workspace’s (409 AD_ACCOUNT_NOT_PROVEN when no ad from it reached your conversations — contact support) and that the partner grant reached Meta (409 AD_ACCOUNT_NOT_SHARED). Linking an account that was unlinked before revives the same link.
curl --request POST \
--url https://pilotstatus.com.br/v1/ads/accounts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"adAccountId": "act_1234567890"
}
'import requests
url = "https://pilotstatus.com.br/v1/ads/accounts"
payload = { "adAccountId": "act_1234567890" }
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({adAccountId: 'act_1234567890'})
};
fetch('https://pilotstatus.com.br/v1/ads/accounts', 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/ads/accounts",
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([
'adAccountId' => 'act_1234567890'
]),
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/ads/accounts"
payload := strings.NewReader("{\n \"adAccountId\": \"act_1234567890\"\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/ads/accounts")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"adAccountId\": \"act_1234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/ads/accounts")
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 \"adAccountId\": \"act_1234567890\"\n}"
response = http.request(request)
puts response.read_body{
"link": {
"adAccountId": "act_1234567890",
"adAccountName": "MM Design",
"linkedAt": "2026-10-05T14:02:11.000Z"
}
}{
"error": "Unknown field(s): token. This endpoint accepts only: adAccountId. | Campo(s) desconhecido(s): token. Este endpoint aceita apenas: adAccountId.",
"code": "UNKNOWN_FIELDS",
"unknownFields": [
"token"
]
}{
"error": "Unauthorized"
}{
"error": "This endpoint requires a tenant-scoped API key",
"code": "NUMBER_SCOPE_NOT_ALLOWED"
}{
"error": "This ad account has not shared access with Pilot Status yet. | Esta conta de anúncios ainda não compartilhou acesso com a Pilot Status.",
"code": "AD_ACCOUNT_NOT_SHARED"
}{
"error": "Internal server error | Erro interno do servidor",
"code": "INTERNAL_ERROR"
}{
"error": "Could not confirm the sharing with Meta right now. Try again. | Não foi possível confirmar o compartilhamento com a Meta agora. Tente novamente.",
"code": "ADS_LOOKUP_UNAVAILABLE"
}{
"error": "The ads integration is not configured on this installation. | Integração de anúncios não configurada nesta instalação.",
"code": "ADS_NOT_CONFIGURED"
}Was this page helpful?
curl --request POST \
--url https://pilotstatus.com.br/v1/ads/accounts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"adAccountId": "act_1234567890"
}
'import requests
url = "https://pilotstatus.com.br/v1/ads/accounts"
payload = { "adAccountId": "act_1234567890" }
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({adAccountId: 'act_1234567890'})
};
fetch('https://pilotstatus.com.br/v1/ads/accounts', 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/ads/accounts",
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([
'adAccountId' => 'act_1234567890'
]),
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/ads/accounts"
payload := strings.NewReader("{\n \"adAccountId\": \"act_1234567890\"\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/ads/accounts")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"adAccountId\": \"act_1234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/ads/accounts")
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 \"adAccountId\": \"act_1234567890\"\n}"
response = http.request(request)
puts response.read_body{
"link": {
"adAccountId": "act_1234567890",
"adAccountName": "MM Design",
"linkedAt": "2026-10-05T14:02:11.000Z"
}
}{
"error": "Unknown field(s): token. This endpoint accepts only: adAccountId. | Campo(s) desconhecido(s): token. Este endpoint aceita apenas: adAccountId.",
"code": "UNKNOWN_FIELDS",
"unknownFields": [
"token"
]
}{
"error": "Unauthorized"
}{
"error": "This endpoint requires a tenant-scoped API key",
"code": "NUMBER_SCOPE_NOT_ALLOWED"
}{
"error": "This ad account has not shared access with Pilot Status yet. | Esta conta de anúncios ainda não compartilhou acesso com a Pilot Status.",
"code": "AD_ACCOUNT_NOT_SHARED"
}{
"error": "Internal server error | Erro interno do servidor",
"code": "INTERNAL_ERROR"
}{
"error": "Could not confirm the sharing with Meta right now. Try again. | Não foi possível confirmar o compartilhamento com a Meta agora. Tente novamente.",
"code": "ADS_LOOKUP_UNAVAILABLE"
}{
"error": "The ads integration is not configured on this installation. | Integração de anúncios não configurada nesta instalação.",
"code": "ADS_NOT_CONFIGURED"
}