@getlatedev/node 0.2.567 → 0.2.569

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.
@@ -6055,7 +6055,7 @@ export type Webhook = {
6055
6055
  /**
6056
6056
  * Events subscribed to
6057
6057
  */
6058
- events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'conversation.started' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'verification.approved' | 'verification.failed')>;
6058
+ events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'conversation.started' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'verification.approved' | 'verification.failed')>;
6059
6059
  /**
6060
6060
  * Whether webhook delivery is enabled
6061
6061
  */
@@ -7242,17 +7242,27 @@ export type WebhookPayloadMessage = {
7242
7242
  */
7243
7243
  isStoryMention?: boolean;
7244
7244
  /**
7245
- * Ad-click attribution forwarded verbatim from Meta. Populated only on
7245
+ * Click attribution forwarded verbatim from Meta. Populated only on
7246
7246
  * the FIRST inbound message after the click; absent on subsequent
7247
- * messages of the same conversation.
7247
+ * messages of the same conversation. On Instagram and Messenger a
7248
+ * RETURNING click also attaches it to the first message that
7249
+ * follows, so read it on every `message.received` for per-click
7250
+ * attribution; a click that opens an existing thread WITHOUT a
7251
+ * message arrives as the separate `referral.received` event.
7248
7252
  *
7249
- * The populated subset identifies the source platform:
7253
+ * The populated subset identifies the source:
7250
7254
  * - `ctwa_clid` and `source_*` fields: WhatsApp CTWA
7251
7255
  * (Click-to-WhatsApp). Attribution window is 7 days from click.
7252
7256
  * Forward to Meta Conversions API for Business Messaging replay.
7253
7257
  * - `ad_id` and `ads_context_data`: Facebook Messenger CTM
7254
7258
  * (Click-to-Message) or Instagram CTD (Click-to-Direct). Use
7255
7259
  * `ad_id` to attribute the conversation to a specific ad.
7260
+ * - `ref` without `ad_id`: an ig.me / m.me link carrying a
7261
+ * `?ref=` parameter (`source` is `SHORTLINK`, `SHORTLINKS` or
7262
+ * `IGME-SOURCE-LINK` depending on surface - treat it as
7263
+ * opaque). Instagram delivers ig.me refs on new threads only
7264
+ * when the account has at least one Ice Breaker configured
7265
+ * (`PUT /v1/accounts/{accountId}/instagram-ice-breakers`).
7256
7266
  *
7257
7267
  */
7258
7268
  referral?: {
@@ -7276,23 +7286,31 @@ export type WebhookPayloadMessage = {
7276
7286
  */
7277
7287
  ad_id?: string;
7278
7288
  /**
7279
- * Optional `ref` parameter passed through from the Meta ad
7280
- * creative. Facebook Messenger CTM / Instagram CTD only.
7289
+ * The `ref` parameter passed through from the Meta ad creative
7290
+ * or from an ig.me / m.me link. Instagram / Facebook Messenger
7291
+ * only.
7281
7292
  *
7282
7293
  */
7283
7294
  ref?: string;
7284
7295
  /**
7285
- * Meta-supplied source identifier (e.g. `ADS`). Facebook Messenger
7286
- * CTM / Instagram CTD only.
7296
+ * Meta-supplied source identifier (`ADS` for ad clicks;
7297
+ * `SHORTLINK`, `SHORTLINKS` or `IGME-SOURCE-LINK` for ref
7298
+ * links). Instagram / Facebook Messenger only.
7287
7299
  *
7288
7300
  */
7289
7301
  source?: string;
7290
7302
  /**
7291
- * Meta-supplied referral type (e.g. `OPEN_THREAD`). Facebook
7292
- * Messenger CTM / Instagram CTD only.
7303
+ * Meta-supplied referral type (e.g. `OPEN_THREAD`). Instagram /
7304
+ * Facebook Messenger only.
7293
7305
  *
7294
7306
  */
7295
7307
  type?: string;
7308
+ /**
7309
+ * URI of the originating site, when Meta supplies one (m.me
7310
+ * links opened from the web). Facebook Messenger only.
7311
+ *
7312
+ */
7313
+ referer_uri?: string;
7296
7314
  /**
7297
7315
  * Snapshot of the ad's public context at click time. Facebook
7298
7316
  * Messenger CTM / Instagram CTD only.
@@ -7749,6 +7767,78 @@ export type event20 = 'reaction.received';
7749
7767
 
7750
7768
  export type action = 'added' | 'removed';
7751
7769
 
7770
+ /**
7771
+ * Webhook payload for referral received events (Instagram, Facebook Messenger)
7772
+ */
7773
+ export type WebhookPayloadReferral = {
7774
+ /**
7775
+ * Stable webhook event ID
7776
+ */
7777
+ id: string;
7778
+ event: 'referral.received';
7779
+ /**
7780
+ * Meta's referral object, forwarded verbatim. Same shape as
7781
+ * `metadata.referral` on `message.received`: `ref` + `source` for
7782
+ * ig.me / m.me links, `ad_id` + `ads_context_data` for returning
7783
+ * Messenger ad clicks.
7784
+ *
7785
+ */
7786
+ referral: {
7787
+ /**
7788
+ * The `ref` parameter of the clicked ig.me / m.me link or ad.
7789
+ */
7790
+ ref?: string;
7791
+ /**
7792
+ * Meta-supplied source (`SHORTLINK`, `SHORTLINKS`, `IGME-SOURCE-LINK`, `ADS` - treat as opaque).
7793
+ */
7794
+ source?: string;
7795
+ /**
7796
+ * Meta-supplied referral type (e.g. `OPEN_THREAD`).
7797
+ */
7798
+ type?: string;
7799
+ /**
7800
+ * URI of the originating site, when Meta supplies one. Facebook Messenger only.
7801
+ */
7802
+ referer_uri?: string;
7803
+ /**
7804
+ * The Meta ad ID, on returning ad clicks. Facebook Messenger only.
7805
+ */
7806
+ ad_id?: string;
7807
+ /**
7808
+ * Snapshot of the ad's public context at click time.
7809
+ */
7810
+ ads_context_data?: {
7811
+ ad_title?: string;
7812
+ photo_url?: string;
7813
+ video_url?: string;
7814
+ post_id?: string;
7815
+ product_id?: string;
7816
+ flow_id?: string;
7817
+ };
7818
+ };
7819
+ /**
7820
+ * Who clicked - the conversation participant.
7821
+ */
7822
+ sender: {
7823
+ /**
7824
+ * Platform-scoped user ID (IGSID / PSID).
7825
+ */
7826
+ id: string;
7827
+ /**
7828
+ * Zernio CRM Contact id for this sender, when one exists.
7829
+ */
7830
+ contactId?: string;
7831
+ };
7832
+ conversation: InboxWebhookConversation;
7833
+ account: InboxWebhookAccount;
7834
+ /**
7835
+ * UTC time at which Zernio generated this event (set once when the event payload is built, before delivery is queued). Retries and redeliveries keep the original value, so it reflects the event, not the delivery attempt.
7836
+ */
7837
+ timestamp: string;
7838
+ };
7839
+
7840
+ export type event21 = 'referral.received';
7841
+
7752
7842
  /**
7753
7843
  * Webhook payload for the review.new event (new review posted on a connected account).
7754
7844
  */
@@ -7774,7 +7864,7 @@ export type WebhookPayloadReviewNew = {
7774
7864
  timestamp: string;
7775
7865
  };
7776
7866
 
7777
- export type event21 = 'review.new';
7867
+ export type event22 = 'review.new';
7778
7868
 
7779
7869
  /**
7780
7870
  * Webhook payload for the review.updated event. Fired when the reviewer edits
@@ -7805,7 +7895,7 @@ export type WebhookPayloadReviewUpdated = {
7805
7895
  timestamp: string;
7806
7896
  };
7807
7897
 
7808
- export type event22 = 'review.updated';
7898
+ export type event23 = 'review.updated';
7809
7899
 
7810
7900
  /**
7811
7901
  * Webhook payload for test deliveries
@@ -7826,7 +7916,7 @@ export type WebhookPayloadTest = {
7826
7916
  timestamp: string;
7827
7917
  };
7828
7918
 
7829
- export type event23 = 'webhook.test';
7919
+ export type event24 = 'webhook.test';
7830
7920
 
7831
7921
  /**
7832
7922
  * Webhook payload for the `whatsapp.template.status_updated` event.
@@ -7881,7 +7971,7 @@ export type WebhookPayloadWhatsAppTemplateStatusUpdated = {
7881
7971
  timestamp: string;
7882
7972
  };
7883
7973
 
7884
- export type event24 = 'whatsapp.template.status_updated';
7974
+ export type event25 = 'whatsapp.template.status_updated';
7885
7975
 
7886
7976
  export type platform11 = 'whatsapp';
7887
7977
 
@@ -16305,7 +16395,7 @@ export type CreateWebhookSettingsData = {
16305
16395
  /**
16306
16396
  * Events to subscribe to (at least one required)
16307
16397
  */
16308
- events: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'conversation.started' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'verification.approved' | 'verification.failed')>;
16398
+ events: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'conversation.started' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'verification.approved' | 'verification.failed')>;
16309
16399
  /**
16310
16400
  * Enable or disable webhook delivery. Defaults to `true` when omitted.
16311
16401
  */
@@ -16360,7 +16450,7 @@ export type UpdateWebhookSettingsData = {
16360
16450
  /**
16361
16451
  * Events to subscribe to. Must contain at least one event if provided.
16362
16452
  */
16363
- events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'conversation.started' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'verification.approved' | 'verification.failed')>;
16453
+ events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'conversation.started' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'verification.approved' | 'verification.failed')>;
16364
16454
  /**
16365
16455
  * Enable or disable webhook delivery
16366
16456
  */
@@ -16742,13 +16832,15 @@ export type ListInboxConversationsResponse = ({
16742
16832
  fetchedAt?: (string) | null;
16743
16833
  } | null;
16744
16834
  /**
16745
- * Ad-click attribution for a conversation that started from a Meta ad.
16746
- * Absent when the conversation did not originate from an ad click.
16835
+ * Click attribution for a conversation that started from a Meta ad or
16836
+ * a ref-tagged ig.me / m.me link. Absent when the conversation did not
16837
+ * originate from an attributable click.
16747
16838
  *
16748
- * Captured from the referral Meta attaches to the first inbound message
16749
- * after the click, which is the only message that carries it. If the same
16750
- * person later clicks a different ad, the original values are kept, so the
16751
- * first ad wins. One exception on WhatsApp: when Meta omits `ctwa_clid`
16839
+ * Captured from the referral Meta delivers for the click. If the same
16840
+ * person later arrives through a different ad or link, the original
16841
+ * values are kept, so the first referral wins; read the fresh referral
16842
+ * per click on the `message.received` / `referral.received` webhooks
16843
+ * instead. One exception on WhatsApp: when Meta omits `ctwa_clid`
16752
16844
  * from that referral, a later Meta automatic event can supply it and
16753
16845
  * refresh `ctwa_captured_at`, so treat `ctwa_captured_at` as the time
16754
16846
  * Zernio stored the value, not the time of the click.
@@ -16757,9 +16849,11 @@ export type ListInboxConversationsResponse = ({
16757
16849
  *
16758
16850
  * - `ctwa_*` is WhatsApp Click-to-WhatsApp. The ad ID is
16759
16851
  * `ctwa_source_id`. There is no `meta_ad_id` on WhatsApp.
16760
- * - `meta_ad_*` is Instagram Click-to-Direct and Facebook Messenger
16761
- * Click-to-Message. The ad ID is `meta_ad_id`. `ctwa_clid` never
16762
- * appears on these platforms.
16852
+ * - `meta_ad_*` is Instagram Click-to-Direct, Facebook Messenger
16853
+ * Click-to-Message, and ig.me / m.me ref links. The ad ID is
16854
+ * `meta_ad_id` (ad clicks only; a link capture carries
16855
+ * `meta_ad_ref` without it). `ctwa_clid` never appears on these
16856
+ * platforms.
16763
16857
  *
16764
16858
  * Every key is optional and only the keys Meta supplied are returned, so
16765
16859
  * read defensively. Meta does not send a campaign or ad set ID, so none
@@ -16799,11 +16893,11 @@ export type ListInboxConversationsResponse = ({
16799
16893
  */
16800
16894
  ctwa_captured_at?: string;
16801
16895
  /**
16802
- * Instagram and Facebook only. The Meta ad ID the user clicked. Always present when an Instagram or Facebook referral was captured.
16896
+ * Instagram and Facebook only. The Meta ad ID the user clicked. Present for ad clicks; absent when the capture came from an ig.me / m.me ref link.
16803
16897
  */
16804
16898
  meta_ad_id?: string;
16805
16899
  /**
16806
- * Instagram and Facebook only. Meta-supplied source identifier, for example ADS.
16900
+ * Instagram and Facebook only. Meta-supplied source identifier: ADS for ad clicks; SHORTLINK, SHORTLINKS or IGME-SOURCE-LINK for ref links (treat as opaque).
16807
16901
  */
16808
16902
  meta_ad_source?: string;
16809
16903
  /**
@@ -16811,7 +16905,7 @@ export type ListInboxConversationsResponse = ({
16811
16905
  */
16812
16906
  meta_ad_type?: string;
16813
16907
  /**
16814
- * Instagram and Facebook only. The ref parameter passed through from the ad creative.
16908
+ * Instagram and Facebook only. The ref parameter passed through from the ad creative or the ig.me / m.me link.
16815
16909
  */
16816
16910
  meta_ad_ref?: string;
16817
16911
  /**
@@ -30421,8 +30515,9 @@ export type CreateStandaloneAdData = {
30421
30515
  * The attached ad takes the full single-creative surface:
30422
30516
  * `headline`/`body`/`description`/`callToAction` plus either
30423
30517
  * `imageUrl`/`video` OR `placementAssets` (its own per-placement
30424
- * Feed/Story assets), and `leadGenFormId` when the target is a
30425
- * lead ad set (the parent must be ON_AD — true for ad sets
30518
+ * Feed/Story assets) OR `translations`/`defaultLocale` (its own
30519
+ * per-locale asset feed, Meta only), and `leadGenFormId` when
30520
+ * the target is a lead ad set (the parent must be ON_AD, true for ad sets
30426
30521
  * created via goal `lead_generation`; Meta rejects a formless ad
30427
30522
  * there, so pass the form on EVERY attached ad). This is the way
30428
30523
  * to build N full ads sharing one ad set: create the first ad
@@ -30778,8 +30873,8 @@ export type CreateStandaloneAdData = {
30778
30873
  * works on a normal ad may be rejected with "The following images have invalid
30779
30874
  * dimensions for Dynamic Creative" (subcode 1885558). Video is not affected.
30780
30875
  *
30781
- * Mutually exclusive with `dynamicCreative`, `placementAssets`, `carouselCards` and
30782
- * `existingCreativeId` Meta allows one `asset_feed_spec` shape per creative.
30876
+ * Mutually exclusive with `dynamicCreative`, `placementAssets`, `carouselCards`,
30877
+ * `existingCreativeId` and `creatives[]`. Meta allows one `asset_feed_spec` shape per creative.
30783
30878
  *
30784
30879
  */
30785
30880
  translations?: Array<{