@zernio/node 0.2.157 → 0.2.170

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.
@@ -785,6 +785,67 @@ export type BlueskyPlatformData = {
785
785
  }>;
786
786
  };
787
787
 
788
+ /**
789
+ * Result of a CSV bulk upload. The same shape is returned for `200` (all rows
790
+ * succeeded or all failed) and `207` (mixed). Per-row outcomes live in `results`;
791
+ * the row's success is `ok`, and failures carry machine-readable codes in `errors`.
792
+ *
793
+ */
794
+ export type BulkUploadResult = {
795
+ /**
796
+ * Number of data rows processed from the CSV
797
+ */
798
+ total?: number;
799
+ /**
800
+ * Count of rows that succeeded (results[].ok === true)
801
+ */
802
+ valid?: number;
803
+ /**
804
+ * Count of rows that failed (total - valid)
805
+ */
806
+ invalid?: number;
807
+ /**
808
+ * One entry per CSV data row, in row order.
809
+ */
810
+ results?: Array<{
811
+ /**
812
+ * 1-based index of the CSV data row (header excluded)
813
+ */
814
+ rowIndex?: number;
815
+ /**
816
+ * Whether the row was created successfully
817
+ */
818
+ ok?: boolean;
819
+ /**
820
+ * ID of the created post. Present only when `ok` is true and not a dry run.
821
+ */
822
+ createdPostId?: string;
823
+ /**
824
+ * Machine-readable failure codes for this row. Present only when `ok` is false.
825
+ * Examples: `unknown_profile:<id>`, `no_account_for_platform:<platform>`,
826
+ * `schedule_time_missing`, `rate_limited:<platform>:@<username>:<remaining>`.
827
+ *
828
+ */
829
+ errors?: Array<(string)>;
830
+ }>;
831
+ /**
832
+ * Top-level advisory warnings (e.g. `rows_exceed_advisory_limit:500`). Empty when none.
833
+ */
834
+ warnings?: Array<(string)>;
835
+ /**
836
+ * Present only when one or more rows targeted an account currently in cooldown.
837
+ * Lets callers map `rate_limited:*` row errors back to structured metadata without
838
+ * parsing the error strings.
839
+ *
840
+ */
841
+ rateLimitedAccounts?: Array<{
842
+ accountId?: string;
843
+ platform?: string;
844
+ username?: string;
845
+ rateLimitedUntil?: string;
846
+ }>;
847
+ };
848
+
788
849
  /**
789
850
  * TikTok Business Center entity. Returned by `GET /v1/ads/business-centers`. BCs are
790
851
  * TikTok's agency container — one BC owns N advertisers (ad accounts). Most solo
@@ -1940,6 +2001,10 @@ export type MediaItem = {
1940
2001
  * Optional title for the media item. Used as the document title for LinkedIn PDF/carousel posts. If omitted, falls back to the post title, then the filename.
1941
2002
  */
1942
2003
  title?: string;
2004
+ /**
2005
+ * Accessibility alternative text for an image, applied on every platform that supports it: Instagram (feed images only, not Reels/Stories), Facebook, Threads, X/Twitter (max 1000 chars), LinkedIn, Bluesky, and Pinterest (max 500 chars). Ignored on platforms without alt-text support (TikTok, YouTube, Snapchat, Telegram, Reddit, Google Business, WhatsApp) and on video items where the platform does not accept it. Set once per image; the same value is sent to each selected platform.
2006
+ */
2007
+ altText?: string;
1943
2008
  filename?: string;
1944
2009
  /**
1945
2010
  * Optional file size in bytes
@@ -2625,6 +2690,169 @@ export type SocialAccount = {
2625
2690
 
2626
2691
  export type platform5 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'whatsapp' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads';
2627
2692
 
2693
+ /**
2694
+ * Normalized, platform-agnostic ad-targeting spec. Every field is optional, an
2695
+ * empty object targets the platform's default broadest audience. Field names are
2696
+ * camelCase and identical across `POST /v1/ads/create` (the `targeting` object),
2697
+ * `POST /v1/ads/targeting/reach-estimate`, and `saved_targeting` audiences, so a
2698
+ * spec resolved once can be reused verbatim.
2699
+ *
2700
+ * Entity ids (`regions[].key`, `cities[].key`, `zips[].key`, `metros[].key`,
2701
+ * `interests[].id`, `behaviors[].id`) are the platform's opaque identifiers
2702
+ * resolved via `GET /v1/ads/targeting/search`. A spec is therefore meaningful only
2703
+ * for the platform it was built against, except the portable fields (`countries`,
2704
+ * `ageMin`/`ageMax`, `gender`, `incomeTier`, `languages`) which carry across
2705
+ * platforms. Fields a platform cannot honour are rejected at create time with
2706
+ * `INVALID_FIELD_VALUE` naming the offending field (not silently dropped).
2707
+ *
2708
+ */
2709
+ export type TargetingSpec = {
2710
+ /**
2711
+ * ISO 3166-1 alpha-2 country codes (e.g. ['US']).
2712
+ */
2713
+ countries?: Array<(string)>;
2714
+ /**
2715
+ * Region/state targeting. `key` is the platform location ID from /v1/ads/targeting/search?dimension=geo&geoType=region.
2716
+ */
2717
+ regions?: Array<{
2718
+ key: string;
2719
+ name?: string;
2720
+ }>;
2721
+ /**
2722
+ * City targeting. Optional `radius` + `distanceUnit` extend beyond the city limits; both must be set together or both omitted. `radius` is only honoured on platforms whose capability map allows city radius (Meta).
2723
+ */
2724
+ cities?: Array<{
2725
+ key: string;
2726
+ name?: string;
2727
+ /**
2728
+ * Radius around the city. Requires distanceUnit.
2729
+ */
2730
+ radius?: number;
2731
+ /**
2732
+ * Required if radius is set.
2733
+ */
2734
+ distanceUnit?: 'mile' | 'kilometer';
2735
+ }>;
2736
+ /**
2737
+ * Postal/ZIP targeting. `key` is the platform's postal location ID (e.g. Meta `US:94304`). Supported on Meta, Google, TikTok, Pinterest, X.
2738
+ */
2739
+ zips?: Array<{
2740
+ key: string;
2741
+ name?: string;
2742
+ }>;
2743
+ /**
2744
+ * DMA / metro-area targeting. `key` is the platform's metro ID (e.g. Meta `DMA:807`).
2745
+ */
2746
+ metros?: Array<{
2747
+ key: string;
2748
+ name?: string;
2749
+ }>;
2750
+ /**
2751
+ * Point-radius (lat/lng) targeting (Meta custom_locations / Google proximity). Honoured only where the capability map allows radius (Meta).
2752
+ */
2753
+ customLocations?: Array<{
2754
+ latitude: number;
2755
+ longitude: number;
2756
+ /**
2757
+ * Positive radius around the point.
2758
+ */
2759
+ radius: number;
2760
+ distanceUnit: 'mile' | 'kilometer';
2761
+ name?: string;
2762
+ address?: string;
2763
+ }>;
2764
+ /**
2765
+ * Geo to exclude from the audience. A subset of the inclusion geo shape.
2766
+ */
2767
+ excludedLocations?: {
2768
+ countries?: Array<(string)>;
2769
+ regions?: Array<{
2770
+ key: string;
2771
+ name?: string;
2772
+ }>;
2773
+ cities?: Array<{
2774
+ key: string;
2775
+ name?: string;
2776
+ }>;
2777
+ zips?: Array<{
2778
+ key: string;
2779
+ name?: string;
2780
+ }>;
2781
+ };
2782
+ ageMin?: number;
2783
+ ageMax?: number;
2784
+ /**
2785
+ * Restrict by gender. 'all' (default) targets everyone.
2786
+ */
2787
+ gender?: 'all' | 'male' | 'female';
2788
+ /**
2789
+ * Normalized household-income tier (ZIP/percentile based). Meta and TikTok
2790
+ * express all four. Google maps only `top_10` (its INCOME_RANGE_90_UP); other
2791
+ * tiers on Google, and any income tier on LinkedIn / X / Pinterest, are rejected.
2792
+ * On Meta, income/zip targeting requires the relevant `specialAdCategories` to be
2793
+ * unset (housing/employment/credit ads cannot use it).
2794
+ *
2795
+ */
2796
+ incomeTier?: 'top_5' | 'top_10' | 'top_10_25' | 'top_25_50';
2797
+ /**
2798
+ * Language codes (e.g. ['en']).
2799
+ */
2800
+ languages?: Array<(string)>;
2801
+ /**
2802
+ * Interest entities from /v1/ads/targeting/search?dimension=interest. Each carries the platform's opaque id.
2803
+ */
2804
+ interests?: Array<{
2805
+ id: string;
2806
+ name?: string;
2807
+ }>;
2808
+ /**
2809
+ * Behaviour entities from /v1/ads/targeting/search?dimension=behavior. Supported on Meta and TikTok.
2810
+ */
2811
+ behaviors?: Array<{
2812
+ id: string;
2813
+ name?: string;
2814
+ }>;
2815
+ /**
2816
+ * LinkedIn B2B only. Industry URN id fragments.
2817
+ */
2818
+ industries?: Array<(string)>;
2819
+ /**
2820
+ * LinkedIn B2B only.
2821
+ */
2822
+ companySizes?: Array<(string)>;
2823
+ /**
2824
+ * LinkedIn B2B only.
2825
+ */
2826
+ seniorities?: Array<(string)>;
2827
+ /**
2828
+ * LinkedIn B2B only.
2829
+ */
2830
+ jobFunctions?: Array<(string)>;
2831
+ /**
2832
+ * Platform audience IDs to include.
2833
+ */
2834
+ audienceInclude?: Array<(string)>;
2835
+ /**
2836
+ * Platform audience IDs to exclude.
2837
+ */
2838
+ audienceExclude?: Array<(string)>;
2839
+ };
2840
+
2841
+ /**
2842
+ * Restrict by gender. 'all' (default) targets everyone.
2843
+ */
2844
+ export type gender = 'all' | 'male' | 'female';
2845
+
2846
+ /**
2847
+ * Normalized household-income tier (ZIP/percentile based). Meta and TikTok
2848
+ * express all four. Google maps only `top_10` (its INCOME_RANGE_90_UP); other
2849
+ * tiers on Google, and any income tier on LinkedIn / X / Pinterest, are rejected.
2850
+ * On Meta, income/zip targeting requires the relevant `specialAdCategories` to be
2851
+ * unset (housing/employment/credit ads cannot use it).
2852
+ *
2853
+ */
2854
+ export type incomeTier = 'top_5' | 'top_10' | 'top_10_25' | 'top_25_50';
2855
+
2628
2856
  /**
2629
2857
  * Text, images (up to 10), videos (up to 10), and mixed media albums. Captions up to 1024 chars for media, 4096 for text-only.
2630
2858
  */
@@ -3097,7 +3325,7 @@ export type Webhook = {
3097
3325
  /**
3098
3326
  * Events subscribed to
3099
3327
  */
3100
- events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'comment.received' | 'review.new' | 'review.updated' | 'ad.status_changed' | 'whatsapp.template.status_updated')>;
3328
+ events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'comment.received' | 'review.new' | 'review.updated' | 'ad.status_changed' | 'whatsapp.template.status_updated')>;
3101
3329
  /**
3102
3330
  * Whether webhook delivery is enabled
3103
3331
  */
@@ -3526,6 +3754,68 @@ export type event5 = 'comment.received';
3526
3754
 
3527
3755
  export type platform7 = 'instagram' | 'facebook' | 'twitter' | 'youtube' | 'linkedin' | 'bluesky' | 'reddit';
3528
3756
 
3757
+ /**
3758
+ * Webhook payload for lead.received events (Meta Lead Gen / Instant Forms).
3759
+ */
3760
+ export type WebhookPayloadLead = {
3761
+ /**
3762
+ * Stable webhook event ID
3763
+ */
3764
+ id: string;
3765
+ event: 'lead.received';
3766
+ lead: {
3767
+ /**
3768
+ * Zernio lead ID (AdLead document ID)
3769
+ */
3770
+ id: string;
3771
+ /**
3772
+ * Meta lead ID (the platform's leadgen_id)
3773
+ */
3774
+ leadgenId: string;
3775
+ /**
3776
+ * Lead Gen form ID the lead was submitted against
3777
+ */
3778
+ formId: string;
3779
+ /**
3780
+ * Human-readable form name (best-effort; may be null)
3781
+ */
3782
+ formName?: (string) | null;
3783
+ /**
3784
+ * Meta ad ID that drove the lead (null for organic/test leads)
3785
+ */
3786
+ adId?: (string) | null;
3787
+ adsetId?: (string) | null;
3788
+ campaignId?: (string) | null;
3789
+ /**
3790
+ * Flattened question key -> answer map. For multiple-choice questions the value is the option key (e.g. "k1"), not the display label.
3791
+ *
3792
+ */
3793
+ fields: {
3794
+ [key: string]: (string);
3795
+ };
3796
+ /**
3797
+ * True when the lead came from an organic post rather than a paid ad
3798
+ */
3799
+ isOrganic: boolean;
3800
+ /**
3801
+ * Meta's lead creation time (ISO 8601)
3802
+ */
3803
+ createdAt: string;
3804
+ };
3805
+ account: {
3806
+ /**
3807
+ * Social account ID (the facebook account owning the Page)
3808
+ */
3809
+ id: string;
3810
+ platform: 'facebook';
3811
+ };
3812
+ timestamp: string;
3813
+ };
3814
+
3815
+ export type event6 = 'lead.received';
3816
+
3817
+ export type platform8 = 'facebook';
3818
+
3529
3819
  /**
3530
3820
  * Webhook payload for message received events
3531
3821
  */
@@ -3810,7 +4100,7 @@ export type WebhookPayloadMessage = {
3810
4100
  timestamp: string;
3811
4101
  };
3812
4102
 
3813
- export type event6 = 'message.received';
4103
+ export type event7 = 'message.received';
3814
4104
 
3815
4105
  /**
3816
4106
  * WhatsApp only. Which kind of interactive reply the user sent:
@@ -3842,7 +4132,7 @@ export type WebhookPayloadMessageDeleted = {
3842
4132
  timestamp: string;
3843
4133
  };
3844
4134
 
3845
- export type event7 = 'message.deleted';
4135
+ export type event8 = 'message.deleted';
3846
4136
 
3847
4137
  /**
3848
4138
  * Shared payload for message.delivered, message.read, and
@@ -3877,7 +4167,7 @@ export type WebhookPayloadMessageDeliveryStatus = {
3877
4167
  timestamp: string;
3878
4168
  };
3879
4169
 
3880
- export type event8 = 'message.delivered' | 'message.read' | 'message.failed';
4170
+ export type event9 = 'message.delivered' | 'message.read' | 'message.failed';
3881
4171
 
3882
4172
  /**
3883
4173
  * Webhook payload for message.edited events. Fires when the sender
@@ -3919,7 +4209,7 @@ export type WebhookPayloadMessageEdited = {
3919
4209
  timestamp: string;
3920
4210
  };
3921
4211
 
3922
- export type event9 = 'message.edited';
4212
+ export type event10 = 'message.edited';
3923
4213
 
3924
4214
  /**
3925
4215
  * Webhook payload for message sent events (fired when a message is sent via the API)
@@ -3995,7 +4285,7 @@ export type WebhookPayloadMessageSent = {
3995
4285
  timestamp: string;
3996
4286
  };
3997
4287
 
3998
- export type event10 = 'message.sent';
4288
+ export type event11 = 'message.sent';
3999
4289
 
4000
4290
  /**
4001
4291
  * Webhook payload for post events
@@ -4023,7 +4313,7 @@ export type WebhookPayloadPost = {
4023
4313
  timestamp: string;
4024
4314
  };
4025
4315
 
4026
- export type event11 = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled';
4316
+ export type event12 = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled';
4027
4317
 
4028
4318
  /**
4029
4319
  * Webhook payload for the per-platform terminal events
@@ -4099,7 +4389,72 @@ export type WebhookPayloadPostPlatform = {
4099
4389
  timestamp: string;
4100
4390
  };
4101
4391
 
4102
- export type event12 = 'post.platform.published' | 'post.platform.failed';
4392
+ export type event13 = 'post.platform.published' | 'post.platform.failed';
4393
+
4394
+ /**
4395
+ * Webhook payload for reaction received events (WhatsApp, Telegram)
4396
+ */
4397
+ export type WebhookPayloadReaction = {
4398
+ /**
4399
+ * Stable webhook event ID
4400
+ */
4401
+ id: string;
4402
+ event: 'reaction.received';
4403
+ reaction: {
4404
+ /**
4405
+ * The emoji reacted with. May be an empty string when `action` is
4406
+ * `removed` on WhatsApp (Meta does not report which emoji was removed).
4407
+ *
4408
+ */
4409
+ emoji: string;
4410
+ action: 'added' | 'removed';
4411
+ /**
4412
+ * Internal Zernio message ID of the reacted-to message, when resolvable from the platform ID.
4413
+ */
4414
+ messageId?: string;
4415
+ /**
4416
+ * Platform-native ID of the reacted-to message (e.g. WhatsApp wamid).
4417
+ */
4418
+ platformMessageId: string;
4419
+ /**
4420
+ * The participant who added or removed the reaction.
4421
+ */
4422
+ sender: {
4423
+ id: string;
4424
+ name?: string;
4425
+ username?: string;
4426
+ picture?: string;
4427
+ /**
4428
+ * WhatsApp only. Sender's phone number in E.164 format (with leading `+`), when available.
4429
+ */
4430
+ phoneNumber?: (string) | null;
4431
+ };
4432
+ reactedAt: string;
4433
+ };
4434
+ conversation: {
4435
+ id: string;
4436
+ platformConversationId: string;
4437
+ participantId?: string;
4438
+ participantName?: string;
4439
+ participantUsername?: string;
4440
+ participantPicture?: string;
4441
+ status: 'active' | 'archived';
4442
+ };
4443
+ account: {
4444
+ /**
4445
+ * Social account ID
4446
+ */
4447
+ id: string;
4448
+ platform: string;
4449
+ username: string;
4450
+ displayName?: string;
4451
+ };
4452
+ timestamp: string;
4453
+ };
4454
+
4455
+ export type event14 = 'reaction.received';
4456
+
4457
+ export type action = 'added' | 'removed';
4103
4458
 
4104
4459
  /**
4105
4460
  * Webhook payload for the review.new event (new review posted on a connected account).
@@ -4119,7 +4474,7 @@ export type WebhookPayloadReviewNew = {
4119
4474
  timestamp: string;
4120
4475
  };
4121
4476
 
4122
- export type event13 = 'review.new';
4477
+ export type event15 = 'review.new';
4123
4478
 
4124
4479
  /**
4125
4480
  * Webhook payload for the review.updated event. Fired when the reviewer edits
@@ -4143,7 +4498,7 @@ export type WebhookPayloadReviewUpdated = {
4143
4498
  timestamp: string;
4144
4499
  };
4145
4500
 
4146
- export type event14 = 'review.updated';
4501
+ export type event16 = 'review.updated';
4147
4502
 
4148
4503
  /**
4149
4504
  * Webhook payload for test deliveries
@@ -4161,7 +4516,7 @@ export type WebhookPayloadTest = {
4161
4516
  timestamp: string;
4162
4517
  };
4163
4518
 
4164
- export type event15 = 'webhook.test';
4519
+ export type event17 = 'webhook.test';
4165
4520
 
4166
4521
  /**
4167
4522
  * Webhook payload for the `whatsapp.template.status_updated` event.
@@ -4216,9 +4571,9 @@ export type WebhookPayloadWhatsAppTemplateStatusUpdated = {
4216
4571
  timestamp: string;
4217
4572
  };
4218
4573
 
4219
- export type event16 = 'whatsapp.template.status_updated';
4574
+ export type event18 = 'whatsapp.template.status_updated';
4220
4575
 
4221
- export type platform8 = 'whatsapp';
4576
+ export type platform9 = 'whatsapp';
4222
4577
 
4223
4578
  /**
4224
4579
  * New status. Forwarded verbatim from Meta's `event` field.
@@ -4573,18 +4928,12 @@ export type ValidatePostData = {
4573
4928
  platformSpecificData?: {
4574
4929
  [key: string]: unknown;
4575
4930
  };
4576
- customMedia?: Array<{
4577
- url?: string;
4578
- type?: 'image' | 'video';
4579
- }>;
4931
+ customMedia?: Array<MediaItem>;
4580
4932
  }>;
4581
4933
  /**
4582
4934
  * Root media items shared across platforms
4583
4935
  */
4584
- mediaItems?: Array<{
4585
- url?: string;
4586
- type?: 'image' | 'video';
4587
- }>;
4936
+ mediaItems?: Array<MediaItem>;
4588
4937
  };
4589
4938
  };
4590
4939
 
@@ -5769,10 +6118,7 @@ export type CreatePostData = {
5769
6118
  * Post caption/text. Optional when media is attached or all platforms have customContent. Required for text-only posts.
5770
6119
  */
5771
6120
  content?: string;
5772
- mediaItems?: Array<{
5773
- type?: 'image' | 'video' | 'gif' | 'document';
5774
- url?: string;
5775
- }>;
6121
+ mediaItems?: Array<MediaItem>;
5776
6122
  /**
5777
6123
  * Target platforms and accounts for this post. Required for non-draft posts (returns 400 if empty). Drafts can omit platforms.
5778
6124
  */
@@ -5783,10 +6129,7 @@ export type CreatePostData = {
5783
6129
  * Platform-specific text override. When set, this content is used instead of the top-level post content for this platform. Useful for tailoring captions per platform (e.g. keeping tweets under 280 characters).
5784
6130
  */
5785
6131
  customContent?: string;
5786
- customMedia?: Array<{
5787
- type?: 'image' | 'video' | 'gif' | 'document';
5788
- url?: string;
5789
- }>;
6132
+ customMedia?: Array<MediaItem>;
5790
6133
  /**
5791
6134
  * Optional per-platform scheduled time override. When omitted, the top-level scheduledFor is used.
5792
6135
  */
@@ -5923,17 +6266,7 @@ export type BulkUploadPostsData = {
5923
6266
  };
5924
6267
  };
5925
6268
 
5926
- export type BulkUploadPostsResponse = ({
5927
- success?: boolean;
5928
- totalRows?: number;
5929
- created?: number;
5930
- failed?: number;
5931
- errors?: Array<{
5932
- row?: number;
5933
- error?: string;
5934
- }>;
5935
- posts?: Array<Post>;
5936
- } | unknown);
6269
+ export type BulkUploadPostsResponse = (BulkUploadResult);
5937
6270
 
5938
6271
  export type BulkUploadPostsError = (unknown | {
5939
6272
  error?: string;
@@ -7202,7 +7535,7 @@ export type GetGoogleBusinessReviewsError = (ErrorResponse | {
7202
7535
  error?: string;
7203
7536
  });
7204
7537
 
7205
- export type GetGoogleBusinessFoodMenusData = {
7538
+ export type GetGoogleBusinessVerificationsData = {
7206
7539
  path: {
7207
7540
  /**
7208
7541
  * The Zernio account ID (from /v1/accounts)
@@ -7217,33 +7550,235 @@ export type GetGoogleBusinessFoodMenusData = {
7217
7550
  };
7218
7551
  };
7219
7552
 
7220
- export type GetGoogleBusinessFoodMenusResponse = ({
7553
+ export type GetGoogleBusinessVerificationsResponse = ({
7221
7554
  success?: boolean;
7222
7555
  accountId?: string;
7223
7556
  locationId?: string;
7224
7557
  /**
7225
- * Resource name of the food menus
7558
+ * Raw Voice of Merchant state from Google.
7226
7559
  */
7227
- name?: string;
7228
- menus?: Array<FoodMenu>;
7229
- });
7230
-
7231
- export type GetGoogleBusinessFoodMenusError = (ErrorResponse | {
7232
- error?: string;
7233
- });
7234
-
7235
- export type UpdateGoogleBusinessFoodMenusData = {
7236
- body: {
7560
+ voiceOfMerchantState?: {
7237
7561
  /**
7238
- * Array of food menus to set
7562
+ * True when the listing is verified and published (eligible to surface reviews
7239
7563
  */
7240
- menus: Array<FoodMenu>;
7564
+ hasVoiceOfMerchant?: boolean;
7241
7565
  /**
7242
- * Field mask for partial updates (e.g. "menus")
7566
+ * True when the authenticated user has owner/manager authority over the listing.
7243
7567
  */
7244
- updateMask?: string;
7245
- };
7246
- path: {
7568
+ hasBusinessAuthority?: boolean;
7569
+ /**
7570
+ * Present when verification is the path to Voice of Merchant.
7571
+ */
7572
+ verify?: {
7573
+ /**
7574
+ * True when a verification is already in progress.
7575
+ */
7576
+ hasPendingVerification?: boolean;
7577
+ };
7578
+ };
7579
+ /**
7580
+ * Verification history, newest first. Empty when none exist.
7581
+ */
7582
+ verifications?: Array<{
7583
+ /**
7584
+ * Resource name, e.g. "locations/123/verifications/0T1776879124712". The last segment is the verificationId.
7585
+ */
7586
+ name?: string;
7587
+ /**
7588
+ * Method used (omitted on some entries).
7589
+ */
7590
+ method?: 'ADDRESS' | 'EMAIL' | 'PHONE_CALL' | 'SMS' | 'AUTO' | 'VETTED_PARTNER';
7591
+ state?: 'PENDING' | 'COMPLETED' | 'FAILED';
7592
+ createTime?: string;
7593
+ }>;
7594
+ });
7595
+
7596
+ export type GetGoogleBusinessVerificationsError = (ErrorResponse | {
7597
+ error?: string;
7598
+ });
7599
+
7600
+ export type StartGoogleBusinessVerificationData = {
7601
+ body: {
7602
+ /**
7603
+ * The verification method. Selects which method-specific field below is required.
7604
+ */
7605
+ method: 'ADDRESS' | 'EMAIL' | 'PHONE_CALL' | 'SMS' | 'AUTO' | 'VETTED_PARTNER';
7606
+ languageCode?: string;
7607
+ /**
7608
+ * For PHONE_CALL / SMS.
7609
+ */
7610
+ phoneNumber?: string;
7611
+ /**
7612
+ * For EMAIL.
7613
+ */
7614
+ emailAddress?: string;
7615
+ /**
7616
+ * For ADDRESS (postcard) verification.
7617
+ */
7618
+ mailerContact?: {
7619
+ [key: string]: unknown;
7620
+ };
7621
+ /**
7622
+ * ServiceBusinessContext (e.g. service address). Required for service-area businesses.
7623
+ */
7624
+ context?: {
7625
+ [key: string]: unknown;
7626
+ };
7627
+ };
7628
+ path: {
7629
+ /**
7630
+ * The Zernio account ID (from /v1/accounts)
7631
+ */
7632
+ accountId: string;
7633
+ };
7634
+ query?: {
7635
+ /**
7636
+ * Override which location to target. If omitted, uses the account's selected location.
7637
+ */
7638
+ locationId?: string;
7639
+ };
7640
+ };
7641
+
7642
+ export type StartGoogleBusinessVerificationResponse = ({
7643
+ success?: boolean;
7644
+ accountId?: string;
7645
+ locationId?: string;
7646
+ verification?: {
7647
+ name?: string;
7648
+ method?: 'ADDRESS' | 'EMAIL' | 'PHONE_CALL' | 'SMS' | 'AUTO' | 'VETTED_PARTNER';
7649
+ state?: 'PENDING' | 'COMPLETED' | 'FAILED';
7650
+ createTime?: string;
7651
+ };
7652
+ });
7653
+
7654
+ export type StartGoogleBusinessVerificationError = (ErrorResponse | {
7655
+ error?: string;
7656
+ });
7657
+
7658
+ export type FetchGoogleBusinessVerificationOptionsData = {
7659
+ body: {
7660
+ languageCode: string;
7661
+ /**
7662
+ * ServiceBusinessContext. Required for service-area businesses (must include the service address).
7663
+ */
7664
+ context?: {
7665
+ [key: string]: unknown;
7666
+ };
7667
+ };
7668
+ path: {
7669
+ /**
7670
+ * The Zernio account ID (from /v1/accounts)
7671
+ */
7672
+ accountId: string;
7673
+ };
7674
+ query?: {
7675
+ /**
7676
+ * Override which location to query. If omitted, uses the account's selected location.
7677
+ */
7678
+ locationId?: string;
7679
+ };
7680
+ };
7681
+
7682
+ export type FetchGoogleBusinessVerificationOptionsResponse = ({
7683
+ success?: boolean;
7684
+ accountId?: string;
7685
+ locationId?: string;
7686
+ options?: Array<{
7687
+ verificationMethod?: 'ADDRESS' | 'EMAIL' | 'PHONE_CALL' | 'SMS' | 'AUTO' | 'VETTED_PARTNER';
7688
+ /**
7689
+ * Present for PHONE_CALL / SMS.
7690
+ */
7691
+ phoneNumber?: string;
7692
+ }>;
7693
+ });
7694
+
7695
+ export type FetchGoogleBusinessVerificationOptionsError = (ErrorResponse | {
7696
+ error?: string;
7697
+ });
7698
+
7699
+ export type CompleteGoogleBusinessVerificationData = {
7700
+ body: {
7701
+ /**
7702
+ * The code Google sent to the business.
7703
+ */
7704
+ pin: string;
7705
+ };
7706
+ path: {
7707
+ /**
7708
+ * The Zernio account ID (from /v1/accounts)
7709
+ */
7710
+ accountId: string;
7711
+ /**
7712
+ * The last segment of a verification `name` from GET /gmb-verifications.
7713
+ */
7714
+ verificationId: string;
7715
+ };
7716
+ query?: {
7717
+ /**
7718
+ * Override which location to target. If omitted, uses the account's selected location.
7719
+ */
7720
+ locationId?: string;
7721
+ };
7722
+ };
7723
+
7724
+ export type CompleteGoogleBusinessVerificationResponse = ({
7725
+ success?: boolean;
7726
+ accountId?: string;
7727
+ locationId?: string;
7728
+ verification?: {
7729
+ name?: string;
7730
+ method?: 'ADDRESS' | 'EMAIL' | 'PHONE_CALL' | 'SMS' | 'AUTO' | 'VETTED_PARTNER';
7731
+ state?: 'PENDING' | 'COMPLETED' | 'FAILED';
7732
+ createTime?: string;
7733
+ };
7734
+ });
7735
+
7736
+ export type CompleteGoogleBusinessVerificationError = (ErrorResponse | {
7737
+ error?: string;
7738
+ });
7739
+
7740
+ export type GetGoogleBusinessFoodMenusData = {
7741
+ path: {
7742
+ /**
7743
+ * The Zernio account ID (from /v1/accounts)
7744
+ */
7745
+ accountId: string;
7746
+ };
7747
+ query?: {
7748
+ /**
7749
+ * Override which location to query. If omitted, uses the account's selected location. Use GET /gmb-locations to list valid IDs.
7750
+ */
7751
+ locationId?: string;
7752
+ };
7753
+ };
7754
+
7755
+ export type GetGoogleBusinessFoodMenusResponse = ({
7756
+ success?: boolean;
7757
+ accountId?: string;
7758
+ locationId?: string;
7759
+ /**
7760
+ * Resource name of the food menus
7761
+ */
7762
+ name?: string;
7763
+ menus?: Array<FoodMenu>;
7764
+ });
7765
+
7766
+ export type GetGoogleBusinessFoodMenusError = (ErrorResponse | {
7767
+ error?: string;
7768
+ });
7769
+
7770
+ export type UpdateGoogleBusinessFoodMenusData = {
7771
+ body: {
7772
+ /**
7773
+ * Array of food menus to set
7774
+ */
7775
+ menus: Array<FoodMenu>;
7776
+ /**
7777
+ * Field mask for partial updates (e.g. "menus")
7778
+ */
7779
+ updateMask?: string;
7780
+ };
7781
+ path: {
7247
7782
  /**
7248
7783
  * The Zernio account ID (from /v1/accounts)
7249
7784
  */
@@ -9692,7 +10227,7 @@ export type CreateWebhookSettingsData = {
9692
10227
  /**
9693
10228
  * Events to subscribe to (at least one required)
9694
10229
  */
9695
- events: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'comment.received' | 'review.new' | 'review.updated' | 'ad.status_changed' | 'whatsapp.template.status_updated')>;
10230
+ events: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'comment.received' | 'review.new' | 'review.updated' | 'ad.status_changed' | 'whatsapp.template.status_updated')>;
9696
10231
  /**
9697
10232
  * Enable or disable webhook delivery. Defaults to `true` when omitted.
9698
10233
  */
@@ -9736,7 +10271,7 @@ export type UpdateWebhookSettingsData = {
9736
10271
  /**
9737
10272
  * Events to subscribe to. Must contain at least one event if provided.
9738
10273
  */
9739
- events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'comment.received' | 'review.new' | 'review.updated' | 'ad.status_changed' | 'whatsapp.template.status_updated')>;
10274
+ events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'comment.received' | 'review.new' | 'review.updated' | 'ad.status_changed' | 'whatsapp.template.status_updated')>;
9740
10275
  /**
9741
10276
  * Enable or disable webhook delivery
9742
10277
  */
@@ -10695,6 +11230,33 @@ export type SendTypingIndicatorError = ({
10695
11230
  error?: string;
10696
11231
  } | unknown);
10697
11232
 
11233
+ export type MarkConversationReadData = {
11234
+ body: {
11235
+ /**
11236
+ * Social account ID
11237
+ */
11238
+ accountId: string;
11239
+ };
11240
+ path: {
11241
+ /**
11242
+ * The conversation ID
11243
+ */
11244
+ conversationId: string;
11245
+ };
11246
+ };
11247
+
11248
+ export type MarkConversationReadResponse = ({
11249
+ success?: boolean;
11250
+ /**
11251
+ * Number of messages marked read by this call
11252
+ */
11253
+ markedCount?: number;
11254
+ });
11255
+
11256
+ export type MarkConversationReadError = ({
11257
+ error?: string;
11258
+ } | unknown);
11259
+
10698
11260
  export type AddMessageReactionData = {
10699
11261
  body: {
10700
11262
  /**
@@ -11130,6 +11692,63 @@ export type GetInboxPostCommentsResponse = ({
11130
11692
  */
11131
11693
  rootCid?: (string) | null;
11132
11694
  }>;
11695
+ /**
11696
+ * (Reddit only) Metadata for the target post, returned alongside the comments in Reddit's
11697
+ * single round-trip. Lets integrators render a preview of the post the user is commenting on
11698
+ * without an additional request. Absent for non-Reddit platforms and when the upstream
11699
+ * response is missing the post listing (deleted post, malformed response).
11700
+ *
11701
+ */
11702
+ post?: {
11703
+ /**
11704
+ * Reddit post base36 id (e.g. "1tjtj26")
11705
+ */
11706
+ id?: string;
11707
+ /**
11708
+ * Fullname with type prefix (e.g. "t3_1tjtj26")
11709
+ */
11710
+ fullname?: string;
11711
+ title?: string;
11712
+ /**
11713
+ * Body text for self-posts (empty for link posts)
11714
+ */
11715
+ selftext?: string;
11716
+ /**
11717
+ * Reddit username
11718
+ */
11719
+ author?: string;
11720
+ /**
11721
+ * Subreddit name
11722
+ */
11723
+ subreddit?: string;
11724
+ /**
11725
+ * Absolute URL to the post on reddit.com
11726
+ */
11727
+ permalink?: string;
11728
+ /**
11729
+ * For link posts
11730
+ */
11731
+ url?: string;
11732
+ /**
11733
+ * Net upvotes (upvotes minus downvotes)
11734
+ */
11735
+ score?: number;
11736
+ numComments?: number;
11737
+ /**
11738
+ * Unix timestamp in seconds
11739
+ */
11740
+ createdUtc?: number;
11741
+ over18?: boolean;
11742
+ stickied?: boolean;
11743
+ /**
11744
+ * Link flair text if any
11745
+ */
11746
+ flairText?: (string) | null;
11747
+ /**
11748
+ * True if the post is a Reddit gallery (multiple images)
11749
+ */
11750
+ isGallery?: boolean;
11751
+ } | null;
11133
11752
  pagination?: {
11134
11753
  hasMore?: boolean;
11135
11754
  cursor?: (string) | null;
@@ -13301,6 +13920,18 @@ export type CreateBroadcastData = {
13301
13920
  name?: string;
13302
13921
  language?: string;
13303
13922
  components?: unknown[];
13923
+ /**
13924
+ * Maps template variable positions ("1", "2") to contact fields or static values. Resolved per recipient at send time.
13925
+ */
13926
+ variableMapping?: {
13927
+ [key: string]: {
13928
+ field?: 'name' | 'phone' | 'email' | 'company' | 'custom';
13929
+ /**
13930
+ * Static value used when field is "custom"
13931
+ */
13932
+ customValue?: string;
13933
+ };
13934
+ };
13304
13935
  };
13305
13936
  segmentFilters?: {
13306
13937
  tags?: Array<(string)>;
@@ -15141,9 +15772,13 @@ export type CreateStandaloneAdData = {
15141
15772
  */
15142
15773
  callToAction?: 'LEARN_MORE' | 'SHOP_NOW' | 'SIGN_UP' | 'BOOK_TRAVEL' | 'CONTACT_US' | 'DOWNLOAD' | 'GET_OFFER' | 'GET_QUOTE' | 'SUBSCRIBE' | 'WATCH_MORE' | 'REGISTER' | 'JOIN' | 'ATTEND' | 'REQUEST_DEMO' | 'VIEW_QUOTE' | 'APPLY' | 'SEE_MORE' | 'BUY_NOW';
15143
15774
  /**
15144
- * Required on legacy + attach shapes (skip for multi-creative). On LinkedIn it's the ad's destination URL; required for `traffic` ads, optional for `engagement` / `awareness`.
15775
+ * Required on legacy + attach shapes (skip for multi-creative). On LinkedIn it's the ad's destination URL; required for `traffic` ads, optional for `engagement` / `awareness`. NOT required when `goal` is `lead_generation` (the ad opens a Lead Gen form instead of a destination).
15145
15776
  */
15146
15777
  linkUrl?: string;
15778
+ /**
15779
+ * Meta Lead Gen forms only (facebook/instagram). The leadgen_forms ID to attach to the ad's creative — create one via POST /v1/ads/lead-forms. REQUIRED when `goal` is `lead_generation`; ignored otherwise. The ad set's promoted_object.page_id + LEAD_GENERATION optimization are derived automatically from the goal.
15780
+ */
15781
+ leadGenFormId?: string;
15147
15782
  /**
15148
15783
  * Image creative for Meta/Google/Pinterest/LinkedIn on legacy + attach shapes (mutually exclusive with `video`). Required for LinkedIn ads unless `video` is set. Not required for Google Search campaigns. For TikTok, this field carries the VIDEO URL (the TikTok ads endpoint is video-only; the field retains the `imageUrl` name for cross-platform consistency). Ignored for X/Twitter. For Google Display, treated as the landscape image (alias of `images.landscape`); supply `images.square` alongside or the request is rejected. For LinkedIn the image is uploaded to LinkedIn under the authoring Company Page (see `organizationId`); recommended ratio 1.91:1 (e.g. 1200×627).
15149
15784
  */
@@ -15269,27 +15904,84 @@ export type CreateStandaloneAdData = {
15269
15904
  name: string;
15270
15905
  }>;
15271
15906
  /**
15272
- * Required for lifetime budgets
15907
+ * Postal/ZIP geo targeting. `key` is the platform's postal location ID from /v1/ads/targeting/search?dimension=geo&geoType=zip. Supported on Meta, Google, TikTok, Pinterest, X.
15273
15908
  */
15274
- endDate?: string;
15909
+ zips?: Array<{
15910
+ key: string;
15911
+ name?: string;
15912
+ }>;
15275
15913
  /**
15276
- * Custom audience ID for targeting
15914
+ * DMA / metro-area geo targeting. `key` is the platform's metro ID from /v1/ads/targeting/search?dimension=geo&geoType=metro.
15277
15915
  */
15278
- audienceId?: string;
15916
+ metros?: Array<{
15917
+ key: string;
15918
+ name?: string;
15919
+ }>;
15279
15920
  /**
15280
- * Google only
15921
+ * Point-radius (lat/lng) geo targeting. Meta only (custom_locations). Rejected on platforms without radius support.
15281
15922
  */
15282
- campaignType?: 'display' | 'search';
15923
+ customLocations?: Array<{
15924
+ latitude: number;
15925
+ longitude: number;
15926
+ radius: number;
15927
+ distanceUnit: 'mile' | 'kilometer';
15928
+ name?: string;
15929
+ address?: string;
15930
+ }>;
15283
15931
  /**
15284
- * Google Search only
15932
+ * Behaviour entities from /v1/ads/targeting/search?dimension=behavior. Supported on Meta and TikTok. Each must include id.
15285
15933
  */
15286
- keywords?: Array<(string)>;
15934
+ behaviors?: Array<{
15935
+ id: string;
15936
+ name?: string;
15937
+ }>;
15287
15938
  /**
15288
- * Google Search RSA only. Extra headlines.
15939
+ * Normalized household-income tier. Meta and TikTok express all four; Google maps only
15940
+ * `top_10`; rejected on LinkedIn, X, and Pinterest. On Meta, income targeting is incompatible
15941
+ * with housing/employment/credit `specialAdCategories`.
15942
+ *
15289
15943
  */
15290
- additionalHeadlines?: Array<(string)>;
15944
+ incomeTier?: 'top_5' | 'top_10' | 'top_10_25' | 'top_25_50';
15291
15945
  /**
15292
- * Google Search RSA only. Extra descriptions.
15946
+ * Language codes (e.g. ['en']). Restricts the audience by language.
15947
+ */
15948
+ languages?: Array<(string)>;
15949
+ /**
15950
+ * ID of a `saved_targeting` audience (created via POST /v1/ads/audiences). When set, its stored
15951
+ * TargetingSpec is expanded as the base targeting; inline fields on this body merge on top. Lets you
15952
+ * reuse a named targeting preset without re-sending every field.
15953
+ *
15954
+ */
15955
+ savedTargetingId?: string;
15956
+ /**
15957
+ * Meta only. Declares the ad's special category, required for housing, employment, credit, or
15958
+ * political/social-issue ads (Meta enforces restricted targeting for these). Note: setting a special
15959
+ * category disables income/zip targeting on Meta.
15960
+ *
15961
+ */
15962
+ specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'ISSUES_ELECTIONS_POLITICS')>;
15963
+ /**
15964
+ * Required for lifetime budgets
15965
+ */
15966
+ endDate?: string;
15967
+ /**
15968
+ * Custom audience ID for targeting
15969
+ */
15970
+ audienceId?: string;
15971
+ /**
15972
+ * Google only
15973
+ */
15974
+ campaignType?: 'display' | 'search';
15975
+ /**
15976
+ * Google Search only
15977
+ */
15978
+ keywords?: Array<(string)>;
15979
+ /**
15980
+ * Google Search RSA only. Extra headlines.
15981
+ */
15982
+ additionalHeadlines?: Array<(string)>;
15983
+ /**
15984
+ * Google Search RSA only. Extra descriptions.
15293
15985
  */
15294
15986
  additionalDescriptions?: Array<(string)>;
15295
15987
  /**
@@ -15480,6 +16172,249 @@ export type CreateStandaloneAdError = (unknown | {
15480
16172
  error?: string;
15481
16173
  });
15482
16174
 
16175
+ export type ListLeadsData = {
16176
+ query?: {
16177
+ /**
16178
+ * Filter to a single connected account.
16179
+ */
16180
+ accountId?: string;
16181
+ /**
16182
+ * Keyset cursor from a previous response's pagination.cursor.
16183
+ */
16184
+ cursor?: string;
16185
+ /**
16186
+ * Filter to a single lead form.
16187
+ */
16188
+ formId?: string;
16189
+ limit?: number;
16190
+ /**
16191
+ * Unix seconds; only leads created at/after this Meta timestamp.
16192
+ */
16193
+ since?: number;
16194
+ };
16195
+ };
16196
+
16197
+ export type ListLeadsResponse = ({
16198
+ status?: string;
16199
+ leads?: Array<{
16200
+ /**
16201
+ * Zernio lead id.
16202
+ */
16203
+ id?: string;
16204
+ /**
16205
+ * Meta lead id.
16206
+ */
16207
+ leadgenId?: string;
16208
+ formId?: string;
16209
+ formName?: (string) | null;
16210
+ accountId?: string;
16211
+ adId?: (string) | null;
16212
+ adsetId?: (string) | null;
16213
+ campaignId?: (string) | null;
16214
+ isOrganic?: boolean;
16215
+ /**
16216
+ * ISO 8601.
16217
+ */
16218
+ createdTime?: (string) | null;
16219
+ /**
16220
+ * Question key → answer.
16221
+ */
16222
+ fields?: {
16223
+ [key: string]: (string);
16224
+ };
16225
+ /**
16226
+ * Raw Meta field_data.
16227
+ */
16228
+ fieldData?: Array<{
16229
+ [key: string]: unknown;
16230
+ }>;
16231
+ }>;
16232
+ pagination?: {
16233
+ hasMore?: boolean;
16234
+ cursor?: (string) | null;
16235
+ };
16236
+ });
16237
+
16238
+ export type ListLeadsError = ({
16239
+ error?: string;
16240
+ } | unknown);
16241
+
16242
+ export type ListLeadFormsData = {
16243
+ query: {
16244
+ /**
16245
+ * Connected facebook account id.
16246
+ */
16247
+ accountId: string;
16248
+ cursor?: string;
16249
+ limit?: number;
16250
+ };
16251
+ };
16252
+
16253
+ export type ListLeadFormsResponse = ({
16254
+ status?: string;
16255
+ forms?: Array<{
16256
+ [key: string]: unknown;
16257
+ }>;
16258
+ pagination?: {
16259
+ hasMore?: boolean;
16260
+ cursor?: (string) | null;
16261
+ };
16262
+ });
16263
+
16264
+ export type ListLeadFormsError = ({
16265
+ error?: string;
16266
+ } | unknown);
16267
+
16268
+ export type CreateLeadFormData = {
16269
+ body: {
16270
+ accountId: string;
16271
+ name: string;
16272
+ questions: Array<{
16273
+ /**
16274
+ * EMAIL, PHONE, FULL_NAME, FIRST_NAME, LAST_NAME, CUSTOM, …
16275
+ */
16276
+ type: string;
16277
+ /**
16278
+ * CUSTOM questions only.
16279
+ */
16280
+ key?: string;
16281
+ /**
16282
+ * CUSTOM questions only.
16283
+ */
16284
+ label?: string;
16285
+ options?: Array<{
16286
+ key?: string;
16287
+ value?: string;
16288
+ }>;
16289
+ inline_context?: string;
16290
+ }>;
16291
+ privacyPolicyUrl: string;
16292
+ privacyPolicyLinkText?: string;
16293
+ followUpActionUrl?: string;
16294
+ locale?: string;
16295
+ thankYouTitle?: string;
16296
+ thankYouBody?: string;
16297
+ thankYouButtonText?: string;
16298
+ thankYouButtonType?: string;
16299
+ thankYouWebsiteUrl?: string;
16300
+ isOptimizedForQuality?: boolean;
16301
+ };
16302
+ };
16303
+
16304
+ export type CreateLeadFormResponse = ({
16305
+ status?: string;
16306
+ form?: {
16307
+ id?: string;
16308
+ name?: string;
16309
+ };
16310
+ });
16311
+
16312
+ export type CreateLeadFormError = ({
16313
+ error?: string;
16314
+ } | unknown);
16315
+
16316
+ export type GetLeadFormData = {
16317
+ path: {
16318
+ formId: string;
16319
+ };
16320
+ query: {
16321
+ accountId: string;
16322
+ };
16323
+ };
16324
+
16325
+ export type GetLeadFormResponse = ({
16326
+ status?: string;
16327
+ form?: {
16328
+ [key: string]: unknown;
16329
+ };
16330
+ });
16331
+
16332
+ export type GetLeadFormError = ({
16333
+ error?: string;
16334
+ });
16335
+
16336
+ export type ArchiveLeadFormData = {
16337
+ path: {
16338
+ formId: string;
16339
+ };
16340
+ query: {
16341
+ accountId: string;
16342
+ };
16343
+ };
16344
+
16345
+ export type ArchiveLeadFormResponse = ({
16346
+ status?: string;
16347
+ formId?: string;
16348
+ archived?: boolean;
16349
+ });
16350
+
16351
+ export type ArchiveLeadFormError = ({
16352
+ error?: string;
16353
+ });
16354
+
16355
+ export type ListFormLeadsData = {
16356
+ path: {
16357
+ formId: string;
16358
+ };
16359
+ query: {
16360
+ accountId: string;
16361
+ cursor?: string;
16362
+ limit?: number;
16363
+ /**
16364
+ * Unix seconds.
16365
+ */
16366
+ since?: number;
16367
+ };
16368
+ };
16369
+
16370
+ export type ListFormLeadsResponse = ({
16371
+ status?: string;
16372
+ leads?: Array<{
16373
+ id?: string;
16374
+ createdTime?: (string) | null;
16375
+ adId?: (string) | null;
16376
+ formId?: string;
16377
+ fields?: {
16378
+ [key: string]: (string);
16379
+ };
16380
+ fieldData?: Array<{
16381
+ [key: string]: unknown;
16382
+ }>;
16383
+ }>;
16384
+ pagination?: {
16385
+ hasMore?: boolean;
16386
+ cursor?: (string) | null;
16387
+ };
16388
+ });
16389
+
16390
+ export type ListFormLeadsError = ({
16391
+ error?: string;
16392
+ });
16393
+
16394
+ export type CreateTestLeadData = {
16395
+ body: {
16396
+ accountId: string;
16397
+ fieldData: Array<{
16398
+ name: string;
16399
+ values: Array<(string)>;
16400
+ }>;
16401
+ };
16402
+ path: {
16403
+ formId: string;
16404
+ };
16405
+ };
16406
+
16407
+ export type CreateTestLeadResponse = ({
16408
+ status?: string;
16409
+ testLead?: {
16410
+ id?: string;
16411
+ };
16412
+ });
16413
+
16414
+ export type CreateTestLeadError = ({
16415
+ error?: string;
16416
+ });
16417
+
15483
16418
  export type SearchAdInterestsData = {
15484
16419
  query: {
15485
16420
  /**
@@ -15505,58 +16440,112 @@ export type SearchAdInterestsError = ({
15505
16440
  error?: string;
15506
16441
  } | unknown);
15507
16442
 
15508
- export type SearchAdTargetingLocationsData = {
16443
+ export type SearchAdTargetingData = {
15509
16444
  query: {
15510
16445
  /**
15511
- * Social account ID (must be a connected Facebook or Instagram account).
16446
+ * Social account ID (a connected account on the target ad platform).
15512
16447
  */
15513
16448
  accountId: string;
15514
16449
  /**
15515
- * ISO 3166-1 alpha-2 country code (e.g. NL) to scope the search.
16450
+ * ISO 3166-1 alpha-2 country code (e.g. NL) to scope a geo search.
15516
16451
  */
15517
16452
  countryCode?: string;
16453
+ /**
16454
+ * What to search. `geo` resolves locations (scope further with `geoType`), `interest`/`behavior` resolve audience entities, `income` resolves income-tier options. Defaults to `interest` for backward compatibility with the deprecated /v1/ads/interests alias.
16455
+ */
16456
+ dimension?: 'geo' | 'interest' | 'behavior' | 'income';
16457
+ /**
16458
+ * Only used when `dimension=geo`. The kind of location to resolve. Defaults to `city`.
16459
+ */
16460
+ geoType?: 'country' | 'region' | 'city' | 'zip' | 'metro';
15518
16461
  /**
15519
16462
  * Maximum results to return.
15520
16463
  */
15521
16464
  limit?: number;
15522
16465
  /**
15523
- * Location name. Locality only no region/country suffix.
16466
+ * Search query. For geo, the locality name only (no region/country suffix).
15524
16467
  */
15525
16468
  q: string;
15526
- /**
15527
- * Type of location to search. Defaults to city.
15528
- */
15529
- type?: 'country' | 'region' | 'city' | 'subcity' | 'neighborhood' | 'zip' | 'metro_area' | 'geo_market';
15530
16469
  };
15531
16470
  };
15532
16471
 
15533
- export type SearchAdTargetingLocationsResponse = ({
16472
+ export type SearchAdTargetingResponse = ({
15534
16473
  results?: Array<{
15535
16474
  /**
15536
- * Meta's opaque location ID. Use this in targeting.cities[].key / regions[].key.
16475
+ * The platform's opaque id. Use as a geo `key` (regions/cities/zips/metros) or an entity `id` (interests/behaviors) in TargetingSpec.
16476
+ */
16477
+ id: string;
16478
+ /**
16479
+ * Human-readable label.
15537
16480
  */
15538
- key: string;
15539
16481
  name: string;
15540
16482
  /**
15541
- * Location type as returned by Meta (city, region, country, etc.).
16483
+ * What the result is (e.g. city, region, country, zip, metro, interest, behavior, income).
15542
16484
  */
15543
16485
  type: string;
15544
- countryCode?: string;
15545
- countryName?: string;
15546
16486
  /**
15547
- * Parent region/state name (cities only).
16487
+ * Optional breadcrumb of parent labels (e.g. ['United States', 'California', 'Los Angeles']). Disambiguates same-named results.
15548
16488
  */
15549
- region?: string;
16489
+ path?: Array<(string)>;
15550
16490
  /**
15551
- * Parent region ID (cities only).
16491
+ * Optional estimated reachable users for this option, when the platform returns it.
15552
16492
  */
15553
- regionId?: (string | number);
15554
- supportsRegion?: boolean;
15555
- supportsCity?: boolean;
16493
+ audienceSize?: (number) | null;
15556
16494
  }>;
15557
16495
  });
15558
16496
 
15559
- export type SearchAdTargetingLocationsError = (unknown | {
16497
+ export type SearchAdTargetingError = (unknown | {
16498
+ error?: string;
16499
+ });
16500
+
16501
+ export type EstimateAdReachData = {
16502
+ body: {
16503
+ /**
16504
+ * Social account ID on the target ad platform.
16505
+ */
16506
+ accountId: string;
16507
+ /**
16508
+ * The targeting spec to estimate. Same shape used by POST /v1/ads/create.
16509
+ */
16510
+ spec: (TargetingSpec);
16511
+ /**
16512
+ * Optional. The optimization goal the estimate should assume (platform's
16513
+ * own vocabulary, e.g. Meta `REACH`, `LINK_CLICKS`, `OFFSITE_CONVERSIONS`).
16514
+ * Some platforms vary the estimate by goal; omit to use the platform default.
16515
+ *
16516
+ */
16517
+ optimizationGoal?: string;
16518
+ };
16519
+ };
16520
+
16521
+ export type EstimateAdReachResponse = ({
16522
+ /**
16523
+ * Whether a pre-flight estimate is available on this platform. False for Google and TikTok.
16524
+ */
16525
+ available: boolean;
16526
+ /**
16527
+ * Lower bound of the estimated reachable audience. Present only when available.
16528
+ */
16529
+ lower?: (number) | null;
16530
+ /**
16531
+ * Upper bound of the estimated reachable audience. Present only when available.
16532
+ */
16533
+ upper?: (number) | null;
16534
+ /**
16535
+ * Optional estimated daily reach/results at the given budget, when the platform returns it.
16536
+ */
16537
+ daily?: (number) | null;
16538
+ /**
16539
+ * Currency of any monetary fields in the estimate, when applicable.
16540
+ */
16541
+ currency?: (string) | null;
16542
+ /**
16543
+ * Meta only. False when Meta is still computing the estimate (the audience is too new); retry shortly.
16544
+ */
16545
+ estimateReady?: (boolean) | null;
16546
+ });
16547
+
16548
+ export type EstimateAdReachError = (unknown | {
15560
16549
  error?: string;
15561
16550
  });
15562
16551
 
@@ -15570,7 +16559,11 @@ export type ListAdAudiencesData = {
15570
16559
  * Platform ad account ID
15571
16560
  */
15572
16561
  adAccountId: string;
15573
- platform?: 'facebook' | 'instagram' | 'googleads' | 'tiktok' | 'pinterest';
16562
+ platform?: 'facebook' | 'instagram' | 'googleads' | 'tiktok' | 'tiktokads' | 'pinterest' | 'linkedin' | 'linkedinads' | 'twitter' | 'xads';
16563
+ /**
16564
+ * Filter to one audience type. `saved_targeting` returns stored TargetingSpec audiences (each item carries a `spec`); the other types return uploaded/derived audiences.
16565
+ */
16566
+ type?: 'customer_list' | 'website' | 'lookalike' | 'saved_targeting';
15574
16567
  };
15575
16568
  };
15576
16569
 
@@ -15580,7 +16573,11 @@ export type ListAdAudiencesResponse = ({
15580
16573
  platformAudienceId?: string;
15581
16574
  name?: string;
15582
16575
  description?: string;
15583
- type?: 'customer_list' | 'website' | 'lookalike';
16576
+ type?: 'customer_list' | 'website' | 'lookalike' | 'saved_targeting';
16577
+ /**
16578
+ * Present (and the only meaningful payload) when `type` is `saved_targeting`. Null for uploaded/derived audience types.
16579
+ */
16580
+ spec?: ((TargetingSpec) | null);
15584
16581
  platform?: string;
15585
16582
  size?: number;
15586
16583
  status?: string;
@@ -15592,46 +16589,58 @@ export type ListAdAudiencesError = ({
15592
16589
  } | unknown);
15593
16590
 
15594
16591
  export type CreateAdAudienceData = {
15595
- body: {
15596
- accountId: string;
15597
- /**
15598
- * Must start with act_
15599
- */
15600
- adAccountId: string;
15601
- name: string;
15602
- description?: string;
15603
- type: 'customer_list' | 'website' | 'lookalike';
15604
- /**
15605
- * Required for website audiences
15606
- */
15607
- pixelId?: string;
15608
- /**
15609
- * Required for website audiences
15610
- */
15611
- retentionDays?: number;
15612
- /**
15613
- * Required for lookalike audiences
15614
- */
15615
- sourceAudienceId?: string;
15616
- /**
15617
- * 2-letter code, required for lookalike audiences
15618
- */
15619
- country?: string;
15620
- /**
15621
- * Required for lookalike audiences
15622
- */
15623
- ratio?: number;
15624
- /**
15625
- * Pixel event rule for website audiences (optional)
15626
- */
15627
- rule?: {
15628
- [key: string]: unknown;
15629
- };
15630
- /**
15631
- * Data source declaration for GDPR compliance (customer_list only)
15632
- */
15633
- customerFileSource?: string;
16592
+ body: ({
16593
+ accountId: string;
16594
+ /**
16595
+ * Platform ad account ID. Must start with act_ for Meta; bare platform id for others (Google customer id, X/TikTok/LinkedIn/Pinterest account id).
16596
+ */
16597
+ adAccountId: string;
16598
+ name: string;
16599
+ description?: string;
16600
+ type: 'customer_list' | 'website' | 'lookalike';
16601
+ /**
16602
+ * Required for website audiences
16603
+ */
16604
+ pixelId?: string;
16605
+ /**
16606
+ * Required for website audiences
16607
+ */
16608
+ retentionDays?: number;
16609
+ /**
16610
+ * Required for lookalike audiences
16611
+ */
16612
+ sourceAudienceId?: string;
16613
+ /**
16614
+ * 2-letter code, required for lookalike audiences
16615
+ */
16616
+ country?: string;
16617
+ /**
16618
+ * Required for lookalike audiences
16619
+ */
16620
+ ratio?: number;
16621
+ /**
16622
+ * Pixel event rule for website audiences (optional)
16623
+ */
16624
+ rule?: {
16625
+ [key: string]: unknown;
15634
16626
  };
16627
+ /**
16628
+ * Data source declaration for GDPR compliance (customer_list only)
16629
+ */
16630
+ customerFileSource?: string;
16631
+ } | {
16632
+ type: 'saved_targeting';
16633
+ /**
16634
+ * Social account ID on the target ad platform.
16635
+ */
16636
+ accountId: string;
16637
+ name: string;
16638
+ description?: string;
16639
+ /**
16640
+ * The targeting spec to store.
16641
+ */
16642
+ spec: (TargetingSpec);
16643
+ });
15635
16644
  };
15636
16645
 
15637
16646
  export type CreateAdAudienceResponse = ({