@getlatedev/node 0.2.485 → 0.2.487

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1654,7 +1654,9 @@ type budgetLevel = 'campaign' | 'adset';
1654
1654
  * called with `timeIncrement=1`. Rate metrics (ctr/cpc/cpm/costPerConversion/
1655
1655
  * roas/videoAvgTimeWatchedActions) are recomputed per day from that day's
1656
1656
  * sums, so summing the additive fields across a node's `daily[]` reproduces
1657
- * its aggregated `metrics` total. Do NOT sum or plain-average
1657
+ * its aggregated `metrics` total. `reach` is the exception: on Meta the
1658
+ * aggregated total is de-duplicated across the range, so daily reach does
1659
+ * not sum to it. Do NOT sum or plain-average
1658
1660
  * `videoAvgTimeWatchedActions` across days: the range value is the
1659
1661
  * play-weighted average of the daily values.
1660
1662
  *
@@ -1668,6 +1670,9 @@ type AdDailyMetrics = AdMetrics & {
1668
1670
  type AdMetrics = {
1669
1671
  spend?: number;
1670
1672
  impressions?: number;
1673
+ /**
1674
+ * Unique people reached in the requested date range. Meta (facebook/instagram): Meta's own de-duplicated reach for the exact range, fetched live and cached up to ~1 hour (may lag recent delivery; on a transient Meta error the value temporarily falls back to a sum of per-day reach, which overcounts people reached on multiple days or by multiple child ads). Because it is de-duplicated, Meta reach is NOT additive: neither daily values nor child nodes sum to the range total. TikTok: sum of per-day reach, so multi-day ranges overcount vs TikTok Ads Manager. Google, LinkedIn, X, Pinterest and OpenAI report 0 (reach not synced). Only derive frequency (impressions / reach) for Meta.
1675
+ */
1671
1676
  reach?: number;
1672
1677
  clicks?: number;
1673
1678
  /**
@@ -1928,7 +1933,7 @@ type AdTreeCampaign = {
1928
1933
  } | null;
1929
1934
  adSets?: Array<AdTreeAdSet>;
1930
1935
  /**
1931
- * Per-day metric series for this campaign. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` (any `dailyLevel`). This is the per-campaign daily trend — summing its additive fields reproduces the campaign `metrics` total.
1936
+ * Per-day metric series for this campaign. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` (any `dailyLevel`). This is the per-campaign daily trend — summing its additive fields reproduces the campaign `metrics` total, except `reach`: on Meta the range total is de-duplicated, so daily reach does not sum to it.
1932
1937
  */
1933
1938
  daily?: Array<AdDailyMetrics>;
1934
1939
  };
@@ -15553,7 +15558,7 @@ type ListInboxConversationsData = {
15553
15558
  /**
15554
15559
  * Filter by platform
15555
15560
  */
15556
- platform?: 'facebook' | 'instagram' | 'twitter' | 'bluesky' | 'reddit' | 'telegram';
15561
+ platform?: 'facebook' | 'instagram' | 'twitter' | 'bluesky' | 'reddit' | 'telegram' | 'whatsapp';
15557
15562
  /**
15558
15563
  * Filter by profile ID
15559
15564
  */
@@ -15620,6 +15625,108 @@ type ListInboxConversationsResponse = ({
15620
15625
  */
15621
15626
  fetchedAt?: (string) | null;
15622
15627
  } | null;
15628
+ /**
15629
+ * Ad-click attribution for a conversation that started from a Meta ad.
15630
+ * Absent when the conversation did not originate from an ad click.
15631
+ *
15632
+ * Captured from the referral Meta attaches to the first inbound message
15633
+ * after the click, which is the only message that carries it. If the same
15634
+ * person later clicks a different ad, the original values are kept, so the
15635
+ * first ad wins. One exception on WhatsApp: when Meta omits `ctwa_clid`
15636
+ * from that referral, a later Meta automatic event can supply it and
15637
+ * refresh `ctwa_captured_at`, so treat `ctwa_captured_at` as the time
15638
+ * Zernio stored the value, not the time of the click.
15639
+ *
15640
+ * Two families of keys, one per surface. They never appear together:
15641
+ *
15642
+ * - `ctwa_*` is WhatsApp Click-to-WhatsApp. The ad ID is
15643
+ * `ctwa_source_id`. There is no `meta_ad_id` on WhatsApp.
15644
+ * - `meta_ad_*` is Instagram Click-to-Direct and Facebook Messenger
15645
+ * Click-to-Message. The ad ID is `meta_ad_id`. `ctwa_clid` never
15646
+ * appears on these platforms.
15647
+ *
15648
+ * Every key is optional and only the keys Meta supplied are returned, so
15649
+ * read defensively. Meta does not send a campaign or ad set ID, so none
15650
+ * is exposed here. More keys may be added over time. Treat any key you
15651
+ * do not recognise as an opaque string.
15652
+ *
15653
+ * Key names differ from the `message.received` webhook on purpose. The
15654
+ * webhook forwards Meta's referral verbatim (`ad_id`, `source`, `type`)
15655
+ * while the stored conversation record uses the prefixed names below.
15656
+ * Renaming either side would break existing integrations, so both
15657
+ * spellings are kept.
15658
+ *
15659
+ */
15660
+ metadata?: {
15661
+ /**
15662
+ * WhatsApp only. Meta's click identifier, the value to forward to the Meta Conversions API for Business Messaging. Meta omits it on some numbers, so a WhatsApp referral can arrive without it.
15663
+ */
15664
+ ctwa_clid?: string;
15665
+ /**
15666
+ * WhatsApp only. The Meta ad ID the user clicked. This is the WhatsApp equivalent of meta_ad_id.
15667
+ */
15668
+ ctwa_source_id?: string;
15669
+ /**
15670
+ * WhatsApp only. What the user clicked, as supplied by Meta (for example ad or post).
15671
+ */
15672
+ ctwa_source_type?: string;
15673
+ /**
15674
+ * WhatsApp only. Meta's URL for the ad that was clicked, normally an fb.me short link.
15675
+ */
15676
+ ctwa_source_url?: string;
15677
+ /**
15678
+ * WhatsApp only. Headline of the ad creative at click time.
15679
+ */
15680
+ ctwa_headline?: string;
15681
+ /**
15682
+ * WhatsApp only. When Zernio stored this referral. Always present when a WhatsApp referral was captured.
15683
+ */
15684
+ ctwa_captured_at?: string;
15685
+ /**
15686
+ * Instagram and Facebook only. The Meta ad ID the user clicked. Always present when an Instagram or Facebook referral was captured.
15687
+ */
15688
+ meta_ad_id?: string;
15689
+ /**
15690
+ * Instagram and Facebook only. Meta-supplied source identifier, for example ADS.
15691
+ */
15692
+ meta_ad_source?: string;
15693
+ /**
15694
+ * Instagram and Facebook only. Meta-supplied referral type, for example OPEN_THREAD.
15695
+ */
15696
+ meta_ad_type?: string;
15697
+ /**
15698
+ * Instagram and Facebook only. The ref parameter passed through from the ad creative.
15699
+ */
15700
+ meta_ad_ref?: string;
15701
+ /**
15702
+ * Instagram and Facebook only. Title of the ad creative at click time.
15703
+ */
15704
+ meta_ad_title?: string;
15705
+ /**
15706
+ * Instagram and Facebook only. Image of the ad creative at click time.
15707
+ */
15708
+ meta_ad_photo_url?: string;
15709
+ /**
15710
+ * Instagram and Facebook only. Video of the ad creative at click time.
15711
+ */
15712
+ meta_ad_video_url?: string;
15713
+ /**
15714
+ * Instagram and Facebook only. The organic post the ad promoted, when the ad was a boosted post.
15715
+ */
15716
+ meta_ad_post_id?: string;
15717
+ /**
15718
+ * Instagram and Facebook only. The catalogue product the user clicked, for product ads.
15719
+ */
15720
+ meta_ad_product_id?: string;
15721
+ /**
15722
+ * Instagram and Facebook only. The Meta flow the ad launched, for flow ads.
15723
+ */
15724
+ meta_ad_flow_id?: string;
15725
+ /**
15726
+ * Instagram and Facebook only. When Zernio stored this referral. Always present when an Instagram or Facebook referral was captured.
15727
+ */
15728
+ meta_ad_captured_at?: string;
15729
+ } | null;
15623
15730
  }>;
15624
15731
  pagination?: {
15625
15732
  hasMore?: boolean;
@@ -15893,6 +16000,79 @@ type GetInboxConversationResponse = ({
15893
16000
  */
15894
16001
  fetchedAt?: (string) | null;
15895
16002
  } | null;
16003
+ /**
16004
+ * Ad-click attribution for a conversation that started from a Meta ad.
16005
+ * Absent when the conversation did not originate from an ad click.
16006
+ *
16007
+ * Captured once, on the first inbound message after the click, and never
16008
+ * overwritten. If the same person later clicks a different ad, the
16009
+ * original values are kept. Meta only sends the referral on that first
16010
+ * message.
16011
+ *
16012
+ * This operation currently returns only the `meta_ad_*` family, which
16013
+ * covers Instagram Click-to-Direct and Facebook Messenger
16014
+ * Click-to-Message. WhatsApp Click-to-WhatsApp attribution (the `ctwa_*`
16015
+ * keys, where the ad ID is `ctwa_source_id`) is returned by
16016
+ * `GET /v1/inbox/conversations` instead.
16017
+ *
16018
+ * Every key is optional and only the keys Meta supplied are returned, so
16019
+ * read defensively. Meta does not send a campaign or ad set ID, so none is
16020
+ * exposed here. More keys may be added over time. Treat any key you do not
16021
+ * recognise as an opaque string.
16022
+ *
16023
+ * Key names differ from the `message.received` webhook on purpose. The
16024
+ * webhook forwards Meta's referral verbatim (`ad_id`, `source`, `type`)
16025
+ * while the stored conversation record uses the prefixed names below.
16026
+ * Renaming either side would break existing integrations, so both
16027
+ * spellings are kept.
16028
+ *
16029
+ */
16030
+ metadata?: {
16031
+ /**
16032
+ * The Meta ad ID the user clicked. Always present when a referral was captured.
16033
+ */
16034
+ meta_ad_id?: string;
16035
+ /**
16036
+ * Meta-supplied source identifier, for example ADS.
16037
+ */
16038
+ meta_ad_source?: string;
16039
+ /**
16040
+ * Meta-supplied referral type, for example OPEN_THREAD.
16041
+ */
16042
+ meta_ad_type?: string;
16043
+ /**
16044
+ * The ref parameter passed through from the ad creative.
16045
+ */
16046
+ meta_ad_ref?: string;
16047
+ /**
16048
+ * Title of the ad creative at click time.
16049
+ */
16050
+ meta_ad_title?: string;
16051
+ /**
16052
+ * Image of the ad creative at click time.
16053
+ */
16054
+ meta_ad_photo_url?: string;
16055
+ /**
16056
+ * Video of the ad creative at click time.
16057
+ */
16058
+ meta_ad_video_url?: string;
16059
+ /**
16060
+ * The organic post the ad promoted, when the ad was a boosted post.
16061
+ */
16062
+ meta_ad_post_id?: string;
16063
+ /**
16064
+ * The catalogue product the user clicked, for product ads.
16065
+ */
16066
+ meta_ad_product_id?: string;
16067
+ /**
16068
+ * The Meta flow the ad launched, for flow ads.
16069
+ */
16070
+ meta_ad_flow_id?: string;
16071
+ /**
16072
+ * When Zernio stored this referral. Always present when a referral was captured.
16073
+ */
16074
+ meta_ad_captured_at?: string;
16075
+ } | null;
15896
16076
  };
15897
16077
  });
15898
16078
  type GetInboxConversationError = ({
@@ -25332,7 +25512,7 @@ type GetAdTreeData = {
25332
25512
  */
25333
25513
  status?: AdStatus;
25334
25514
  /**
25335
- * Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`. See `dailyLevel` to control which levels carry it.
25515
+ * Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`, except Meta `reach`: the range total is Meta's de-duplicated value, so daily reach does not sum to it. See `dailyLevel` to control which levels carry it.
25336
25516
  */
25337
25517
  timeIncrement?: 1;
25338
25518
  /**
@@ -25384,6 +25564,9 @@ type GetAdsTimelineResponse = ({
25384
25564
  */
25385
25565
  spend?: number;
25386
25566
  impressions?: number;
25567
+ /**
25568
+ * Reach summed across the account's ads for this single day. A person seen by two ads the same day counts twice, and reach is de-duplicated per day only: do NOT sum it across days (people reached on multiple days would be double-counted).
25569
+ */
25387
25570
  reach?: number;
25388
25571
  clicks?: number;
25389
25572
  engagement?: number;
package/dist/index.d.ts CHANGED
@@ -1654,7 +1654,9 @@ type budgetLevel = 'campaign' | 'adset';
1654
1654
  * called with `timeIncrement=1`. Rate metrics (ctr/cpc/cpm/costPerConversion/
1655
1655
  * roas/videoAvgTimeWatchedActions) are recomputed per day from that day's
1656
1656
  * sums, so summing the additive fields across a node's `daily[]` reproduces
1657
- * its aggregated `metrics` total. Do NOT sum or plain-average
1657
+ * its aggregated `metrics` total. `reach` is the exception: on Meta the
1658
+ * aggregated total is de-duplicated across the range, so daily reach does
1659
+ * not sum to it. Do NOT sum or plain-average
1658
1660
  * `videoAvgTimeWatchedActions` across days: the range value is the
1659
1661
  * play-weighted average of the daily values.
1660
1662
  *
@@ -1668,6 +1670,9 @@ type AdDailyMetrics = AdMetrics & {
1668
1670
  type AdMetrics = {
1669
1671
  spend?: number;
1670
1672
  impressions?: number;
1673
+ /**
1674
+ * Unique people reached in the requested date range. Meta (facebook/instagram): Meta's own de-duplicated reach for the exact range, fetched live and cached up to ~1 hour (may lag recent delivery; on a transient Meta error the value temporarily falls back to a sum of per-day reach, which overcounts people reached on multiple days or by multiple child ads). Because it is de-duplicated, Meta reach is NOT additive: neither daily values nor child nodes sum to the range total. TikTok: sum of per-day reach, so multi-day ranges overcount vs TikTok Ads Manager. Google, LinkedIn, X, Pinterest and OpenAI report 0 (reach not synced). Only derive frequency (impressions / reach) for Meta.
1675
+ */
1671
1676
  reach?: number;
1672
1677
  clicks?: number;
1673
1678
  /**
@@ -1928,7 +1933,7 @@ type AdTreeCampaign = {
1928
1933
  } | null;
1929
1934
  adSets?: Array<AdTreeAdSet>;
1930
1935
  /**
1931
- * Per-day metric series for this campaign. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` (any `dailyLevel`). This is the per-campaign daily trend — summing its additive fields reproduces the campaign `metrics` total.
1936
+ * Per-day metric series for this campaign. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` (any `dailyLevel`). This is the per-campaign daily trend — summing its additive fields reproduces the campaign `metrics` total, except `reach`: on Meta the range total is de-duplicated, so daily reach does not sum to it.
1932
1937
  */
1933
1938
  daily?: Array<AdDailyMetrics>;
1934
1939
  };
@@ -15553,7 +15558,7 @@ type ListInboxConversationsData = {
15553
15558
  /**
15554
15559
  * Filter by platform
15555
15560
  */
15556
- platform?: 'facebook' | 'instagram' | 'twitter' | 'bluesky' | 'reddit' | 'telegram';
15561
+ platform?: 'facebook' | 'instagram' | 'twitter' | 'bluesky' | 'reddit' | 'telegram' | 'whatsapp';
15557
15562
  /**
15558
15563
  * Filter by profile ID
15559
15564
  */
@@ -15620,6 +15625,108 @@ type ListInboxConversationsResponse = ({
15620
15625
  */
15621
15626
  fetchedAt?: (string) | null;
15622
15627
  } | null;
15628
+ /**
15629
+ * Ad-click attribution for a conversation that started from a Meta ad.
15630
+ * Absent when the conversation did not originate from an ad click.
15631
+ *
15632
+ * Captured from the referral Meta attaches to the first inbound message
15633
+ * after the click, which is the only message that carries it. If the same
15634
+ * person later clicks a different ad, the original values are kept, so the
15635
+ * first ad wins. One exception on WhatsApp: when Meta omits `ctwa_clid`
15636
+ * from that referral, a later Meta automatic event can supply it and
15637
+ * refresh `ctwa_captured_at`, so treat `ctwa_captured_at` as the time
15638
+ * Zernio stored the value, not the time of the click.
15639
+ *
15640
+ * Two families of keys, one per surface. They never appear together:
15641
+ *
15642
+ * - `ctwa_*` is WhatsApp Click-to-WhatsApp. The ad ID is
15643
+ * `ctwa_source_id`. There is no `meta_ad_id` on WhatsApp.
15644
+ * - `meta_ad_*` is Instagram Click-to-Direct and Facebook Messenger
15645
+ * Click-to-Message. The ad ID is `meta_ad_id`. `ctwa_clid` never
15646
+ * appears on these platforms.
15647
+ *
15648
+ * Every key is optional and only the keys Meta supplied are returned, so
15649
+ * read defensively. Meta does not send a campaign or ad set ID, so none
15650
+ * is exposed here. More keys may be added over time. Treat any key you
15651
+ * do not recognise as an opaque string.
15652
+ *
15653
+ * Key names differ from the `message.received` webhook on purpose. The
15654
+ * webhook forwards Meta's referral verbatim (`ad_id`, `source`, `type`)
15655
+ * while the stored conversation record uses the prefixed names below.
15656
+ * Renaming either side would break existing integrations, so both
15657
+ * spellings are kept.
15658
+ *
15659
+ */
15660
+ metadata?: {
15661
+ /**
15662
+ * WhatsApp only. Meta's click identifier, the value to forward to the Meta Conversions API for Business Messaging. Meta omits it on some numbers, so a WhatsApp referral can arrive without it.
15663
+ */
15664
+ ctwa_clid?: string;
15665
+ /**
15666
+ * WhatsApp only. The Meta ad ID the user clicked. This is the WhatsApp equivalent of meta_ad_id.
15667
+ */
15668
+ ctwa_source_id?: string;
15669
+ /**
15670
+ * WhatsApp only. What the user clicked, as supplied by Meta (for example ad or post).
15671
+ */
15672
+ ctwa_source_type?: string;
15673
+ /**
15674
+ * WhatsApp only. Meta's URL for the ad that was clicked, normally an fb.me short link.
15675
+ */
15676
+ ctwa_source_url?: string;
15677
+ /**
15678
+ * WhatsApp only. Headline of the ad creative at click time.
15679
+ */
15680
+ ctwa_headline?: string;
15681
+ /**
15682
+ * WhatsApp only. When Zernio stored this referral. Always present when a WhatsApp referral was captured.
15683
+ */
15684
+ ctwa_captured_at?: string;
15685
+ /**
15686
+ * Instagram and Facebook only. The Meta ad ID the user clicked. Always present when an Instagram or Facebook referral was captured.
15687
+ */
15688
+ meta_ad_id?: string;
15689
+ /**
15690
+ * Instagram and Facebook only. Meta-supplied source identifier, for example ADS.
15691
+ */
15692
+ meta_ad_source?: string;
15693
+ /**
15694
+ * Instagram and Facebook only. Meta-supplied referral type, for example OPEN_THREAD.
15695
+ */
15696
+ meta_ad_type?: string;
15697
+ /**
15698
+ * Instagram and Facebook only. The ref parameter passed through from the ad creative.
15699
+ */
15700
+ meta_ad_ref?: string;
15701
+ /**
15702
+ * Instagram and Facebook only. Title of the ad creative at click time.
15703
+ */
15704
+ meta_ad_title?: string;
15705
+ /**
15706
+ * Instagram and Facebook only. Image of the ad creative at click time.
15707
+ */
15708
+ meta_ad_photo_url?: string;
15709
+ /**
15710
+ * Instagram and Facebook only. Video of the ad creative at click time.
15711
+ */
15712
+ meta_ad_video_url?: string;
15713
+ /**
15714
+ * Instagram and Facebook only. The organic post the ad promoted, when the ad was a boosted post.
15715
+ */
15716
+ meta_ad_post_id?: string;
15717
+ /**
15718
+ * Instagram and Facebook only. The catalogue product the user clicked, for product ads.
15719
+ */
15720
+ meta_ad_product_id?: string;
15721
+ /**
15722
+ * Instagram and Facebook only. The Meta flow the ad launched, for flow ads.
15723
+ */
15724
+ meta_ad_flow_id?: string;
15725
+ /**
15726
+ * Instagram and Facebook only. When Zernio stored this referral. Always present when an Instagram or Facebook referral was captured.
15727
+ */
15728
+ meta_ad_captured_at?: string;
15729
+ } | null;
15623
15730
  }>;
15624
15731
  pagination?: {
15625
15732
  hasMore?: boolean;
@@ -15893,6 +16000,79 @@ type GetInboxConversationResponse = ({
15893
16000
  */
15894
16001
  fetchedAt?: (string) | null;
15895
16002
  } | null;
16003
+ /**
16004
+ * Ad-click attribution for a conversation that started from a Meta ad.
16005
+ * Absent when the conversation did not originate from an ad click.
16006
+ *
16007
+ * Captured once, on the first inbound message after the click, and never
16008
+ * overwritten. If the same person later clicks a different ad, the
16009
+ * original values are kept. Meta only sends the referral on that first
16010
+ * message.
16011
+ *
16012
+ * This operation currently returns only the `meta_ad_*` family, which
16013
+ * covers Instagram Click-to-Direct and Facebook Messenger
16014
+ * Click-to-Message. WhatsApp Click-to-WhatsApp attribution (the `ctwa_*`
16015
+ * keys, where the ad ID is `ctwa_source_id`) is returned by
16016
+ * `GET /v1/inbox/conversations` instead.
16017
+ *
16018
+ * Every key is optional and only the keys Meta supplied are returned, so
16019
+ * read defensively. Meta does not send a campaign or ad set ID, so none is
16020
+ * exposed here. More keys may be added over time. Treat any key you do not
16021
+ * recognise as an opaque string.
16022
+ *
16023
+ * Key names differ from the `message.received` webhook on purpose. The
16024
+ * webhook forwards Meta's referral verbatim (`ad_id`, `source`, `type`)
16025
+ * while the stored conversation record uses the prefixed names below.
16026
+ * Renaming either side would break existing integrations, so both
16027
+ * spellings are kept.
16028
+ *
16029
+ */
16030
+ metadata?: {
16031
+ /**
16032
+ * The Meta ad ID the user clicked. Always present when a referral was captured.
16033
+ */
16034
+ meta_ad_id?: string;
16035
+ /**
16036
+ * Meta-supplied source identifier, for example ADS.
16037
+ */
16038
+ meta_ad_source?: string;
16039
+ /**
16040
+ * Meta-supplied referral type, for example OPEN_THREAD.
16041
+ */
16042
+ meta_ad_type?: string;
16043
+ /**
16044
+ * The ref parameter passed through from the ad creative.
16045
+ */
16046
+ meta_ad_ref?: string;
16047
+ /**
16048
+ * Title of the ad creative at click time.
16049
+ */
16050
+ meta_ad_title?: string;
16051
+ /**
16052
+ * Image of the ad creative at click time.
16053
+ */
16054
+ meta_ad_photo_url?: string;
16055
+ /**
16056
+ * Video of the ad creative at click time.
16057
+ */
16058
+ meta_ad_video_url?: string;
16059
+ /**
16060
+ * The organic post the ad promoted, when the ad was a boosted post.
16061
+ */
16062
+ meta_ad_post_id?: string;
16063
+ /**
16064
+ * The catalogue product the user clicked, for product ads.
16065
+ */
16066
+ meta_ad_product_id?: string;
16067
+ /**
16068
+ * The Meta flow the ad launched, for flow ads.
16069
+ */
16070
+ meta_ad_flow_id?: string;
16071
+ /**
16072
+ * When Zernio stored this referral. Always present when a referral was captured.
16073
+ */
16074
+ meta_ad_captured_at?: string;
16075
+ } | null;
15896
16076
  };
15897
16077
  });
15898
16078
  type GetInboxConversationError = ({
@@ -25332,7 +25512,7 @@ type GetAdTreeData = {
25332
25512
  */
25333
25513
  status?: AdStatus;
25334
25514
  /**
25335
- * Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`. See `dailyLevel` to control which levels carry it.
25515
+ * Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`, except Meta `reach`: the range total is Meta's de-duplicated value, so daily reach does not sum to it. See `dailyLevel` to control which levels carry it.
25336
25516
  */
25337
25517
  timeIncrement?: 1;
25338
25518
  /**
@@ -25384,6 +25564,9 @@ type GetAdsTimelineResponse = ({
25384
25564
  */
25385
25565
  spend?: number;
25386
25566
  impressions?: number;
25567
+ /**
25568
+ * Reach summed across the account's ads for this single day. A person seen by two ads the same day counts twice, and reach is de-duplicated per day only: do NOT sum it across days (people reached on multiple days would be double-counted).
25569
+ */
25387
25570
  reach?: number;
25388
25571
  clicks?: number;
25389
25572
  engagement?: number;
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(index_exports);
36
36
  // package.json
37
37
  var package_default = {
38
38
  name: "@getlatedev/node",
39
- version: "0.2.485",
39
+ version: "0.2.487",
40
40
  description: "The official Node.js library for the Zernio API",
41
41
  main: "dist/index.js",
42
42
  module: "dist/index.mjs",
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5
5
  // package.json
6
6
  var package_default = {
7
7
  name: "@getlatedev/node",
8
- version: "0.2.485",
8
+ version: "0.2.487",
9
9
  description: "The official Node.js library for the Zernio API",
10
10
  main: "dist/index.js",
11
11
  module: "dist/index.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlatedev/node",
3
- "version": "0.2.485",
3
+ "version": "0.2.487",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -478,7 +478,9 @@ export type budgetLevel = 'campaign' | 'adset';
478
478
  * called with `timeIncrement=1`. Rate metrics (ctr/cpc/cpm/costPerConversion/
479
479
  * roas/videoAvgTimeWatchedActions) are recomputed per day from that day's
480
480
  * sums, so summing the additive fields across a node's `daily[]` reproduces
481
- * its aggregated `metrics` total. Do NOT sum or plain-average
481
+ * its aggregated `metrics` total. `reach` is the exception: on Meta the
482
+ * aggregated total is de-duplicated across the range, so daily reach does
483
+ * not sum to it. Do NOT sum or plain-average
482
484
  * `videoAvgTimeWatchedActions` across days: the range value is the
483
485
  * play-weighted average of the daily values.
484
486
  *
@@ -493,6 +495,9 @@ export type AdDailyMetrics = AdMetrics & {
493
495
  export type AdMetrics = {
494
496
  spend?: number;
495
497
  impressions?: number;
498
+ /**
499
+ * Unique people reached in the requested date range. Meta (facebook/instagram): Meta's own de-duplicated reach for the exact range, fetched live and cached up to ~1 hour (may lag recent delivery; on a transient Meta error the value temporarily falls back to a sum of per-day reach, which overcounts people reached on multiple days or by multiple child ads). Because it is de-duplicated, Meta reach is NOT additive: neither daily values nor child nodes sum to the range total. TikTok: sum of per-day reach, so multi-day ranges overcount vs TikTok Ads Manager. Google, LinkedIn, X, Pinterest and OpenAI report 0 (reach not synced). Only derive frequency (impressions / reach) for Meta.
500
+ */
496
501
  reach?: number;
497
502
  clicks?: number;
498
503
  /**
@@ -757,7 +762,7 @@ export type AdTreeCampaign = {
757
762
  } | null;
758
763
  adSets?: Array<AdTreeAdSet>;
759
764
  /**
760
- * Per-day metric series for this campaign. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` (any `dailyLevel`). This is the per-campaign daily trend — summing its additive fields reproduces the campaign `metrics` total.
765
+ * Per-day metric series for this campaign. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` (any `dailyLevel`). This is the per-campaign daily trend — summing its additive fields reproduces the campaign `metrics` total, except `reach`: on Meta the range total is de-duplicated, so daily reach does not sum to it.
761
766
  */
762
767
  daily?: Array<AdDailyMetrics>;
763
768
  };
@@ -15210,7 +15215,7 @@ export type ListInboxConversationsData = {
15210
15215
  /**
15211
15216
  * Filter by platform
15212
15217
  */
15213
- platform?: 'facebook' | 'instagram' | 'twitter' | 'bluesky' | 'reddit' | 'telegram';
15218
+ platform?: 'facebook' | 'instagram' | 'twitter' | 'bluesky' | 'reddit' | 'telegram' | 'whatsapp';
15214
15219
  /**
15215
15220
  * Filter by profile ID
15216
15221
  */
@@ -15278,6 +15283,108 @@ export type ListInboxConversationsResponse = ({
15278
15283
  */
15279
15284
  fetchedAt?: (string) | null;
15280
15285
  } | null;
15286
+ /**
15287
+ * Ad-click attribution for a conversation that started from a Meta ad.
15288
+ * Absent when the conversation did not originate from an ad click.
15289
+ *
15290
+ * Captured from the referral Meta attaches to the first inbound message
15291
+ * after the click, which is the only message that carries it. If the same
15292
+ * person later clicks a different ad, the original values are kept, so the
15293
+ * first ad wins. One exception on WhatsApp: when Meta omits `ctwa_clid`
15294
+ * from that referral, a later Meta automatic event can supply it and
15295
+ * refresh `ctwa_captured_at`, so treat `ctwa_captured_at` as the time
15296
+ * Zernio stored the value, not the time of the click.
15297
+ *
15298
+ * Two families of keys, one per surface. They never appear together:
15299
+ *
15300
+ * - `ctwa_*` is WhatsApp Click-to-WhatsApp. The ad ID is
15301
+ * `ctwa_source_id`. There is no `meta_ad_id` on WhatsApp.
15302
+ * - `meta_ad_*` is Instagram Click-to-Direct and Facebook Messenger
15303
+ * Click-to-Message. The ad ID is `meta_ad_id`. `ctwa_clid` never
15304
+ * appears on these platforms.
15305
+ *
15306
+ * Every key is optional and only the keys Meta supplied are returned, so
15307
+ * read defensively. Meta does not send a campaign or ad set ID, so none
15308
+ * is exposed here. More keys may be added over time. Treat any key you
15309
+ * do not recognise as an opaque string.
15310
+ *
15311
+ * Key names differ from the `message.received` webhook on purpose. The
15312
+ * webhook forwards Meta's referral verbatim (`ad_id`, `source`, `type`)
15313
+ * while the stored conversation record uses the prefixed names below.
15314
+ * Renaming either side would break existing integrations, so both
15315
+ * spellings are kept.
15316
+ *
15317
+ */
15318
+ metadata?: {
15319
+ /**
15320
+ * WhatsApp only. Meta's click identifier, the value to forward to the Meta Conversions API for Business Messaging. Meta omits it on some numbers, so a WhatsApp referral can arrive without it.
15321
+ */
15322
+ ctwa_clid?: string;
15323
+ /**
15324
+ * WhatsApp only. The Meta ad ID the user clicked. This is the WhatsApp equivalent of meta_ad_id.
15325
+ */
15326
+ ctwa_source_id?: string;
15327
+ /**
15328
+ * WhatsApp only. What the user clicked, as supplied by Meta (for example ad or post).
15329
+ */
15330
+ ctwa_source_type?: string;
15331
+ /**
15332
+ * WhatsApp only. Meta's URL for the ad that was clicked, normally an fb.me short link.
15333
+ */
15334
+ ctwa_source_url?: string;
15335
+ /**
15336
+ * WhatsApp only. Headline of the ad creative at click time.
15337
+ */
15338
+ ctwa_headline?: string;
15339
+ /**
15340
+ * WhatsApp only. When Zernio stored this referral. Always present when a WhatsApp referral was captured.
15341
+ */
15342
+ ctwa_captured_at?: string;
15343
+ /**
15344
+ * Instagram and Facebook only. The Meta ad ID the user clicked. Always present when an Instagram or Facebook referral was captured.
15345
+ */
15346
+ meta_ad_id?: string;
15347
+ /**
15348
+ * Instagram and Facebook only. Meta-supplied source identifier, for example ADS.
15349
+ */
15350
+ meta_ad_source?: string;
15351
+ /**
15352
+ * Instagram and Facebook only. Meta-supplied referral type, for example OPEN_THREAD.
15353
+ */
15354
+ meta_ad_type?: string;
15355
+ /**
15356
+ * Instagram and Facebook only. The ref parameter passed through from the ad creative.
15357
+ */
15358
+ meta_ad_ref?: string;
15359
+ /**
15360
+ * Instagram and Facebook only. Title of the ad creative at click time.
15361
+ */
15362
+ meta_ad_title?: string;
15363
+ /**
15364
+ * Instagram and Facebook only. Image of the ad creative at click time.
15365
+ */
15366
+ meta_ad_photo_url?: string;
15367
+ /**
15368
+ * Instagram and Facebook only. Video of the ad creative at click time.
15369
+ */
15370
+ meta_ad_video_url?: string;
15371
+ /**
15372
+ * Instagram and Facebook only. The organic post the ad promoted, when the ad was a boosted post.
15373
+ */
15374
+ meta_ad_post_id?: string;
15375
+ /**
15376
+ * Instagram and Facebook only. The catalogue product the user clicked, for product ads.
15377
+ */
15378
+ meta_ad_product_id?: string;
15379
+ /**
15380
+ * Instagram and Facebook only. The Meta flow the ad launched, for flow ads.
15381
+ */
15382
+ meta_ad_flow_id?: string;
15383
+ /**
15384
+ * Instagram and Facebook only. When Zernio stored this referral. Always present when an Instagram or Facebook referral was captured.
15385
+ */
15386
+ meta_ad_captured_at?: string;
15387
+ } | null;
15281
15388
  }>;
15282
15389
  pagination?: {
15283
15390
  hasMore?: boolean;
@@ -15560,6 +15667,79 @@ export type GetInboxConversationResponse = ({
15560
15667
  */
15561
15668
  fetchedAt?: (string) | null;
15562
15669
  } | null;
15670
+ /**
15671
+ * Ad-click attribution for a conversation that started from a Meta ad.
15672
+ * Absent when the conversation did not originate from an ad click.
15673
+ *
15674
+ * Captured once, on the first inbound message after the click, and never
15675
+ * overwritten. If the same person later clicks a different ad, the
15676
+ * original values are kept. Meta only sends the referral on that first
15677
+ * message.
15678
+ *
15679
+ * This operation currently returns only the `meta_ad_*` family, which
15680
+ * covers Instagram Click-to-Direct and Facebook Messenger
15681
+ * Click-to-Message. WhatsApp Click-to-WhatsApp attribution (the `ctwa_*`
15682
+ * keys, where the ad ID is `ctwa_source_id`) is returned by
15683
+ * `GET /v1/inbox/conversations` instead.
15684
+ *
15685
+ * Every key is optional and only the keys Meta supplied are returned, so
15686
+ * read defensively. Meta does not send a campaign or ad set ID, so none is
15687
+ * exposed here. More keys may be added over time. Treat any key you do not
15688
+ * recognise as an opaque string.
15689
+ *
15690
+ * Key names differ from the `message.received` webhook on purpose. The
15691
+ * webhook forwards Meta's referral verbatim (`ad_id`, `source`, `type`)
15692
+ * while the stored conversation record uses the prefixed names below.
15693
+ * Renaming either side would break existing integrations, so both
15694
+ * spellings are kept.
15695
+ *
15696
+ */
15697
+ metadata?: {
15698
+ /**
15699
+ * The Meta ad ID the user clicked. Always present when a referral was captured.
15700
+ */
15701
+ meta_ad_id?: string;
15702
+ /**
15703
+ * Meta-supplied source identifier, for example ADS.
15704
+ */
15705
+ meta_ad_source?: string;
15706
+ /**
15707
+ * Meta-supplied referral type, for example OPEN_THREAD.
15708
+ */
15709
+ meta_ad_type?: string;
15710
+ /**
15711
+ * The ref parameter passed through from the ad creative.
15712
+ */
15713
+ meta_ad_ref?: string;
15714
+ /**
15715
+ * Title of the ad creative at click time.
15716
+ */
15717
+ meta_ad_title?: string;
15718
+ /**
15719
+ * Image of the ad creative at click time.
15720
+ */
15721
+ meta_ad_photo_url?: string;
15722
+ /**
15723
+ * Video of the ad creative at click time.
15724
+ */
15725
+ meta_ad_video_url?: string;
15726
+ /**
15727
+ * The organic post the ad promoted, when the ad was a boosted post.
15728
+ */
15729
+ meta_ad_post_id?: string;
15730
+ /**
15731
+ * The catalogue product the user clicked, for product ads.
15732
+ */
15733
+ meta_ad_product_id?: string;
15734
+ /**
15735
+ * The Meta flow the ad launched, for flow ads.
15736
+ */
15737
+ meta_ad_flow_id?: string;
15738
+ /**
15739
+ * When Zernio stored this referral. Always present when a referral was captured.
15740
+ */
15741
+ meta_ad_captured_at?: string;
15742
+ } | null;
15563
15743
  };
15564
15744
  });
15565
15745
 
@@ -25745,7 +25925,7 @@ export type GetAdTreeData = {
25745
25925
  */
25746
25926
  status?: AdStatus;
25747
25927
  /**
25748
- * Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`. See `dailyLevel` to control which levels carry it.
25928
+ * Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`, except Meta `reach`: the range total is Meta's de-duplicated value, so daily reach does not sum to it. See `dailyLevel` to control which levels carry it.
25749
25929
  */
25750
25930
  timeIncrement?: 1;
25751
25931
  /**
@@ -25801,6 +25981,9 @@ export type GetAdsTimelineResponse = ({
25801
25981
  */
25802
25982
  spend?: number;
25803
25983
  impressions?: number;
25984
+ /**
25985
+ * Reach summed across the account's ads for this single day. A person seen by two ads the same day counts twice, and reach is de-duplicated per day only: do NOT sum it across days (people reached on multiple days would be double-counted).
25986
+ */
25804
25987
  reach?: number;
25805
25988
  clicks?: number;
25806
25989
  engagement?: number;