@getlatedev/node 0.2.1286 → 0.2.1287
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 +233 -184
- package/dist/index.d.ts +233 -184
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/generated/types.gen.ts +234 -183
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.
|
|
39
|
+
version: "0.2.1287",
|
|
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.
|
|
8
|
+
version: "0.2.1287",
|
|
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
|
@@ -4483,6 +4483,74 @@ export type ConnectWelcomeScreen = {
|
|
|
4483
4483
|
} | null;
|
|
4484
4484
|
};
|
|
4485
4485
|
|
|
4486
|
+
/**
|
|
4487
|
+
* The ad that opened the conversation, enriched from the ads Zernio syncs for
|
|
4488
|
+
* the account owner. null when the conversation did not start from a Meta
|
|
4489
|
+
* referral (ad click or ig.me / m.me ref link).
|
|
4490
|
+
*
|
|
4491
|
+
* Meta's referral carries the ad ID but no campaign or ad set ID. When the ad
|
|
4492
|
+
* is in your synced ads (`GET /v1/ads`), `synced` is true and the ad name,
|
|
4493
|
+
* campaign, ad set and ad account come from there. Otherwise `synced` is false,
|
|
4494
|
+
* `name` falls back to the ad title (Instagram, Facebook) or headline (WhatsApp)
|
|
4495
|
+
* Meta sent with the click, and the other fields are null.
|
|
4496
|
+
*
|
|
4497
|
+
* A team member limited to some profiles, or an API key scoped to profiles, is
|
|
4498
|
+
* enriched only from the ads it can list with `GET /v1/ads`; any other ad comes
|
|
4499
|
+
* back `synced` false.
|
|
4500
|
+
*
|
|
4501
|
+
* A non-null object with `adId` null is a referral that is not an ad click:
|
|
4502
|
+
* an ig.me / m.me ref link (`name` null) or a WhatsApp click on a post
|
|
4503
|
+
* (`ctwa_source_type` post, `name` is Meta's headline). Nothing is looked up
|
|
4504
|
+
* in your ads for it and `synced` is false.
|
|
4505
|
+
*
|
|
4506
|
+
*/
|
|
4507
|
+
export type ConversationAdAttribution = {
|
|
4508
|
+
/**
|
|
4509
|
+
* Meta's ad ID: `meta_ad_id` on Instagram and Facebook, `ctwa_source_id` on WhatsApp when `ctwa_source_type` is `ad`. Accepted by `GET /v1/ads/{adId}`.
|
|
4510
|
+
*/
|
|
4511
|
+
adId: (string) | null;
|
|
4512
|
+
/**
|
|
4513
|
+
* The synced ad's name, else the ad title or headline Meta sent.
|
|
4514
|
+
*/
|
|
4515
|
+
name: (string) | null;
|
|
4516
|
+
/**
|
|
4517
|
+
* True when the ad was found in your synced ads.
|
|
4518
|
+
*/
|
|
4519
|
+
synced: boolean;
|
|
4520
|
+
/**
|
|
4521
|
+
* Meta campaign ID. Synced ads only.
|
|
4522
|
+
*/
|
|
4523
|
+
campaignId: (string) | null;
|
|
4524
|
+
/**
|
|
4525
|
+
* Campaign name. Synced ads only.
|
|
4526
|
+
*/
|
|
4527
|
+
campaignName: (string) | null;
|
|
4528
|
+
/**
|
|
4529
|
+
* Meta ad set ID. Synced ads only.
|
|
4530
|
+
*/
|
|
4531
|
+
adSetId: (string) | null;
|
|
4532
|
+
/**
|
|
4533
|
+
* Ad set name. Synced ads only.
|
|
4534
|
+
*/
|
|
4535
|
+
adSetName: (string) | null;
|
|
4536
|
+
/**
|
|
4537
|
+
* Meta ad account ID (act_...). Synced ads only.
|
|
4538
|
+
*/
|
|
4539
|
+
adAccountId: (string) | null;
|
|
4540
|
+
/**
|
|
4541
|
+
* Ad account name. Synced ads only.
|
|
4542
|
+
*/
|
|
4543
|
+
adAccountName: (string) | null;
|
|
4544
|
+
/**
|
|
4545
|
+
* The post the ad promotes, from the synced ad or else Meta's `post_id` on the click.
|
|
4546
|
+
*/
|
|
4547
|
+
platformPostId: (string) | null;
|
|
4548
|
+
/**
|
|
4549
|
+
* True when the ad was created outside Zernio (synced from Ads Manager), false when created through Zernio, null when not synced.
|
|
4550
|
+
*/
|
|
4551
|
+
isExternal: (boolean) | null;
|
|
4552
|
+
} | null;
|
|
4553
|
+
|
|
4486
4554
|
/**
|
|
4487
4555
|
* A Google Ads conversion action, e.g. a WEBPAGE conversion created via
|
|
4488
4556
|
* `createConversionAction`. Returned by `listConversionActions` and
|
|
@@ -7912,6 +7980,137 @@ export type region = 'US' | 'GB';
|
|
|
7912
7980
|
*/
|
|
7913
7981
|
export type status24 = 'ordering' | 'awaiting_payment' | 'activating' | 'active' | 'suspended' | 'canceled' | 'failed';
|
|
7914
7982
|
|
|
7983
|
+
/**
|
|
7984
|
+
* Click attribution for a conversation that started from a Meta ad or
|
|
7985
|
+
* a ref-tagged ig.me / m.me link, as Meta sent it. Absent when the
|
|
7986
|
+
* conversation did not originate from an attributable click. For the ad
|
|
7987
|
+
* name, campaign and ad set read `adAttribution` instead.
|
|
7988
|
+
*
|
|
7989
|
+
* Captured from the referral Meta delivers for the click. If the same
|
|
7990
|
+
* person later arrives through a different ad or link, the original
|
|
7991
|
+
* values are kept, so the first referral wins; read the fresh referral
|
|
7992
|
+
* per click on the `message.received` / `referral.received` webhooks
|
|
7993
|
+
* instead. On Instagram Click-to-Direct Meta usually delivers the ad post
|
|
7994
|
+
* first as an attachment-only `share` / `ig_post` message with no
|
|
7995
|
+
* referral, then attaches the referral to the next message. One exception
|
|
7996
|
+
* on WhatsApp: when Meta omits `ctwa_clid` from that referral, a later
|
|
7997
|
+
* Meta automatic event can supply it and refresh `ctwa_captured_at`, so
|
|
7998
|
+
* treat `ctwa_captured_at` as the time Zernio stored the value, not the
|
|
7999
|
+
* time of the click.
|
|
8000
|
+
*
|
|
8001
|
+
* Two families of keys, one per surface. They never appear together:
|
|
8002
|
+
*
|
|
8003
|
+
* - `ctwa_*` is WhatsApp Click-to-WhatsApp. The ad ID is
|
|
8004
|
+
* `ctwa_source_id`. There is no `meta_ad_id` on WhatsApp.
|
|
8005
|
+
* - `meta_ad_*` is Instagram Click-to-Direct, Facebook Messenger
|
|
8006
|
+
* Click-to-Message, and ig.me / m.me ref links. The ad ID is
|
|
8007
|
+
* `meta_ad_id` (ad clicks only; a link capture carries
|
|
8008
|
+
* `meta_ad_ref` without it). `ctwa_clid` never appears on these
|
|
8009
|
+
* platforms.
|
|
8010
|
+
*
|
|
8011
|
+
* Every key is optional and only the keys Meta supplied are returned, so
|
|
8012
|
+
* read defensively. Meta does not send a campaign or ad set ID; they are
|
|
8013
|
+
* resolved from your synced ads in `adAttribution`. More keys may be added
|
|
8014
|
+
* over time. Treat any key you do not recognise as an opaque string.
|
|
8015
|
+
*
|
|
8016
|
+
* Key names differ from the `message.received` webhook on purpose. The
|
|
8017
|
+
* webhook forwards Meta's referral verbatim (`ad_id`, `source`, `type`)
|
|
8018
|
+
* while the stored conversation record uses the prefixed names below.
|
|
8019
|
+
* Renaming either side would break existing integrations, so both
|
|
8020
|
+
* spellings are kept.
|
|
8021
|
+
*
|
|
8022
|
+
*/
|
|
8023
|
+
export type InboxConversationAdMetadata = {
|
|
8024
|
+
/**
|
|
8025
|
+
* 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.
|
|
8026
|
+
*/
|
|
8027
|
+
ctwa_clid?: string;
|
|
8028
|
+
/**
|
|
8029
|
+
* WhatsApp only. The Meta ad ID the user clicked (or the post ID when `ctwa_source_type` is post). This is the WhatsApp equivalent of meta_ad_id.
|
|
8030
|
+
*/
|
|
8031
|
+
ctwa_source_id?: string;
|
|
8032
|
+
/**
|
|
8033
|
+
* WhatsApp only. What the user clicked, as supplied by Meta (for example ad or post).
|
|
8034
|
+
*/
|
|
8035
|
+
ctwa_source_type?: string;
|
|
8036
|
+
/**
|
|
8037
|
+
* WhatsApp only. Meta's URL for the ad that was clicked, normally an fb.me short link.
|
|
8038
|
+
*/
|
|
8039
|
+
ctwa_source_url?: string;
|
|
8040
|
+
/**
|
|
8041
|
+
* WhatsApp only. Headline of the ad creative at click time.
|
|
8042
|
+
*/
|
|
8043
|
+
ctwa_headline?: string;
|
|
8044
|
+
/**
|
|
8045
|
+
* WhatsApp only. Body text of the ad creative at click time.
|
|
8046
|
+
*/
|
|
8047
|
+
ctwa_body?: string;
|
|
8048
|
+
/**
|
|
8049
|
+
* WhatsApp only. Media type of the ad creative, image or video.
|
|
8050
|
+
*/
|
|
8051
|
+
ctwa_media_type?: string;
|
|
8052
|
+
/**
|
|
8053
|
+
* WhatsApp only. Image of the ad creative at click time (image ads).
|
|
8054
|
+
*/
|
|
8055
|
+
ctwa_image_url?: string;
|
|
8056
|
+
/**
|
|
8057
|
+
* WhatsApp only. Video of the ad creative at click time (video ads).
|
|
8058
|
+
*/
|
|
8059
|
+
ctwa_video_url?: string;
|
|
8060
|
+
/**
|
|
8061
|
+
* WhatsApp only. Thumbnail of the ad video at click time (video ads).
|
|
8062
|
+
*/
|
|
8063
|
+
ctwa_thumbnail_url?: string;
|
|
8064
|
+
/**
|
|
8065
|
+
* WhatsApp only. When Zernio stored this referral. Always present when a WhatsApp referral was captured.
|
|
8066
|
+
*/
|
|
8067
|
+
ctwa_captured_at?: string;
|
|
8068
|
+
/**
|
|
8069
|
+
* 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.
|
|
8070
|
+
*/
|
|
8071
|
+
meta_ad_id?: string;
|
|
8072
|
+
/**
|
|
8073
|
+
* Instagram and Facebook only. Meta-supplied source identifier: ADS for ad clicks; SHORTLINK, SHORTLINKS or IGME-SOURCE-LINK for ref links (treat as opaque).
|
|
8074
|
+
*/
|
|
8075
|
+
meta_ad_source?: string;
|
|
8076
|
+
/**
|
|
8077
|
+
* Instagram and Facebook only. Meta-supplied referral type, for example OPEN_THREAD.
|
|
8078
|
+
*/
|
|
8079
|
+
meta_ad_type?: string;
|
|
8080
|
+
/**
|
|
8081
|
+
* Instagram and Facebook only. The ref parameter passed through from the ad creative or the ig.me / m.me link.
|
|
8082
|
+
*/
|
|
8083
|
+
meta_ad_ref?: string;
|
|
8084
|
+
/**
|
|
8085
|
+
* Instagram and Facebook only. Title of the ad creative at click time.
|
|
8086
|
+
*/
|
|
8087
|
+
meta_ad_title?: string;
|
|
8088
|
+
/**
|
|
8089
|
+
* Instagram and Facebook only. Image of the ad creative at click time.
|
|
8090
|
+
*/
|
|
8091
|
+
meta_ad_photo_url?: string;
|
|
8092
|
+
/**
|
|
8093
|
+
* Instagram and Facebook only. Video of the ad creative at click time.
|
|
8094
|
+
*/
|
|
8095
|
+
meta_ad_video_url?: string;
|
|
8096
|
+
/**
|
|
8097
|
+
* Instagram and Facebook only. The organic post the ad promoted, when the ad was a boosted post.
|
|
8098
|
+
*/
|
|
8099
|
+
meta_ad_post_id?: string;
|
|
8100
|
+
/**
|
|
8101
|
+
* Instagram and Facebook only. The catalogue product the user clicked, for product ads.
|
|
8102
|
+
*/
|
|
8103
|
+
meta_ad_product_id?: string;
|
|
8104
|
+
/**
|
|
8105
|
+
* Instagram and Facebook only. The Meta flow the ad launched, for flow ads.
|
|
8106
|
+
*/
|
|
8107
|
+
meta_ad_flow_id?: string;
|
|
8108
|
+
/**
|
|
8109
|
+
* Instagram and Facebook only. When Zernio stored this referral. Always present when an Instagram or Facebook referral was captured.
|
|
8110
|
+
*/
|
|
8111
|
+
meta_ad_captured_at?: string;
|
|
8112
|
+
} | null;
|
|
8113
|
+
|
|
7915
8114
|
/**
|
|
7916
8115
|
* Attachment snapshot inside an edit-history entry.
|
|
7917
8116
|
*/
|
|
@@ -14888,6 +15087,20 @@ export type previousOwner = 'app' | 'ai_agent' | 'other';
|
|
|
14888
15087
|
* platform (Instagram, Messenger/Facebook, Telegram, WhatsApp, X, Reddit,
|
|
14889
15088
|
* Bluesky, SMS, TikTok). Platform-agnostic: one subscription covers every DM platform.
|
|
14890
15089
|
*
|
|
15090
|
+
* `conversation.metadata` (the referral as Meta sent it) and
|
|
15091
|
+
* `conversation.adAttribution` (the ad, campaign and ad set from your synced
|
|
15092
|
+
* ads) are filled only when the message that created the conversation carried
|
|
15093
|
+
* Meta's referral. That holds for WhatsApp Click-to-WhatsApp and Facebook
|
|
15094
|
+
* Messenger Click-to-Message, and for ig.me / m.me ref links. On Instagram
|
|
15095
|
+
* Click-to-Direct it usually does NOT: Meta creates the thread with the ad post
|
|
15096
|
+
* itself, an attachment-only `share` / `ig_post` message with no referral, and
|
|
15097
|
+
* attaches the referral to the next message. That conversation.started then
|
|
15098
|
+
* has `adAttribution` null and no `metadata`. Read the click from `metadata.ad`
|
|
15099
|
+
* and `metadata.referral` on the `message.received` that follows, or from
|
|
15100
|
+
* `adAttribution` on `GET /v1/inbox/conversations` and
|
|
15101
|
+
* `GET /v1/inbox/conversations/{conversationId}`, which carry it once the
|
|
15102
|
+
* referral is stored.
|
|
15103
|
+
*
|
|
14891
15104
|
*/
|
|
14892
15105
|
export type WebhookPayloadConversationStarted = {
|
|
14893
15106
|
/**
|
|
@@ -14900,7 +15113,10 @@ export type WebhookPayloadConversationStarted = {
|
|
|
14900
15113
|
id: string;
|
|
14901
15114
|
profiles?: WebhookProfiles;
|
|
14902
15115
|
event: 'conversation.started';
|
|
14903
|
-
conversation: InboxWebhookConversationDetail
|
|
15116
|
+
conversation: (InboxWebhookConversationDetail & {
|
|
15117
|
+
metadata?: InboxConversationAdMetadata;
|
|
15118
|
+
adAttribution: ConversationAdAttribution;
|
|
15119
|
+
});
|
|
14904
15120
|
account: InboxWebhookAccount;
|
|
14905
15121
|
/**
|
|
14906
15122
|
* When the conversation document was created.
|
|
@@ -15567,6 +15783,18 @@ export type WebhookPayloadMessage = {
|
|
|
15567
15783
|
flow_id?: string;
|
|
15568
15784
|
};
|
|
15569
15785
|
} | null;
|
|
15786
|
+
/**
|
|
15787
|
+
* Present with `referral` whenever the referral is attributable: on
|
|
15788
|
+
* Instagram and Facebook every forwarded referral (an `ad_id` or a
|
|
15789
|
+
* `ref`), on WhatsApp a referral carrying `ctwa_clid`, `source_id`,
|
|
15790
|
+
* `source_url` or `headline`. The same click enriched from your
|
|
15791
|
+
* synced ads: the ad name, campaign, ad set and ad account Zernio
|
|
15792
|
+
* holds for this ad ID. Built from this message's referral, so it
|
|
15793
|
+
* follows a returning click, while the conversation's
|
|
15794
|
+
* `adAttribution` keeps the first one.
|
|
15795
|
+
*
|
|
15796
|
+
*/
|
|
15797
|
+
ad?: (ConversationAdAttribution);
|
|
15570
15798
|
/**
|
|
15571
15799
|
* WhatsApp only. Meta's own reason this message has no
|
|
15572
15800
|
* renderable body. Present when Meta attached an error to the
|
|
@@ -17514,7 +17742,7 @@ export type WorkflowNode = {
|
|
|
17514
17742
|
*
|
|
17515
17743
|
* **trigger**: `{ triggerType: inbound_message|api_call|whatsapp_event|referral|story_mention|comment|reaction|lead_received, keywords:[string], matchType: any|contains|exact|regex, onlyFirstMessage:boolean, eventType: message_sent|message_delivered|message_read|message_failed|reaction, referral:{ ref, matchType: exact|prefix|any }, reaction:{ emojis:[string] }, comment:{ keywords:[string], matchType: any|contains|exact|regex, platformPostId }, leadReceived:{ formIds:[string], pageAccountIds:[string], consentCheckboxKey, defaultCountry, allowCrossProfile:boolean }, cooldownHours:int (1-720) }`. Default `triggerType` is `inbound_message` for legacy nodes. A workflow starts only on events of its own trigger type: `inbound_message` on a message, `referral` on an ig.me / m.me / click-to-message ad referral (standalone, or the first message carrying one; the two are deduplicated per conversation within 60 seconds), `story_mention` on an Instagram story mention, `reaction` on a reaction (Instagram, Facebook, WhatsApp, Telegram groups), `comment` on an Instagram or Facebook comment (the run starts with no conversation and its first `send_message`, which must be text (with optional buttons or quick replies) or cards and must follow the trigger directly (checked on save; on some Instagram accounts Meta refuses buttons and cards to commenters who do not follow the account), is sent as a private reply to the comment; the run then continues in the conversation that reply opens; when an active comment automation's keywords match the comment, the automation answers and the workflow does not start), `whatsapp_event` on a WhatsApp status of a message we sent (filtered by `eventType`), `api_call` only via `POST /v1/workflows/{workflowId}/trigger`, and `lead_received` (WhatsApp workflows only) when a Meta lead ad form is submitted. A `lead_received` trigger needs `leadReceived.consentCheckboxKey` and at least one of `formIds` or `pageAccountIds`; a form scope wins over a Page scope, then the earliest activated workflow. It starts only for leads submitted in the last hour and after the workflow was activated, whose consent checkbox (the form's custom disclaimer, see `POST /v1/ads/lead-forms`) is ticked, and whose phone number parses to a valid international number (`defaultCountry`, ISO 3166 alpha-2, defaults to the country of the workflow's WhatsApp number); otherwise the lead is marked `unreachable`. The Page and the WhatsApp number must be in the same profile unless `allowCrossProfile` is true. Every send or call reached first from the trigger must be a WhatsApp template (checked on save). `referral.matchType` defaults to `any`. `cooldownHours` (inbound_message, referral, story_mention, reaction, whatsapp_event and lead_received, where it defaults to 24) stops the same contact from starting the workflow again inside the window. A `whatsapp_event` workflow never starts on the status of a message a workflow, sequence or comment automation sent. A redelivered platform event never starts the same workflow twice.
|
|
17516
17744
|
*
|
|
17517
|
-
* **Variables** available from the start of every run (absent values are `''`): `lastMessage`, `inboundText`, `triggerText`, `conversationId`, `contact.name`, `contact.phone`, `contact.handle`, `contact.tags` (array), `contact.fields` (the contact's custom fields object), `contact.lastInteractionAt` (ISO date), `contact.lastInteractionHoursAgo` (number), `contact.isFollower` (Instagram, from the stored profile: true, false or `''` when unknown), `referral.ref`, `referral.source`, `referral.type`, `referral.adId`, `postback.payload`, `postback.title`, `quickReply.payload`, `quickReply.title`, `story.id`, `story.url`, `comment.id`, `comment.text`, `comment.platformPostId`, `reaction.emoji`, `reaction.action` (added|removed). `api_call` runs also get the request's `variables`, merged over these. `lead_received` runs also get `lead.id`, `lead.leadgenId`, `lead.formId`, `lead.formName`, `lead.adId`, `lead.adsetId`, `lead.campaignId` and every form answer by its key (`lead.full_name`, `lead.email`, `lead.phone_number`). Template `variableMapping` entries with `field: custom` interpolate `{{...}}` in `customValue`. An array or object interpolated into text renders as JSON.
|
|
17745
|
+
* **Variables** available from the start of every run (absent values are `''`): `lastMessage`, `inboundText`, `triggerText`, `conversationId`, `contact.name`, `contact.phone`, `contact.handle`, `contact.tags` (array), `contact.fields` (the contact's custom fields object), `contact.lastInteractionAt` (ISO date), `contact.lastInteractionHoursAgo` (number), `contact.isFollower` (Instagram, from the stored profile: true, false or `''` when unknown), `referral.ref`, `referral.source`, `referral.type`, `referral.adId`, `referral.adTitle` (the ad title or headline Meta sent), `referral.adName` (the synced ad's name, else `referral.adTitle`), `referral.campaignName` (the synced ad's campaign), `postback.payload`, `postback.title`, `quickReply.payload`, `quickReply.title`, `story.id`, `story.url`, `comment.id`, `comment.text`, `comment.platformPostId`, `reaction.emoji`, `reaction.action` (added|removed). `api_call` runs also get the request's `variables`, merged over these. `lead_received` runs also get `lead.id`, `lead.leadgenId`, `lead.formId`, `lead.formName`, `lead.adId`, `lead.adsetId`, `lead.campaignId` and every form answer by its key (`lead.full_name`, `lead.email`, `lead.phone_number`). Template `variableMapping` entries with `field: custom` interpolate `{{...}}` in `customValue`. An array or object interpolated into text renders as JSON.
|
|
17518
17746
|
*
|
|
17519
17747
|
* **send_message**: `{ messageType: text|template|media|interactive|cards, text, template, media:{mediaType:image|video|audio|document, url,caption}, interactive, buttons, quickReplies, messageTag }`. `template` is `{name,language,variableMapping}` for `messageType: template` and `{ type: generic, elements:[{ title, subtitle, imageUrl, buttons }] }` (1 to 10 cards) for `messageType: cards`. `template` and `interactive` are WhatsApp-only. `interactive.type` is inferred from the payload shape when omitted; payloads with neither `type` nor an inferable shape are rejected.
|
|
17520
17748
|
* Facebook and Instagram only (rejected with a 400 on other platforms; WhatsApp keeps `interactive`): `cards`, plus `buttons` on `text` (cards carry their own buttons) and `quickReplies` / `messageTag` on `text`, `media` and `cards`. `media` takes no `buttons` (a 400 at save). `buttons:[{ type: url|postback|phone, title, url, payload, phone, workflowId }]` (1 to 3, text only and the text then 640 characters at most, sent as Meta's button_template, `phone` Facebook-only, not inside cards), `quickReplies:[{ title, payload, imageUrl, workflowId }]` (1 to 13, not combined with `buttons`) and `messageTag: HUMAN_AGENT|CONFIRMED_EVENT_UPDATE|POST_PURCHASE_UPDATE|ACCOUNT_UPDATE` (Instagram accepts only `HUMAN_AGENT`). Titles are capped at 20 characters (80 for card titles and subtitles). A postback button or quick reply with no `payload` gets `zernio:workflow:<this workflow id>`, so a tap answers this workflow's pending `wait_for_reply` or restarts it; with `workflowId` (a 24-hex workflow id, not combined with `payload`) the tap starts that workflow instead.
|
|
@@ -29350,112 +29578,8 @@ export type ListInboxConversationsResponse = ({
|
|
|
29350
29578
|
*/
|
|
29351
29579
|
fetchedAt?: (string) | null;
|
|
29352
29580
|
} | null;
|
|
29353
|
-
|
|
29354
|
-
|
|
29355
|
-
* a ref-tagged ig.me / m.me link. Absent when the conversation did not
|
|
29356
|
-
* originate from an attributable click.
|
|
29357
|
-
*
|
|
29358
|
-
* Captured from the referral Meta delivers for the click. If the same
|
|
29359
|
-
* person later arrives through a different ad or link, the original
|
|
29360
|
-
* values are kept, so the first referral wins; read the fresh referral
|
|
29361
|
-
* per click on the `message.received` / `referral.received` webhooks
|
|
29362
|
-
* instead. One exception on WhatsApp: when Meta omits `ctwa_clid`
|
|
29363
|
-
* from that referral, a later Meta automatic event can supply it and
|
|
29364
|
-
* refresh `ctwa_captured_at`, so treat `ctwa_captured_at` as the time
|
|
29365
|
-
* Zernio stored the value, not the time of the click.
|
|
29366
|
-
*
|
|
29367
|
-
* Two families of keys, one per surface. They never appear together:
|
|
29368
|
-
*
|
|
29369
|
-
* - `ctwa_*` is WhatsApp Click-to-WhatsApp. The ad ID is
|
|
29370
|
-
* `ctwa_source_id`. There is no `meta_ad_id` on WhatsApp.
|
|
29371
|
-
* - `meta_ad_*` is Instagram Click-to-Direct, Facebook Messenger
|
|
29372
|
-
* Click-to-Message, and ig.me / m.me ref links. The ad ID is
|
|
29373
|
-
* `meta_ad_id` (ad clicks only; a link capture carries
|
|
29374
|
-
* `meta_ad_ref` without it). `ctwa_clid` never appears on these
|
|
29375
|
-
* platforms.
|
|
29376
|
-
*
|
|
29377
|
-
* Every key is optional and only the keys Meta supplied are returned, so
|
|
29378
|
-
* read defensively. Meta does not send a campaign or ad set ID, so none
|
|
29379
|
-
* is exposed here. More keys may be added over time. Treat any key you
|
|
29380
|
-
* do not recognise as an opaque string.
|
|
29381
|
-
*
|
|
29382
|
-
* Key names differ from the `message.received` webhook on purpose. The
|
|
29383
|
-
* webhook forwards Meta's referral verbatim (`ad_id`, `source`, `type`)
|
|
29384
|
-
* while the stored conversation record uses the prefixed names below.
|
|
29385
|
-
* Renaming either side would break existing integrations, so both
|
|
29386
|
-
* spellings are kept.
|
|
29387
|
-
*
|
|
29388
|
-
*/
|
|
29389
|
-
metadata?: {
|
|
29390
|
-
/**
|
|
29391
|
-
* 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.
|
|
29392
|
-
*/
|
|
29393
|
-
ctwa_clid?: string;
|
|
29394
|
-
/**
|
|
29395
|
-
* WhatsApp only. The Meta ad ID the user clicked. This is the WhatsApp equivalent of meta_ad_id.
|
|
29396
|
-
*/
|
|
29397
|
-
ctwa_source_id?: string;
|
|
29398
|
-
/**
|
|
29399
|
-
* WhatsApp only. What the user clicked, as supplied by Meta (for example ad or post).
|
|
29400
|
-
*/
|
|
29401
|
-
ctwa_source_type?: string;
|
|
29402
|
-
/**
|
|
29403
|
-
* WhatsApp only. Meta's URL for the ad that was clicked, normally an fb.me short link.
|
|
29404
|
-
*/
|
|
29405
|
-
ctwa_source_url?: string;
|
|
29406
|
-
/**
|
|
29407
|
-
* WhatsApp only. Headline of the ad creative at click time.
|
|
29408
|
-
*/
|
|
29409
|
-
ctwa_headline?: string;
|
|
29410
|
-
/**
|
|
29411
|
-
* WhatsApp only. When Zernio stored this referral. Always present when a WhatsApp referral was captured.
|
|
29412
|
-
*/
|
|
29413
|
-
ctwa_captured_at?: string;
|
|
29414
|
-
/**
|
|
29415
|
-
* 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.
|
|
29416
|
-
*/
|
|
29417
|
-
meta_ad_id?: string;
|
|
29418
|
-
/**
|
|
29419
|
-
* Instagram and Facebook only. Meta-supplied source identifier: ADS for ad clicks; SHORTLINK, SHORTLINKS or IGME-SOURCE-LINK for ref links (treat as opaque).
|
|
29420
|
-
*/
|
|
29421
|
-
meta_ad_source?: string;
|
|
29422
|
-
/**
|
|
29423
|
-
* Instagram and Facebook only. Meta-supplied referral type, for example OPEN_THREAD.
|
|
29424
|
-
*/
|
|
29425
|
-
meta_ad_type?: string;
|
|
29426
|
-
/**
|
|
29427
|
-
* Instagram and Facebook only. The ref parameter passed through from the ad creative or the ig.me / m.me link.
|
|
29428
|
-
*/
|
|
29429
|
-
meta_ad_ref?: string;
|
|
29430
|
-
/**
|
|
29431
|
-
* Instagram and Facebook only. Title of the ad creative at click time.
|
|
29432
|
-
*/
|
|
29433
|
-
meta_ad_title?: string;
|
|
29434
|
-
/**
|
|
29435
|
-
* Instagram and Facebook only. Image of the ad creative at click time.
|
|
29436
|
-
*/
|
|
29437
|
-
meta_ad_photo_url?: string;
|
|
29438
|
-
/**
|
|
29439
|
-
* Instagram and Facebook only. Video of the ad creative at click time.
|
|
29440
|
-
*/
|
|
29441
|
-
meta_ad_video_url?: string;
|
|
29442
|
-
/**
|
|
29443
|
-
* Instagram and Facebook only. The organic post the ad promoted, when the ad was a boosted post.
|
|
29444
|
-
*/
|
|
29445
|
-
meta_ad_post_id?: string;
|
|
29446
|
-
/**
|
|
29447
|
-
* Instagram and Facebook only. The catalogue product the user clicked, for product ads.
|
|
29448
|
-
*/
|
|
29449
|
-
meta_ad_product_id?: string;
|
|
29450
|
-
/**
|
|
29451
|
-
* Instagram and Facebook only. The Meta flow the ad launched, for flow ads.
|
|
29452
|
-
*/
|
|
29453
|
-
meta_ad_flow_id?: string;
|
|
29454
|
-
/**
|
|
29455
|
-
* Instagram and Facebook only. When Zernio stored this referral. Always present when an Instagram or Facebook referral was captured.
|
|
29456
|
-
*/
|
|
29457
|
-
meta_ad_captured_at?: string;
|
|
29458
|
-
} | null;
|
|
29581
|
+
metadata?: InboxConversationAdMetadata;
|
|
29582
|
+
adAttribution?: ConversationAdAttribution;
|
|
29459
29583
|
}>;
|
|
29460
29584
|
pagination?: {
|
|
29461
29585
|
hasMore?: boolean;
|
|
@@ -29853,81 +29977,8 @@ export type GetInboxConversationResponse = ({
|
|
|
29853
29977
|
*/
|
|
29854
29978
|
fetchedAt?: (string) | null;
|
|
29855
29979
|
} | null;
|
|
29856
|
-
|
|
29857
|
-
|
|
29858
|
-
* Absent when the conversation did not originate from an ad click.
|
|
29859
|
-
*
|
|
29860
|
-
* Captured once, from the first inbound message Meta attaches the referral
|
|
29861
|
-
* to, and never overwritten. If the same person later clicks a different
|
|
29862
|
-
* ad, the original values are kept. On Instagram Click-to-Direct that is
|
|
29863
|
-
* usually not the first message: Meta first delivers the ad post as an
|
|
29864
|
-
* attachment-only `share` / `ig_post` message with no referral, then
|
|
29865
|
-
* attaches the referral to the next message.
|
|
29866
|
-
*
|
|
29867
|
-
* This operation currently returns only the `meta_ad_*` family, which
|
|
29868
|
-
* covers Instagram Click-to-Direct and Facebook Messenger
|
|
29869
|
-
* Click-to-Message. WhatsApp Click-to-WhatsApp attribution (the `ctwa_*`
|
|
29870
|
-
* keys, where the ad ID is `ctwa_source_id`) is returned by
|
|
29871
|
-
* `GET /v1/inbox/conversations` instead.
|
|
29872
|
-
*
|
|
29873
|
-
* Every key is optional and only the keys Meta supplied are returned, so
|
|
29874
|
-
* read defensively. Meta does not send a campaign or ad set ID, so none is
|
|
29875
|
-
* exposed here. More keys may be added over time. Treat any key you do not
|
|
29876
|
-
* recognise as an opaque string.
|
|
29877
|
-
*
|
|
29878
|
-
* Key names differ from the `message.received` webhook on purpose. The
|
|
29879
|
-
* webhook forwards Meta's referral verbatim (`ad_id`, `source`, `type`)
|
|
29880
|
-
* while the stored conversation record uses the prefixed names below.
|
|
29881
|
-
* Renaming either side would break existing integrations, so both
|
|
29882
|
-
* spellings are kept.
|
|
29883
|
-
*
|
|
29884
|
-
*/
|
|
29885
|
-
metadata?: {
|
|
29886
|
-
/**
|
|
29887
|
-
* The Meta ad ID the user clicked. Always present when a referral was captured.
|
|
29888
|
-
*/
|
|
29889
|
-
meta_ad_id?: string;
|
|
29890
|
-
/**
|
|
29891
|
-
* Meta-supplied source identifier, for example ADS.
|
|
29892
|
-
*/
|
|
29893
|
-
meta_ad_source?: string;
|
|
29894
|
-
/**
|
|
29895
|
-
* Meta-supplied referral type, for example OPEN_THREAD.
|
|
29896
|
-
*/
|
|
29897
|
-
meta_ad_type?: string;
|
|
29898
|
-
/**
|
|
29899
|
-
* The ref parameter passed through from the ad creative.
|
|
29900
|
-
*/
|
|
29901
|
-
meta_ad_ref?: string;
|
|
29902
|
-
/**
|
|
29903
|
-
* Title of the ad creative at click time.
|
|
29904
|
-
*/
|
|
29905
|
-
meta_ad_title?: string;
|
|
29906
|
-
/**
|
|
29907
|
-
* Image of the ad creative at click time.
|
|
29908
|
-
*/
|
|
29909
|
-
meta_ad_photo_url?: string;
|
|
29910
|
-
/**
|
|
29911
|
-
* Video of the ad creative at click time.
|
|
29912
|
-
*/
|
|
29913
|
-
meta_ad_video_url?: string;
|
|
29914
|
-
/**
|
|
29915
|
-
* The organic post the ad promoted, when the ad was a boosted post.
|
|
29916
|
-
*/
|
|
29917
|
-
meta_ad_post_id?: string;
|
|
29918
|
-
/**
|
|
29919
|
-
* The catalogue product the user clicked, for product ads.
|
|
29920
|
-
*/
|
|
29921
|
-
meta_ad_product_id?: string;
|
|
29922
|
-
/**
|
|
29923
|
-
* The Meta flow the ad launched, for flow ads.
|
|
29924
|
-
*/
|
|
29925
|
-
meta_ad_flow_id?: string;
|
|
29926
|
-
/**
|
|
29927
|
-
* When Zernio stored this referral. Always present when a referral was captured.
|
|
29928
|
-
*/
|
|
29929
|
-
meta_ad_captured_at?: string;
|
|
29930
|
-
} | null;
|
|
29980
|
+
metadata?: InboxConversationAdMetadata;
|
|
29981
|
+
adAttribution?: ConversationAdAttribution;
|
|
29931
29982
|
};
|
|
29932
29983
|
});
|
|
29933
29984
|
|