@zernio/node 0.2.731 → 0.2.732

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.
@@ -910,6 +910,124 @@ export type AdNegativeKeywordListKeyword = {
910
910
 
911
911
  export type matchType2 = 'broad' | 'phrase' | 'exact';
912
912
 
913
+ /**
914
+ * What the ad optimises against. Behaviour depends on the platform.
915
+ *
916
+ * **Meta**: forwarded to the ad set's `promoted_object` (snake-cased).
917
+ * For `goal: app_promotion`, it is also sent on the campaign only when
918
+ * `isSkadnetworkAttribution: true`. Plain Android app installs keep the
919
+ * existing campaign payload, with the promoted object only on the ad set.
920
+ * POST /v1/ads/campaigns forwards this object only for that explicit SKAN flag.
921
+ * Required for goals whose ad-set optimization_goal points at a specific
922
+ * event/page/app (without it Meta rejects the ad-set create with
923
+ * `error_subcode: 1815430` "Please select a promoted object for your ad set"):
924
+ * - `goal: conversions` / `lead_conversion` (OFFSITE_CONVERSIONS): requires `pixelId` + `customEventType`, or `customConversionId` when optimising against a Custom Conversion (the conversion carries its own event definition). For a pixel CUSTOM event (one you named yourself in CAPI/Events Manager), send `customEventType: OTHER` + `customEventStr` with the event name.
925
+ * - `goal: app_promotion` (APP_INSTALLS): requires `applicationId` + `objectStoreUrl`
926
+ * - `goal: lead_generation` (LEAD_GENERATION): `pageId` is auto-filled from the connected Page when omitted
927
+ *
928
+ * Other Meta goals (engagement, traffic, awareness, video_views) ignore this field.
929
+ *
930
+ * **TikTok**: used by `goal: conversions` and the Smart+ goals (`smartPlus: true`).
931
+ * - `pixelId` maps to the ad group's `pixel_id`. Required: a TikTok website-conversion
932
+ * ad group without a pixel is rejected with `40002: Please select a pixel`.
933
+ * - `customEventType` maps to the ad group's `optimization_event` (the pixel event to
934
+ * optimise for). Optional on the regular conversions flow, required on Smart+.
935
+ * See the `customEventType` field below for the valid TikTok codes.
936
+ * - `applicationId` (Smart+ `goal: app_promotion` only) maps to the ad group's `app_id`:
937
+ * the App ID of an app registered on the TikTok Ads account (Assets → Events →
938
+ * App Events). Install optimization needs the app's MMP tracking configured.
939
+ *
940
+ * The remaining `promotedObject.*` fields are Meta-only. Platforms other than
941
+ * Meta and TikTok ignore `promotedObject` entirely.
942
+ *
943
+ */
944
+ export type AdPromotedObject = {
945
+ /**
946
+ * Pixel ID. **Meta:** Facebook Pixel ID, required for `goal: conversions`.
947
+ * Requires `customEventType` alongside it; Meta rejects any promoted_object
948
+ * carrying `pixel_id` without `custom_event_type` (error_subcode 1885014),
949
+ * even when `customConversionId` is also present.
950
+ * **TikTok:** TikTok Pixel ID, required for `goal: conversions`.
951
+ * To discover the pixels an ad account can use, call
952
+ * `GET /v1/accounts/{accountId}/tracking-tags?adAccountId=act_...` (each entry
953
+ * carries `kind` and `ownerAdAccountId`), or
954
+ * `GET /v1/accounts/{accountId}/conversion-destinations`. Note this is a
955
+ * different resource from `GET /v1/ads/{adId}/tracking-tags`, which reads an
956
+ * ad's click-URL params (`url_tags`), not pixels.
957
+ *
958
+ */
959
+ pixelId?: string;
960
+ /**
961
+ * The event the campaign/ad group optimises against.
962
+ *
963
+ * **Meta:** standard event like `PURCHASE`, `LEAD`, `COMPLETE_REGISTRATION`,
964
+ * `ADD_TO_CART`. Uppercased internally so callers can pass any case. Required
965
+ * for `goal: conversions`.
966
+ *
967
+ * **TikTok:** an `optimization_event` code (UPPER_SNAKE, not Meta's vocabulary
968
+ * and not PascalCase), OR the exact event name shown in TikTok Events Manager
969
+ * (auto-resolved to its code). Must be one of the event types your TikTok
970
+ * Pixel tracks; custom events are not optimizable. Current taxonomy:
971
+ * `SHOPPING` (Purchase), `ON_WEB_CART` (Add to Cart), `INITIATE_ORDER`
972
+ * (Initiate Checkout), `FORM` (Lead), `ON_WEB_REGISTER` (Complete
973
+ * Registration), `ON_WEB_DETAIL` (View Content). `ON_WEB_ORDER` is
974
+ * deprecated. On rejection the error lists the event types your pixel
975
+ * actually tracks. Optional for `goal: conversions`.
976
+ *
977
+ */
978
+ customEventType?: string;
979
+ /**
980
+ * Meta only. Pixel custom-event name to optimise against (Meta's
981
+ * `custom_event_str`), exactly as it appears in Events Manager and in your
982
+ * CAPI payloads (case-sensitive, not uppercased). Requires
983
+ * `customEventType: OTHER`, and `OTHER` requires this field (400 either way).
984
+ * The same as picking a custom event in Ads Manager's conversion-event
985
+ * dropdown. For rule-based Custom Conversions use `customConversionId`
986
+ * instead.
987
+ *
988
+ */
989
+ customEventStr?: string;
990
+ /**
991
+ * Facebook Page ID. Used by `goal: lead_generation`. Auto-filled from the
992
+ * connected Page when omitted.
993
+ *
994
+ */
995
+ pageId?: string;
996
+ /**
997
+ * App ID. Required for `goal: app_promotion`.
998
+ */
999
+ applicationId?: string;
1000
+ /**
1001
+ * App Store / Play Store listing URL. Required for `goal: app_promotion`.
1002
+ */
1003
+ objectStoreUrl?: string;
1004
+ /**
1005
+ * Custom Conversion ID, when optimising against one instead of a standard
1006
+ * event. Accepted alone by this API, without `pixelId` or `customEventType`.
1007
+ * If `pixelId` is also sent, `customEventType` is still required on the
1008
+ * promoted_object (Meta rejects `pixel_id` without `custom_event_type`,
1009
+ * error_subcode 1885014).
1010
+ *
1011
+ */
1012
+ customConversionId?: string;
1013
+ /**
1014
+ * Optional catalog ID. If supplied with productSetId, the set must belong to this catalog. A catalog ID cannot replace productSetId.
1015
+ */
1016
+ productCatalogId?: string;
1017
+ /**
1018
+ * Meta product SET ID from GET /v1/ads/catalogs/{catalogId}/product-sets. Zernio checks that the token can read the set and its product_catalog before creation. A catalog ID or inaccessible set returns a precise 400 naming promotedObject.productSetId. A mismatch with productCatalogId names promotedObject.productCatalogId.
1019
+ */
1020
+ productSetId?: string;
1021
+ /**
1022
+ * Meta only. Offline event set (dataset) to optimise toward. Post-merger these are datasets: the id is the dataset id (for pixel-backed datasets, the pixel id).
1023
+ */
1024
+ offlineConversionDataSetId?: string;
1025
+ /**
1026
+ * Meta only. WhatsApp number on messaging-destination ad sets.
1027
+ */
1028
+ whatsappPhoneNumber?: string;
1029
+ };
1030
+
913
1031
  /**
914
1032
  * Platform-side review state, independent of the delivery `status` and the `configuredStatus` on/off toggle. `in_review` means the platform is still reviewing. Absent when the platform reports no review signal (e.g. a paused ad whose review state is masked behind the pause).
915
1033
  */
@@ -988,6 +1106,23 @@ export type AdsTimelineResponse = {
988
1106
  }>;
989
1107
  };
990
1108
 
1109
+ /**
1110
+ * Meta only. Attaches pixel measurement to the ad regardless of the optimization goal (the "Website events" tracking row in Ads Manager). `pixelId` becomes the ad's `tracking_specs` (offsite_conversion + fb_pixel); `urlTags` is stored on the new creative as `url_tags` and retained on the ad for compatibility. Applied on the legacy single-creative shape, every ad of the multi-creative shape, and the attach shape. NOTE: tracking lives on the AD object and is not inherited from the ad set, so pass it on EVERY attach call that should carry the pixel.
1111
+ */
1112
+ export type AdTracking = {
1113
+ /**
1114
+ * Meta Pixel ID to attach for offsite-conversion measurement.
1115
+ */
1116
+ pixelId?: string;
1117
+ /**
1118
+ * Click-URL params stored on the creative as `url_tags` and returned by GET /v1/ads/{adId}/tracking-tags. App-promotion linkUrl stays byte-identical to promotedObject.objectStoreUrl. Meta dynamic macros ({{ad.id}}, {{campaign.id}}, {{placement}}, ...) are sent through unescaped so Meta expands them; every other character is percent-encoded.
1119
+ */
1120
+ urlTags?: Array<{
1121
+ key: string;
1122
+ value: string;
1123
+ }>;
1124
+ };
1125
+
991
1126
  /**
992
1127
  * Ad set (or ad group/line item depending on platform) with rolled-up metrics and child ads
993
1128
  */
@@ -2823,6 +2958,7 @@ export type CtwaAdRequestBody = {
2823
2958
  * Meta enhancement settings for single or attached ads, and defaults for creatives[]. An item replaces the entire map, including with an empty object.
2824
2959
  */
2825
2960
  creativeFeatures?: MetaCreativeFeatures;
2961
+ tracking?: AdTracking;
2826
2962
  /**
2827
2963
  * Facebook or Instagram SocialAccount ID.
2828
2964
  */
@@ -5410,6 +5546,21 @@ export type MetaCreativeFeatures = {
5410
5546
  [key: string]: ('OPT_IN' | 'OPT_OUT');
5411
5547
  };
5412
5548
 
5549
+ export type MetaInstagramIdentityRef = {
5550
+ /**
5551
+ * Instagram identity ID.
5552
+ */
5553
+ igUserId: string;
5554
+ /**
5555
+ * Instagram username; empty when Meta does not expose it.
5556
+ */
5557
+ username: string;
5558
+ /**
5559
+ * Profile picture URL when available.
5560
+ */
5561
+ profilePictureUrl?: string;
5562
+ };
5563
+
5413
5564
  /**
5414
5565
  * Meta explicit Promotion offer. Maps to creative_sourcing_spec.promotion_metadata_spec with promotion_source ADVERTISER_INPUT. Dates become Unix seconds. Send null to omit an explicit offer on a new creative or remove it when rebuilding. Creation success alone does not confirm application: inspect promotionStatus in the response.
5415
5566
  */
@@ -6429,6 +6580,14 @@ export type platform8 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linke
6429
6580
  *
6430
6581
  */
6431
6582
  export type TargetingSpec = {
6583
+ /**
6584
+ * Meta only. Operating systems and version ranges, such as iOS_ver_14.0_and_above or Android. Emitted as user_os. May also be supplied inside targeting.
6585
+ */
6586
+ userOs?: Array<(string)>;
6587
+ /**
6588
+ * Meta only. Device models such as iPhone. Emitted as user_device. May also be supplied inside targeting.
6589
+ */
6590
+ userDevice?: Array<(string)>;
6432
6591
  /**
6433
6592
  * ISO 3166-1 alpha-2 country codes (e.g. ['US']).
6434
6593
  */
@@ -31950,6 +32109,19 @@ export type CreateAdCampaignData = {
31950
32109
  * Mapped to the ODAX objective (same mapping as POST /v1/ads/create).
31951
32110
  */
31952
32111
  goal: 'engagement' | 'traffic' | 'awareness' | 'video_views' | 'lead_generation' | 'lead_conversion' | 'job_applicants' | 'conversions' | 'app_promotion' | 'catalog_sales' | 'page_likes';
32112
+ /**
32113
+ * Meta app promotion only. Immutable campaign flag. Set true for iOS 14+ SKAdNetwork campaigns and supply promotedObject.applicationId plus promotedObject.objectStoreUrl. The campaign receives promotedObject only when this flag is true. Cannot be changed on an existing campaign.
32114
+ */
32115
+ isSkadnetworkAttribution?: boolean;
32116
+ promotedObject?: AdPromotedObject;
32117
+ /**
32118
+ * Meta only. SKAdNetwork app promotion requires AUCTION.
32119
+ */
32120
+ buyingType?: 'AUCTION' | 'RESERVED';
32121
+ /**
32122
+ * Meta only. Runs campaign validation without creating or persisting a campaign; Idempotency-Key storage is bypassed. Returns HTTP 200 with validateOnly true and status VALIDATED.
32123
+ */
32124
+ validateOnly?: boolean;
31953
32125
  specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'ISSUES_ELECTIONS_POLITICS' | 'FINANCIAL_PRODUCTS_SERVICES' | 'ONLINE_GAMBLING_AND_GAMING')>;
31954
32126
  /**
31955
32127
  * Campaign-level (CBO) budget in WHOLE currency units (USD: 50 = $50.00), NOT cents. Meta's own Marketing API takes this same number in minor units, so it is an easy and expensive mix-up. Requires budgetType.
@@ -31983,6 +32155,18 @@ export type CreateAdCampaignData = {
31983
32155
  };
31984
32156
 
31985
32157
  export type CreateAdCampaignResponse = ({
32158
+ /**
32159
+ * Always true.
32160
+ */
32161
+ validateOnly?: boolean;
32162
+ adAccountId?: string;
32163
+ /**
32164
+ * Empty because no campaign was created.
32165
+ */
32166
+ campaignId?: "";
32167
+ objective?: string;
32168
+ status?: "VALIDATED";
32169
+ } | {
31986
32170
  adAccountId?: string;
31987
32171
  /**
31988
32172
  * Platform id of the new campaign
@@ -33955,7 +34139,7 @@ export type UpdateAdTrackingTagsError = ({
33955
34139
  export type GetAdCommentsData = {
33956
34140
  path: {
33957
34141
  /**
33958
- * Internal Zernio ad ID (ObjectId).
34142
+ * Internal Zernio ad ID or indexed platform ad/post ID.
33959
34143
  */
33960
34144
  adId: string;
33961
34145
  };
@@ -33969,6 +34153,14 @@ export type GetAdCommentsData = {
33969
34153
  * Which side of the ad to return comments for. Omit to default to the Instagram side when present, else Facebook. Returns ad_not_commentable if the ad has no such placement.
33970
34154
  */
33971
34155
  placement?: 'facebook' | 'instagram';
34156
+ /**
34157
+ * TikTok-only start date. Defaults to 30 days before until. Maximum window is 30 days.
34158
+ */
34159
+ since?: string;
34160
+ /**
34161
+ * TikTok-only end date. Defaults to today in UTC.
34162
+ */
34163
+ until?: string;
33972
34164
  };
33973
34165
  };
33974
34166
 
@@ -33983,25 +34175,37 @@ export type GetAdCommentsResponse = ({
33983
34175
  };
33984
34176
  meta: {
33985
34177
  /**
33986
- * Which side these comments are on (same as `placement`).
34178
+ * Platform of the comments.
33987
34179
  */
33988
- platform: 'facebook' | 'instagram';
34180
+ platform: 'facebook' | 'instagram' | 'tiktok';
33989
34181
  /**
33990
34182
  * The placement these comments are for, useful when you didn't pass ?placement= and want to know which one you got.
33991
34183
  */
33992
- placement: 'facebook' | 'instagram';
34184
+ placement?: 'facebook' | 'instagram';
33993
34185
  /**
33994
34186
  * Internal Zernio ad ID.
33995
34187
  */
33996
34188
  adId: string;
33997
34189
  /**
33998
- * Meta ad ID.
34190
+ * Platform ad ID.
33999
34191
  */
34000
- platformAdId: string;
34192
+ platformAdId?: string;
34001
34193
  /**
34002
34194
  * Underlying post ID the comments belong to. effective_object_story_id for the Facebook side, effective_instagram_media_id for the Instagram side.
34003
34195
  */
34004
- effectiveStoryId: string;
34196
+ effectiveStoryId?: string;
34197
+ /**
34198
+ * TikTok-only video item ID. Null when the ad and comments do not expose it.
34199
+ */
34200
+ tiktokItemId?: (string) | null;
34201
+ /**
34202
+ * TikTok-only resolved start date.
34203
+ */
34204
+ since?: string;
34205
+ /**
34206
+ * TikTok-only resolved end date.
34207
+ */
34208
+ until?: string;
34005
34209
  /**
34006
34210
  * Facebook-only. The connected Facebook Page SocialAccount these comments were read through. Pass it as `accountId` (with `effectiveStoryId` as the postId) to /v1/inbox/comments to reply/hide/delete. Null when no connected Page was used (then moderation isn't possible).
34007
34211
  */
@@ -34030,6 +34234,127 @@ export type GetAdCommentsError = (unknown | {
34030
34234
  error?: string;
34031
34235
  });
34032
34236
 
34237
+ export type ReplyToAdCommentData = {
34238
+ body: {
34239
+ /**
34240
+ * Non-empty reply text.
34241
+ */
34242
+ text: string;
34243
+ };
34244
+ path: {
34245
+ /**
34246
+ * Internal Zernio ad ID or indexed platform ad ID.
34247
+ */
34248
+ adId: string;
34249
+ /**
34250
+ * TikTok comment ID from the ad comment listing.
34251
+ */
34252
+ commentId: string;
34253
+ };
34254
+ query?: {
34255
+ /**
34256
+ * Start date of the comment lookup window. Defaults to 30 days before until.
34257
+ */
34258
+ since?: string;
34259
+ /**
34260
+ * End date of the comment lookup window. Defaults to today in UTC.
34261
+ */
34262
+ until?: string;
34263
+ };
34264
+ };
34265
+
34266
+ export type ReplyToAdCommentResponse = ({
34267
+ status: 'success';
34268
+ /**
34269
+ * ID of the created reply or moderated comment.
34270
+ */
34271
+ commentId: string;
34272
+ });
34273
+
34274
+ export type ReplyToAdCommentError = (ErrorResponse | {
34275
+ error?: string;
34276
+ } | unknown);
34277
+
34278
+ export type HideAdCommentData = {
34279
+ body: {
34280
+ /**
34281
+ * True to hide the comment; false to restore it.
34282
+ */
34283
+ hidden: boolean;
34284
+ };
34285
+ path: {
34286
+ /**
34287
+ * Internal Zernio ad ID or indexed platform ad ID.
34288
+ */
34289
+ adId: string;
34290
+ /**
34291
+ * TikTok comment ID from the ad comment listing.
34292
+ */
34293
+ commentId: string;
34294
+ };
34295
+ query?: {
34296
+ /**
34297
+ * Start date of the comment lookup window. Defaults to 30 days before until.
34298
+ */
34299
+ since?: string;
34300
+ /**
34301
+ * End date of the comment lookup window. Defaults to today in UTC.
34302
+ */
34303
+ until?: string;
34304
+ };
34305
+ };
34306
+
34307
+ export type HideAdCommentResponse = ({
34308
+ status: 'success';
34309
+ /**
34310
+ * ID of the created reply or moderated comment.
34311
+ */
34312
+ commentId: string;
34313
+ /**
34314
+ * The requested visibility state.
34315
+ */
34316
+ hidden?: boolean;
34317
+ });
34318
+
34319
+ export type HideAdCommentError = (ErrorResponse | {
34320
+ error?: string;
34321
+ } | unknown);
34322
+
34323
+ export type DeleteAdCommentData = {
34324
+ path: {
34325
+ /**
34326
+ * Internal Zernio ad ID or indexed platform ad ID.
34327
+ */
34328
+ adId: string;
34329
+ /**
34330
+ * TikTok comment ID from the ad comment listing.
34331
+ */
34332
+ commentId: string;
34333
+ };
34334
+ query?: {
34335
+ /**
34336
+ * Start date of the comment lookup window. Defaults to 30 days before until.
34337
+ */
34338
+ since?: string;
34339
+ /**
34340
+ * End date of the comment lookup window. Defaults to today in UTC.
34341
+ */
34342
+ until?: string;
34343
+ };
34344
+ };
34345
+
34346
+ export type DeleteAdCommentResponse = ({
34347
+ status: 'success';
34348
+ /**
34349
+ * ID of the created reply or moderated comment.
34350
+ */
34351
+ commentId: string;
34352
+ });
34353
+
34354
+ export type DeleteAdCommentError = (ErrorResponse | {
34355
+ error?: string;
34356
+ } | unknown);
34357
+
34033
34358
  export type ListAdsBusinessCentersData = {
34034
34359
  query: {
34035
34360
  /**
@@ -34246,6 +34571,140 @@ export type ListAdStudiesError = (unknown | {
34246
34571
  error?: string;
34247
34572
  });
34248
34573
 
34574
+ export type ListAdsInstagramAccountsData = {
34575
+ query: {
34576
+ /**
34577
+ * Zernio Meta Ads or Facebook SocialAccount ID.
34578
+ */
34579
+ accountId: string;
34580
+ /**
34581
+ * Meta ad account ID including the act_ prefix.
34582
+ */
34583
+ adAccountId: string;
34584
+ };
34585
+ };
34586
+
34587
+ export type ListAdsInstagramAccountsResponse = ({
34588
+ accounts: Array<(MetaInstagramIdentityRef & {
34589
+ /**
34590
+ * Whether this is a Page-backed Instagram identity.
34591
+ */
34592
+ isPageBacked: boolean;
34593
+ /**
34594
+ * Discovery source; Page linkage also uses page_backed.
34595
+ */
34596
+ source: 'ad_account' | 'page_backed' | 'business';
34597
+ })>;
34598
+ pages: Array<{
34599
+ /**
34600
+ * Facebook Page ID.
34601
+ */
34602
+ pageId: string;
34603
+ /**
34604
+ * Facebook Page name.
34605
+ */
34606
+ name: string;
34607
+ instagramBusinessAccount?: MetaInstagramIdentityRef;
34608
+ connectedInstagramAccount?: MetaInstagramIdentityRef;
34609
+ }>;
34610
+ resolved: {
34611
+ /**
34612
+ * Page selected by the shared ad-creation resolver.
34613
+ */
34614
+ pageId: (string) | null;
34615
+ /**
34616
+ * Instagram identity selected by the shared ad-creation resolver.
34617
+ */
34618
+ igUserId: (string) | null;
34619
+ /**
34620
+ * Discovery source of the resolved identity; null when absent from discovery.
34621
+ */
34622
+ source: ('ad_account' | 'page_backed' | 'business') | null;
34623
+ };
34624
+ });
34625
+
34626
+ export type ListAdsInstagramAccountsError = (ErrorResponse | {
34627
+ error?: string;
34628
+ } | unknown);
34629
+
34630
+ export type ListAdvertisableApplicationsData = {
34631
+ query: {
34632
+ /**
34633
+ * Zernio Meta Ads or Facebook SocialAccount ID.
34634
+ */
34635
+ accountId: string;
34636
+ /**
34637
+ * Meta ad account ID including the act_ prefix.
34638
+ */
34639
+ adAccountId: string;
34640
+ };
34641
+ };
34642
+
34643
+ export type ListAdvertisableApplicationsResponse = ({
34644
+ applications: Array<{
34645
+ /**
34646
+ * Meta application ID.
34647
+ */
34648
+ id: string;
34649
+ /**
34650
+ * Application name.
34651
+ */
34652
+ name: string;
34653
+ /**
34654
+ * Platform identifiers reported by Meta.
34655
+ */
34656
+ supportedPlatforms: Array<(string)>;
34657
+ /**
34658
+ * Platform-keyed store URLs returned unchanged by Meta.
34659
+ */
34660
+ storeUrls: {
34661
+ [key: string]: (string);
34662
+ };
34663
+ }>;
34664
+ });
34665
+
34666
+ export type ListAdvertisableApplicationsError = (ErrorResponse | {
34667
+ error?: string;
34668
+ } | unknown);
34669
+
34670
+ export type GetIosFourteenCampaignLimitsData = {
34671
+ query: {
34672
+ /**
34673
+ * Zernio Meta Ads or Facebook SocialAccount ID.
34674
+ */
34675
+ accountId: string;
34676
+ /**
34677
+ * Meta ad account ID including the act_ prefix.
34678
+ */
34679
+ adAccountId: string;
34680
+ /**
34681
+ * Meta application ID from advertisable-applications.
34682
+ */
34683
+ applicationId: string;
34684
+ };
34685
+ };
34686
+
34687
+ export type GetIosFourteenCampaignLimitsResponse = ({
34688
+ limits: {
34689
+ /**
34690
+ * Campaign group limit reported by Meta.
34691
+ */
34692
+ campaignGroupLimit?: (number) | null;
34693
+ /**
34694
+ * Campaign limit reported by Meta.
34695
+ */
34696
+ campaignLimit?: (number) | null;
34697
+ /**
34698
+ * Campaign group limit details returned by Meta.
34699
+ */
34700
+ campaignGroupLimitsDetails?: Array<unknown>;
34701
+ } | null;
34702
+ });
34703
+
34704
+ export type GetIosFourteenCampaignLimitsError = (ErrorResponse | {
34705
+ error?: string;
34706
+ } | unknown);
34707
+
34249
34708
  export type ListMetaBusinessesData = {
34250
34709
  query: {
34251
34710
  /**
@@ -35696,22 +36155,7 @@ export type CreateStandaloneAdData = {
35696
36155
  * Meta only. Exact ad name (the single-creative ad object's name). Overrides the default, which is `name`. (For per-ad names on the multi-creative shape, set `name` on each `creatives[]` entry instead.)
35697
36156
  */
35698
36157
  adName?: string;
35699
- /**
35700
- * Meta only. Attaches pixel measurement to the ad regardless of the optimization goal (the "Website events" tracking row in Ads Manager). `pixelId` becomes the ad's `tracking_specs` (offsite_conversion + fb_pixel); `urlTags` becomes the ad's `url_tags` (click-tracking query params). Applied on the legacy single-creative shape, every ad of the multi-creative shape, and the attach shape. NOTE: tracking lives on the AD object and is not inherited from the ad set, so pass it on EVERY attach call that should carry the pixel.
35701
- */
35702
- tracking?: {
35703
- /**
35704
- * Meta Pixel ID to attach for offsite-conversion measurement.
35705
- */
35706
- pixelId?: string;
35707
- /**
35708
- * Click-URL params appended to the ad's destination as `url_tags` (e.g. utm_source). Meta dynamic macros ({{ad.id}}, {{campaign.id}}, {{placement}}, ...) are sent through unescaped so Meta expands them; every other character is percent-encoded.
35709
- */
35710
- urlTags?: Array<{
35711
- key: string;
35712
- value: string;
35713
- }>;
35714
- };
36158
+ tracking?: AdTracking;
35715
36159
  /**
35716
36160
  * Required on legacy and multi-creative shapes; the attach shape inherits it from the ad set. Available goals vary by platform.
35717
36161
  *
@@ -35763,7 +36207,7 @@ export type CreateStandaloneAdData = {
35763
36207
  */
35764
36208
  multiAdvertiser?: 'OPT_IN' | 'OPT_OUT';
35765
36209
  /**
35766
- * Meta only, single standalone shape only (no creatives[], adSetId, or RESERVED). Dry-run: each node runs Meta's execution_options validate_only and NOTHING is created or persisted. Children need real parents, so a fresh tree validates the campaign + creative (the ad set needs its campaign to exist, so pass existingCampaignId to validate it too; the ad itself is never validatable pre-create). A Meta validation failure returns the 400 verbatim; success returns 200 with per-node results instead of an ad.
36210
+ * Meta only. Validates the complete inline campaign, ad set, creative and ad with execution_options validate_only. Nothing is uploaded or created, and validation bypasses Idempotency-Key storage. Supports a single image, existing video.id or existingCreativeId; media pools, new video uploads, creatives[], adSetId and RESERVED buying return 400. Existing campaign or creative nodes are marked skipped. Success returns 200 with per-node results; Meta rejection returns an error.
35767
36211
  */
35768
36212
  validateOnly?: boolean;
35769
36213
  /**
@@ -36732,118 +37176,22 @@ export type CreateStandaloneAdData = {
36732
37176
  */
36733
37177
  smartPlus?: boolean;
36734
37178
  /**
36735
- * What the ad optimises against. Behaviour depends on the platform.
36736
- *
36737
- * **Meta**: forwarded to the ad set's `promoted_object` (snake-cased).
36738
- * Required for goals whose ad-set optimization_goal points at a specific
36739
- * event/page/app (without it Meta rejects the ad-set create with
36740
- * `error_subcode: 1815430` "Please select a promoted object for your ad set"):
36741
- * - `goal: conversions` / `lead_conversion` (OFFSITE_CONVERSIONS): requires `pixelId` + `customEventType`, or `customConversionId` when optimising against a Custom Conversion (the conversion carries its own event definition). For a pixel CUSTOM event (one you named yourself in CAPI/Events Manager), send `customEventType: OTHER` + `customEventStr` with the event name.
36742
- * - `goal: app_promotion` (APP_INSTALLS): requires `applicationId` + `objectStoreUrl`
36743
- * - `goal: lead_generation` (LEAD_GENERATION): `pageId` is auto-filled from the connected Page when omitted
36744
- *
36745
- * Other Meta goals (engagement, traffic, awareness, video_views) ignore this field.
36746
- *
36747
- * **TikTok**: used by `goal: conversions` and the Smart+ goals (`smartPlus: true`).
36748
- * - `pixelId` maps to the ad group's `pixel_id`. Required: a TikTok website-conversion
36749
- * ad group without a pixel is rejected with `40002: Please select a pixel`.
36750
- * - `customEventType` maps to the ad group's `optimization_event` (the pixel event to
36751
- * optimise for). Optional on the regular conversions flow, required on Smart+.
36752
- * See the `customEventType` field below for the valid TikTok codes.
36753
- * - `applicationId` (Smart+ `goal: app_promotion` only) maps to the ad group's `app_id`:
36754
- * the App ID of an app registered on the TikTok Ads account (Assets → Events →
36755
- * App Events). Install optimization needs the app's MMP tracking configured.
36756
- *
36757
- * The remaining `promotedObject.*` fields are Meta-only. Platforms other than
36758
- * Meta and TikTok ignore `promotedObject` entirely.
36759
- *
36760
- */
36761
- promotedObject?: {
36762
- /**
36763
- * Pixel ID. **Meta:** Facebook Pixel ID, required for `goal: conversions`.
36764
- * Requires `customEventType` alongside it; Meta rejects any promoted_object
36765
- * carrying `pixel_id` without `custom_event_type` (error_subcode 1885014),
36766
- * even when `customConversionId` is also present.
36767
- * **TikTok:** TikTok Pixel ID, required for `goal: conversions`.
36768
- * To discover the pixels an ad account can use, call
36769
- * `GET /v1/accounts/{accountId}/tracking-tags?adAccountId=act_...` (each entry
36770
- * carries `kind` and `ownerAdAccountId`), or
36771
- * `GET /v1/accounts/{accountId}/conversion-destinations`. Note this is a
36772
- * different resource from `GET /v1/ads/{adId}/tracking-tags`, which reads an
36773
- * ad's click-URL params (`url_tags`), not pixels.
36774
- *
36775
- */
36776
- pixelId?: string;
36777
- /**
36778
- * The event the campaign/ad group optimises against.
36779
- *
36780
- * **Meta:** standard event like `PURCHASE`, `LEAD`, `COMPLETE_REGISTRATION`,
36781
- * `ADD_TO_CART`. Uppercased internally so callers can pass any case. Required
36782
- * for `goal: conversions`.
36783
- *
36784
- * **TikTok:** an `optimization_event` code (UPPER_SNAKE, not Meta's vocabulary
36785
- * and not PascalCase), OR the exact event name shown in TikTok Events Manager
36786
- * (auto-resolved to its code). Must be one of the event types your TikTok
36787
- * Pixel tracks; custom events are not optimizable. Current taxonomy:
36788
- * `SHOPPING` (Purchase), `ON_WEB_CART` (Add to Cart), `INITIATE_ORDER`
36789
- * (Initiate Checkout), `FORM` (Lead), `ON_WEB_REGISTER` (Complete
36790
- * Registration), `ON_WEB_DETAIL` (View Content). `ON_WEB_ORDER` is
36791
- * deprecated. On rejection the error lists the event types your pixel
36792
- * actually tracks. Optional for `goal: conversions`.
36793
- *
36794
- */
36795
- customEventType?: string;
36796
- /**
36797
- * Meta only. Pixel custom-event name to optimise against (Meta's
36798
- * `custom_event_str`), exactly as it appears in Events Manager and in your
36799
- * CAPI payloads (case-sensitive, not uppercased). Requires
36800
- * `customEventType: OTHER`, and `OTHER` requires this field (400 either way).
36801
- * The same as picking a custom event in Ads Manager's conversion-event
36802
- * dropdown. For rule-based Custom Conversions use `customConversionId`
36803
- * instead.
36804
- *
36805
- */
36806
- customEventStr?: string;
36807
- /**
36808
- * Facebook Page ID. Used by `goal: lead_generation`. Auto-filled from the
36809
- * connected Page when omitted.
36810
- *
36811
- */
36812
- pageId?: string;
36813
- /**
36814
- * App ID. Required for `goal: app_promotion`.
36815
- */
36816
- applicationId?: string;
36817
- /**
36818
- * App Store / Play Store listing URL. Required for `goal: app_promotion`.
36819
- */
36820
- objectStoreUrl?: string;
36821
- /**
36822
- * Custom Conversion ID, when optimising against one instead of a standard
36823
- * event. Accepted alone by this API, without `pixelId` or `customEventType`.
36824
- * If `pixelId` is also sent, `customEventType` is still required on the
36825
- * promoted_object (Meta rejects `pixel_id` without `custom_event_type`,
36826
- * error_subcode 1885014).
36827
- *
36828
- */
36829
- customConversionId?: string;
36830
- /**
36831
- * Optional catalog ID. If supplied with productSetId, the set must belong to this catalog. A catalog ID cannot replace productSetId.
36832
- */
36833
- productCatalogId?: string;
36834
- /**
36835
- * Meta product SET ID from GET /v1/ads/catalogs/{catalogId}/product-sets. Zernio checks that the token can read the set and its product_catalog before creation. A catalog ID or inaccessible set returns a precise 400 naming promotedObject.productSetId. A mismatch with productCatalogId names promotedObject.productCatalogId.
36836
- */
36837
- productSetId?: string;
36838
- /**
36839
- * Meta only. Offline event set (dataset) to optimise toward. Post-merger these are datasets: the id is the dataset id (for pixel-backed datasets, the pixel id).
36840
- */
36841
- offlineConversionDataSetId?: string;
36842
- /**
36843
- * Meta only. WhatsApp number on messaging-destination ad sets.
36844
- */
36845
- whatsappPhoneNumber?: string;
36846
- };
37179
+ * Meta only. Operating systems and version ranges, such as iOS_ver_14.0_and_above or Android. Emitted as user_os. May also be supplied inside targeting.
37180
+ */
37181
+ userOs?: Array<(string)>;
37182
+ /**
37183
+ * Meta only. Device models such as iPhone. Emitted as user_device. May also be supplied inside targeting.
37184
+ */
37185
+ userDevice?: Array<(string)>;
37186
+ /**
37187
+ * Meta app promotion only. Immutable campaign flag. Set true for iOS 14+ SKAdNetwork campaigns and supply promotedObject.applicationId plus promotedObject.objectStoreUrl. The campaign receives promotedObject only when this flag is true. Cannot be changed on an existing campaign.
37188
+ */
37189
+ isSkadnetworkAttribution?: boolean;
37190
+ /**
37191
+ * Meta ad-set attribution. Required as SKADNETWORK for iOS 14+ app promotion or a SKAdNetwork campaign. Requires AUCTION buying. Standalone Meta ad-set creation is not supported; use this field on /v1/ads/create.
37192
+ */
37193
+ campaignAttribution?: 'AEM' | 'SKADNETWORK';
37194
+ promotedObject?: AdPromotedObject;
36847
37195
  };
36848
37196
  headers?: {
36849
37197
  /**