@zernio/node 0.2.157 → 0.2.169

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
  */
@@ -4101,6 +4329,71 @@ export type WebhookPayloadPostPlatform = {
4101
4329
 
4102
4330
  export type event12 = 'post.platform.published' | 'post.platform.failed';
4103
4331
 
4332
+ /**
4333
+ * Webhook payload for reaction received events (WhatsApp, Telegram)
4334
+ */
4335
+ export type WebhookPayloadReaction = {
4336
+ /**
4337
+ * Stable webhook event ID
4338
+ */
4339
+ id: string;
4340
+ event: 'reaction.received';
4341
+ reaction: {
4342
+ /**
4343
+ * The emoji reacted with. May be an empty string when `action` is
4344
+ * `removed` on WhatsApp (Meta does not report which emoji was removed).
4345
+ *
4346
+ */
4347
+ emoji: string;
4348
+ action: 'added' | 'removed';
4349
+ /**
4350
+ * Internal Zernio message ID of the reacted-to message, when resolvable from the platform ID.
4351
+ */
4352
+ messageId?: string;
4353
+ /**
4354
+ * Platform-native ID of the reacted-to message (e.g. WhatsApp wamid).
4355
+ */
4356
+ platformMessageId: string;
4357
+ /**
4358
+ * The participant who added or removed the reaction.
4359
+ */
4360
+ sender: {
4361
+ id: string;
4362
+ name?: string;
4363
+ username?: string;
4364
+ picture?: string;
4365
+ /**
4366
+ * WhatsApp only. Sender's phone number in E.164 format (with leading `+`), when available.
4367
+ */
4368
+ phoneNumber?: (string) | null;
4369
+ };
4370
+ reactedAt: string;
4371
+ };
4372
+ conversation: {
4373
+ id: string;
4374
+ platformConversationId: string;
4375
+ participantId?: string;
4376
+ participantName?: string;
4377
+ participantUsername?: string;
4378
+ participantPicture?: string;
4379
+ status: 'active' | 'archived';
4380
+ };
4381
+ account: {
4382
+ /**
4383
+ * Social account ID
4384
+ */
4385
+ id: string;
4386
+ platform: string;
4387
+ username: string;
4388
+ displayName?: string;
4389
+ };
4390
+ timestamp: string;
4391
+ };
4392
+
4393
+ export type event13 = 'reaction.received';
4394
+
4395
+ export type action = 'added' | 'removed';
4396
+
4104
4397
  /**
4105
4398
  * Webhook payload for the review.new event (new review posted on a connected account).
4106
4399
  */
@@ -4119,7 +4412,7 @@ export type WebhookPayloadReviewNew = {
4119
4412
  timestamp: string;
4120
4413
  };
4121
4414
 
4122
- export type event13 = 'review.new';
4415
+ export type event14 = 'review.new';
4123
4416
 
4124
4417
  /**
4125
4418
  * Webhook payload for the review.updated event. Fired when the reviewer edits
@@ -4143,7 +4436,7 @@ export type WebhookPayloadReviewUpdated = {
4143
4436
  timestamp: string;
4144
4437
  };
4145
4438
 
4146
- export type event14 = 'review.updated';
4439
+ export type event15 = 'review.updated';
4147
4440
 
4148
4441
  /**
4149
4442
  * Webhook payload for test deliveries
@@ -4161,7 +4454,7 @@ export type WebhookPayloadTest = {
4161
4454
  timestamp: string;
4162
4455
  };
4163
4456
 
4164
- export type event15 = 'webhook.test';
4457
+ export type event16 = 'webhook.test';
4165
4458
 
4166
4459
  /**
4167
4460
  * Webhook payload for the `whatsapp.template.status_updated` event.
@@ -4216,7 +4509,7 @@ export type WebhookPayloadWhatsAppTemplateStatusUpdated = {
4216
4509
  timestamp: string;
4217
4510
  };
4218
4511
 
4219
- export type event16 = 'whatsapp.template.status_updated';
4512
+ export type event17 = 'whatsapp.template.status_updated';
4220
4513
 
4221
4514
  export type platform8 = 'whatsapp';
4222
4515
 
@@ -4573,18 +4866,12 @@ export type ValidatePostData = {
4573
4866
  platformSpecificData?: {
4574
4867
  [key: string]: unknown;
4575
4868
  };
4576
- customMedia?: Array<{
4577
- url?: string;
4578
- type?: 'image' | 'video';
4579
- }>;
4869
+ customMedia?: Array<MediaItem>;
4580
4870
  }>;
4581
4871
  /**
4582
4872
  * Root media items shared across platforms
4583
4873
  */
4584
- mediaItems?: Array<{
4585
- url?: string;
4586
- type?: 'image' | 'video';
4587
- }>;
4874
+ mediaItems?: Array<MediaItem>;
4588
4875
  };
4589
4876
  };
4590
4877
 
@@ -5769,10 +6056,7 @@ export type CreatePostData = {
5769
6056
  * Post caption/text. Optional when media is attached or all platforms have customContent. Required for text-only posts.
5770
6057
  */
5771
6058
  content?: string;
5772
- mediaItems?: Array<{
5773
- type?: 'image' | 'video' | 'gif' | 'document';
5774
- url?: string;
5775
- }>;
6059
+ mediaItems?: Array<MediaItem>;
5776
6060
  /**
5777
6061
  * Target platforms and accounts for this post. Required for non-draft posts (returns 400 if empty). Drafts can omit platforms.
5778
6062
  */
@@ -5783,10 +6067,7 @@ export type CreatePostData = {
5783
6067
  * 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
6068
  */
5785
6069
  customContent?: string;
5786
- customMedia?: Array<{
5787
- type?: 'image' | 'video' | 'gif' | 'document';
5788
- url?: string;
5789
- }>;
6070
+ customMedia?: Array<MediaItem>;
5790
6071
  /**
5791
6072
  * Optional per-platform scheduled time override. When omitted, the top-level scheduledFor is used.
5792
6073
  */
@@ -5923,17 +6204,7 @@ export type BulkUploadPostsData = {
5923
6204
  };
5924
6205
  };
5925
6206
 
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);
6207
+ export type BulkUploadPostsResponse = (BulkUploadResult);
5937
6208
 
5938
6209
  export type BulkUploadPostsError = (unknown | {
5939
6210
  error?: string;
@@ -7202,7 +7473,7 @@ export type GetGoogleBusinessReviewsError = (ErrorResponse | {
7202
7473
  error?: string;
7203
7474
  });
7204
7475
 
7205
- export type GetGoogleBusinessFoodMenusData = {
7476
+ export type GetGoogleBusinessVerificationsData = {
7206
7477
  path: {
7207
7478
  /**
7208
7479
  * The Zernio account ID (from /v1/accounts)
@@ -7217,31 +7488,80 @@ export type GetGoogleBusinessFoodMenusData = {
7217
7488
  };
7218
7489
  };
7219
7490
 
7220
- export type GetGoogleBusinessFoodMenusResponse = ({
7491
+ export type GetGoogleBusinessVerificationsResponse = ({
7221
7492
  success?: boolean;
7222
7493
  accountId?: string;
7223
7494
  locationId?: string;
7224
7495
  /**
7225
- * Resource name of the food menus
7496
+ * Raw Voice of Merchant state from Google.
7226
7497
  */
7227
- name?: string;
7228
- menus?: Array<FoodMenu>;
7498
+ voiceOfMerchantState?: {
7499
+ /**
7500
+ * True when the listing is verified and published (eligible to surface reviews
7501
+ */
7502
+ hasVoiceOfMerchant?: boolean;
7503
+ /**
7504
+ * True when the authenticated user has owner/manager authority over the listing.
7505
+ */
7506
+ hasBusinessAuthority?: boolean;
7507
+ /**
7508
+ * Present when verification is the path to Voice of Merchant.
7509
+ */
7510
+ verify?: {
7511
+ /**
7512
+ * True when a verification is already in progress.
7513
+ */
7514
+ hasPendingVerification?: boolean;
7515
+ };
7516
+ };
7517
+ /**
7518
+ * Verification history, newest first. Empty when none exist.
7519
+ */
7520
+ verifications?: Array<{
7521
+ /**
7522
+ * Resource name, e.g. "locations/123/verifications/0T1776879124712". The last segment is the verificationId.
7523
+ */
7524
+ name?: string;
7525
+ /**
7526
+ * Method used (omitted on some entries).
7527
+ */
7528
+ method?: 'ADDRESS' | 'EMAIL' | 'PHONE_CALL' | 'SMS' | 'AUTO' | 'VETTED_PARTNER';
7529
+ state?: 'PENDING' | 'COMPLETED' | 'FAILED';
7530
+ createTime?: string;
7531
+ }>;
7229
7532
  });
7230
7533
 
7231
- export type GetGoogleBusinessFoodMenusError = (ErrorResponse | {
7534
+ export type GetGoogleBusinessVerificationsError = (ErrorResponse | {
7232
7535
  error?: string;
7233
7536
  });
7234
7537
 
7235
- export type UpdateGoogleBusinessFoodMenusData = {
7538
+ export type StartGoogleBusinessVerificationData = {
7236
7539
  body: {
7237
7540
  /**
7238
- * Array of food menus to set
7541
+ * The verification method. Selects which method-specific field below is required.
7239
7542
  */
7240
- menus: Array<FoodMenu>;
7543
+ method: 'ADDRESS' | 'EMAIL' | 'PHONE_CALL' | 'SMS' | 'AUTO' | 'VETTED_PARTNER';
7544
+ languageCode?: string;
7241
7545
  /**
7242
- * Field mask for partial updates (e.g. "menus")
7546
+ * For PHONE_CALL / SMS.
7243
7547
  */
7244
- updateMask?: string;
7548
+ phoneNumber?: string;
7549
+ /**
7550
+ * For EMAIL.
7551
+ */
7552
+ emailAddress?: string;
7553
+ /**
7554
+ * For ADDRESS (postcard) verification.
7555
+ */
7556
+ mailerContact?: {
7557
+ [key: string]: unknown;
7558
+ };
7559
+ /**
7560
+ * ServiceBusinessContext (e.g. service address). Required for service-area businesses.
7561
+ */
7562
+ context?: {
7563
+ [key: string]: unknown;
7564
+ };
7245
7565
  };
7246
7566
  path: {
7247
7567
  /**
@@ -7251,25 +7571,178 @@ export type UpdateGoogleBusinessFoodMenusData = {
7251
7571
  };
7252
7572
  query?: {
7253
7573
  /**
7254
- * Override which location to target. If omitted, uses the account's selected location. Use GET /gmb-locations to list valid IDs.
7574
+ * Override which location to target. If omitted, uses the account's selected location.
7255
7575
  */
7256
7576
  locationId?: string;
7257
7577
  };
7258
7578
  };
7259
7579
 
7260
- export type UpdateGoogleBusinessFoodMenusResponse = ({
7580
+ export type StartGoogleBusinessVerificationResponse = ({
7261
7581
  success?: boolean;
7262
7582
  accountId?: string;
7263
7583
  locationId?: string;
7264
- name?: string;
7265
- menus?: Array<FoodMenu>;
7584
+ verification?: {
7585
+ name?: string;
7586
+ method?: 'ADDRESS' | 'EMAIL' | 'PHONE_CALL' | 'SMS' | 'AUTO' | 'VETTED_PARTNER';
7587
+ state?: 'PENDING' | 'COMPLETED' | 'FAILED';
7588
+ createTime?: string;
7589
+ };
7266
7590
  });
7267
7591
 
7268
- export type UpdateGoogleBusinessFoodMenusError = (ErrorResponse | {
7592
+ export type StartGoogleBusinessVerificationError = (ErrorResponse | {
7269
7593
  error?: string;
7270
7594
  });
7271
7595
 
7272
- export type GetGoogleBusinessLocationDetailsData = {
7596
+ export type FetchGoogleBusinessVerificationOptionsData = {
7597
+ body: {
7598
+ languageCode: string;
7599
+ /**
7600
+ * ServiceBusinessContext. Required for service-area businesses (must include the service address).
7601
+ */
7602
+ context?: {
7603
+ [key: string]: unknown;
7604
+ };
7605
+ };
7606
+ path: {
7607
+ /**
7608
+ * The Zernio account ID (from /v1/accounts)
7609
+ */
7610
+ accountId: string;
7611
+ };
7612
+ query?: {
7613
+ /**
7614
+ * Override which location to query. If omitted, uses the account's selected location.
7615
+ */
7616
+ locationId?: string;
7617
+ };
7618
+ };
7619
+
7620
+ export type FetchGoogleBusinessVerificationOptionsResponse = ({
7621
+ success?: boolean;
7622
+ accountId?: string;
7623
+ locationId?: string;
7624
+ options?: Array<{
7625
+ verificationMethod?: 'ADDRESS' | 'EMAIL' | 'PHONE_CALL' | 'SMS' | 'AUTO' | 'VETTED_PARTNER';
7626
+ /**
7627
+ * Present for PHONE_CALL / SMS.
7628
+ */
7629
+ phoneNumber?: string;
7630
+ }>;
7631
+ });
7632
+
7633
+ export type FetchGoogleBusinessVerificationOptionsError = (ErrorResponse | {
7634
+ error?: string;
7635
+ });
7636
+
7637
+ export type CompleteGoogleBusinessVerificationData = {
7638
+ body: {
7639
+ /**
7640
+ * The code Google sent to the business.
7641
+ */
7642
+ pin: string;
7643
+ };
7644
+ path: {
7645
+ /**
7646
+ * The Zernio account ID (from /v1/accounts)
7647
+ */
7648
+ accountId: string;
7649
+ /**
7650
+ * The last segment of a verification `name` from GET /gmb-verifications.
7651
+ */
7652
+ verificationId: string;
7653
+ };
7654
+ query?: {
7655
+ /**
7656
+ * Override which location to target. If omitted, uses the account's selected location.
7657
+ */
7658
+ locationId?: string;
7659
+ };
7660
+ };
7661
+
7662
+ export type CompleteGoogleBusinessVerificationResponse = ({
7663
+ success?: boolean;
7664
+ accountId?: string;
7665
+ locationId?: string;
7666
+ verification?: {
7667
+ name?: string;
7668
+ method?: 'ADDRESS' | 'EMAIL' | 'PHONE_CALL' | 'SMS' | 'AUTO' | 'VETTED_PARTNER';
7669
+ state?: 'PENDING' | 'COMPLETED' | 'FAILED';
7670
+ createTime?: string;
7671
+ };
7672
+ });
7673
+
7674
+ export type CompleteGoogleBusinessVerificationError = (ErrorResponse | {
7675
+ error?: string;
7676
+ });
7677
+
7678
+ export type GetGoogleBusinessFoodMenusData = {
7679
+ path: {
7680
+ /**
7681
+ * The Zernio account ID (from /v1/accounts)
7682
+ */
7683
+ accountId: string;
7684
+ };
7685
+ query?: {
7686
+ /**
7687
+ * Override which location to query. If omitted, uses the account's selected location. Use GET /gmb-locations to list valid IDs.
7688
+ */
7689
+ locationId?: string;
7690
+ };
7691
+ };
7692
+
7693
+ export type GetGoogleBusinessFoodMenusResponse = ({
7694
+ success?: boolean;
7695
+ accountId?: string;
7696
+ locationId?: string;
7697
+ /**
7698
+ * Resource name of the food menus
7699
+ */
7700
+ name?: string;
7701
+ menus?: Array<FoodMenu>;
7702
+ });
7703
+
7704
+ export type GetGoogleBusinessFoodMenusError = (ErrorResponse | {
7705
+ error?: string;
7706
+ });
7707
+
7708
+ export type UpdateGoogleBusinessFoodMenusData = {
7709
+ body: {
7710
+ /**
7711
+ * Array of food menus to set
7712
+ */
7713
+ menus: Array<FoodMenu>;
7714
+ /**
7715
+ * Field mask for partial updates (e.g. "menus")
7716
+ */
7717
+ updateMask?: string;
7718
+ };
7719
+ path: {
7720
+ /**
7721
+ * The Zernio account ID (from /v1/accounts)
7722
+ */
7723
+ accountId: string;
7724
+ };
7725
+ query?: {
7726
+ /**
7727
+ * Override which location to target. If omitted, uses the account's selected location. Use GET /gmb-locations to list valid IDs.
7728
+ */
7729
+ locationId?: string;
7730
+ };
7731
+ };
7732
+
7733
+ export type UpdateGoogleBusinessFoodMenusResponse = ({
7734
+ success?: boolean;
7735
+ accountId?: string;
7736
+ locationId?: string;
7737
+ name?: string;
7738
+ menus?: Array<FoodMenu>;
7739
+ });
7740
+
7741
+ export type UpdateGoogleBusinessFoodMenusError = (ErrorResponse | {
7742
+ error?: string;
7743
+ });
7744
+
7745
+ export type GetGoogleBusinessLocationDetailsData = {
7273
7746
  path: {
7274
7747
  /**
7275
7748
  * The Zernio account ID (from /v1/accounts)
@@ -9692,7 +10165,7 @@ export type CreateWebhookSettingsData = {
9692
10165
  /**
9693
10166
  * Events to subscribe to (at least one required)
9694
10167
  */
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')>;
10168
+ 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
10169
  /**
9697
10170
  * Enable or disable webhook delivery. Defaults to `true` when omitted.
9698
10171
  */
@@ -9736,7 +10209,7 @@ export type UpdateWebhookSettingsData = {
9736
10209
  /**
9737
10210
  * Events to subscribe to. Must contain at least one event if provided.
9738
10211
  */
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')>;
10212
+ 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
10213
  /**
9741
10214
  * Enable or disable webhook delivery
9742
10215
  */
@@ -10695,6 +11168,33 @@ export type SendTypingIndicatorError = ({
10695
11168
  error?: string;
10696
11169
  } | unknown);
10697
11170
 
11171
+ export type MarkConversationReadData = {
11172
+ body: {
11173
+ /**
11174
+ * Social account ID
11175
+ */
11176
+ accountId: string;
11177
+ };
11178
+ path: {
11179
+ /**
11180
+ * The conversation ID
11181
+ */
11182
+ conversationId: string;
11183
+ };
11184
+ };
11185
+
11186
+ export type MarkConversationReadResponse = ({
11187
+ success?: boolean;
11188
+ /**
11189
+ * Number of messages marked read by this call
11190
+ */
11191
+ markedCount?: number;
11192
+ });
11193
+
11194
+ export type MarkConversationReadError = ({
11195
+ error?: string;
11196
+ } | unknown);
11197
+
10698
11198
  export type AddMessageReactionData = {
10699
11199
  body: {
10700
11200
  /**
@@ -11130,6 +11630,63 @@ export type GetInboxPostCommentsResponse = ({
11130
11630
  */
11131
11631
  rootCid?: (string) | null;
11132
11632
  }>;
11633
+ /**
11634
+ * (Reddit only) Metadata for the target post, returned alongside the comments in Reddit's
11635
+ * single round-trip. Lets integrators render a preview of the post the user is commenting on
11636
+ * without an additional request. Absent for non-Reddit platforms and when the upstream
11637
+ * response is missing the post listing (deleted post, malformed response).
11638
+ *
11639
+ */
11640
+ post?: {
11641
+ /**
11642
+ * Reddit post base36 id (e.g. "1tjtj26")
11643
+ */
11644
+ id?: string;
11645
+ /**
11646
+ * Fullname with type prefix (e.g. "t3_1tjtj26")
11647
+ */
11648
+ fullname?: string;
11649
+ title?: string;
11650
+ /**
11651
+ * Body text for self-posts (empty for link posts)
11652
+ */
11653
+ selftext?: string;
11654
+ /**
11655
+ * Reddit username
11656
+ */
11657
+ author?: string;
11658
+ /**
11659
+ * Subreddit name
11660
+ */
11661
+ subreddit?: string;
11662
+ /**
11663
+ * Absolute URL to the post on reddit.com
11664
+ */
11665
+ permalink?: string;
11666
+ /**
11667
+ * For link posts
11668
+ */
11669
+ url?: string;
11670
+ /**
11671
+ * Net upvotes (upvotes minus downvotes)
11672
+ */
11673
+ score?: number;
11674
+ numComments?: number;
11675
+ /**
11676
+ * Unix timestamp in seconds
11677
+ */
11678
+ createdUtc?: number;
11679
+ over18?: boolean;
11680
+ stickied?: boolean;
11681
+ /**
11682
+ * Link flair text if any
11683
+ */
11684
+ flairText?: (string) | null;
11685
+ /**
11686
+ * True if the post is a Reddit gallery (multiple images)
11687
+ */
11688
+ isGallery?: boolean;
11689
+ } | null;
11133
11690
  pagination?: {
11134
11691
  hasMore?: boolean;
11135
11692
  cursor?: (string) | null;
@@ -13301,6 +13858,18 @@ export type CreateBroadcastData = {
13301
13858
  name?: string;
13302
13859
  language?: string;
13303
13860
  components?: unknown[];
13861
+ /**
13862
+ * Maps template variable positions ("1", "2") to contact fields or static values. Resolved per recipient at send time.
13863
+ */
13864
+ variableMapping?: {
13865
+ [key: string]: {
13866
+ field?: 'name' | 'phone' | 'email' | 'company' | 'custom';
13867
+ /**
13868
+ * Static value used when field is "custom"
13869
+ */
13870
+ customValue?: string;
13871
+ };
13872
+ };
13304
13873
  };
13305
13874
  segmentFilters?: {
13306
13875
  tags?: Array<(string)>;
@@ -15141,9 +15710,13 @@ export type CreateStandaloneAdData = {
15141
15710
  */
15142
15711
  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
15712
  /**
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`.
15713
+ * 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
15714
  */
15146
15715
  linkUrl?: string;
15716
+ /**
15717
+ * 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.
15718
+ */
15719
+ leadGenFormId?: string;
15147
15720
  /**
15148
15721
  * 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
15722
  */
@@ -15268,6 +15841,63 @@ export type CreateStandaloneAdData = {
15268
15841
  id: string;
15269
15842
  name: string;
15270
15843
  }>;
15844
+ /**
15845
+ * 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.
15846
+ */
15847
+ zips?: Array<{
15848
+ key: string;
15849
+ name?: string;
15850
+ }>;
15851
+ /**
15852
+ * DMA / metro-area geo targeting. `key` is the platform's metro ID from /v1/ads/targeting/search?dimension=geo&geoType=metro.
15853
+ */
15854
+ metros?: Array<{
15855
+ key: string;
15856
+ name?: string;
15857
+ }>;
15858
+ /**
15859
+ * Point-radius (lat/lng) geo targeting. Meta only (custom_locations). Rejected on platforms without radius support.
15860
+ */
15861
+ customLocations?: Array<{
15862
+ latitude: number;
15863
+ longitude: number;
15864
+ radius: number;
15865
+ distanceUnit: 'mile' | 'kilometer';
15866
+ name?: string;
15867
+ address?: string;
15868
+ }>;
15869
+ /**
15870
+ * Behaviour entities from /v1/ads/targeting/search?dimension=behavior. Supported on Meta and TikTok. Each must include id.
15871
+ */
15872
+ behaviors?: Array<{
15873
+ id: string;
15874
+ name?: string;
15875
+ }>;
15876
+ /**
15877
+ * Normalized household-income tier. Meta and TikTok express all four; Google maps only
15878
+ * `top_10`; rejected on LinkedIn, X, and Pinterest. On Meta, income targeting is incompatible
15879
+ * with housing/employment/credit `specialAdCategories`.
15880
+ *
15881
+ */
15882
+ incomeTier?: 'top_5' | 'top_10' | 'top_10_25' | 'top_25_50';
15883
+ /**
15884
+ * Language codes (e.g. ['en']). Restricts the audience by language.
15885
+ */
15886
+ languages?: Array<(string)>;
15887
+ /**
15888
+ * ID of a `saved_targeting` audience (created via POST /v1/ads/audiences). When set, its stored
15889
+ * TargetingSpec is expanded as the base targeting; inline fields on this body merge on top. Lets you
15890
+ * reuse a named targeting preset without re-sending every field.
15891
+ *
15892
+ */
15893
+ savedTargetingId?: string;
15894
+ /**
15895
+ * Meta only. Declares the ad's special category, required for housing, employment, credit, or
15896
+ * political/social-issue ads (Meta enforces restricted targeting for these). Note: setting a special
15897
+ * category disables income/zip targeting on Meta.
15898
+ *
15899
+ */
15900
+ specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'ISSUES_ELECTIONS_POLITICS')>;
15271
15901
  /**
15272
15902
  * Required for lifetime budgets
15273
15903
  */
@@ -15480,6 +16110,249 @@ export type CreateStandaloneAdError = (unknown | {
15480
16110
  error?: string;
15481
16111
  });
15482
16112
 
16113
+ export type ListLeadsData = {
16114
+ query?: {
16115
+ /**
16116
+ * Filter to a single connected account.
16117
+ */
16118
+ accountId?: string;
16119
+ /**
16120
+ * Keyset cursor from a previous response's pagination.cursor.
16121
+ */
16122
+ cursor?: string;
16123
+ /**
16124
+ * Filter to a single lead form.
16125
+ */
16126
+ formId?: string;
16127
+ limit?: number;
16128
+ /**
16129
+ * Unix seconds; only leads created at/after this Meta timestamp.
16130
+ */
16131
+ since?: number;
16132
+ };
16133
+ };
16134
+
16135
+ export type ListLeadsResponse = ({
16136
+ status?: string;
16137
+ leads?: Array<{
16138
+ /**
16139
+ * Zernio lead id.
16140
+ */
16141
+ id?: string;
16142
+ /**
16143
+ * Meta lead id.
16144
+ */
16145
+ leadgenId?: string;
16146
+ formId?: string;
16147
+ formName?: (string) | null;
16148
+ accountId?: string;
16149
+ adId?: (string) | null;
16150
+ adsetId?: (string) | null;
16151
+ campaignId?: (string) | null;
16152
+ isOrganic?: boolean;
16153
+ /**
16154
+ * ISO 8601.
16155
+ */
16156
+ createdTime?: (string) | null;
16157
+ /**
16158
+ * Question key → answer.
16159
+ */
16160
+ fields?: {
16161
+ [key: string]: (string);
16162
+ };
16163
+ /**
16164
+ * Raw Meta field_data.
16165
+ */
16166
+ fieldData?: Array<{
16167
+ [key: string]: unknown;
16168
+ }>;
16169
+ }>;
16170
+ pagination?: {
16171
+ hasMore?: boolean;
16172
+ cursor?: (string) | null;
16173
+ };
16174
+ });
16175
+
16176
+ export type ListLeadsError = ({
16177
+ error?: string;
16178
+ } | unknown);
16179
+
16180
+ export type ListLeadFormsData = {
16181
+ query: {
16182
+ /**
16183
+ * Connected facebook account id.
16184
+ */
16185
+ accountId: string;
16186
+ cursor?: string;
16187
+ limit?: number;
16188
+ };
16189
+ };
16190
+
16191
+ export type ListLeadFormsResponse = ({
16192
+ status?: string;
16193
+ forms?: Array<{
16194
+ [key: string]: unknown;
16195
+ }>;
16196
+ pagination?: {
16197
+ hasMore?: boolean;
16198
+ cursor?: (string) | null;
16199
+ };
16200
+ });
16201
+
16202
+ export type ListLeadFormsError = ({
16203
+ error?: string;
16204
+ } | unknown);
16205
+
16206
+ export type CreateLeadFormData = {
16207
+ body: {
16208
+ accountId: string;
16209
+ name: string;
16210
+ questions: Array<{
16211
+ /**
16212
+ * EMAIL, PHONE, FULL_NAME, FIRST_NAME, LAST_NAME, CUSTOM, …
16213
+ */
16214
+ type: string;
16215
+ /**
16216
+ * CUSTOM questions only.
16217
+ */
16218
+ key?: string;
16219
+ /**
16220
+ * CUSTOM questions only.
16221
+ */
16222
+ label?: string;
16223
+ options?: Array<{
16224
+ key?: string;
16225
+ value?: string;
16226
+ }>;
16227
+ inline_context?: string;
16228
+ }>;
16229
+ privacyPolicyUrl: string;
16230
+ privacyPolicyLinkText?: string;
16231
+ followUpActionUrl?: string;
16232
+ locale?: string;
16233
+ thankYouTitle?: string;
16234
+ thankYouBody?: string;
16235
+ thankYouButtonText?: string;
16236
+ thankYouButtonType?: string;
16237
+ thankYouWebsiteUrl?: string;
16238
+ isOptimizedForQuality?: boolean;
16239
+ };
16240
+ };
16241
+
16242
+ export type CreateLeadFormResponse = ({
16243
+ status?: string;
16244
+ form?: {
16245
+ id?: string;
16246
+ name?: string;
16247
+ };
16248
+ });
16249
+
16250
+ export type CreateLeadFormError = ({
16251
+ error?: string;
16252
+ } | unknown);
16253
+
16254
+ export type GetLeadFormData = {
16255
+ path: {
16256
+ formId: string;
16257
+ };
16258
+ query: {
16259
+ accountId: string;
16260
+ };
16261
+ };
16262
+
16263
+ export type GetLeadFormResponse = ({
16264
+ status?: string;
16265
+ form?: {
16266
+ [key: string]: unknown;
16267
+ };
16268
+ });
16269
+
16270
+ export type GetLeadFormError = ({
16271
+ error?: string;
16272
+ });
16273
+
16274
+ export type ArchiveLeadFormData = {
16275
+ path: {
16276
+ formId: string;
16277
+ };
16278
+ query: {
16279
+ accountId: string;
16280
+ };
16281
+ };
16282
+
16283
+ export type ArchiveLeadFormResponse = ({
16284
+ status?: string;
16285
+ formId?: string;
16286
+ archived?: boolean;
16287
+ });
16288
+
16289
+ export type ArchiveLeadFormError = ({
16290
+ error?: string;
16291
+ });
16292
+
16293
+ export type ListFormLeadsData = {
16294
+ path: {
16295
+ formId: string;
16296
+ };
16297
+ query: {
16298
+ accountId: string;
16299
+ cursor?: string;
16300
+ limit?: number;
16301
+ /**
16302
+ * Unix seconds.
16303
+ */
16304
+ since?: number;
16305
+ };
16306
+ };
16307
+
16308
+ export type ListFormLeadsResponse = ({
16309
+ status?: string;
16310
+ leads?: Array<{
16311
+ id?: string;
16312
+ createdTime?: (string) | null;
16313
+ adId?: (string) | null;
16314
+ formId?: string;
16315
+ fields?: {
16316
+ [key: string]: (string);
16317
+ };
16318
+ fieldData?: Array<{
16319
+ [key: string]: unknown;
16320
+ }>;
16321
+ }>;
16322
+ pagination?: {
16323
+ hasMore?: boolean;
16324
+ cursor?: (string) | null;
16325
+ };
16326
+ });
16327
+
16328
+ export type ListFormLeadsError = ({
16329
+ error?: string;
16330
+ });
16331
+
16332
+ export type CreateTestLeadData = {
16333
+ body: {
16334
+ accountId: string;
16335
+ fieldData: Array<{
16336
+ name: string;
16337
+ values: Array<(string)>;
16338
+ }>;
16339
+ };
16340
+ path: {
16341
+ formId: string;
16342
+ };
16343
+ };
16344
+
16345
+ export type CreateTestLeadResponse = ({
16346
+ status?: string;
16347
+ testLead?: {
16348
+ id?: string;
16349
+ };
16350
+ });
16351
+
16352
+ export type CreateTestLeadError = ({
16353
+ error?: string;
16354
+ });
16355
+
15483
16356
  export type SearchAdInterestsData = {
15484
16357
  query: {
15485
16358
  /**
@@ -15505,58 +16378,112 @@ export type SearchAdInterestsError = ({
15505
16378
  error?: string;
15506
16379
  } | unknown);
15507
16380
 
15508
- export type SearchAdTargetingLocationsData = {
16381
+ export type SearchAdTargetingData = {
15509
16382
  query: {
15510
16383
  /**
15511
- * Social account ID (must be a connected Facebook or Instagram account).
16384
+ * Social account ID (a connected account on the target ad platform).
15512
16385
  */
15513
16386
  accountId: string;
15514
16387
  /**
15515
- * ISO 3166-1 alpha-2 country code (e.g. NL) to scope the search.
16388
+ * ISO 3166-1 alpha-2 country code (e.g. NL) to scope a geo search.
15516
16389
  */
15517
16390
  countryCode?: string;
16391
+ /**
16392
+ * 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.
16393
+ */
16394
+ dimension?: 'geo' | 'interest' | 'behavior' | 'income';
16395
+ /**
16396
+ * Only used when `dimension=geo`. The kind of location to resolve. Defaults to `city`.
16397
+ */
16398
+ geoType?: 'country' | 'region' | 'city' | 'zip' | 'metro';
15518
16399
  /**
15519
16400
  * Maximum results to return.
15520
16401
  */
15521
16402
  limit?: number;
15522
16403
  /**
15523
- * Location name. Locality only no region/country suffix.
16404
+ * Search query. For geo, the locality name only (no region/country suffix).
15524
16405
  */
15525
16406
  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
16407
  };
15531
16408
  };
15532
16409
 
15533
- export type SearchAdTargetingLocationsResponse = ({
16410
+ export type SearchAdTargetingResponse = ({
15534
16411
  results?: Array<{
15535
16412
  /**
15536
- * Meta's opaque location ID. Use this in targeting.cities[].key / regions[].key.
16413
+ * The platform's opaque id. Use as a geo `key` (regions/cities/zips/metros) or an entity `id` (interests/behaviors) in TargetingSpec.
16414
+ */
16415
+ id: string;
16416
+ /**
16417
+ * Human-readable label.
15537
16418
  */
15538
- key: string;
15539
16419
  name: string;
15540
16420
  /**
15541
- * Location type as returned by Meta (city, region, country, etc.).
16421
+ * What the result is (e.g. city, region, country, zip, metro, interest, behavior, income).
15542
16422
  */
15543
16423
  type: string;
15544
- countryCode?: string;
15545
- countryName?: string;
15546
16424
  /**
15547
- * Parent region/state name (cities only).
16425
+ * Optional breadcrumb of parent labels (e.g. ['United States', 'California', 'Los Angeles']). Disambiguates same-named results.
15548
16426
  */
15549
- region?: string;
16427
+ path?: Array<(string)>;
15550
16428
  /**
15551
- * Parent region ID (cities only).
16429
+ * Optional estimated reachable users for this option, when the platform returns it.
15552
16430
  */
15553
- regionId?: (string | number);
15554
- supportsRegion?: boolean;
15555
- supportsCity?: boolean;
16431
+ audienceSize?: (number) | null;
15556
16432
  }>;
15557
16433
  });
15558
16434
 
15559
- export type SearchAdTargetingLocationsError = (unknown | {
16435
+ export type SearchAdTargetingError = (unknown | {
16436
+ error?: string;
16437
+ });
16438
+
16439
+ export type EstimateAdReachData = {
16440
+ body: {
16441
+ /**
16442
+ * Social account ID on the target ad platform.
16443
+ */
16444
+ accountId: string;
16445
+ /**
16446
+ * The targeting spec to estimate. Same shape used by POST /v1/ads/create.
16447
+ */
16448
+ spec: (TargetingSpec);
16449
+ /**
16450
+ * Optional. The optimization goal the estimate should assume (platform's
16451
+ * own vocabulary, e.g. Meta `REACH`, `LINK_CLICKS`, `OFFSITE_CONVERSIONS`).
16452
+ * Some platforms vary the estimate by goal; omit to use the platform default.
16453
+ *
16454
+ */
16455
+ optimizationGoal?: string;
16456
+ };
16457
+ };
16458
+
16459
+ export type EstimateAdReachResponse = ({
16460
+ /**
16461
+ * Whether a pre-flight estimate is available on this platform. False for Google and TikTok.
16462
+ */
16463
+ available: boolean;
16464
+ /**
16465
+ * Lower bound of the estimated reachable audience. Present only when available.
16466
+ */
16467
+ lower?: (number) | null;
16468
+ /**
16469
+ * Upper bound of the estimated reachable audience. Present only when available.
16470
+ */
16471
+ upper?: (number) | null;
16472
+ /**
16473
+ * Optional estimated daily reach/results at the given budget, when the platform returns it.
16474
+ */
16475
+ daily?: (number) | null;
16476
+ /**
16477
+ * Currency of any monetary fields in the estimate, when applicable.
16478
+ */
16479
+ currency?: (string) | null;
16480
+ /**
16481
+ * Meta only. False when Meta is still computing the estimate (the audience is too new); retry shortly.
16482
+ */
16483
+ estimateReady?: (boolean) | null;
16484
+ });
16485
+
16486
+ export type EstimateAdReachError = (unknown | {
15560
16487
  error?: string;
15561
16488
  });
15562
16489
 
@@ -15570,7 +16497,11 @@ export type ListAdAudiencesData = {
15570
16497
  * Platform ad account ID
15571
16498
  */
15572
16499
  adAccountId: string;
15573
- platform?: 'facebook' | 'instagram' | 'googleads' | 'tiktok' | 'pinterest';
16500
+ platform?: 'facebook' | 'instagram' | 'googleads' | 'tiktok' | 'tiktokads' | 'pinterest' | 'linkedin' | 'linkedinads' | 'twitter' | 'xads';
16501
+ /**
16502
+ * Filter to one audience type. `saved_targeting` returns stored TargetingSpec audiences (each item carries a `spec`); the other types return uploaded/derived audiences.
16503
+ */
16504
+ type?: 'customer_list' | 'website' | 'lookalike' | 'saved_targeting';
15574
16505
  };
15575
16506
  };
15576
16507
 
@@ -15580,7 +16511,11 @@ export type ListAdAudiencesResponse = ({
15580
16511
  platformAudienceId?: string;
15581
16512
  name?: string;
15582
16513
  description?: string;
15583
- type?: 'customer_list' | 'website' | 'lookalike';
16514
+ type?: 'customer_list' | 'website' | 'lookalike' | 'saved_targeting';
16515
+ /**
16516
+ * Present (and the only meaningful payload) when `type` is `saved_targeting`. Null for uploaded/derived audience types.
16517
+ */
16518
+ spec?: ((TargetingSpec) | null);
15584
16519
  platform?: string;
15585
16520
  size?: number;
15586
16521
  status?: string;
@@ -15592,46 +16527,58 @@ export type ListAdAudiencesError = ({
15592
16527
  } | unknown);
15593
16528
 
15594
16529
  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;
16530
+ body: ({
16531
+ accountId: string;
16532
+ /**
16533
+ * Platform ad account ID. Must start with act_ for Meta; bare platform id for others (Google customer id, X/TikTok/LinkedIn/Pinterest account id).
16534
+ */
16535
+ adAccountId: string;
16536
+ name: string;
16537
+ description?: string;
16538
+ type: 'customer_list' | 'website' | 'lookalike';
16539
+ /**
16540
+ * Required for website audiences
16541
+ */
16542
+ pixelId?: string;
16543
+ /**
16544
+ * Required for website audiences
16545
+ */
16546
+ retentionDays?: number;
16547
+ /**
16548
+ * Required for lookalike audiences
16549
+ */
16550
+ sourceAudienceId?: string;
16551
+ /**
16552
+ * 2-letter code, required for lookalike audiences
16553
+ */
16554
+ country?: string;
16555
+ /**
16556
+ * Required for lookalike audiences
16557
+ */
16558
+ ratio?: number;
16559
+ /**
16560
+ * Pixel event rule for website audiences (optional)
16561
+ */
16562
+ rule?: {
16563
+ [key: string]: unknown;
15634
16564
  };
16565
+ /**
16566
+ * Data source declaration for GDPR compliance (customer_list only)
16567
+ */
16568
+ customerFileSource?: string;
16569
+ } | {
16570
+ type: 'saved_targeting';
16571
+ /**
16572
+ * Social account ID on the target ad platform.
16573
+ */
16574
+ accountId: string;
16575
+ name: string;
16576
+ description?: string;
16577
+ /**
16578
+ * The targeting spec to store.
16579
+ */
16580
+ spec: (TargetingSpec);
16581
+ });
15635
16582
  };
15636
16583
 
15637
16584
  export type CreateAdAudienceResponse = ({