Ad referral summary (CTWA)
Groups the linked number’s Click-to-WhatsApp traffic by ad/post, ordered by conversation count desc. conversations counts DISTINCT conversations and messages counts messages — two messages in the same conversation are 1 conversation and 2 messages.
lastSourceUrl and lastHeadline come from the newest message for that ad: the copy can be edited, and the useful one is the last Meta sent.
The list is capped at 200 ads; when it overflows, truncated is true and a notice says so — narrow the window with startDate/endDate.
referral.sourceId is Meta’s ad (or post) id, exposed as an opaque grouping key. There is no campaign or adset name here and that is not an omission: reading the ad object (GET /{ad_id}?fields=id,name,adset{id,name},campaign{id,name}) requires the ads_read permission on the advertiser’s ad account, and the WhatsApp system-user token behind a connected number carries only whatsapp_business_management and whatsapp_business_messaging. To resolve names, call the Meta Marketing API yourself with a token authorised on that ad account, using this sourceId.
Privacy (PII): the COUNTS stay correct on a RELAY_ONLY number (they come from the ad identity, which is not personal data); only lastSourceUrl and lastHeadline come back null, with piiNotice: "PII_RELAY_ONLY".
Requires a number-scoped key.
The referral object also carries the RESOLVED names of the ad — adName, adsetId, adsetName, campaignId, campaignName — plus namesResolvedAt.
⚠️ Those six come back null unless the advertiser has shared that ad account with the Pilot Status business portfolio as a partner. A null name is a SUPPORTED state, not an error: the conversation is still counted and sourceId is still returned.
No endpoint resolves a name on demand — resolution happens asynchronously, off the request path, so querying never triggers a Marketing API call and a null can become a name minutes later with nothing done on your side. namesResolvedAt is what makes that observable: null means “not resolved yet”, while a timestamp with null names means “we asked and Meta returned nothing” (deleted ad, or sharing not granted).
curl --request GET \
--url https://pilotstatus.com.br/v1/referrals/summary \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/referrals/summary"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/referrals/summary', 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/referrals/summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/referrals/summary"
req, _ := http.NewRequest("GET", 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.get("https://pilotstatus.com.br/v1/referrals/summary")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/referrals/summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ads": [
{
"sourceId": "120249828053880703",
"sourceType": "ad",
"conversations": 12,
"messages": 31,
"firstAt": "2026-07-28T10:00:00.000Z",
"lastAt": "2026-08-16T12:00:00.000Z",
"lastSourceUrl": "https://www.instagram.com/p/DcJhrlpA3Pl/",
"lastHeadline": "SALE MM DESIGN",
"adName": "Ads 01 - Vídeo dos 70%",
"adsetId": "120249828053990703",
"adsetName": "[IG] [LL1% IG + VÍDEOS] - 35 a 50",
"campaignId": "120249677595590703",
"campaignName": "[CD-01] [WHATSAPP] - MM Design - Sale 70%",
"namesResolvedAt": "2026-08-17T21:04:00.000Z"
},
{
"sourceId": "120249828075420703",
"sourceType": "ad",
"conversations": 4,
"messages": 9,
"firstAt": "2026-08-02T09:00:00.000Z",
"lastAt": "2026-08-15T18:30:00.000Z",
"lastSourceUrl": "https://www.instagram.com/p/DcAbcdEfGh/",
"lastHeadline": "MM DESIGN — Outlet",
"adName": null,
"adsetId": null,
"adsetName": null,
"campaignId": null,
"campaignName": null,
"namesResolvedAt": null
}
],
"total": 2,
"limit": 200,
"truncated": false
}{
"error": "startDate must be before or equal to endDate",
"code": "INVALID_DATE_RANGE"
}{
"error": "Unauthorized"
}{
"error": "Tenant-scoped keys cannot call number endpoints",
"code": "TENANT_SCOPE_NOT_ALLOWED"
}Authorizations
Your ps_ API key
Query Parameters
Start of the date range (over providerTimestamp). Must be ≤ endDate. (string (ISO 8601))
End of the date range (over providerTimestamp). (string (ISO 8601))
Response
Ad referral summary
Was this page helpful?
curl --request GET \
--url https://pilotstatus.com.br/v1/referrals/summary \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/referrals/summary"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/referrals/summary', 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/referrals/summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/referrals/summary"
req, _ := http.NewRequest("GET", 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.get("https://pilotstatus.com.br/v1/referrals/summary")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/referrals/summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ads": [
{
"sourceId": "120249828053880703",
"sourceType": "ad",
"conversations": 12,
"messages": 31,
"firstAt": "2026-07-28T10:00:00.000Z",
"lastAt": "2026-08-16T12:00:00.000Z",
"lastSourceUrl": "https://www.instagram.com/p/DcJhrlpA3Pl/",
"lastHeadline": "SALE MM DESIGN",
"adName": "Ads 01 - Vídeo dos 70%",
"adsetId": "120249828053990703",
"adsetName": "[IG] [LL1% IG + VÍDEOS] - 35 a 50",
"campaignId": "120249677595590703",
"campaignName": "[CD-01] [WHATSAPP] - MM Design - Sale 70%",
"namesResolvedAt": "2026-08-17T21:04:00.000Z"
},
{
"sourceId": "120249828075420703",
"sourceType": "ad",
"conversations": 4,
"messages": 9,
"firstAt": "2026-08-02T09:00:00.000Z",
"lastAt": "2026-08-15T18:30:00.000Z",
"lastSourceUrl": "https://www.instagram.com/p/DcAbcdEfGh/",
"lastHeadline": "MM DESIGN — Outlet",
"adName": null,
"adsetId": null,
"adsetName": null,
"campaignId": null,
"campaignName": null,
"namesResolvedAt": null
}
],
"total": 2,
"limit": 200,
"truncated": false
}{
"error": "startDate must be before or equal to endDate",
"code": "INVALID_DATE_RANGE"
}{
"error": "Unauthorized"
}{
"error": "Tenant-scoped keys cannot call number endpoints",
"code": "TENANT_SCOPE_NOT_ALLOWED"
}