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).