@zernio/node 0.2.36 → 0.2.38

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.
@@ -107,11 +107,41 @@ export type Ad = {
107
107
  campaignName?: string;
108
108
  adSetName?: string;
109
109
  /**
110
- * Platform-specific creative data
110
+ * Platform-specific creative data. Fields vary by platform.
111
111
  */
112
112
  creative?: {
113
- [key: string]: unknown;
114
- };
113
+ /**
114
+ * Primary thumbnail/image URL
115
+ */
116
+ thumbnailUrl?: string;
117
+ /**
118
+ * Alternative image URL
119
+ */
120
+ imageUrl?: string;
121
+ /**
122
+ * All media URLs for this ad (carousel images, multiple assets). Populated for Meta (carousel child_attachments), Google Ads (responsive display marketing_images), and LinkedIn (multi-image posts).
123
+ */
124
+ mediaUrls?: Array<(string)>;
125
+ /**
126
+ * Ad copy/text
127
+ */
128
+ body?: string;
129
+ /**
130
+ * Google Ads headline
131
+ */
132
+ googleHeadline?: string;
133
+ /**
134
+ * Google Ads description
135
+ */
136
+ googleDescription?: string;
137
+ /**
138
+ * Destination URL
139
+ */
140
+ linkUrl?: string;
141
+ pinterestImageUrl?: string;
142
+ pinterestTitle?: string;
143
+ pinterestDescription?: string;
144
+ } | null;
115
145
  targeting?: {
116
146
  [key: string]: unknown;
117
147
  };
@@ -179,6 +209,55 @@ export type AdMetrics = {
179
209
  lastSyncedAt?: string;
180
210
  };
181
211
 
212
+ /**
213
+ * Ad set (or ad group/line item depending on platform) with rolled-up metrics and child ads
214
+ */
215
+ export type AdTreeAdSet = {
216
+ platformAdSetId?: string;
217
+ adSetName?: string;
218
+ /**
219
+ * Derived from child ad statuses
220
+ */
221
+ status?: 'active' | 'paused' | 'pending_review' | 'rejected' | 'completed' | 'cancelled' | 'error';
222
+ adCount?: number;
223
+ budget?: {
224
+ amount?: number;
225
+ type?: 'daily' | 'lifetime';
226
+ } | null;
227
+ metrics?: AdMetrics;
228
+ /**
229
+ * Individual ads within this ad set (capped at 100). Returns a subset of Ad fields from the aggregation (core fields like _id, name, platform, status, budget, metrics, creative, goal are included; targeting and schedule may be absent).
230
+ */
231
+ ads?: Array<Ad>;
232
+ };
233
+
234
+ /**
235
+ * Campaign with nested ad sets and rolled-up metrics
236
+ */
237
+ export type AdTreeCampaign = {
238
+ platformCampaignId?: string;
239
+ platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter';
240
+ campaignName?: string;
241
+ /**
242
+ * Derived from child ad statuses
243
+ */
244
+ status?: 'active' | 'paused' | 'pending_review' | 'rejected' | 'completed' | 'cancelled' | 'error';
245
+ /**
246
+ * Total ads across all ad sets
247
+ */
248
+ adCount?: number;
249
+ adSetCount?: number;
250
+ budget?: {
251
+ amount?: number;
252
+ type?: 'daily' | 'lifetime';
253
+ } | null;
254
+ metrics?: AdMetrics;
255
+ platformAdAccountId?: string;
256
+ accountId?: string;
257
+ profileId?: string;
258
+ adSets?: Array<AdTreeAdSet>;
259
+ };
260
+
182
261
  export type AnalyticsListResponse = {
183
262
  overview?: AnalyticsOverview;
184
263
  posts?: Array<{
@@ -350,10 +429,6 @@ export type BlueskyPlatformData = {
350
429
  }>;
351
430
  };
352
431
 
353
- export type CaptionResponse = {
354
- caption?: string;
355
- };
356
-
357
432
  /**
358
433
  * Connection event log showing account connection/disconnection history
359
434
  */
@@ -450,22 +525,6 @@ export type eventType = 'connect_success' | 'connect_failed' | 'disconnect' | 'r
450
525
  */
451
526
  export type connectionMethod = 'oauth' | 'credentials' | 'invitation';
452
527
 
453
- export type DownloadFormat = {
454
- formatId?: string;
455
- ext?: string;
456
- resolution?: string;
457
- filesize?: number;
458
- quality?: string;
459
- };
460
-
461
- export type DownloadResponse = {
462
- url?: string;
463
- title?: string;
464
- thumbnail?: string;
465
- duration?: number;
466
- formats?: Array<DownloadFormat>;
467
- };
468
-
469
528
  export type ErrorResponse = {
470
529
  error?: string;
471
530
  details?: {
@@ -616,18 +675,6 @@ export type GoogleBusinessPlatformData = {
616
675
  */
617
676
  export type type2 = 'LEARN_MORE' | 'BOOK' | 'ORDER' | 'SHOP' | 'SIGN_UP' | 'CALL';
618
677
 
619
- export type HashtagCheckResponse = {
620
- hashtags?: Array<HashtagInfo>;
621
- };
622
-
623
- export type HashtagInfo = {
624
- hashtag?: string;
625
- status?: 'safe' | 'banned' | 'restricted' | 'unknown';
626
- postCount?: number;
627
- };
628
-
629
- export type status3 = 'safe' | 'banned' | 'restricted' | 'unknown';
630
-
631
678
  export type InstagramAccountInsightsResponse = {
632
679
  success?: boolean;
633
680
  /**
@@ -1013,7 +1060,7 @@ export type PlatformAnalytics = {
1013
1060
  errorMessage?: (string) | null;
1014
1061
  };
1015
1062
 
1016
- export type status4 = 'published' | 'failed';
1063
+ export type status3 = 'published' | 'failed';
1017
1064
 
1018
1065
  /**
1019
1066
  * Sync state of analytics for this platform
@@ -1123,7 +1170,7 @@ export type Post = {
1123
1170
  updatedAt?: string;
1124
1171
  };
1125
1172
 
1126
- export type status5 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
1173
+ export type status4 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
1127
1174
 
1128
1175
  export type visibility = 'public' | 'private' | 'unlisted';
1129
1176
 
@@ -1239,7 +1286,7 @@ export type PostLog = {
1239
1286
  */
1240
1287
  export type action = 'publish' | 'retry' | 'media_upload' | 'rate_limit_pause' | 'token_refresh' | 'cancelled';
1241
1288
 
1242
- export type status6 = 'success' | 'failed' | 'pending' | 'skipped';
1289
+ export type status5 = 'success' | 'failed' | 'pending' | 'skipped';
1243
1290
 
1244
1291
  export type PostRetryResponse = {
1245
1292
  message?: string;
@@ -1659,18 +1706,6 @@ export type commercialContentType = 'none' | 'brand_organic' | 'brand_content';
1659
1706
  */
1660
1707
  export type mediaType2 = 'video' | 'photo';
1661
1708
 
1662
- export type TranscriptResponse = {
1663
- transcript?: string;
1664
- segments?: Array<TranscriptSegment>;
1665
- language?: string;
1666
- };
1667
-
1668
- export type TranscriptSegment = {
1669
- text?: string;
1670
- start?: number;
1671
- duration?: number;
1672
- };
1673
-
1674
1709
  export type TwitterPlatformData = {
1675
1710
  /**
1676
1711
  * ID of an existing tweet to reply to. The published tweet will appear as a reply in that tweet's thread. For threads, only the first tweet replies to the target; subsequent tweets chain normally.
@@ -1724,7 +1759,7 @@ export type UploadTokenResponse = {
1724
1759
  status?: 'pending' | 'completed' | 'expired';
1725
1760
  };
1726
1761
 
1727
- export type status7 = 'pending' | 'completed' | 'expired';
1762
+ export type status6 = 'pending' | 'completed' | 'expired';
1728
1763
 
1729
1764
  export type UploadTokenStatusResponse = {
1730
1765
  token?: string;
@@ -1863,7 +1898,7 @@ export type WebhookLog = {
1863
1898
 
1864
1899
  export type event = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'message.received' | 'comment.received' | 'webhook.test';
1865
1900
 
1866
- export type status8 = 'success' | 'failed';
1901
+ export type status7 = 'success' | 'failed';
1867
1902
 
1868
1903
  /**
1869
1904
  * Webhook payload for account connected events
@@ -2125,7 +2160,7 @@ export type platform4 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp';
2125
2160
 
2126
2161
  export type direction = 'incoming' | 'outgoing';
2127
2162
 
2128
- export type status9 = 'active' | 'archived';
2163
+ export type status8 = 'active' | 'archived';
2129
2164
 
2130
2165
  /**
2131
2166
  * Webhook payload for post events
@@ -2306,6 +2341,35 @@ export type YouTubeDailyViewsResponse = {
2306
2341
  };
2307
2342
  };
2308
2343
 
2344
+ export type YouTubeDemographicsResponse = {
2345
+ success?: boolean;
2346
+ /**
2347
+ * The Zernio SocialAccount ID
2348
+ */
2349
+ accountId?: string;
2350
+ platform?: string;
2351
+ /**
2352
+ * Object keyed by breakdown dimension (age, gender, country)
2353
+ */
2354
+ demographics?: {
2355
+ [key: string]: Array<{
2356
+ /**
2357
+ * The dimension value (e.g., "25-34", "US", "male")
2358
+ */
2359
+ dimension?: string;
2360
+ /**
2361
+ * Viewer percentage (age/gender) or view count (country)
2362
+ */
2363
+ value?: number;
2364
+ }>;
2365
+ };
2366
+ dateRange?: {
2367
+ startDate?: string;
2368
+ endDate?: string;
2369
+ };
2370
+ note?: string;
2371
+ };
2372
+
2309
2373
  /**
2310
2374
  * Videos under 3 min auto-detected as Shorts. Custom thumbnails for regular videos only. Scheduled videos are uploaded immediately with the specified visibility.
2311
2375
  */
@@ -2354,219 +2418,6 @@ export type YouTubeScopeMissingResponse = {
2354
2418
  };
2355
2419
  };
2356
2420
 
2357
- export type DownloadYouTubeVideoData = {
2358
- query: {
2359
- /**
2360
- * Action to perform: 'download' returns download URL, 'formats' lists available formats
2361
- */
2362
- action?: 'download' | 'formats';
2363
- /**
2364
- * Desired format (when action=download)
2365
- */
2366
- format?: 'video' | 'audio';
2367
- /**
2368
- * Specific format ID from formats list
2369
- */
2370
- formatId?: string;
2371
- /**
2372
- * Desired quality (when action=download)
2373
- */
2374
- quality?: 'hd' | 'sd';
2375
- /**
2376
- * YouTube video URL or video ID
2377
- */
2378
- url: string;
2379
- };
2380
- };
2381
-
2382
- export type DownloadYouTubeVideoResponse = ({
2383
- success?: boolean;
2384
- title?: string;
2385
- downloadUrl?: string;
2386
- formats?: Array<{
2387
- id?: string;
2388
- label?: string;
2389
- ext?: string;
2390
- type?: string;
2391
- height?: number;
2392
- width?: number;
2393
- }>;
2394
- });
2395
-
2396
- export type DownloadYouTubeVideoError = ({
2397
- error?: string;
2398
- } | unknown);
2399
-
2400
- export type GetYouTubeTranscriptData = {
2401
- query: {
2402
- /**
2403
- * Language code for transcript
2404
- */
2405
- lang?: string;
2406
- /**
2407
- * YouTube video URL or video ID
2408
- */
2409
- url: string;
2410
- };
2411
- };
2412
-
2413
- export type GetYouTubeTranscriptResponse = ({
2414
- success?: boolean;
2415
- videoId?: string;
2416
- language?: string;
2417
- fullText?: string;
2418
- segments?: Array<{
2419
- text?: string;
2420
- start?: number;
2421
- duration?: number;
2422
- }>;
2423
- });
2424
-
2425
- export type GetYouTubeTranscriptError = (unknown);
2426
-
2427
- export type DownloadInstagramMediaData = {
2428
- query: {
2429
- /**
2430
- * Instagram reel or post URL
2431
- */
2432
- url: string;
2433
- };
2434
- };
2435
-
2436
- export type DownloadInstagramMediaResponse = ({
2437
- success?: boolean;
2438
- title?: string;
2439
- downloadUrl?: string;
2440
- });
2441
-
2442
- export type DownloadInstagramMediaError = unknown;
2443
-
2444
- export type CheckInstagramHashtagsData = {
2445
- body: {
2446
- hashtags: Array<(string)>;
2447
- };
2448
- };
2449
-
2450
- export type CheckInstagramHashtagsResponse = ({
2451
- success?: boolean;
2452
- results?: Array<{
2453
- hashtag?: string;
2454
- status?: 'banned' | 'restricted' | 'safe' | 'unknown';
2455
- reason?: string;
2456
- confidence?: number;
2457
- }>;
2458
- summary?: {
2459
- banned?: number;
2460
- restricted?: number;
2461
- safe?: number;
2462
- };
2463
- });
2464
-
2465
- export type CheckInstagramHashtagsError = unknown;
2466
-
2467
- export type DownloadTikTokVideoData = {
2468
- query: {
2469
- /**
2470
- * 'formats' to list available formats
2471
- */
2472
- action?: 'download' | 'formats';
2473
- /**
2474
- * Specific format ID (0 = no watermark, etc.)
2475
- */
2476
- formatId?: string;
2477
- /**
2478
- * TikTok video URL or ID
2479
- */
2480
- url: string;
2481
- };
2482
- };
2483
-
2484
- export type DownloadTikTokVideoResponse = ({
2485
- success?: boolean;
2486
- title?: string;
2487
- downloadUrl?: string;
2488
- formats?: Array<{
2489
- id?: string;
2490
- label?: string;
2491
- ext?: string;
2492
- }>;
2493
- });
2494
-
2495
- export type DownloadTikTokVideoError = unknown;
2496
-
2497
- export type DownloadTwitterMediaData = {
2498
- query: {
2499
- action?: 'download' | 'formats';
2500
- formatId?: string;
2501
- /**
2502
- * Twitter/X post URL
2503
- */
2504
- url: string;
2505
- };
2506
- };
2507
-
2508
- export type DownloadTwitterMediaResponse = ({
2509
- success?: boolean;
2510
- title?: string;
2511
- downloadUrl?: string;
2512
- });
2513
-
2514
- export type DownloadTwitterMediaError = unknown;
2515
-
2516
- export type DownloadFacebookVideoData = {
2517
- query: {
2518
- /**
2519
- * Facebook video or reel URL
2520
- */
2521
- url: string;
2522
- };
2523
- };
2524
-
2525
- export type DownloadFacebookVideoResponse = ({
2526
- success?: boolean;
2527
- title?: string;
2528
- downloadUrl?: string;
2529
- thumbnail?: string;
2530
- });
2531
-
2532
- export type DownloadFacebookVideoError = unknown;
2533
-
2534
- export type DownloadLinkedInVideoData = {
2535
- query: {
2536
- /**
2537
- * LinkedIn post URL
2538
- */
2539
- url: string;
2540
- };
2541
- };
2542
-
2543
- export type DownloadLinkedInVideoResponse = ({
2544
- success?: boolean;
2545
- title?: string;
2546
- downloadUrl?: string;
2547
- });
2548
-
2549
- export type DownloadLinkedInVideoError = unknown;
2550
-
2551
- export type DownloadBlueskyMediaData = {
2552
- query: {
2553
- /**
2554
- * Bluesky post URL
2555
- */
2556
- url: string;
2557
- };
2558
- };
2559
-
2560
- export type DownloadBlueskyMediaResponse = ({
2561
- success?: boolean;
2562
- title?: string;
2563
- text?: string;
2564
- downloadUrl?: string;
2565
- thumbnail?: string;
2566
- });
2567
-
2568
- export type DownloadBlueskyMediaError = unknown;
2569
-
2570
2421
  export type ValidatePostLengthData = {
2571
2422
  body: {
2572
2423
  /**
@@ -2896,20 +2747,63 @@ export type GetInstagramDemographicsError = ({
2896
2747
  code?: string;
2897
2748
  });
2898
2749
 
2899
- export type GetDailyMetricsData = {
2900
- query?: {
2750
+ export type GetYouTubeDemographicsData = {
2751
+ query: {
2901
2752
  /**
2902
- * Filter by social account ID
2753
+ * The Zernio SocialAccount ID for the YouTube account
2903
2754
  */
2904
- accountId?: string;
2755
+ accountId: string;
2905
2756
  /**
2906
- * Inclusive start date (ISO 8601). Defaults to 180 days ago.
2757
+ * Comma-separated list of demographic dimensions: age, gender, country.
2758
+ * Defaults to all three if omitted.
2759
+ *
2907
2760
  */
2908
- fromDate?: string;
2761
+ breakdown?: string;
2909
2762
  /**
2910
- * Filter by platform (e.g. "instagram", "tiktok"). Omit for all platforms.
2763
+ * End date in YYYY-MM-DD format. Defaults to 3 days ago (YouTube data latency).
2764
+ *
2911
2765
  */
2912
- platform?: string;
2766
+ endDate?: string;
2767
+ /**
2768
+ * Start date in YYYY-MM-DD format. Defaults to 90 days ago.
2769
+ *
2770
+ */
2771
+ startDate?: string;
2772
+ };
2773
+ };
2774
+
2775
+ export type GetYouTubeDemographicsResponse = (YouTubeDemographicsResponse);
2776
+
2777
+ export type GetYouTubeDemographicsError = ({
2778
+ error?: string;
2779
+ } | {
2780
+ error?: string;
2781
+ code?: string;
2782
+ } | {
2783
+ success?: boolean;
2784
+ error?: string;
2785
+ code?: string;
2786
+ scopeStatus?: {
2787
+ hasAnalyticsScope?: boolean;
2788
+ requiresReauthorization?: boolean;
2789
+ reauthorizeUrl?: string;
2790
+ };
2791
+ });
2792
+
2793
+ export type GetDailyMetricsData = {
2794
+ query?: {
2795
+ /**
2796
+ * Filter by social account ID
2797
+ */
2798
+ accountId?: string;
2799
+ /**
2800
+ * Inclusive start date (ISO 8601). Defaults to 180 days ago.
2801
+ */
2802
+ fromDate?: string;
2803
+ /**
2804
+ * Filter by platform (e.g. "instagram", "tiktok"). Omit for all platforms.
2805
+ */
2806
+ platform?: string;
2913
2807
  /**
2914
2808
  * Filter by profile ID. Omit for all profiles.
2915
2809
  */
@@ -3778,6 +3672,14 @@ export type ListAccountsData = {
3778
3672
  * When true, includes accounts from over-limit profiles.
3779
3673
  */
3780
3674
  includeOverLimit?: boolean;
3675
+ /**
3676
+ * Page size. Required alongside page for pagination.
3677
+ */
3678
+ limit?: number;
3679
+ /**
3680
+ * Page number (1-based). When provided with limit, enables server-side pagination. Omit for all accounts.
3681
+ */
3682
+ page?: number;
3781
3683
  /**
3782
3684
  * Filter accounts by platform (e.g. "instagram", "twitter").
3783
3685
  */
@@ -3795,6 +3697,10 @@ export type ListAccountsResponse = ({
3795
3697
  * Whether user has analytics add-on access
3796
3698
  */
3797
3699
  hasAnalyticsAccess?: boolean;
3700
+ /**
3701
+ * Only present when page/limit params are provided
3702
+ */
3703
+ pagination?: Pagination;
3798
3704
  });
3799
3705
 
3800
3706
  export type ListAccountsError = ({
@@ -9867,6 +9773,346 @@ export type RejectWhatsAppGroupJoinRequestsError = ({
9867
9773
  error?: string;
9868
9774
  });
9869
9775
 
9776
+ export type ListWhatsAppFlowsData = {
9777
+ query: {
9778
+ /**
9779
+ * WhatsApp social account ID
9780
+ */
9781
+ accountId: string;
9782
+ };
9783
+ };
9784
+
9785
+ export type ListWhatsAppFlowsResponse = ({
9786
+ success?: boolean;
9787
+ flows?: Array<{
9788
+ id?: string;
9789
+ name?: string;
9790
+ status?: 'DRAFT' | 'PUBLISHED' | 'DEPRECATED' | 'BLOCKED' | 'THROTTLED';
9791
+ categories?: Array<(string)>;
9792
+ validation_errors?: Array<{
9793
+ [key: string]: unknown;
9794
+ }>;
9795
+ }>;
9796
+ });
9797
+
9798
+ export type ListWhatsAppFlowsError = (unknown | {
9799
+ error?: string;
9800
+ });
9801
+
9802
+ export type CreateWhatsAppFlowData = {
9803
+ body: {
9804
+ /**
9805
+ * WhatsApp social account ID
9806
+ */
9807
+ accountId: string;
9808
+ /**
9809
+ * Flow display name
9810
+ */
9811
+ name: string;
9812
+ /**
9813
+ * Flow categories
9814
+ */
9815
+ categories: Array<('SIGN_UP' | 'SIGN_IN' | 'APPOINTMENT_BOOKING' | 'LEAD_GENERATION' | 'CONTACT_US' | 'CUSTOMER_SUPPORT' | 'SURVEY' | 'OTHER')>;
9816
+ /**
9817
+ * Optional: ID of an existing flow to clone
9818
+ */
9819
+ cloneFlowId?: string;
9820
+ };
9821
+ };
9822
+
9823
+ export type CreateWhatsAppFlowResponse = ({
9824
+ success?: boolean;
9825
+ flow?: {
9826
+ id?: string;
9827
+ name?: string;
9828
+ status?: string;
9829
+ categories?: Array<(string)>;
9830
+ };
9831
+ });
9832
+
9833
+ export type CreateWhatsAppFlowError = (unknown | {
9834
+ error?: string;
9835
+ });
9836
+
9837
+ export type GetWhatsAppFlowData = {
9838
+ path: {
9839
+ /**
9840
+ * Flow ID
9841
+ */
9842
+ flowId: string;
9843
+ };
9844
+ query: {
9845
+ /**
9846
+ * WhatsApp social account ID
9847
+ */
9848
+ accountId: string;
9849
+ /**
9850
+ * Comma-separated fields to return (default: id,name,status,categories,validation_errors,json_version,preview,data_api_version,endpoint_uri)
9851
+ */
9852
+ fields?: string;
9853
+ };
9854
+ };
9855
+
9856
+ export type GetWhatsAppFlowResponse = ({
9857
+ success?: boolean;
9858
+ flow?: {
9859
+ id?: string;
9860
+ name?: string;
9861
+ status?: string;
9862
+ categories?: Array<(string)>;
9863
+ validation_errors?: Array<{
9864
+ [key: string]: unknown;
9865
+ }>;
9866
+ json_version?: string;
9867
+ preview?: {
9868
+ preview_url?: string;
9869
+ expires_at?: string;
9870
+ };
9871
+ };
9872
+ });
9873
+
9874
+ export type GetWhatsAppFlowError = ({
9875
+ error?: string;
9876
+ } | unknown);
9877
+
9878
+ export type UpdateWhatsAppFlowData = {
9879
+ body: {
9880
+ /**
9881
+ * WhatsApp social account ID
9882
+ */
9883
+ accountId: string;
9884
+ /**
9885
+ * New flow name
9886
+ */
9887
+ name?: string;
9888
+ categories?: Array<('SIGN_UP' | 'SIGN_IN' | 'APPOINTMENT_BOOKING' | 'LEAD_GENERATION' | 'CONTACT_US' | 'CUSTOMER_SUPPORT' | 'SURVEY' | 'OTHER')>;
9889
+ };
9890
+ path: {
9891
+ /**
9892
+ * Flow ID
9893
+ */
9894
+ flowId: string;
9895
+ };
9896
+ };
9897
+
9898
+ export type UpdateWhatsAppFlowResponse = ({
9899
+ success?: boolean;
9900
+ });
9901
+
9902
+ export type UpdateWhatsAppFlowError = (unknown | {
9903
+ error?: string;
9904
+ });
9905
+
9906
+ export type DeleteWhatsAppFlowData = {
9907
+ path: {
9908
+ /**
9909
+ * Flow ID
9910
+ */
9911
+ flowId: string;
9912
+ };
9913
+ query: {
9914
+ /**
9915
+ * WhatsApp social account ID
9916
+ */
9917
+ accountId: string;
9918
+ };
9919
+ };
9920
+
9921
+ export type DeleteWhatsAppFlowResponse = ({
9922
+ success?: boolean;
9923
+ });
9924
+
9925
+ export type DeleteWhatsAppFlowError = (unknown | {
9926
+ error?: string;
9927
+ });
9928
+
9929
+ export type GetWhatsAppFlowJsonData = {
9930
+ path: {
9931
+ /**
9932
+ * Flow ID
9933
+ */
9934
+ flowId: string;
9935
+ };
9936
+ query: {
9937
+ /**
9938
+ * WhatsApp social account ID
9939
+ */
9940
+ accountId: string;
9941
+ };
9942
+ };
9943
+
9944
+ export type GetWhatsAppFlowJsonResponse = ({
9945
+ success?: boolean;
9946
+ assets?: Array<{
9947
+ name?: string;
9948
+ asset_type?: string;
9949
+ /**
9950
+ * Temporary URL to download the flow JSON
9951
+ */
9952
+ download_url?: string;
9953
+ }>;
9954
+ });
9955
+
9956
+ export type GetWhatsAppFlowJsonError = ({
9957
+ error?: string;
9958
+ } | unknown);
9959
+
9960
+ export type UploadWhatsAppFlowJsonData = {
9961
+ body: {
9962
+ /**
9963
+ * WhatsApp social account ID
9964
+ */
9965
+ accountId: string;
9966
+ /**
9967
+ * The Flow JSON content. Pass as a JSON object or a JSON string.
9968
+ */
9969
+ flow_json: ({
9970
+ [key: string]: unknown;
9971
+ } | string);
9972
+ };
9973
+ path: {
9974
+ /**
9975
+ * Flow ID
9976
+ */
9977
+ flowId: string;
9978
+ };
9979
+ };
9980
+
9981
+ export type UploadWhatsAppFlowJsonResponse = ({
9982
+ success?: boolean;
9983
+ /**
9984
+ * Empty array if valid; otherwise, contains validation error details from Meta
9985
+ */
9986
+ validation_errors?: Array<{
9987
+ error?: string;
9988
+ error_type?: string;
9989
+ message?: string;
9990
+ line_start?: number;
9991
+ line_end?: number;
9992
+ column_start?: number;
9993
+ column_end?: number;
9994
+ }>;
9995
+ });
9996
+
9997
+ export type UploadWhatsAppFlowJsonError = (unknown | {
9998
+ error?: string;
9999
+ });
10000
+
10001
+ export type PublishWhatsAppFlowData = {
10002
+ body: {
10003
+ /**
10004
+ * WhatsApp social account ID
10005
+ */
10006
+ accountId: string;
10007
+ };
10008
+ path: {
10009
+ /**
10010
+ * Flow ID
10011
+ */
10012
+ flowId: string;
10013
+ };
10014
+ };
10015
+
10016
+ export type PublishWhatsAppFlowResponse = ({
10017
+ success?: boolean;
10018
+ });
10019
+
10020
+ export type PublishWhatsAppFlowError = (unknown | {
10021
+ error?: string;
10022
+ });
10023
+
10024
+ export type DeprecateWhatsAppFlowData = {
10025
+ body: {
10026
+ /**
10027
+ * WhatsApp social account ID
10028
+ */
10029
+ accountId: string;
10030
+ };
10031
+ path: {
10032
+ /**
10033
+ * Flow ID
10034
+ */
10035
+ flowId: string;
10036
+ };
10037
+ };
10038
+
10039
+ export type DeprecateWhatsAppFlowResponse = ({
10040
+ success?: boolean;
10041
+ });
10042
+
10043
+ export type DeprecateWhatsAppFlowError = (unknown | {
10044
+ error?: string;
10045
+ });
10046
+
10047
+ export type SendWhatsAppFlowMessageData = {
10048
+ body: {
10049
+ /**
10050
+ * WhatsApp social account ID
10051
+ */
10052
+ accountId: string;
10053
+ /**
10054
+ * Recipient phone number (E.164 format, e.g. +1234567890)
10055
+ */
10056
+ to: string;
10057
+ /**
10058
+ * Published flow ID
10059
+ */
10060
+ flow_id: string;
10061
+ /**
10062
+ * CTA button text (e.g. 'Book Now', 'Sign Up')
10063
+ */
10064
+ flow_cta: string;
10065
+ /**
10066
+ * Action type: navigate opens a screen directly, data_exchange hits your endpoint first
10067
+ */
10068
+ flow_action?: 'navigate' | 'data_exchange';
10069
+ /**
10070
+ * Unique token to correlate responses. Auto-generated UUID if omitted.
10071
+ */
10072
+ flow_token?: string;
10073
+ flow_action_payload?: {
10074
+ /**
10075
+ * First screen ID to navigate to
10076
+ */
10077
+ screen?: string;
10078
+ /**
10079
+ * Optional data to pass to the screen
10080
+ */
10081
+ data?: {
10082
+ [key: string]: unknown;
10083
+ };
10084
+ };
10085
+ /**
10086
+ * Message body text
10087
+ */
10088
+ body: string;
10089
+ header?: {
10090
+ type?: 'text';
10091
+ text?: string;
10092
+ };
10093
+ /**
10094
+ * Optional footer text
10095
+ */
10096
+ footer?: string;
10097
+ /**
10098
+ * Set true to test an unpublished (DRAFT) flow
10099
+ */
10100
+ draft?: boolean;
10101
+ };
10102
+ };
10103
+
10104
+ export type SendWhatsAppFlowMessageResponse = ({
10105
+ success?: boolean;
10106
+ /**
10107
+ * WhatsApp message ID (WAMID)
10108
+ */
10109
+ messageId?: string;
10110
+ });
10111
+
10112
+ export type SendWhatsAppFlowMessageError = (unknown | {
10113
+ error?: string;
10114
+ });
10115
+
9870
10116
  export type ListContactsData = {
9871
10117
  query?: {
9872
10118
  isSubscribed?: 'true' | 'false';
@@ -11196,6 +11442,46 @@ export type UpdateAdCampaignStatusError = (unknown | {
11196
11442
  error?: string;
11197
11443
  });
11198
11444
 
11445
+ export type GetAdTreeData = {
11446
+ query?: {
11447
+ /**
11448
+ * Social account ID
11449
+ */
11450
+ accountId?: string;
11451
+ /**
11452
+ * Platform ad account ID
11453
+ */
11454
+ adAccountId?: string;
11455
+ /**
11456
+ * Campaigns per page
11457
+ */
11458
+ limit?: number;
11459
+ /**
11460
+ * Page number (1-based)
11461
+ */
11462
+ page?: number;
11463
+ platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter';
11464
+ /**
11465
+ * Profile ID
11466
+ */
11467
+ profileId?: string;
11468
+ source?: 'zernio' | 'all';
11469
+ /**
11470
+ * Filter by derived campaign status (post-aggregation)
11471
+ */
11472
+ status?: 'active' | 'paused' | 'pending_review' | 'rejected' | 'completed' | 'cancelled' | 'error';
11473
+ };
11474
+ };
11475
+
11476
+ export type GetAdTreeResponse = ({
11477
+ campaigns?: Array<AdTreeCampaign>;
11478
+ pagination?: Pagination;
11479
+ });
11480
+
11481
+ export type GetAdTreeError = ({
11482
+ error?: string;
11483
+ } | unknown);
11484
+
11199
11485
  export type GetAdData = {
11200
11486
  path: {
11201
11487
  adId: string;
@@ -11540,7 +11826,7 @@ export type ListAdAudiencesResponse = ({
11540
11826
 
11541
11827
  export type ListAdAudiencesError = ({
11542
11828
  error?: string;
11543
- });
11829
+ } | unknown);
11544
11830
 
11545
11831
  export type CreateAdAudienceData = {
11546
11832
  body: {