@getlatedev/node 0.2.1101 → 0.2.1103

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.
@@ -3104,6 +3104,23 @@ export type CampaignBidding = {
3104
3104
  */
3105
3105
  export type channel2 = 'SEARCH' | 'DISPLAY';
3106
3106
 
3107
+ /**
3108
+ * Actions taken on the matched comment itself (comment trigger only; ignored on the
3109
+ * story-reply and DM doors). They never block or fail the DM: when one cannot run,
3110
+ * the log row says why (`likeSkipped`, `hideSkipped`).
3111
+ *
3112
+ */
3113
+ export type CommentAutomationActions = {
3114
+ /**
3115
+ * Like the comment as the account. Facebook always; Instagram only for accounts connected through Facebook Login and allowlisted for likes while Meta reviews the permission. Otherwise the like is skipped and logged.
3116
+ */
3117
+ likeComment?: boolean;
3118
+ /**
3119
+ * Hide the comment once the first DM has been attempted, so the private reply is never sent to an already hidden comment.
3120
+ */
3121
+ hideComment?: boolean;
3122
+ };
3123
+
3107
3124
  /**
3108
3125
  * Who a comment automation answers. Instagram only - Meta exposes the follow
3109
3126
  * relationship on no other platform, and only for people who have MESSAGED the
@@ -3150,6 +3167,23 @@ export type followerStatus = 'any' | 'follower' | 'non_follower';
3150
3167
  */
3151
3168
  export type whenUnknown = 'send' | 'skip' | 'verify';
3152
3169
 
3170
+ /**
3171
+ * An image, video, audio clip or file sent right after the DM text as a second message
3172
+ * (a Meta message carries one body, so text and attachment are two sends). On the comment
3173
+ * trigger Meta may refuse the second message until the commenter replies; the DM then
3174
+ * still counts as sent and the log row carries `mediaError`.
3175
+ *
3176
+ */
3177
+ export type CommentAutomationDmMedia = {
3178
+ type: 'image' | 'video' | 'audio' | 'file';
3179
+ /**
3180
+ * Publicly reachable http(s) URL Meta downloads the media from.
3181
+ */
3182
+ url: string;
3183
+ };
3184
+
3185
+ export type type3 = 'image' | 'video' | 'audio' | 'file';
3186
+
3153
3187
  /**
3154
3188
  * Copy for the follow gate. Sensible defaults are used for any field left empty.
3155
3189
  */
@@ -3168,13 +3202,191 @@ export type CommentAutomationFollowGate = {
3168
3202
  notFollowingMessage?: string;
3169
3203
  };
3170
3204
 
3205
+ export type CommentAutomationLog = {
3206
+ id?: string;
3207
+ commentId?: string;
3208
+ commenterId?: string;
3209
+ commenterName?: (string) | null;
3210
+ commenterUsername?: (string) | null;
3211
+ commentText?: (string) | null;
3212
+ /**
3213
+ * Which door triggered this send. Null on rows written before this field existed (all of those are comment-triggered).
3214
+ */
3215
+ source?: ('comment' | 'live_comment' | 'story_reply' | 'story_mention' | 'dm') | null;
3216
+ /**
3217
+ * DM outcome. 'pending' = the automation has a dmDelaySeconds and the response is queued but not sent yet. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap. 'skipped' also covers repeatPolicy, cooldown and dedupeSameTextHours suppressions, with the reason in error.
3218
+ */
3219
+ status?: 'pending' | 'sent' | 'failed' | 'skipped' | 'gated';
3220
+ /**
3221
+ * How the audience rule resolved. Null on automations without one.
3222
+ */
3223
+ audienceOutcome?: ('passed' | 'blocked' | 'gate_sent' | 'gate_passed' | 'gate_failed') | null;
3224
+ /**
3225
+ * Whether the follow-gate button reached the commenter: 'rejected' = Meta refused the gate DM, 'omitted' = the prompt went out as plain text because it was over 640 characters. Null when no gate DM was sent.
3226
+ */
3227
+ gateButtonStatus?: ('delivered' | 'rejected' | 'omitted') | null;
3228
+ /**
3229
+ * Follow relationship at decision time. Null when Instagram would not tell us (the commenter never messaged the account).
3230
+ */
3231
+ commenterIsFollower?: (boolean) | null;
3232
+ commenterFollowerCount?: (number) | null;
3233
+ /**
3234
+ * When the follow-gate tap was claimed.
3235
+ */
3236
+ gateResolvedAt?: (string) | null;
3237
+ /**
3238
+ * DM error message when status is failed, or the reason when it is skipped.
3239
+ */
3240
+ error?: (string) | null;
3241
+ /**
3242
+ * Platform error codes of the failed DM (Meta `code` and `error_subcode`), when the platform sent them. Null on successful rows and on rows written before this field existed.
3243
+ */
3244
+ platformError?: {
3245
+ code?: number;
3246
+ subcode?: number;
3247
+ } | null;
3248
+ /**
3249
+ * True when the failed send spent the comment's single private reply (Instagram subcode 1545133 or 2534023, or Meta code 10900 on Instagram and Facebook), the same rule as `details.privateReplyConsumed` on the private-reply endpoint. Null on direct DMs and on rows written before this field existed.
3250
+ */
3251
+ privateReplyConsumed?: (boolean) | null;
3252
+ /**
3253
+ * Outcome of the optional public reply on the triggering comment. With publicReplyPolicy after_dm, 'skipped' if no commentReply was configured or if the DM failed (the public reply is not attempted in that case).
3254
+ */
3255
+ commentReplyStatus?: ('pending' | 'sent' | 'failed' | 'skipped') | null;
3256
+ /**
3257
+ * Public-reply error message if commentReplyStatus is failed
3258
+ */
3259
+ commentReplyError?: (string) | null;
3260
+ /**
3261
+ * When the public reply was posted. Null when it was not.
3262
+ */
3263
+ publicReplyPostedAt?: (string) | null;
3264
+ /**
3265
+ * Why actions.likeComment did not like the comment. Null when it did or was not configured.
3266
+ */
3267
+ likeSkipped?: (string) | null;
3268
+ /**
3269
+ * Why actions.hideComment did not hide the comment. Null when it did or was not configured.
3270
+ */
3271
+ hideSkipped?: (string) | null;
3272
+ /**
3273
+ * Why the dmMedia follow-up was not delivered. The DM itself still counts as sent.
3274
+ */
3275
+ mediaError?: (string) | null;
3276
+ /**
3277
+ * When the next queued send fires. Present only while something is still pending.
3278
+ */
3279
+ nextDueAt?: (string) | null;
3280
+ /**
3281
+ * This recipient's first click on a tracked link (what uniqueClicks counts).
3282
+ */
3283
+ clickedAt?: (string) | null;
3284
+ /**
3285
+ * This recipient's total clicks on tracked links.
3286
+ */
3287
+ clickCount?: number;
3288
+ createdAt?: string;
3289
+ };
3290
+
3291
+ /**
3292
+ * Which door triggered this send. Null on rows written before this field existed (all of those are comment-triggered).
3293
+ */
3294
+ export type source = 'comment' | 'live_comment' | 'story_reply' | 'story_mention' | 'dm';
3295
+
3296
+ /**
3297
+ * DM outcome. 'pending' = the automation has a dmDelaySeconds and the response is queued but not sent yet. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap. 'skipped' also covers repeatPolicy, cooldown and dedupeSameTextHours suppressions, with the reason in error.
3298
+ */
3299
+ export type status10 = 'pending' | 'sent' | 'failed' | 'skipped' | 'gated';
3300
+
3301
+ /**
3302
+ * How the audience rule resolved. Null on automations without one.
3303
+ */
3304
+ export type audienceOutcome = 'passed' | 'blocked' | 'gate_sent' | 'gate_passed' | 'gate_failed';
3305
+
3306
+ /**
3307
+ * Whether the follow-gate button reached the commenter: 'rejected' = Meta refused the gate DM, 'omitted' = the prompt went out as plain text because it was over 640 characters. Null when no gate DM was sent.
3308
+ */
3309
+ export type gateButtonStatus = 'delivered' | 'rejected' | 'omitted';
3310
+
3311
+ /**
3312
+ * Outcome of the optional public reply on the triggering comment. With publicReplyPolicy after_dm, 'skipped' if no commentReply was configured or if the DM failed (the public reply is not attempted in that case).
3313
+ */
3314
+ export type commentReplyStatus = 'pending' | 'sent' | 'failed' | 'skipped';
3315
+
3316
+ export type CommentAutomationQuickReply = {
3317
+ title: string;
3318
+ /**
3319
+ * Delivered back via the messaging webhook when tapped.
3320
+ */
3321
+ payload: string;
3322
+ imageUrl?: string;
3323
+ };
3324
+
3325
+ /**
3326
+ * Whether a commenter can receive this automation's DM more than once.
3327
+ * * `once` (default) - one DM per person per door, ever.
3328
+ * * `every_comment` - every new matching comment is eligible again. One comment
3329
+ * is still answered at most once. `cooldownHours` suppresses a repeat sent to the
3330
+ * same person within that many hours.
3331
+ *
3332
+ */
3333
+ export type CommentAutomationRepeatPolicy = {
3334
+ mode: 'once' | 'every_comment';
3335
+ /**
3336
+ * every_comment only (400 with once). Hours after a DM during which the same person is not DMed again.
3337
+ */
3338
+ cooldownHours?: number;
3339
+ };
3340
+
3341
+ export type mode = 'once' | 'every_comment';
3342
+
3343
+ /**
3344
+ * Running counters for the automation.
3345
+ */
3346
+ export type CommentAutomationStats = {
3347
+ /**
3348
+ * Matched triggers that reached the audience or send stage.
3349
+ */
3350
+ triggered?: number;
3351
+ dmsSent?: number;
3352
+ dmsFailed?: number;
3353
+ uniqueContacts?: number;
3354
+ /**
3355
+ * DMs sent with a trackable (wrapped) link. CTR denominator: divide clicks by this, not dmsSent. Lags dmsSent for campaigns that predate click tracking.
3356
+ */
3357
+ trackedSends?: number;
3358
+ /**
3359
+ * Total clicks on tracked links (bots/prefetch excluded).
3360
+ */
3361
+ linkClicks?: number;
3362
+ /**
3363
+ * Distinct people who clicked a tracked link.
3364
+ */
3365
+ uniqueClicks?: number;
3366
+ /**
3367
+ * DMs confirmed delivered (Messenger; IG emits no delivery receipt).
3368
+ */
3369
+ delivered?: number;
3370
+ /**
3371
+ * DMs confirmed read (IG messaging_seen / Messenger message_reads).
3372
+ */
3373
+ read?: number;
3374
+ /**
3375
+ * Triggers the audience rule did not answer with the DM.
3376
+ */
3377
+ audienceSkipped?: number;
3378
+ followGateSent?: number;
3379
+ followGatePassed?: number;
3380
+ followGateFailed?: number;
3381
+ };
3382
+
3171
3383
  /**
3172
3384
  * A Meta generic template (product card) sent as the automation's first DM.
3173
3385
  * It REPLACES the plain `dmMessage` bubble: a Meta message carries one body
3174
3386
  * shape, and a comment gets exactly one private reply, so the card and the
3175
3387
  * text cannot both be delivered. Put your selling copy in `subtitle`.
3176
- * Mutually exclusive with `buttons` (sending both is a 400). Works on both
3177
- * the `comment` and `story_reply` triggers.
3388
+ * Mutually exclusive with `buttons` (sending both is a 400). Works on every
3389
+ * Instagram and Facebook trigger.
3178
3390
  * Up to 10 elements, rendered as a horizontally swipeable carousel.
3179
3391
  * Rendering confirmed on the Instagram and Messenger mobile apps.
3180
3392
  *
@@ -3188,7 +3400,7 @@ export type CommentAutomationTemplate = {
3188
3400
  elements: Array<CommentAutomationTemplateElement>;
3189
3401
  };
3190
3402
 
3191
- export type type3 = 'generic';
3403
+ export type type4 = 'generic';
3192
3404
 
3193
3405
  /**
3194
3406
  * Facebook only. How Messenger renders each element imageUrl: horizontal (1.91:1, the default) or square (1:1). Instagram has no such setting, so an Instagram automation carrying it is a 400.
@@ -3360,9 +3572,9 @@ export type platform5 = 'shopify';
3360
3572
 
3361
3573
  export type method = 'code' | 'automatic';
3362
3574
 
3363
- export type type4 = 'percentage' | 'fixed_amount' | 'free_shipping' | 'buy_x_get_y' | 'app';
3575
+ export type type5 = 'percentage' | 'fixed_amount' | 'free_shipping' | 'buy_x_get_y' | 'app';
3364
3576
 
3365
- export type status10 = 'active' | 'scheduled' | 'expired';
3577
+ export type status11 = 'active' | 'scheduled' | 'expired';
3366
3578
 
3367
3579
  export type CommerceImage = {
3368
3580
  /**
@@ -3417,7 +3629,7 @@ export type CommerceMarket = {
3417
3629
  type?: string;
3418
3630
  };
3419
3631
 
3420
- export type status11 = 'active' | 'draft';
3632
+ export type status12 = 'active' | 'draft';
3421
3633
 
3422
3634
  export type CommerceMenu = {
3423
3635
  id?: string;
@@ -3438,7 +3650,7 @@ export type CommerceMenuItem = {
3438
3650
  items?: Array<CommerceMenuItem>;
3439
3651
  };
3440
3652
 
3441
- export type type5 = 'frontpage' | 'collection' | 'collections' | 'product' | 'catalog' | 'page' | 'blog' | 'article' | 'search' | 'shop_policy' | 'http' | 'metaobject' | 'customer_account_page';
3653
+ export type type6 = 'frontpage' | 'collection' | 'collections' | 'product' | 'catalog' | 'page' | 'blog' | 'article' | 'search' | 'shop_policy' | 'http' | 'metaobject' | 'customer_account_page';
3442
3654
 
3443
3655
  export type CommerceMenuItemInput = {
3444
3656
  title: string;
@@ -3807,7 +4019,7 @@ export type ConversionDestination = {
3807
4019
  * For LinkedIn, `inactive` means the rule is soft-deleted (`enabled: false`).
3808
4020
  *
3809
4021
  */
3810
- export type status12 = 'active' | 'inactive';
4022
+ export type status13 = 'active' | 'inactive';
3811
4023
 
3812
4024
  /**
3813
4025
  * A single conversion event to relay to the ad platform. All PII fields
@@ -4693,7 +4905,7 @@ export type objective = 'OUTCOME_ENGAGEMENT' | 'OUTCOME_SALES' | 'OUTCOME_LEADS'
4693
4905
  * `adSetId`, the new ads themselves.
4694
4906
  *
4695
4907
  */
4696
- export type status13 = 'ACTIVE' | 'PAUSED';
4908
+ export type status14 = 'ACTIVE' | 'PAUSED';
4697
4909
 
4698
4910
  /**
4699
4911
  * Campaign-level status, same semantics as `POST /v1/ads/create`. Defaults
@@ -5077,7 +5289,7 @@ export type privacy_level = 2;
5077
5289
  /**
5078
5290
  * 1=SCHEDULED, 2=ACTIVE, 3=COMPLETED, 4=CANCELED
5079
5291
  */
5080
- export type status14 = 1 | 2 | 3 | 4;
5292
+ export type status15 = 1 | 2 | 3 | 4;
5081
5293
 
5082
5294
  /**
5083
5295
  * 1=STAGE_INSTANCE, 2=VOICE, 3=EXTERNAL
@@ -5111,7 +5323,7 @@ export type DmButton = {
5111
5323
  phone?: string;
5112
5324
  };
5113
5325
 
5114
- export type type6 = 'url' | 'postback' | 'phone';
5326
+ export type type7 = 'url' | 'postback' | 'phone';
5115
5327
 
5116
5328
  /**
5117
5329
  * Canonical error envelope. `error` is the human-readable message; `type`,
@@ -5246,7 +5458,7 @@ export type ErrorResponse = {
5246
5458
  /**
5247
5459
  * Error class for programmatic handling.
5248
5460
  */
5249
- export type type7 = 'invalid_request_error' | 'authentication_error' | 'permission_error' | 'not_found' | 'rate_limit_error' | 'platform_error' | 'api_error';
5461
+ export type type8 = 'invalid_request_error' | 'authentication_error' | 'permission_error' | 'not_found' | 'rate_limit_error' | 'platform_error' | 'api_error';
5250
5462
 
5251
5463
  /**
5252
5464
  * Meta ad create failures only. The step that failed: `media` (image/video download or upload), `campaign`, `adset`, `creative`, `ad` (the ad POST itself, where Meta's code 31 / 3858385 hold and 100 / 1359188 payment rejections land), `activation` (switching the created objects on), or `other` (a read or check before any write).
@@ -5287,7 +5499,7 @@ export type ExternalPostMediaItem = {
5287
5499
  unavailableReason?: 'platform_withheld';
5288
5500
  };
5289
5501
 
5290
- export type type8 = 'image' | 'video';
5502
+ export type type9 = 'image' | 'video';
5291
5503
 
5292
5504
  /**
5293
5505
  * unavailable means the media file could not be retrieved (url is null or, for LinkedIn videos, a cover image standing in for the file). available or absent means the file is available at url (older synced items omit the field).
@@ -5446,7 +5658,7 @@ export type ExternalPostWebhookPost = {
5446
5658
  /**
5447
5659
  * Always "external". Distinguishes these from Zernio-originated post.* events.
5448
5660
  */
5449
- export type source = 'external';
5661
+ export type source2 = 'external';
5450
5662
 
5451
5663
  /**
5452
5664
  * Feed posts support up to 10 images (no mixed video+image). Stories require single media (24h, no captions). Reels require a single vertical video (9:16). The Zernio API does not preflight Reel duration. Meta's Reels publishing guide documents 3-90 seconds. Geo-restriction is a hard visibility restriction: users outside the specified countries cannot see the post. Not supported for stories. Draft, carousel, and colored-background text options live under facebookSettings, see FacebookSettings.
@@ -5619,7 +5831,7 @@ export type FeedbackReceipt = {
5619
5831
  duplicate?: boolean;
5620
5832
  };
5621
5833
 
5622
- export type status15 = 'received';
5834
+ export type status16 = 'received';
5623
5835
 
5624
5836
  export type FollowerStatsResponse = {
5625
5837
  accounts?: Array<AccountWithFollowerStats>;
@@ -5744,7 +5956,7 @@ export type GoogleAdLabel = {
5744
5956
  description?: (string) | null;
5745
5957
  };
5746
5958
 
5747
- export type status16 = 'ENABLED' | 'REMOVED' | 'UNKNOWN';
5959
+ export type status17 = 'ENABLED' | 'REMOVED' | 'UNKNOWN';
5748
5960
 
5749
5961
  /**
5750
5962
  * At least one id across the four target lists. Up to 1000 ids per list.
@@ -5842,7 +6054,7 @@ export type GoogleAdsManagerLink = {
5842
6054
  /**
5843
6055
  * Status the link has after this call.
5844
6056
  */
5845
- export type status17 = 'PENDING' | 'ACTIVE' | 'REFUSED' | 'CANCELED' | 'INACTIVE';
6057
+ export type status18 = 'PENDING' | 'ACTIVE' | 'REFUSED' | 'CANCELED' | 'INACTIVE';
5846
6058
 
5847
6059
  /**
5848
6060
  * Link one asset to the asset group. Send exactly one of asset (an existing asset), text, imageUrl or youtubeVideoId (new content, created in the same request).
@@ -6014,7 +6226,7 @@ export type topicType = 'STANDARD' | 'EVENT' | 'OFFER';
6014
6226
  /**
6015
6227
  * Button action type: LEARN_MORE, BOOK, ORDER, SHOP, SIGN_UP, CALL
6016
6228
  */
6017
- export type type9 = 'LEARN_MORE' | 'BOOK' | 'ORDER' | 'SHOP' | 'SIGN_UP' | 'CALL';
6229
+ export type type10 = 'LEARN_MORE' | 'BOOK' | 'ORDER' | 'SHOP' | 'SIGN_UP' | 'CALL';
6018
6230
 
6019
6231
  /**
6020
6232
  * A Google Business Profile review, as returned by every gmb-reviews read endpoint.
@@ -6332,7 +6544,7 @@ export type GoogleListingGroupFilterNode = {
6332
6544
  } | null;
6333
6545
  };
6334
6546
 
6335
- export type type10 = 'SUBDIVISION' | 'UNIT_INCLUDED' | 'UNIT_EXCLUDED';
6547
+ export type type11 = 'SUBDIVISION' | 'UNIT_INCLUDED' | 'UNIT_EXCLUDED';
6336
6548
 
6337
6549
  export type GoogleListingGroupNode = {
6338
6550
  dimension: GoogleListingGroupDimension;
@@ -6563,7 +6775,7 @@ export type GoogleRecommendationResult = {
6563
6775
  error?: string;
6564
6776
  };
6565
6777
 
6566
- export type status18 = 'applied' | 'dismissed' | 'failed';
6778
+ export type status19 = 'applied' | 'dismissed' | 'failed';
6567
6779
 
6568
6780
  export type GoogleRsaDescription = {
6569
6781
  text: string;
@@ -6651,7 +6863,7 @@ export type ImessageSandboxContact = {
6651
6863
  createdAt?: string;
6652
6864
  };
6653
6865
 
6654
- export type status19 = 'pending' | 'active';
6866
+ export type status20 = 'pending' | 'active';
6655
6867
 
6656
6868
  /**
6657
6869
  * An iMessage sender registered as an account on a profile.
@@ -6720,7 +6932,7 @@ export type kind = 'phone' | 'email';
6720
6932
 
6721
6933
  export type region = 'US' | 'GB';
6722
6934
 
6723
- export type status20 = 'ordering' | 'activating' | 'active' | 'suspended' | 'canceled' | 'failed';
6935
+ export type status21 = 'ordering' | 'activating' | 'active' | 'suspended' | 'canceled' | 'failed';
6724
6936
 
6725
6937
  /**
6726
6938
  * Attachment snapshot inside an edit-history entry.
@@ -6792,7 +7004,7 @@ export type InboxWebhookConversation = {
6792
7004
  contactId?: string;
6793
7005
  };
6794
7006
 
6795
- export type status21 = 'active' | 'archived';
7007
+ export type status22 = 'active' | 'archived';
6796
7008
 
6797
7009
  /**
6798
7010
  * The conversation object included in conversation lifecycle webhook payloads (conversation.started, conversation.control_changed).
@@ -7907,7 +8119,7 @@ export type MediaItem = {
7907
8119
  tiktokProcessed?: boolean;
7908
8120
  };
7909
8121
 
7910
- export type type11 = 'image' | 'video' | 'gif' | 'document';
8122
+ export type type12 = 'image' | 'video' | 'gif' | 'document';
7911
8123
 
7912
8124
  export type MediaSubtitle = {
7913
8125
  /**
@@ -7950,6 +8162,28 @@ export type MessagingCarouselCard = {
7950
8162
  linkUrl?: string;
7951
8163
  };
7952
8164
 
8165
+ export type MessengerGreeting = {
8166
+ /**
8167
+ * Meta locale, e.g. `default`, `en_US`, `es_ES`.
8168
+ */
8169
+ locale: string;
8170
+ text: string;
8171
+ };
8172
+
8173
+ export type MessengerIceBreakerLocale = {
8174
+ /**
8175
+ * Meta locale, e.g. `default`, `en_US`.
8176
+ */
8177
+ locale: string;
8178
+ call_to_actions: Array<{
8179
+ question: string;
8180
+ /**
8181
+ * Postback payload sent on tap. `zernio:workflow:<workflowId>` starts that workflow.
8182
+ */
8183
+ payload: string;
8184
+ }>;
8185
+ };
8186
+
7953
8187
  /**
7954
8188
  * Meta (facebook/instagram) options for platformSpecificData on POST /v1/ads/boost and /v1/ads/create. Unknown keys are rejected, not dropped.
7955
8189
  */
@@ -8633,7 +8867,7 @@ export type OwnedPhoneNumber = {
8633
8867
  }>;
8634
8868
  };
8635
8869
 
8636
- export type status22 = 'pending_payment' | 'pending_regulatory' | 'regulatory_declined' | 'provisioning' | 'verifying' | 'active' | 'suspended' | 'releasing' | 'released';
8870
+ export type status23 = 'pending_payment' | 'pending_regulatory' | 'regulatory_declined' | 'provisioning' | 'verifying' | 'active' | 'suspended' | 'releasing' | 'released';
8637
8871
 
8638
8872
  export type metaVerificationStatus = 'pending' | 'code_requested' | 'verified' | 'expired';
8639
8873
 
@@ -8763,7 +8997,7 @@ export type PlatformAnalytics = {
8763
8997
  errorMessage?: (string) | null;
8764
8998
  };
8765
8999
 
8766
- export type status23 = 'published' | 'failed';
9000
+ export type status24 = 'published' | 'failed';
8767
9001
 
8768
9002
  /**
8769
9003
  * Sync state of analytics for this platform
@@ -8892,7 +9126,7 @@ export type PortfolioBidStrategy = {
8892
9126
  targetRoas?: (number) | null;
8893
9127
  };
8894
9128
 
8895
- export type type12 = 'TARGET_CPA' | 'TARGET_ROAS' | 'MAXIMIZE_CONVERSIONS' | 'MAXIMIZE_CONVERSION_VALUE';
9129
+ export type type13 = 'TARGET_CPA' | 'TARGET_ROAS' | 'MAXIMIZE_CONVERSIONS' | 'MAXIMIZE_CONVERSION_VALUE';
8896
9130
 
8897
9131
  export type Post = {
8898
9132
  _id?: string;
@@ -9173,7 +9407,7 @@ export type Product = {
9173
9407
  publishedAt?: (string) | null;
9174
9408
  };
9175
9409
 
9176
- export type status24 = 'active' | 'draft' | 'archived';
9410
+ export type status25 = 'active' | 'draft' | 'archived';
9177
9411
 
9178
9412
  export type ProductImage = {
9179
9413
  url?: string;
@@ -9388,7 +9622,7 @@ export type RcsAgent = {
9388
9622
  createdAt?: string;
9389
9623
  };
9390
9624
 
9391
- export type status25 = 'requested' | 'changes_requested' | 'brand_vetting' | 'agent_review' | 'testing' | 'launch_review' | 'launching' | 'live' | 'rejected' | 'deactivated';
9625
+ export type status26 = 'requested' | 'changes_requested' | 'brand_vetting' | 'agent_review' | 'testing' | 'launch_review' | 'launching' | 'live' | 'rejected' | 'deactivated';
9392
9626
 
9393
9627
  export type useCase = 'MULTI_USE' | 'PROMOTIONAL' | 'TRANSACTIONAL' | 'OTP';
9394
9628
 
@@ -9440,7 +9674,7 @@ export type RcsBrand = RcsBrandInput & {
9440
9674
  /**
9441
9675
  * draft = not filed yet (still editable).
9442
9676
  */
9443
- export type status26 = 'draft' | 'vetting' | 'verified' | 'rejected';
9677
+ export type status27 = 'draft' | 'vetting' | 'verified' | 'rejected';
9444
9678
 
9445
9679
  export type RcsBrandInput = {
9446
9680
  displayName: string;
@@ -9527,7 +9761,7 @@ export type RcsCarrierApproval = {
9527
9761
 
9528
9762
  export type scope2 = 'carrier' | 'hub' | 'bot';
9529
9763
 
9530
- export type status27 = 'PENDING' | 'SUBMITTED' | 'APPROVED' | 'REJECTED';
9764
+ export type status28 = 'PENDING' | 'SUBMITTED' | 'APPROVED' | 'REJECTED';
9531
9765
 
9532
9766
  /**
9533
9767
  * Message content. `suggestions` (max 11) render as chips under the message.
@@ -9553,7 +9787,7 @@ export type RcsContent = {
9553
9787
  suggestions?: Array<RcsSuggestion>;
9554
9788
  };
9555
9789
 
9556
- export type type13 = 'text';
9790
+ export type type14 = 'text';
9557
9791
 
9558
9792
  export type orientation = 'VERTICAL' | 'HORIZONTAL';
9559
9793
 
@@ -9666,7 +9900,7 @@ export type RcsSuggestion = {
9666
9900
  postbackData?: string;
9667
9901
  };
9668
9902
 
9669
- export type type14 = 'reply';
9903
+ export type type15 = 'reply';
9670
9904
 
9671
9905
  export type application = 'BROWSER' | 'WEBVIEW';
9672
9906
 
@@ -11003,7 +11237,7 @@ export type UploadedFile = {
11003
11237
  mimeType?: string;
11004
11238
  };
11005
11239
 
11006
- export type type15 = 'image' | 'video' | 'document';
11240
+ export type type16 = 'image' | 'video' | 'document';
11007
11241
 
11008
11242
  export type UploadTokenResponse = {
11009
11243
  token?: string;
@@ -11012,7 +11246,7 @@ export type UploadTokenResponse = {
11012
11246
  status?: 'pending' | 'completed' | 'expired';
11013
11247
  };
11014
11248
 
11015
- export type status28 = 'pending' | 'completed' | 'expired';
11249
+ export type status29 = 'pending' | 'completed' | 'expired';
11016
11250
 
11017
11251
  export type UploadTokenStatusResponse = {
11018
11252
  token?: string;
@@ -11213,7 +11447,7 @@ export type granularity = 'day' | 'month' | 'total';
11213
11447
  /**
11214
11448
  * `cycle` = a real billing period resolved; `window` = trailing/custom window (or cycle fallback).
11215
11449
  */
11216
- export type source2 = 'cycle' | 'window';
11450
+ export type source3 = 'cycle' | 'window';
11217
11451
 
11218
11452
  export type groupBy = 'profile' | 'account';
11219
11453
 
@@ -11519,7 +11753,7 @@ export type Verification = {
11519
11753
  resend?: boolean;
11520
11754
  };
11521
11755
 
11522
- export type status29 = 'pending' | 'approved' | 'expired' | 'max_attempts_reached' | 'canceled' | 'delivery_failed';
11756
+ export type status30 = 'pending' | 'approved' | 'expired' | 'max_attempts_reached' | 'canceled' | 'delivery_failed';
11523
11757
 
11524
11758
  export type channel4 = 'sms' | 'whatsapp';
11525
11759
 
@@ -11551,7 +11785,7 @@ export type Webhook = {
11551
11785
  /**
11552
11786
  * Events subscribed to
11553
11787
  */
11554
- 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' | 'account.ads.sync_failed' | 'account.ads.sync_recovered' | 'analytics.synced' | 'message.received' | 'conversation.started' | 'conversation.control_changed' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.played' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'ad.video.processed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.account.quality_updated' | 'whatsapp.account.status_updated' | 'whatsapp.account.alert_received' | 'whatsapp.contact.identity_changed' | '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' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed' | 'api.changelog.published' | 'sms.registration.action_required' | 'sms.registration.status_updated' | 'branded_calling.identity.status_updated' | 'branded_calling.identity.action_required' | 'branded_calling.number.status_updated' | 'rcs.agent.status_updated' | 'commerce.product.created' | 'commerce.product.updated' | 'commerce.product.deleted')>;
11788
+ 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' | 'account.ads.sync_failed' | 'account.ads.sync_recovered' | 'analytics.synced' | 'message.received' | 'conversation.started' | 'conversation.control_changed' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.played' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'ad.video.processed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.account.quality_updated' | 'whatsapp.account.status_updated' | 'whatsapp.account.alert_received' | 'whatsapp.contact.identity_changed' | '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' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed' | 'api.changelog.published' | 'sms.registration.action_required' | 'sms.registration.status_updated' | 'branded_calling.identity.status_updated' | 'branded_calling.identity.action_required' | 'branded_calling.number.status_updated' | 'rcs.agent.status_updated' | 'commerce.product.created' | 'commerce.product.updated' | 'commerce.product.deleted' | 'contact.tag_added' | 'contact.tag_removed' | 'contact.field_changed' | 'sequence.enrolled' | 'sequence.exited' | 'workflow.run.started' | 'workflow.run.completed' | 'workflow.run.failed')>;
11555
11789
  /**
11556
11790
  * Whether webhook delivery is enabled
11557
11791
  */
@@ -11673,7 +11907,7 @@ export type WebhookLog = {
11673
11907
  /**
11674
11908
  * Delivery outcome
11675
11909
  */
11676
- export type status30 = 'success' | 'failed';
11910
+ export type status31 = 'success' | 'failed';
11677
11911
 
11678
11912
  /**
11679
11913
  * Webhook payload for `account.ads.initial_sync_completed` events.
@@ -11785,7 +12019,7 @@ export type event = 'account.ads.initial_sync_completed';
11785
12019
  /**
11786
12020
  * Overall outcome of the initial sync.
11787
12021
  */
11788
- export type status31 = 'success' | 'failure';
12022
+ export type status32 = 'success' | 'failure';
11789
12023
 
11790
12024
  /**
11791
12025
  * Stable category for UX branching. New values may be added; existing ones are
@@ -12146,7 +12380,7 @@ export type event7 = 'ad.video.processed';
12146
12380
  /**
12147
12381
  * `ready`: usable as `video.id` on the create endpoints. `error`: Meta could not process it; upload again.
12148
12382
  */
12149
- export type status32 = 'ready' | 'error';
12383
+ export type status33 = 'ready' | 'error';
12150
12384
 
12151
12385
  /**
12152
12386
  * Webhook payload for `analytics.synced`. Fired once per connected account each
@@ -12500,6 +12734,10 @@ export type WebhookPayloadComment = {
12500
12734
  * Parent comment ID if this is a reply
12501
12735
  */
12502
12736
  parentCommentId: (string) | null;
12737
+ /**
12738
+ * Instagram only: true when the comment was made on a live broadcast (the live_comments webhook field). Absent on every other comment.
12739
+ */
12740
+ isLive?: boolean;
12503
12741
  /**
12504
12742
  * Ad context. Present only when the comment was made on paid content.
12505
12743
  * Instagram: populated from the webhook payload's value.media.ad_id, value.media.ad_title and value.media.original_media_id, each only when Meta includes it.
@@ -12630,11 +12868,72 @@ export type WebhookPayloadCommerceProduct = {
12630
12868
 
12631
12869
  export type event15 = 'commerce.product.created' | 'commerce.product.updated' | 'commerce.product.deleted';
12632
12870
 
12633
- export type type16 = 'product';
12871
+ export type type17 = 'product';
12872
+
12873
+ export type WebhookPayloadContactFieldChanged = {
12874
+ /**
12875
+ * Event id, the dedupe key.
12876
+ */
12877
+ id: string;
12878
+ event: 'contact.field_changed';
12879
+ timestamp: string;
12880
+ contact: {
12881
+ /**
12882
+ * Zernio contact id.
12883
+ */
12884
+ id?: string;
12885
+ };
12886
+ /**
12887
+ * Custom field slug.
12888
+ */
12889
+ field: string;
12890
+ /**
12891
+ * Value before the write; null when the field was not set.
12892
+ */
12893
+ previousValue: unknown;
12894
+ /**
12895
+ * Value after the write; null when the field was removed.
12896
+ */
12897
+ value: unknown;
12898
+ /**
12899
+ * Who wrote the field: the API or dashboard, a workflow set_field node, or an automation.
12900
+ */
12901
+ source: 'api' | 'workflow' | 'automation';
12902
+ };
12903
+
12904
+ export type event16 = 'contact.field_changed';
12634
12905
 
12635
12906
  /**
12636
- * WhatsApp only. Who answers a conversation changed: Meta Business Agent took it over,
12637
- * handed it to you, or another partner app took it.
12907
+ * Who wrote the field: the API or dashboard, a workflow set_field node, or an automation.
12908
+ */
12909
+ export type source4 = 'api' | 'workflow' | 'automation';
12910
+
12911
+ export type WebhookPayloadContactTag = {
12912
+ /**
12913
+ * Event id, the dedupe key.
12914
+ */
12915
+ id: string;
12916
+ event: 'contact.tag_added' | 'contact.tag_removed';
12917
+ timestamp: string;
12918
+ contact: {
12919
+ /**
12920
+ * Zernio contact id.
12921
+ */
12922
+ id?: string;
12923
+ };
12924
+ tag: string;
12925
+ /**
12926
+ * Who wrote the tag: the API or dashboard, a workflow add_tag / remove_tag node, or a comment-automation link click.
12927
+ */
12928
+ source: 'api' | 'workflow' | 'automation';
12929
+ };
12930
+
12931
+ export type event17 = 'contact.tag_added' | 'contact.tag_removed';
12932
+
12933
+ /**
12934
+ * Who answers a conversation changed under Meta's handover protocol. WhatsApp: Meta
12935
+ * Business Agent took it over, handed it to you, or another partner app took it.
12936
+ * Facebook and Instagram: another app passed the thread to you, or took or received it.
12638
12937
  *
12639
12938
  */
12640
12939
  export type WebhookPayloadConversationControlChanged = {
@@ -12647,13 +12946,17 @@ export type WebhookPayloadConversationControlChanged = {
12647
12946
  account: InboxWebhookAccount;
12648
12947
  control: {
12649
12948
  /**
12650
- * Who answers now. ai_agent: Meta Business Agent; app: you; other: another partner app on the number.
12949
+ * Who answers now. ai_agent: Meta Business Agent (WhatsApp); app: you; other: another app (a WhatsApp partner, or a Messenger / Instagram receiver such as Page Inbox).
12651
12950
  */
12652
12951
  owner: 'app' | 'ai_agent' | 'other';
12653
12952
  /**
12654
- * Owner before this change, null when the thread had never been agent-handled.
12953
+ * Owner before this change, null when no handover had touched the thread.
12655
12954
  */
12656
12955
  previousOwner: ('app' | 'ai_agent' | 'other') | null;
12956
+ /**
12957
+ * Meta app id of the new owner, when Meta names it (Facebook and Instagram handovers, WhatsApp partner apps). Page Inbox is 263902037430900.
12958
+ */
12959
+ ownerAppId?: string;
12657
12960
  /**
12658
12961
  * Free-form string the transferring app attached to the handover, forwarded verbatim.
12659
12962
  */
@@ -12666,15 +12969,15 @@ export type WebhookPayloadConversationControlChanged = {
12666
12969
  timestamp: string;
12667
12970
  };
12668
12971
 
12669
- export type event16 = 'conversation.control_changed';
12972
+ export type event18 = 'conversation.control_changed';
12670
12973
 
12671
12974
  /**
12672
- * Who answers now. ai_agent: Meta Business Agent; app: you; other: another partner app on the number.
12975
+ * Who answers now. ai_agent: Meta Business Agent (WhatsApp); app: you; other: another app (a WhatsApp partner, or a Messenger / Instagram receiver such as Page Inbox).
12673
12976
  */
12674
12977
  export type owner = 'app' | 'ai_agent' | 'other';
12675
12978
 
12676
12979
  /**
12677
- * Owner before this change, null when the thread had never been agent-handled.
12980
+ * Owner before this change, null when no handover had touched the thread.
12678
12981
  */
12679
12982
  export type previousOwner = 'app' | 'ai_agent' | 'other';
12680
12983
 
@@ -12703,7 +13006,7 @@ export type WebhookPayloadConversationStarted = {
12703
13006
  timestamp: string;
12704
13007
  };
12705
13008
 
12706
- export type event17 = 'conversation.started';
13009
+ export type event19 = 'conversation.started';
12707
13010
 
12708
13011
  /**
12709
13012
  * Webhook payload for post.external.created / post.external.updated /
@@ -12735,7 +13038,7 @@ export type WebhookPayloadExternalPost = {
12735
13038
  timestamp: string;
12736
13039
  };
12737
13040
 
12738
- export type event18 = 'post.external.created' | 'post.external.updated' | 'post.external.deleted';
13041
+ export type event20 = 'post.external.created' | 'post.external.updated' | 'post.external.deleted';
12739
13042
 
12740
13043
  /**
12741
13044
  * Webhook payload for lead.received events (Meta Lead Gen / Instant Forms).
@@ -12806,7 +13109,7 @@ export type WebhookPayloadLead = {
12806
13109
  timestamp: string;
12807
13110
  };
12808
13111
 
12809
- export type event19 = 'lead.received';
13112
+ export type event21 = 'lead.received';
12810
13113
 
12811
13114
  export type platform14 = 'facebook';
12812
13115
 
@@ -13000,15 +13303,35 @@ export type WebhookPayloadMessage = {
13000
13303
  *
13001
13304
  */
13002
13305
  sentVia?: ('human' | 'api' | 'broadcast' | 'sequence' | 'workflow' | 'comment_automation' | 'bulk-api') | null;
13306
+ /**
13307
+ * Always null on this event; see message.sent.
13308
+ */
13309
+ automationId?: (string) | null;
13310
+ /**
13311
+ * Always null on this event; see message.sent.
13312
+ */
13313
+ workflowId?: (string) | null;
13314
+ /**
13315
+ * Always null on this event; see message.sent.
13316
+ */
13317
+ executionId?: (string) | null;
13318
+ /**
13319
+ * Always null on this event; see message.sent.
13320
+ */
13321
+ broadcastId?: (string) | null;
13322
+ /**
13323
+ * Always null on this event; see message.sent.
13324
+ */
13325
+ sequenceId?: (string) | null;
13003
13326
  };
13004
13327
  conversation: InboxWebhookConversation;
13005
13328
  account: InboxWebhookAccount;
13006
13329
  /**
13007
- * Platform-specific message context (present when the message is a quick reply tap, postback button tap, inline keyboard callback, a quote-reply to an earlier message, a WhatsApp inbound that Meta Business Agent is answering, or a TikTok DM that is not plain text)
13330
+ * Platform-specific message context (present when the message is a quick reply tap, postback button tap, inline keyboard callback, a quote-reply to an earlier message, an inbound another app is answering under Meta's handover protocol, or a TikTok DM that is not plain text)
13008
13331
  */
13009
13332
  metadata?: {
13010
13333
  /**
13011
- * WhatsApp only. true when this inbound arrived while Meta Business Agent held the conversation: the agent answers it, and Zernio only observes. Sending a reply takes control back. See conversation.control_changed.
13334
+ * true when this inbound arrived on Meta's standby path because another app owned the conversation: Meta Business Agent on WhatsApp, another handover receiver (such as Page Inbox) on Facebook and Instagram. That app answers it, Zernio only observes, and no automation runs. On WhatsApp sending a reply takes control back; on Facebook and Instagram take control first with POST /v1/inbox/conversations/{conversationId}/thread-control. See conversation.control_changed.
13012
13335
  */
13013
13336
  standby?: boolean;
13014
13337
  /**
@@ -13365,7 +13688,7 @@ export type WebhookPayloadMessage = {
13365
13688
  timestamp: string;
13366
13689
  };
13367
13690
 
13368
- export type event20 = 'message.received';
13691
+ export type event22 = 'message.received';
13369
13692
 
13370
13693
  /**
13371
13694
  * Which Zernio surface produced the message. Always present and
@@ -13426,7 +13749,7 @@ export type WebhookPayloadMessageDeleted = {
13426
13749
  timestamp: string;
13427
13750
  };
13428
13751
 
13429
- export type event21 = 'message.deleted';
13752
+ export type event23 = 'message.deleted';
13430
13753
 
13431
13754
  /**
13432
13755
  * Shared payload for message.delivered, message.read, message.played and
@@ -13489,7 +13812,7 @@ export type WebhookPayloadMessageDeliveryStatus = {
13489
13812
  timestamp: string;
13490
13813
  };
13491
13814
 
13492
- export type event22 = 'message.delivered' | 'message.read' | 'message.played' | 'message.failed';
13815
+ export type event24 = 'message.delivered' | 'message.read' | 'message.played' | 'message.failed';
13493
13816
 
13494
13817
  /**
13495
13818
  * Webhook payload for message.edited events. Fires when the sender
@@ -13527,7 +13850,7 @@ export type WebhookPayloadMessageEdited = {
13527
13850
  timestamp: string;
13528
13851
  };
13529
13852
 
13530
- export type event23 = 'message.edited';
13853
+ export type event25 = 'message.edited';
13531
13854
 
13532
13855
  /**
13533
13856
  * Webhook payload for message sent events (fired when a message is sent via the API, or from the WhatsApp Business app on Coexistence numbers)
@@ -13649,6 +13972,26 @@ export type WebhookPayloadMessageSent = {
13649
13972
  *
13650
13973
  */
13651
13974
  sentVia?: ('human' | 'api' | 'broadcast' | 'sequence' | 'workflow' | 'comment_automation' | 'bulk-api') | null;
13975
+ /**
13976
+ * The comment automation that sent this DM (sentVia comment_automation). Null otherwise.
13977
+ */
13978
+ automationId?: (string) | null;
13979
+ /**
13980
+ * The workflow whose run sent this message (sentVia workflow). Null otherwise.
13981
+ */
13982
+ workflowId?: (string) | null;
13983
+ /**
13984
+ * The workflow run (execution) that sent this message, as returned by the workflow executions endpoints. Null when workflowId is null.
13985
+ */
13986
+ executionId?: (string) | null;
13987
+ /**
13988
+ * The broadcast that sent this message (sentVia broadcast). Null otherwise.
13989
+ */
13990
+ broadcastId?: (string) | null;
13991
+ /**
13992
+ * The sequence whose step sent this message (sentVia sequence). Null otherwise.
13993
+ */
13994
+ sequenceId?: (string) | null;
13652
13995
  };
13653
13996
  pricing?: WhatsAppMessagePricing;
13654
13997
  billingConversation?: WhatsAppBillingConversation;
@@ -13745,7 +14088,7 @@ export type WebhookPayloadMessageSent = {
13745
14088
  timestamp: string;
13746
14089
  };
13747
14090
 
13748
- export type event24 = 'message.sent';
14091
+ export type event26 = 'message.sent';
13749
14092
 
13750
14093
  /**
13751
14094
  * Every platform whose outgoing messages Zernio observes. sms is absent on purpose: its carrier receipts update delivery status and never raise message.sent.
@@ -13755,7 +14098,7 @@ export type platform15 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp' | 't
13755
14098
  /**
13756
14099
  * WhatsApp send origin. whatsapp_business_app when sent from the WhatsApp Business phone app on a Coexistence number; cloud_api when sent through Zernio (dashboard, API, or broadcasts); meta_business_agent when Meta Business Agent answered on the number. Absent on non-WhatsApp platforms. Says where WhatsApp saw the send come from, not which Zernio surface produced it: read sentVia for that.
13757
14100
  */
13758
- export type source3 = 'whatsapp_business_app' | 'cloud_api' | 'meta_business_agent';
14101
+ export type source5 = 'whatsapp_business_app' | 'cloud_api' | 'meta_business_agent';
13759
14102
 
13760
14103
  /**
13761
14104
  * Webhook payload for phone_number.stock_available events
@@ -13799,7 +14142,7 @@ export type WebhookPayloadPhoneNumberStockAvailable = {
13799
14142
  timestamp: string;
13800
14143
  };
13801
14144
 
13802
- export type event25 = 'phone_number.stock_available';
14145
+ export type event27 = 'phone_number.stock_available';
13803
14146
 
13804
14147
  /**
13805
14148
  * Webhook payload for post events
@@ -13849,7 +14192,7 @@ export type WebhookPayloadPost = {
13849
14192
  timestamp: string;
13850
14193
  };
13851
14194
 
13852
- export type event26 = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled';
14195
+ export type event28 = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled';
13853
14196
 
13854
14197
  /**
13855
14198
  * Webhook payload for the per-platform terminal events
@@ -13968,12 +14311,12 @@ export type WebhookPayloadPostPlatform = {
13968
14311
  timestamp: string;
13969
14312
  };
13970
14313
 
13971
- export type event27 = 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved';
14314
+ export type event29 = 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved';
13972
14315
 
13973
14316
  /**
13974
14317
  * Terminal status this event fires on. Matches the event suffix.
13975
14318
  */
13976
- export type status33 = 'published' | 'failed' | 'deleted';
14319
+ export type status34 = 'published' | 'failed' | 'deleted';
13977
14320
 
13978
14321
  /**
13979
14322
  * Webhook payload for reaction received events (WhatsApp, Telegram, Slack, Instagram, Facebook Messenger, TikTok)
@@ -14028,7 +14371,7 @@ export type WebhookPayloadReaction = {
14028
14371
  timestamp: string;
14029
14372
  };
14030
14373
 
14031
- export type event28 = 'reaction.received';
14374
+ export type event30 = 'reaction.received';
14032
14375
 
14033
14376
  export type action = 'added' | 'removed';
14034
14377
 
@@ -14102,7 +14445,7 @@ export type WebhookPayloadReferral = {
14102
14445
  timestamp: string;
14103
14446
  };
14104
14447
 
14105
- export type event29 = 'referral.received';
14448
+ export type event31 = 'referral.received';
14106
14449
 
14107
14450
  /**
14108
14451
  * Webhook payload for the review.new event (new review posted on a connected account).
@@ -14129,7 +14472,7 @@ export type WebhookPayloadReviewNew = {
14129
14472
  timestamp: string;
14130
14473
  };
14131
14474
 
14132
- export type event30 = 'review.new';
14475
+ export type event32 = 'review.new';
14133
14476
 
14134
14477
  /**
14135
14478
  * Webhook payload for the review.updated event. Fired when the reviewer edits their
@@ -14162,7 +14505,40 @@ export type WebhookPayloadReviewUpdated = {
14162
14505
  timestamp: string;
14163
14506
  };
14164
14507
 
14165
- export type event31 = 'review.updated';
14508
+ export type event33 = 'review.updated';
14509
+
14510
+ export type WebhookPayloadSequenceEnrollment = {
14511
+ /**
14512
+ * Event id, the dedupe key.
14513
+ */
14514
+ id: string;
14515
+ event: 'sequence.enrolled' | 'sequence.exited';
14516
+ timestamp: string;
14517
+ sequence: {
14518
+ id?: string;
14519
+ name?: string;
14520
+ };
14521
+ contact: {
14522
+ /**
14523
+ * Zernio contact id.
14524
+ */
14525
+ id?: string;
14526
+ };
14527
+ enrollment: {
14528
+ id?: string;
14529
+ };
14530
+ /**
14531
+ * sequence.exited only. completed: the last step was sent; replied: the contact replied and the sequence exits on reply; manual: unenrolled through the API; failed: the step kept failing to send; unsubscribed: the contact opted out.
14532
+ */
14533
+ exitReason?: 'completed' | 'replied' | 'manual' | 'failed' | 'unsubscribed';
14534
+ };
14535
+
14536
+ export type event34 = 'sequence.enrolled' | 'sequence.exited';
14537
+
14538
+ /**
14539
+ * sequence.exited only. completed: the last step was sent; replied: the contact replied and the sequence exits on reply; manual: unenrolled through the API; failed: the step kept failing to send; unsubscribed: the contact opted out.
14540
+ */
14541
+ export type exitReason = 'completed' | 'replied' | 'manual' | 'failed' | 'unsubscribed';
14166
14542
 
14167
14543
  /**
14168
14544
  * Webhook payload for test deliveries
@@ -14183,7 +14559,7 @@ export type WebhookPayloadTest = {
14183
14559
  timestamp: string;
14184
14560
  };
14185
14561
 
14186
- export type event32 = 'webhook.test';
14562
+ export type event35 = 'webhook.test';
14187
14563
 
14188
14564
  /**
14189
14565
  * Webhook payload for `whatsapp.account.alert_received`, forwarded from Meta's
@@ -14230,7 +14606,7 @@ export type WebhookPayloadWhatsAppAccountAlertReceived = {
14230
14606
  timestamp: string;
14231
14607
  };
14232
14608
 
14233
- export type event33 = 'whatsapp.account.alert_received';
14609
+ export type event36 = 'whatsapp.account.alert_received';
14234
14610
 
14235
14611
  export type platform16 = 'whatsapp';
14236
14612
 
@@ -14281,12 +14657,12 @@ export type WebhookPayloadWhatsAppAccountNameStatusUpdated = {
14281
14657
  timestamp: string;
14282
14658
  };
14283
14659
 
14284
- export type event34 = 'whatsapp.account.name_status_updated';
14660
+ export type event37 = 'whatsapp.account.name_status_updated';
14285
14661
 
14286
14662
  /**
14287
14663
  * Normalized from Meta's `decision` (REJECTED -> DECLINED, DEFERRED -> PENDING_REVIEW; the review is still open on DEFERRED, not a rejection).
14288
14664
  */
14289
- export type status34 = 'APPROVED' | 'DECLINED' | 'PENDING_REVIEW';
14665
+ export type status35 = 'APPROVED' | 'DECLINED' | 'PENDING_REVIEW';
14290
14666
 
14291
14667
  /**
14292
14668
  * Webhook payload for `whatsapp.account.quality_updated`. Fired when a connected
@@ -14334,12 +14710,12 @@ export type WebhookPayloadWhatsAppAccountQualityUpdated = {
14334
14710
  timestamp: string;
14335
14711
  };
14336
14712
 
14337
- export type event35 = 'whatsapp.account.quality_updated';
14713
+ export type event38 = 'whatsapp.account.quality_updated';
14338
14714
 
14339
14715
  /**
14340
14716
  * The Meta webhook field that reported the change.
14341
14717
  */
14342
- export type source4 = 'phone_number_quality_update' | 'business_capability_update';
14718
+ export type source6 = 'phone_number_quality_update' | 'business_capability_update';
14343
14719
 
14344
14720
  /**
14345
14721
  * Webhook payload for `whatsapp.account.status_updated`. Fired when Meta restricts,
@@ -14405,12 +14781,12 @@ export type WebhookPayloadWhatsAppAccountStatusUpdated = {
14405
14781
  timestamp: string;
14406
14782
  };
14407
14783
 
14408
- export type event36 = 'whatsapp.account.status_updated';
14784
+ export type event39 = 'whatsapp.account.status_updated';
14409
14785
 
14410
14786
  /**
14411
14787
  * `active` only on a reinstatement (DISABLED_UPDATE with ban state REINSTATE).
14412
14788
  */
14413
- export type status35 = 'restricted' | 'active';
14789
+ export type status36 = 'restricted' | 'active';
14414
14790
 
14415
14791
  /**
14416
14792
  * Webhook payload for the `whatsapp.contact.identity_changed` event. Fired when
@@ -14457,7 +14833,7 @@ export type WebhookPayloadWhatsAppContactIdentityChanged = {
14457
14833
  timestamp: string;
14458
14834
  };
14459
14835
 
14460
- export type event37 = 'whatsapp.contact.identity_changed';
14836
+ export type event40 = 'whatsapp.contact.identity_changed';
14461
14837
 
14462
14838
  /**
14463
14839
  * Which Meta signal reported the change. `user_changed_number`: new phone number. `user_changed_user_id` and `user_id_update`: new BSUID.
@@ -14526,7 +14902,7 @@ export type WebhookPayloadWhatsAppTemplateCategoryUpdated = {
14526
14902
  timestamp: string;
14527
14903
  };
14528
14904
 
14529
- export type event38 = 'whatsapp.template.category_updated';
14905
+ export type event41 = 'whatsapp.template.category_updated';
14530
14906
 
14531
14907
  /**
14532
14908
  * `scheduled` is Meta's 24h advance notice of an upcoming
@@ -14603,7 +14979,7 @@ export type WebhookPayloadWhatsAppTemplateStatusUpdated = {
14603
14979
  timestamp: string;
14604
14980
  };
14605
14981
 
14606
- export type event39 = 'whatsapp.template.status_updated';
14982
+ export type event42 = 'whatsapp.template.status_updated';
14607
14983
 
14608
14984
  /**
14609
14985
  * New status. Forwarded verbatim from Meta's `event` field.
@@ -14611,7 +14987,66 @@ export type event39 = 'whatsapp.template.status_updated';
14611
14987
  * request before the template is actually removed.
14612
14988
  *
14613
14989
  */
14614
- export type status36 = 'APPROVED' | 'REJECTED' | 'PENDING' | 'PAUSED' | 'DISABLED' | 'IN_APPEAL' | 'PENDING_DELETION';
14990
+ export type status37 = 'APPROVED' | 'REJECTED' | 'PENDING' | 'PAUSED' | 'DISABLED' | 'IN_APPEAL' | 'PENDING_DELETION';
14991
+
14992
+ export type WebhookPayloadWorkflowRun = {
14993
+ /**
14994
+ * Event id, the dedupe key.
14995
+ */
14996
+ id: string;
14997
+ event: 'workflow.run.started' | 'workflow.run.completed' | 'workflow.run.failed';
14998
+ timestamp: string;
14999
+ workflow: {
15000
+ id?: string;
15001
+ /**
15002
+ * Null when the workflow was deleted while the run was live.
15003
+ */
15004
+ name?: (string) | null;
15005
+ };
15006
+ execution: {
15007
+ /**
15008
+ * Workflow run (execution) id.
15009
+ */
15010
+ id?: string;
15011
+ /**
15012
+ * running on workflow.run.started; completed or exited (ended on purpose before the last node, e.g. a handoff) on workflow.run.completed; failed on workflow.run.failed.
15013
+ */
15014
+ status?: 'running' | 'waiting' | 'completed' | 'exited' | 'failed';
15015
+ };
15016
+ /**
15017
+ * Null while a comment-triggered run has not sent the private reply that opens its conversation.
15018
+ */
15019
+ conversation: {
15020
+ id?: string;
15021
+ } | null;
15022
+ contact: {
15023
+ /**
15024
+ * Zernio contact id.
15025
+ */
15026
+ id?: string;
15027
+ } | null;
15028
+ trigger: {
15029
+ /**
15030
+ * The trigger node type, e.g. inbound_message (the default when the node sets none). Null when the workflow was deleted while the run was live.
15031
+ */
15032
+ type?: (string) | null;
15033
+ /**
15034
+ * The inbound message that started the run, when there was one.
15035
+ */
15036
+ text?: string;
15037
+ };
15038
+ /**
15039
+ * workflow.run.failed only: which node failed and why.
15040
+ */
15041
+ error?: string;
15042
+ };
15043
+
15044
+ export type event43 = 'workflow.run.started' | 'workflow.run.completed' | 'workflow.run.failed';
15045
+
15046
+ /**
15047
+ * running on workflow.run.started; completed or exited (ended on purpose before the last node, e.g. a handoff) on workflow.run.completed; failed on workflow.run.failed.
15048
+ */
15049
+ export type status38 = 'running' | 'waiting' | 'completed' | 'exited' | 'failed';
14615
15050
 
14616
15051
  /**
14617
15052
  * WhatsApp only. Meta's `conversation` object from the status webhook (the billing
@@ -14700,6 +15135,24 @@ export type WhatsAppContactIdentity = {
14700
15135
  whatsappUsername: (string) | null;
14701
15136
  };
14702
15137
 
15138
+ export type WhatsAppConversationalAutomation = {
15139
+ /**
15140
+ * When true, Meta sends a `request_welcome` event the first time a person opens a chat with the number.
15141
+ */
15142
+ enable_welcome_message?: boolean;
15143
+ /**
15144
+ * Ice breakers shown to a person opening a chat. Tapping one sends its text as a normal message.
15145
+ */
15146
+ prompts?: Array<(string)>;
15147
+ /**
15148
+ * Slash commands shown when a person types `/`. Names are unique, letters, digits and underscores, without the slash.
15149
+ */
15150
+ commands?: Array<{
15151
+ command_name: string;
15152
+ command_description: string;
15153
+ }>;
15154
+ };
15155
+
14703
15156
  export type WhatsAppFooterComponent = {
14704
15157
  type: 'footer';
14705
15158
  /**
@@ -14858,7 +15311,7 @@ export type WhatsAppTemplateButton = {
14858
15311
  navigate_screen?: string;
14859
15312
  };
14860
15313
 
14861
- export type type17 = 'quick_reply' | 'url' | 'phone_number' | 'otp' | 'copy_code' | 'flow' | 'mpm' | 'catalog';
15314
+ export type type18 = 'quick_reply' | 'url' | 'phone_number' | 'otp' | 'copy_code' | 'flow' | 'mpm' | 'catalog';
14862
15315
 
14863
15316
  /**
14864
15317
  * Required when type is otp
@@ -14900,7 +15353,7 @@ export type WhatsAppTemplateLookupError = {
14900
15353
  };
14901
15354
  };
14902
15355
 
14903
- export type type18 = 'platform_error';
15356
+ export type type19 = 'platform_error';
14904
15357
 
14905
15358
  export type code = 'platform_api_error';
14906
15359
 
@@ -14982,7 +15435,7 @@ export type WorkflowExecutionEvent = {
14982
15435
 
14983
15436
  export type action2 = 'execution_started' | 'execution_completed' | 'execution_exited' | 'execution_paused' | 'execution_resumed' | 'node_started' | 'node_completed' | 'node_failed' | 'node_skipped';
14984
15437
 
14985
- export type status37 = 'success' | 'failed' | 'pending';
15438
+ export type status39 = 'success' | 'failed' | 'pending';
14986
15439
 
14987
15440
  /**
14988
15441
  * A node in a workflow graph. `config` shape depends on `type`.
@@ -15004,13 +15457,16 @@ export type WorkflowNode = {
15004
15457
  /**
15005
15458
  * Type-specific settings. All string fields support `{{variable}}` interpolation against the run's variable bag (resolved at execution time).
15006
15459
  *
15007
- * **trigger**: `{ triggerType: inbound_message|api_call|whatsapp_event, keywords:[string], matchType: any|contains|exact|regex, onlyFirstMessage:boolean, eventType: message_sent|message_delivered|message_read|message_failed|reaction }`. Default `triggerType` is `inbound_message` for legacy nodes. `eventType` is only honored when `triggerType` is `whatsapp_event` (WhatsApp-only).
15460
+ * **trigger**: `{ triggerType: inbound_message|api_call|whatsapp_event|referral|story_mention|comment|reaction, 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 }, 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; Instagram delivers only plain text 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`. `referral.matchType` defaults to `any`. `cooldownHours` (inbound_message, referral, story_mention, reaction and whatsapp_event) 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.
15008
15461
  *
15009
- * **send_message**: `{ messageType: text|template|media|interactive, text, template:{name,language,variableMapping}, media:{mediaType:image|video|audio|document, url,caption}, interactive }`. `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.
15462
+ * **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. An array or object interpolated into text renders as JSON.
15010
15463
  *
15011
- * **wait_for_reply**: `{ timeoutMinutes:int (max 43200), saveAs:string }`. Resume via the `'reply'` edge on inbound, or `'timeout'` edge after `timeoutMinutes` of silence.
15464
+ * **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.
15465
+ * 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.
15012
15466
  *
15013
- * **condition**: `{ rules:[{ id, variable, operator: equals|not_equals|contains|not_contains|starts_with|ends_with|exists|not_exists|matches, value }] }`. First matching rule takes its `id` as the sourceHandle; otherwise `'default'`.
15467
+ * **wait_for_reply**: `{ timeoutMinutes:int (max 43200), saveAs:string }`. Resume via the `'reply'` edge on inbound, or `'timeout'` edge after `timeoutMinutes` of silence. On Facebook and Instagram a button tap sets `{{postback.payload}}` / `{{postback.title}}` and a quick reply tap sets `{{quickReply.payload}}` / `{{quickReply.title}}`; each reply clears the previous tap.
15468
+ *
15469
+ * **condition**: `{ rules:[{ id, variable, operator: equals|not_equals|contains|not_contains|starts_with|ends_with|exists|not_exists|matches|greater_than|less_than|greater_or_equal|less_or_equal|before|after|has_tag|not_has_tag|is_true|is_false, value }] }`. First matching rule takes its `id` as the sourceHandle; otherwise `'default'`. Text operators compare case-insensitively. `greater_than`, `less_than`, `greater_or_equal` and `less_or_equal` compare numbers (a non-numeric side is false); `before` and `after` compare ISO dates; `has_tag` and `not_has_tag` test whether an array variable (such as `contact.tags`) contains `value`; `is_true` and `is_false` take no value.
15014
15470
  *
15015
15471
  * **set_variable**: `{ assignments:[{ name, value }] }`. Run-scoped (lives only for this execution; use `set_field` for persistent values).
15016
15472
  *
@@ -15059,7 +15515,7 @@ export type WorkflowNode = {
15059
15515
  * integrations (webhook, ai, handoff, start_call).
15060
15516
  *
15061
15517
  */
15062
- export type type19 = 'trigger' | 'send_message' | 'wait_for_reply' | 'condition' | 'set_variable' | 'delay' | 'webhook' | 'ai' | 'handoff' | 'start_call' | 'a_b_split' | 'set_field' | 'enroll_sequence' | 'add_tag' | 'remove_tag' | 'end';
15518
+ export type type20 = 'trigger' | 'send_message' | 'wait_for_reply' | 'condition' | 'set_variable' | 'delay' | 'webhook' | 'ai' | 'handoff' | 'start_call' | 'a_b_split' | 'set_field' | 'enroll_sequence' | 'add_tag' | 'remove_tag' | 'end';
15063
15519
 
15064
15520
  /**
15065
15521
  * A single X API operation with its per-call price and the Zernio platform methods that trigger it.
@@ -15179,7 +15635,7 @@ export type XArticle = {
15179
15635
  /**
15180
15636
  * Publish creates an X Article draft and then publishes it. Draft stops after draft creation and returns the X draft ID without a public URL.
15181
15637
  */
15182
- export type mode = 'publish' | 'draft';
15638
+ export type mode2 = 'publish' | 'draft';
15183
15639
 
15184
15640
  export type XArticleBlock = {
15185
15641
  type: 'unstyled' | 'header-one' | 'header-two' | 'header-three' | 'unordered-list-item' | 'ordered-list-item' | 'blockquote' | 'atomic';
@@ -15195,7 +15651,7 @@ export type XArticleBlock = {
15195
15651
  entity_ranges?: Array<XArticleEntityRange>;
15196
15652
  };
15197
15653
 
15198
- export type type20 = 'unstyled' | 'header-one' | 'header-two' | 'header-three' | 'unordered-list-item' | 'ordered-list-item' | 'blockquote' | 'atomic';
15654
+ export type type21 = 'unstyled' | 'header-one' | 'header-two' | 'header-three' | 'unordered-list-item' | 'ordered-list-item' | 'blockquote' | 'atomic';
15199
15655
 
15200
15656
  /**
15201
15657
  * X's snake_case content-state shape. Standard DraftJS camelCase fields such as entityMap, inlineStyleRanges, and entityRanges are rejected.
@@ -15274,7 +15730,7 @@ export type XArticleEntity = {
15274
15730
 
15275
15731
  export type mutability = 'immutable' | 'mutable' | 'segmented';
15276
15732
 
15277
- export type type21 = 'divider' | 'latex';
15733
+ export type type22 = 'divider' | 'latex';
15278
15734
 
15279
15735
  /**
15280
15736
  * The referenced entity must exist, and offset plus length must not exceed the containing block's text length.
@@ -16350,6 +16806,45 @@ export type GetInstagramDemographicsError = ({
16350
16806
  code?: string;
16351
16807
  });
16352
16808
 
16809
+ export type GetInstagramOnlineFollowersData = {
16810
+ query: {
16811
+ /**
16812
+ * The Zernio SocialAccount ID for the Instagram account
16813
+ */
16814
+ accountId: string;
16815
+ };
16816
+ };
16817
+
16818
+ export type GetInstagramOnlineFollowersResponse = ({
16819
+ success?: boolean;
16820
+ accountId?: string;
16821
+ platform?: 'instagram';
16822
+ metric?: 'online_followers';
16823
+ /**
16824
+ * Oldest first, as Meta returns them. Days Meta still reports as empty are left out.
16825
+ */
16826
+ days?: Array<{
16827
+ /**
16828
+ * The end_time Meta returns for this day.
16829
+ */
16830
+ endTime?: string;
16831
+ /**
16832
+ * Followers online per hour, keyed "0" to "23".
16833
+ */
16834
+ hours?: {
16835
+ [key: string]: (number);
16836
+ };
16837
+ }>;
16838
+ note?: string;
16839
+ });
16840
+
16841
+ export type GetInstagramOnlineFollowersError = (ErrorResponse | {
16842
+ error?: string;
16843
+ code?: string;
16844
+ } | {
16845
+ error?: string;
16846
+ });
16847
+
16353
16848
  export type GetYouTubeDemographicsData = {
16354
16849
  query: {
16355
16850
  /**
@@ -25418,7 +25913,7 @@ export type CreateWebhookSettingsData = {
25418
25913
  /**
25419
25914
  * Events to subscribe to (at least one required)
25420
25915
  */
25421
- 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' | 'account.ads.sync_failed' | 'account.ads.sync_recovered' | 'analytics.synced' | 'message.received' | 'conversation.started' | 'conversation.control_changed' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.played' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'ad.video.processed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.account.quality_updated' | 'whatsapp.account.status_updated' | 'whatsapp.account.alert_received' | 'whatsapp.contact.identity_changed' | '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' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed' | 'api.changelog.published' | 'sms.registration.action_required' | 'sms.registration.status_updated' | 'branded_calling.identity.status_updated' | 'branded_calling.identity.action_required' | 'branded_calling.number.status_updated' | 'rcs.agent.status_updated' | 'commerce.product.created' | 'commerce.product.updated' | 'commerce.product.deleted')>;
25916
+ 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' | 'account.ads.sync_failed' | 'account.ads.sync_recovered' | 'analytics.synced' | 'message.received' | 'conversation.started' | 'conversation.control_changed' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.played' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'ad.video.processed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.account.quality_updated' | 'whatsapp.account.status_updated' | 'whatsapp.account.alert_received' | 'whatsapp.contact.identity_changed' | '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' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed' | 'api.changelog.published' | 'sms.registration.action_required' | 'sms.registration.status_updated' | 'branded_calling.identity.status_updated' | 'branded_calling.identity.action_required' | 'branded_calling.number.status_updated' | 'rcs.agent.status_updated' | 'commerce.product.created' | 'commerce.product.updated' | 'commerce.product.deleted' | 'contact.tag_added' | 'contact.tag_removed' | 'contact.field_changed' | 'sequence.enrolled' | 'sequence.exited' | 'workflow.run.started' | 'workflow.run.completed' | 'workflow.run.failed')>;
25422
25917
  /**
25423
25918
  * Enable or disable webhook delivery. Defaults to `true` when omitted.
25424
25919
  */
@@ -25484,7 +25979,7 @@ export type UpdateWebhookSettingsData = {
25484
25979
  /**
25485
25980
  * Events to subscribe to. Must contain at least one event if provided.
25486
25981
  */
25487
- 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' | 'account.ads.sync_failed' | 'account.ads.sync_recovered' | 'analytics.synced' | 'message.received' | 'conversation.started' | 'conversation.control_changed' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.played' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'ad.video.processed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.account.quality_updated' | 'whatsapp.account.status_updated' | 'whatsapp.account.alert_received' | 'whatsapp.contact.identity_changed' | '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' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed' | 'api.changelog.published' | 'sms.registration.action_required' | 'sms.registration.status_updated' | 'branded_calling.identity.status_updated' | 'branded_calling.identity.action_required' | 'branded_calling.number.status_updated' | 'rcs.agent.status_updated' | 'commerce.product.created' | 'commerce.product.updated' | 'commerce.product.deleted')>;
25982
+ 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' | 'account.ads.sync_failed' | 'account.ads.sync_recovered' | 'analytics.synced' | 'message.received' | 'conversation.started' | 'conversation.control_changed' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.played' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'ad.video.processed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.account.quality_updated' | 'whatsapp.account.status_updated' | 'whatsapp.account.alert_received' | 'whatsapp.contact.identity_changed' | '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' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed' | 'api.changelog.published' | 'sms.registration.action_required' | 'sms.registration.status_updated' | 'branded_calling.identity.status_updated' | 'branded_calling.identity.action_required' | 'branded_calling.number.status_updated' | 'rcs.agent.status_updated' | 'commerce.product.created' | 'commerce.product.updated' | 'commerce.product.deleted' | 'contact.tag_added' | 'contact.tag_removed' | 'contact.field_changed' | 'sequence.enrolled' | 'sequence.exited' | 'workflow.run.started' | 'workflow.run.completed' | 'workflow.run.failed')>;
25488
25983
  /**
25489
25984
  * Enable or disable webhook delivery
25490
25985
  */
@@ -25823,6 +26318,10 @@ export type ListInboxConversationsData = {
25823
26318
  * Pagination cursor for next page
25824
26319
  */
25825
26320
  cursor?: string;
26321
+ /**
26322
+ * requests lists Facebook and Instagram Message Requests (threads from people the account has not accepted) live from Meta, first page only, each item with `folder: requests`. Meta has no accept call: replying moves a thread to the inbox, which is what POST /v1/inbox/conversations/{conversationId}/accept does. When Meta will not list the folder for the one account asked (`accountId`), the call answers 400 PLATFORM_LIMITATION; across several accounts the refusal is reported per account in meta.failedAccounts.
26323
+ */
26324
+ folder?: 'inbox' | 'requests';
25826
26325
  /**
25827
26326
  * Maximum number of conversations to return
25828
26327
  */
@@ -25878,9 +26377,13 @@ export type ListInboxConversationsResponse = ({
25878
26377
  */
25879
26378
  unreadCount?: (number) | null;
25880
26379
  /**
25881
- * WhatsApp only, present once Meta Business Agent has touched the thread. ai_agent: the agent answers and new inbound arrive flagged metadata.standby; app: you hold control; other: another partner app does. Change it with POST /v1/inbox/conversations/{conversationId}/thread-control.
26380
+ * Present once a handover has touched the thread (WhatsApp, Facebook, Instagram). ai_agent: Meta Business Agent answers (WhatsApp) and new inbound arrive flagged metadata.standby; app: you hold control; other: another app does (a WhatsApp partner, or a Messenger / Instagram receiver such as Page Inbox). Change it with POST /v1/inbox/conversations/{conversationId}/thread-control.
25882
26381
  */
25883
26382
  threadControl?: 'app' | 'ai_agent' | 'other';
26383
+ /**
26384
+ * Present only on items listed with folder=requests: a Message Request the account has not accepted yet.
26385
+ */
26386
+ folder?: 'requests';
25884
26387
  /**
25885
26388
  * iMessage only, true for a group thread. Manage it through the /v1/imessage/groups/{conversationId} endpoints.
25886
26389
  */
@@ -26830,6 +27333,9 @@ export type SendInboxMessageData = {
26830
27333
  * Instagram / Facebook: also mutually exclusive with `template`.
26831
27334
  * A Meta message carries one body shape, so sending both is a 400
26832
27335
  * rather than a silent drop of the buttons.
27336
+ * The buttons and `message` render as Meta's button_template (one
27337
+ * bubble with the text and the buttons below it), so `message` must
27338
+ * be 640 characters or less when buttons are attached (400 otherwise).
26833
27339
  *
26834
27340
  * WhatsApp: buttons always render as interactive reply buttons.
26835
27341
  * Only `title` and `payload` are used; `type`, `url`, and `phone`
@@ -27573,11 +28079,18 @@ export type SetConversationThreadControlData = {
27573
28079
  * Social account ID
27574
28080
  */
27575
28081
  accountId: string;
27576
- action: 'release' | 'take' | 'pass';
27577
28082
  /**
27578
- * With action pass: send control to Meta Business Agent instead of the escalation partner.
28083
+ * `request` is Facebook and Instagram only.
28084
+ */
28085
+ action: 'release' | 'take' | 'pass' | 'request';
28086
+ /**
28087
+ * WhatsApp only. With action pass: send control to Meta Business Agent instead of the escalation partner.
27579
28088
  */
27580
28089
  target?: 'ai_agent';
28090
+ /**
28091
+ * Facebook and Instagram only, required with action pass: the Meta app id receiving the thread.
28092
+ */
28093
+ targetAppId?: string;
27581
28094
  /**
27582
28095
  * Free-form note forwarded verbatim to the app receiving control (its messaging_handovers webhook).
27583
28096
  */
@@ -27595,11 +28108,43 @@ export type SetConversationThreadControlResponse = ({
27595
28108
  success?: boolean;
27596
28109
  control?: {
27597
28110
  owner?: 'app' | 'ai_agent' | 'other';
28111
+ /**
28112
+ * The app that received the thread, on a Facebook or Instagram pass.
28113
+ */
28114
+ ownerAppId?: string;
27598
28115
  };
27599
28116
  });
27600
28117
 
27601
28118
  export type SetConversationThreadControlError = (ErrorResponse | unknown);
27602
28119
 
28120
+ export type AcceptConversationRequestData = {
28121
+ body: {
28122
+ /**
28123
+ * Facebook or Instagram social account ID
28124
+ */
28125
+ accountId: string;
28126
+ /**
28127
+ * The reply that accepts the request
28128
+ */
28129
+ message: string;
28130
+ };
28131
+ path: {
28132
+ /**
28133
+ * The `id` of the request item from the requests folder.
28134
+ */
28135
+ conversationId: string;
28136
+ };
28137
+ };
28138
+
28139
+ export type AcceptConversationRequestResponse = ({
28140
+ success?: boolean;
28141
+ data?: {
28142
+ messageId?: string;
28143
+ };
28144
+ });
28145
+
28146
+ export type AcceptConversationRequestError = (ErrorResponse | unknown);
28147
+
27603
28148
  export type MarkConversationReadData = {
27604
28149
  body: {
27605
28150
  /**
@@ -27824,6 +28369,102 @@ export type DeleteMessengerGetStartedError = (ErrorResponse | {
27824
28369
  error?: string;
27825
28370
  } | unknown);
27826
28371
 
28372
+ export type GetMessengerGreetingData = {
28373
+ path: {
28374
+ accountId: string;
28375
+ };
28376
+ };
28377
+
28378
+ export type GetMessengerGreetingResponse = ({
28379
+ data?: Array<MessengerGreeting>;
28380
+ });
28381
+
28382
+ export type GetMessengerGreetingError = (ErrorResponse | {
28383
+ error?: string;
28384
+ });
28385
+
28386
+ export type SetMessengerGreetingData = {
28387
+ body: {
28388
+ /**
28389
+ * One entry per locale; one must use locale `default`.
28390
+ */
28391
+ greeting: Array<MessengerGreeting>;
28392
+ };
28393
+ path: {
28394
+ accountId: string;
28395
+ };
28396
+ };
28397
+
28398
+ export type SetMessengerGreetingResponse = ({
28399
+ success?: boolean;
28400
+ });
28401
+
28402
+ export type SetMessengerGreetingError = (ErrorResponse | {
28403
+ error?: string;
28404
+ });
28405
+
28406
+ export type DeleteMessengerGreetingData = {
28407
+ path: {
28408
+ accountId: string;
28409
+ };
28410
+ };
28411
+
28412
+ export type DeleteMessengerGreetingResponse = ({
28413
+ success?: boolean;
28414
+ });
28415
+
28416
+ export type DeleteMessengerGreetingError = (ErrorResponse | {
28417
+ error?: string;
28418
+ });
28419
+
28420
+ export type GetMessengerIceBreakersData = {
28421
+ path: {
28422
+ accountId: string;
28423
+ };
28424
+ };
28425
+
28426
+ export type GetMessengerIceBreakersResponse = ({
28427
+ data?: Array<MessengerIceBreakerLocale>;
28428
+ });
28429
+
28430
+ export type GetMessengerIceBreakersError = (ErrorResponse | {
28431
+ error?: string;
28432
+ });
28433
+
28434
+ export type SetMessengerIceBreakersData = {
28435
+ body: {
28436
+ /**
28437
+ * One entry per locale; one must use locale `default`.
28438
+ */
28439
+ ice_breakers: Array<MessengerIceBreakerLocale>;
28440
+ };
28441
+ path: {
28442
+ accountId: string;
28443
+ };
28444
+ };
28445
+
28446
+ export type SetMessengerIceBreakersResponse = ({
28447
+ success?: boolean;
28448
+ });
28449
+
28450
+ export type SetMessengerIceBreakersError = (ErrorResponse | {
28451
+ error?: string;
28452
+ });
28453
+
28454
+ export type DeleteMessengerIceBreakersData = {
28455
+ path: {
28456
+ accountId: string;
28457
+ };
28458
+ };
28459
+
28460
+ export type DeleteMessengerIceBreakersResponse = ({
28461
+ success?: boolean;
28462
+ });
28463
+
28464
+ export type DeleteMessengerIceBreakersError = (ErrorResponse | {
28465
+ error?: string;
28466
+ });
28467
+
27827
28468
  export type GetInstagramIceBreakersData = {
27828
28469
  path: {
27829
28470
  accountId: string;
@@ -32135,6 +32776,57 @@ export type UpdateWhatsAppCommerceSettingsResponse = ({
32135
32776
 
32136
32777
  export type UpdateWhatsAppCommerceSettingsError = (ErrorResponse);
32137
32778
 
32779
+ export type GetWhatsAppConversationalAutomationData = {
32780
+ query: {
32781
+ /**
32782
+ * WhatsApp account ID
32783
+ */
32784
+ accountId: string;
32785
+ };
32786
+ };
32787
+
32788
+ export type GetWhatsAppConversationalAutomationResponse = ({
32789
+ data?: WhatsAppConversationalAutomation;
32790
+ });
32791
+
32792
+ export type GetWhatsAppConversationalAutomationError = (ErrorResponse | {
32793
+ error?: string;
32794
+ });
32795
+
32796
+ export type SetWhatsAppConversationalAutomationData = {
32797
+ body: ({
32798
+ /**
32799
+ * WhatsApp account ID
32800
+ */
32801
+ accountId: string;
32802
+ } & WhatsAppConversationalAutomation);
32803
+ };
32804
+
32805
+ export type SetWhatsAppConversationalAutomationResponse = ({
32806
+ success?: boolean;
32807
+ });
32808
+
32809
+ export type SetWhatsAppConversationalAutomationError = (ErrorResponse | {
32810
+ error?: string;
32811
+ });
32812
+
32813
+ export type DeleteWhatsAppConversationalAutomationData = {
32814
+ query: {
32815
+ /**
32816
+ * WhatsApp account ID
32817
+ */
32818
+ accountId: string;
32819
+ };
32820
+ };
32821
+
32822
+ export type DeleteWhatsAppConversationalAutomationResponse = ({
32823
+ success?: boolean;
32824
+ });
32825
+
32826
+ export type DeleteWhatsAppConversationalAutomationError = (ErrorResponse | {
32827
+ error?: string;
32828
+ });
32829
+
32138
32830
  export type GetWhatsAppBusinessProfileData = {
32139
32831
  query: {
32140
32832
  /**
@@ -36916,12 +37608,22 @@ export type CreateBroadcastData = {
36916
37608
  name: string;
36917
37609
  description?: string;
36918
37610
  message?: {
37611
+ /**
37612
+ * Required on every platform except WhatsApp (which sends `template`) and an SMS broadcast that carries attachments.
37613
+ */
36919
37614
  text?: string;
37615
+ /**
37616
+ * SMS only: sent as MMS media, one media_url per attachment. Each url must be public http(s); JPEG, PNG, GIF, WEBP, MP4 or 3GPP under 1 MB (checked at create when the host answers a HEAD request; Telnyx enforces the 1 MB total per message at send).
37617
+ */
36920
37618
  attachments?: Array<{
36921
37619
  type?: string;
36922
37620
  url?: string;
36923
37621
  filename?: string;
36924
37622
  }>;
37623
+ /**
37624
+ * Instagram and Facebook only. Meta message tag sent with every recipient message (messaging_type MESSAGE_TAG) so the broadcast can reach people outside the 24h window. Instagram accepts HUMAN_AGENT only. Rejected with a 400 on any other platform.
37625
+ */
37626
+ messageTag?: 'CONFIRMED_EVENT_UPDATE' | 'POST_PURCHASE_UPDATE' | 'ACCOUNT_UPDATE' | 'HUMAN_AGENT';
36925
37627
  };
36926
37628
  /**
36927
37629
  * WhatsApp template (required when platform is whatsapp)
@@ -36948,6 +37650,12 @@ export type CreateBroadcastData = {
36948
37650
  segmentFilters?: {
36949
37651
  tags?: Array<(string)>;
36950
37652
  isSubscribed?: boolean;
37653
+ /**
37654
+ * Custom field values a contact must hold, keyed by field slug. Exact match per key (type included: 5 does not match "5"); every key must match.
37655
+ */
37656
+ customFields?: {
37657
+ [key: string]: unknown;
37658
+ };
36951
37659
  };
36952
37660
  };
36953
37661
  };
@@ -36990,6 +37698,10 @@ export type GetBroadcastResponse = ({
36990
37698
  };
36991
37699
  segmentFilters?: {
36992
37700
  tags?: Array<(string)>;
37701
+ isSubscribed?: boolean;
37702
+ customFields?: {
37703
+ [key: string]: unknown;
37704
+ };
36993
37705
  };
36994
37706
  status?: 'draft' | 'scheduled' | 'sending' | 'completed' | 'failed' | 'cancelled';
36995
37707
  scheduledAt?: string;
@@ -37018,6 +37730,18 @@ export type UpdateBroadcastData = {
37018
37730
  */
37019
37731
  message?: {
37020
37732
  text?: string;
37733
+ /**
37734
+ * SMS only: sent as MMS media.
37735
+ */
37736
+ attachments?: Array<{
37737
+ type?: string;
37738
+ url?: string;
37739
+ filename?: string;
37740
+ }>;
37741
+ /**
37742
+ * Instagram and Facebook only. See createBroadcast.
37743
+ */
37744
+ messageTag?: 'CONFIRMED_EVENT_UPDATE' | 'POST_PURCHASE_UPDATE' | 'ACCOUNT_UPDATE' | 'HUMAN_AGENT';
37021
37745
  };
37022
37746
  /**
37023
37747
  * WhatsApp template payload (used when platform is `whatsapp`).
@@ -37451,7 +38175,10 @@ export type ListWorkflowExecutionsResponse = ({
37451
38175
  [key: string]: unknown;
37452
38176
  };
37453
38177
  platformIdentifier?: string;
37454
- conversationId?: string;
38178
+ /**
38179
+ * Null only while a comment-triggered run has not sent its private reply yet.
38180
+ */
38181
+ conversationId?: (string) | null;
37455
38182
  stepCount?: number;
37456
38183
  lastError?: (string) | null;
37457
38184
  resumeAt?: (string) | null;
@@ -37511,6 +38238,40 @@ export type TriggerWorkflowError = (unknown | ErrorResponse | {
37511
38238
  error?: string;
37512
38239
  });
37513
38240
 
38241
+ export type TriggerApiCallWorkflowData = {
38242
+ body: {
38243
+ /**
38244
+ * A conversation on the workflow's account
38245
+ */
38246
+ conversationId?: string;
38247
+ /**
38248
+ * A contact with a conversation on the workflow's account
38249
+ */
38250
+ contactId?: string;
38251
+ /**
38252
+ * Recipient phone in E.164 (WhatsApp workflows only)
38253
+ */
38254
+ to?: string;
38255
+ /**
38256
+ * Seed variables, merged over the standard run variables
38257
+ */
38258
+ variables?: {
38259
+ [key: string]: unknown;
38260
+ };
38261
+ };
38262
+ path: {
38263
+ workflowId: string;
38264
+ };
38265
+ };
38266
+
38267
+ export type TriggerApiCallWorkflowResponse = ({
38268
+ executionId: string;
38269
+ });
38270
+
38271
+ export type TriggerApiCallWorkflowError = (ErrorResponse | {
38272
+ error?: string;
38273
+ });
38274
+
37514
38275
  export type ListWorkflowExecutionEventsData = {
37515
38276
  path: {
37516
38277
  executionId: string;
@@ -38001,11 +38762,12 @@ export type ListCommentAutomationsResponse = ({
38001
38762
  automations?: Array<{
38002
38763
  id?: string;
38003
38764
  name?: string;
38004
- platform?: 'instagram' | 'facebook';
38005
- trigger?: 'comment' | 'story_reply';
38765
+ platform?: 'instagram' | 'facebook' | 'tiktok' | 'threads' | 'linkedin' | 'youtube';
38766
+ trigger?: 'comment' | 'live_comment' | 'story_reply' | 'story_mention';
38006
38767
  accountId?: string;
38007
38768
  platformPostId?: string;
38008
38769
  postTitle?: string;
38770
+ postId?: string;
38009
38771
  keywords?: Array<(string)>;
38010
38772
  /**
38011
38773
  * How a keyword is compared with the comment. 'contains' (default) matches anywhere, even inside another word (keyword 'app' fires on 'happy'). 'word' matches the keyword only as a standalone word. 'exact' requires the whole comment to be exactly the keyword.
@@ -38054,33 +38816,19 @@ export type ListCommentAutomationsResponse = ({
38054
38816
  * Whether these keywords also fire on a plain inbound DM.
38055
38817
  */
38056
38818
  alsoMatchInDms?: boolean;
38819
+ repeatPolicy?: CommentAutomationRepeatPolicy;
38820
+ /**
38821
+ * Same-text dedupe window in hours. Omitted when off.
38822
+ */
38823
+ dedupeSameTextHours?: number;
38824
+ publicReplyPolicy?: 'after_dm' | 'always';
38825
+ actions?: CommentAutomationActions;
38826
+ quickReplies?: Array<CommentAutomationQuickReply>;
38827
+ dmMedia?: CommentAutomationDmMedia;
38828
+ audience?: CommentAutomationAudience;
38829
+ followGate?: CommentAutomationFollowGate;
38057
38830
  isActive?: boolean;
38058
- stats?: {
38059
- triggered?: number;
38060
- dmsSent?: number;
38061
- dmsFailed?: number;
38062
- uniqueContacts?: number;
38063
- /**
38064
- * DMs sent with a trackable (wrapped) link. CTR denominator: divide clicks by this, not dmsSent. Lags dmsSent for campaigns that predate click tracking.
38065
- */
38066
- trackedSends?: number;
38067
- /**
38068
- * Total clicks on tracked links (bots/prefetch excluded).
38069
- */
38070
- linkClicks?: number;
38071
- /**
38072
- * Distinct people who clicked a tracked link.
38073
- */
38074
- uniqueClicks?: number;
38075
- /**
38076
- * DMs confirmed delivered (Messenger; IG emits no delivery receipt).
38077
- */
38078
- delivered?: number;
38079
- /**
38080
- * DMs confirmed read (IG messaging_seen / Messenger message_reads).
38081
- */
38082
- read?: number;
38083
- };
38831
+ stats?: CommentAutomationStats;
38084
38832
  createdAt?: string;
38085
38833
  }>;
38086
38834
  });
@@ -38091,13 +38839,13 @@ export type CreateCommentAutomationData = {
38091
38839
  body: {
38092
38840
  profileId: string;
38093
38841
  /**
38094
- * Instagram or Facebook account ID
38842
+ * Instagram, Facebook, TikTok, Threads, LinkedIn or YouTube account ID. On the last four the automation only posts the public reply. X accounts are refused (400, code platform_not_supported) while X comment polling is off.
38095
38843
  */
38096
38844
  accountId: string;
38097
38845
  /**
38098
- * What fires the automation. 'comment' (keyword comment on a post) or 'story_reply' (keyword reply to an Instagram story). For 'story_reply', platformPostId is the story media id (omit for any story).
38846
+ * What fires the automation. 'comment' (keyword comment on a post), 'live_comment' (keyword comment on an Instagram live broadcast), 'story_reply' (keyword reply to an Instagram story) or 'story_mention' (a story mentioning the Instagram account). For 'story_reply', platformPostId is the story media id (omit for any story). Every trigger but 'comment' is Instagram only; reply-only platforms accept 'comment' only.
38099
38847
  */
38100
- trigger?: 'comment' | 'story_reply';
38848
+ trigger?: 'comment' | 'live_comment' | 'story_reply' | 'story_mention';
38101
38849
  /**
38102
38850
  * Platform media/post ID (or story media id when trigger=story_reply). Omit for an account-wide (any-post / any-story) automation.
38103
38851
  */
@@ -38131,9 +38879,9 @@ export type CreateCommentAutomationData = {
38131
38879
  */
38132
38880
  typoTolerance?: boolean;
38133
38881
  /**
38134
- * DM text to send to commenter. Max 640 chars when buttons are set, otherwise ~1000.
38882
+ * DM text sent to the commenter. Required on Instagram and Facebook (400 missing_required_field when absent). Rejected on TikTok, Threads, LinkedIn and YouTube, which have no private reply (400 invalid_field_value). Max 640 chars when buttons are set, otherwise ~1000.
38135
38883
  */
38136
- dmMessage: string;
38884
+ dmMessage?: string;
38137
38885
  /**
38138
38886
  * Optional inline DM buttons (1-3). Phone buttons are Facebook-only. Omit or pass [] for a plain-text DM.
38139
38887
  */
@@ -38143,7 +38891,7 @@ export type CreateCommentAutomationData = {
38143
38891
  */
38144
38892
  template?: (CommentAutomationTemplate);
38145
38893
  /**
38146
- * Optional public reply to the comment
38894
+ * Public reply to the comment. Optional on Instagram and Facebook; required on TikTok, Threads, LinkedIn and YouTube, where it is the automation's only action.
38147
38895
  */
38148
38896
  commentReply?: string;
38149
38897
  /**
@@ -38176,6 +38924,25 @@ export type CreateCommentAutomationData = {
38176
38924
  alsoMatchInDms?: boolean;
38177
38925
  audience?: CommentAutomationAudience;
38178
38926
  followGate?: CommentAutomationFollowGate;
38927
+ repeatPolicy?: CommentAutomationRepeatPolicy;
38928
+ /**
38929
+ * Skip the DM when this recipient already received identical DM text (after personalisation) from this account, from any automation, within this many hours. The skip is logged with status skipped.
38930
+ */
38931
+ dedupeSameTextHours?: (number) | null;
38932
+ /**
38933
+ * 'after_dm' posts commentReply only after a successful DM. 'always' posts it whatever the audience rule, dedupe or DM outcome: the moment a comment matches, or after commentReplyDelaySeconds when set (raised to dmDelaySeconds, so it never precedes the DM attempt).
38934
+ */
38935
+ publicReplyPolicy?: 'after_dm' | 'always';
38936
+ actions?: CommentAutomationActions;
38937
+ /**
38938
+ * Opt-in quick-reply chips on the DM (up to 13). Chips do not render in Message Requests, where a first DM to a cold commenter lands, so prefer buttons for first contact. Mutually exclusive with buttons and template (400).
38939
+ */
38940
+ quickReplies?: Array<CommentAutomationQuickReply>;
38941
+ dmMedia?: (CommentAutomationDmMedia | null);
38942
+ /**
38943
+ * Create the automation paused with false.
38944
+ */
38945
+ isActive?: boolean;
38179
38946
  };
38180
38947
  };
38181
38948
 
@@ -38184,8 +38951,8 @@ export type CreateCommentAutomationResponse = ({
38184
38951
  automation?: {
38185
38952
  id?: string;
38186
38953
  name?: string;
38187
- platform?: string;
38188
- trigger?: 'comment' | 'story_reply';
38954
+ platform?: 'instagram' | 'facebook' | 'tiktok' | 'threads' | 'linkedin' | 'youtube';
38955
+ trigger?: 'comment' | 'live_comment' | 'story_reply' | 'story_mention';
38189
38956
  platformPostId?: string;
38190
38957
  keywords?: Array<(string)>;
38191
38958
  /**
@@ -38231,17 +38998,22 @@ export type CreateCommentAutomationResponse = ({
38231
38998
  * Whether these keywords also fire on a plain inbound DM.
38232
38999
  */
38233
39000
  alsoMatchInDms?: boolean;
39001
+ repeatPolicy?: CommentAutomationRepeatPolicy;
39002
+ /**
39003
+ * Same-text dedupe window in hours. Omitted when off.
39004
+ */
39005
+ dedupeSameTextHours?: number;
39006
+ publicReplyPolicy?: 'after_dm' | 'always';
39007
+ actions?: CommentAutomationActions;
39008
+ quickReplies?: Array<CommentAutomationQuickReply>;
39009
+ dmMedia?: CommentAutomationDmMedia;
38234
39010
  isActive?: boolean;
38235
- stats?: {
38236
- totalTriggered?: number;
38237
- totalSent?: number;
38238
- totalFailed?: number;
38239
- };
39011
+ stats?: CommentAutomationStats;
38240
39012
  createdAt?: string;
38241
39013
  };
38242
39014
  });
38243
39015
 
38244
- export type CreateCommentAutomationError = (unknown | ErrorResponse);
39016
+ export type CreateCommentAutomationError = (ErrorResponse | unknown);
38245
39017
 
38246
39018
  export type GetCommentAutomationData = {
38247
39019
  path: {
@@ -38254,8 +39026,8 @@ export type GetCommentAutomationResponse = ({
38254
39026
  automation?: {
38255
39027
  id?: string;
38256
39028
  name?: string;
38257
- platform?: string;
38258
- trigger?: 'comment' | 'story_reply';
39029
+ platform?: 'instagram' | 'facebook' | 'tiktok' | 'threads' | 'linkedin' | 'youtube';
39030
+ trigger?: 'comment' | 'live_comment' | 'story_reply' | 'story_mention';
38259
39031
  accountId?: string;
38260
39032
  platformPostId?: string;
38261
39033
  postId?: string;
@@ -38304,67 +39076,24 @@ export type GetCommentAutomationResponse = ({
38304
39076
  * Whether these keywords also fire on a plain inbound DM.
38305
39077
  */
38306
39078
  alsoMatchInDms?: boolean;
39079
+ repeatPolicy?: CommentAutomationRepeatPolicy;
39080
+ /**
39081
+ * Same-text dedupe window in hours. Omitted when off.
39082
+ */
39083
+ dedupeSameTextHours?: number;
39084
+ publicReplyPolicy?: 'after_dm' | 'always';
39085
+ actions?: CommentAutomationActions;
39086
+ quickReplies?: Array<CommentAutomationQuickReply>;
39087
+ dmMedia?: CommentAutomationDmMedia;
38307
39088
  isActive?: boolean;
38308
- stats?: {
38309
- totalTriggered?: number;
38310
- totalSent?: number;
38311
- totalFailed?: number;
38312
- };
39089
+ stats?: CommentAutomationStats;
38313
39090
  createdAt?: string;
38314
39091
  updatedAt?: string;
38315
39092
  };
38316
- logs?: Array<{
38317
- id?: string;
38318
- commentId?: string;
38319
- commenterId?: string;
38320
- commenterName?: string;
38321
- commentText?: string;
38322
- /**
38323
- * Which door triggered this send. Absent on rows written before this field existed (all of those are comment-triggered).
38324
- */
38325
- source?: 'comment' | 'story_reply' | 'dm';
38326
- /**
38327
- * DM outcome. 'pending' = the automation has a dmDelaySeconds and the response is queued but not sent yet. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap.
38328
- */
38329
- status?: 'pending' | 'sent' | 'failed' | 'skipped' | 'gated';
38330
- /**
38331
- * How the audience rule resolved. Absent on automations without one.
38332
- */
38333
- audienceOutcome?: 'passed' | 'blocked' | 'gate_sent' | 'gate_passed' | 'gate_failed';
38334
- /**
38335
- * Follow relationship at decision time. Absent when Instagram would not tell us (the commenter never messaged the account).
38336
- */
38337
- commenterIsFollower?: boolean;
38338
- commenterFollowerCount?: number;
38339
- /**
38340
- * DM error message if status is failed
38341
- */
38342
- error?: string;
38343
- /**
38344
- * Platform error codes of the failed DM (Meta `code` and `error_subcode`), when the platform sent them. Absent on successful rows and on rows written before this field existed.
38345
- */
38346
- platformError?: {
38347
- code?: number;
38348
- subcode?: number;
38349
- };
38350
- /**
38351
- * True when the failed send spent the comment's single private reply (Instagram subcode 1545133 or 2534023, or Meta code 10900 on Instagram and Facebook), the same rule as `details.privateReplyConsumed` on the private-reply endpoint. Absent on direct DMs and on rows written before this field existed.
38352
- */
38353
- privateReplyConsumed?: boolean;
38354
- /**
38355
- * Outcome of the optional public reply on the triggering comment. 'skipped' if no commentReply was configured or if the DM failed (the public reply is not attempted in that case).
38356
- */
38357
- commentReplyStatus?: 'sent' | 'failed' | 'skipped';
38358
- /**
38359
- * Public-reply error message if commentReplyStatus is failed
38360
- */
38361
- commentReplyError?: string;
38362
- /**
38363
- * When the next queued send fires. Present only while something is still pending.
38364
- */
38365
- nextDueAt?: string;
38366
- createdAt?: string;
38367
- }>;
39093
+ /**
39094
+ * The 20 most recent trigger logs.
39095
+ */
39096
+ logs?: Array<CommentAutomationLog>;
38368
39097
  });
38369
39098
 
38370
39099
  export type GetCommentAutomationError = (ErrorResponse | {
@@ -38375,9 +39104,9 @@ export type UpdateCommentAutomationData = {
38375
39104
  body?: {
38376
39105
  name?: string;
38377
39106
  /**
38378
- * What fires the automation. Changing it detaches the automation from its bound post or story (a post id and a story id are different objects), unless this same request sets a new binding. 'story_reply' is Instagram only.
39107
+ * What fires the automation. Changing it detaches the automation from its bound post or story (a post id and a story id are different objects), unless this same request sets a new binding. Every trigger but 'comment' is Instagram only; 'story_mention' also requires no keywords and no binding.
38379
39108
  */
38380
- trigger?: 'comment' | 'story_reply';
39109
+ trigger?: 'comment' | 'live_comment' | 'story_reply' | 'story_mention';
38381
39110
  keywords?: Array<(string)>;
38382
39111
  /**
38383
39112
  * How a keyword is compared with the comment. 'contains' (default) matches anywhere, even inside another word (keyword 'app' fires on 'happy'). 'word' matches the keyword only as a standalone word. 'exact' requires the whole comment to be exactly the keyword.
@@ -38432,6 +39161,21 @@ export type UpdateCommentAutomationData = {
38432
39161
  audience?: CommentAutomationAudience;
38433
39162
  followGate?: CommentAutomationFollowGate;
38434
39163
  isActive?: boolean;
39164
+ repeatPolicy?: CommentAutomationRepeatPolicy;
39165
+ /**
39166
+ * Skip the DM when this recipient already received identical DM text (after personalisation) from this account, from any automation, within this many hours. The skip is logged with status skipped. Send null to clear.
39167
+ */
39168
+ dedupeSameTextHours?: (number) | null;
39169
+ /**
39170
+ * 'after_dm' posts commentReply only after a successful DM. 'always' posts it whatever the audience rule, dedupe or DM outcome: the moment a comment matches, or after commentReplyDelaySeconds when set (raised to dmDelaySeconds, so it never precedes the DM attempt).
39171
+ */
39172
+ publicReplyPolicy?: 'after_dm' | 'always';
39173
+ actions?: CommentAutomationActions;
39174
+ /**
39175
+ * Opt-in quick-reply chips on the DM (up to 13). Chips do not render in Message Requests, where a first DM to a cold commenter lands, so prefer buttons for first contact. Mutually exclusive with buttons and template (400). Send null to clear.
39176
+ */
39177
+ quickReplies?: Array<CommentAutomationQuickReply> | null;
39178
+ dmMedia?: (CommentAutomationDmMedia | null);
38435
39179
  };
38436
39180
  path: {
38437
39181
  automationId: string;
@@ -38477,7 +39221,17 @@ export type UpdateCommentAutomationResponse = ({
38477
39221
  * Whether these keywords also fire on a plain inbound DM.
38478
39222
  */
38479
39223
  alsoMatchInDms?: boolean;
39224
+ repeatPolicy?: CommentAutomationRepeatPolicy;
39225
+ /**
39226
+ * Same-text dedupe window in hours. Omitted when off.
39227
+ */
39228
+ dedupeSameTextHours?: number;
39229
+ publicReplyPolicy?: 'after_dm' | 'always';
39230
+ actions?: CommentAutomationActions;
39231
+ quickReplies?: Array<CommentAutomationQuickReply>;
39232
+ dmMedia?: CommentAutomationDmMedia;
38480
39233
  isActive?: boolean;
39234
+ stats?: CommentAutomationStats;
38481
39235
  updatedAt?: string;
38482
39236
  };
38483
39237
  });
@@ -38514,58 +39268,7 @@ export type ListCommentAutomationLogsData = {
38514
39268
 
38515
39269
  export type ListCommentAutomationLogsResponse = ({
38516
39270
  success?: boolean;
38517
- logs?: Array<{
38518
- id?: string;
38519
- commentId?: string;
38520
- commenterId?: string;
38521
- commenterName?: string;
38522
- commentText?: string;
38523
- /**
38524
- * Which door triggered this send. Absent on rows written before this field existed (all of those are comment-triggered).
38525
- */
38526
- source?: 'comment' | 'story_reply' | 'dm';
38527
- /**
38528
- * DM outcome. 'pending' = the automation has a dmDelaySeconds and the response is queued but not sent yet. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap.
38529
- */
38530
- status?: 'pending' | 'sent' | 'failed' | 'skipped' | 'gated';
38531
- /**
38532
- * How the audience rule resolved. Absent on automations without one.
38533
- */
38534
- audienceOutcome?: 'passed' | 'blocked' | 'gate_sent' | 'gate_passed' | 'gate_failed';
38535
- /**
38536
- * Follow relationship at decision time. Absent when Instagram would not tell us (the commenter never messaged the account).
38537
- */
38538
- commenterIsFollower?: boolean;
38539
- commenterFollowerCount?: number;
38540
- /**
38541
- * DM error message if status is failed
38542
- */
38543
- error?: string;
38544
- /**
38545
- * Platform error codes of the failed DM (Meta `code` and `error_subcode`), when the platform sent them. Absent on successful rows and on rows written before this field existed.
38546
- */
38547
- platformError?: {
38548
- code?: number;
38549
- subcode?: number;
38550
- };
38551
- /**
38552
- * True when the failed send spent the comment's single private reply (Instagram subcode 1545133 or 2534023, or Meta code 10900 on Instagram and Facebook), the same rule as `details.privateReplyConsumed` on the private-reply endpoint. Absent on direct DMs and on rows written before this field existed.
38553
- */
38554
- privateReplyConsumed?: boolean;
38555
- /**
38556
- * Outcome of the optional public reply on the triggering comment. 'skipped' if no commentReply was configured or if the DM failed (the public reply is not attempted in that case).
38557
- */
38558
- commentReplyStatus?: 'sent' | 'failed' | 'skipped';
38559
- /**
38560
- * Public-reply error message if commentReplyStatus is failed
38561
- */
38562
- commentReplyError?: string;
38563
- /**
38564
- * When the next queued send fires. Present only while something is still pending.
38565
- */
38566
- nextDueAt?: string;
38567
- createdAt?: string;
38568
- }>;
39271
+ logs?: Array<CommentAutomationLog>;
38569
39272
  pagination?: {
38570
39273
  total?: number;
38571
39274
  limit?: number;
@@ -45176,6 +45879,10 @@ export type BoostPostData = {
45176
45879
  * Meta WhatsApp only. E.164 number already paired with the Page. Omit to use the default pairing. Requires WHATSAPP_MESSAGE callToAction. Stored as creative.whatsappPhoneNumber on the ad.
45177
45880
  */
45178
45881
  whatsappPhoneNumber?: string;
45882
+ /**
45883
+ * Meta messaging boosts only (callToAction MESSAGE_PAGE, WHATSAPP_MESSAGE or INSTAGRAM_MESSAGE). A workflow in the account's profile, started in the conversation a click on the ad opens. Stored on the ad. 400 without a messaging callToAction or on another platform, 404 when no such workflow exists in the profile.
45884
+ */
45885
+ workflowId?: string;
45179
45886
  /**
45180
45887
  * ISO 4217 currency code matching the ad account's currency. Meta only. Optional: Zernio resolves it from the ad account when omitted. The value selects the minor-unit exponent Zernio converts budget/bid amounts by before calling Meta (most currencies are cents; zero-decimal currencies like JPY/KRW are sent as-is).
45181
45888
  */
@@ -50061,6 +50768,10 @@ export type CreateMessagingAdData = {
50061
50768
  *
50062
50769
  */
50063
50770
  placementAssets?: (MetaPlacementAssets);
50771
+ /**
50772
+ * A workflow in the ad account's profile. When someone clicks the ad, that workflow starts in the conversation the click opens (on the first message, a postback or a standalone referral carrying the ad id), ahead of keyword-matched workflows, if it is active on the receiving account. Stored on the ad. 404 when no such workflow exists in the profile.
50773
+ */
50774
+ workflowId?: string;
50064
50775
  /**
50065
50776
  * Dry-runs the ad on Meta with execution_options validate_only as ONE inline campaign + ad set + creative + ad (or creative + ad on the existing ad set with `adSetId`). Nothing is uploaded or created and nothing is stored; media is checked by URL. Supports one creative with `imageUrl`, image `placementAssets`, `carouselCards`, an existing `video.id`, or an existing post. Several creatives, a new `video.url` and video `placementAssets` need uploads first and return 400. Success returns 200 with per-node results; a Meta rejection returns the Meta error.
50066
50777
  */