@zernio/node 0.2.730 → 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.
- package/README.md +6 -0
- package/dist/index.d.mts +576 -154
- package/dist/index.d.ts +576 -154
- package/dist/index.js +55 -1
- package/dist/index.mjs +55 -1
- package/package.json +1 -1
- package/src/client.ts +24 -0
- package/src/generated/sdk.gen.ts +132 -7
- package/src/generated/types.gen.ts +582 -153
|
@@ -271,6 +271,11 @@ export type Ad = {
|
|
|
271
271
|
* Public Facebook watch URL for VIDEO-type ads (https://www.facebook.com/watch/?v={videoId}). Null for non-video ads.
|
|
272
272
|
*/
|
|
273
273
|
videoUrl?: (string) | null;
|
|
274
|
+
/**
|
|
275
|
+
* Meta offer read from the live creative on creation or GET /v1/ads/{adId}. Null when metadata is not returned or cannot be read. Requested values are never echoed as applied.
|
|
276
|
+
*/
|
|
277
|
+
promotion?: MetaPromotion;
|
|
278
|
+
promotionStatus?: MetaPromotionStatus;
|
|
274
279
|
/**
|
|
275
280
|
* Meta ad creative id backing this ad. Reusable via existingCreativeId on POST /v1/ads/create.
|
|
276
281
|
*/
|
|
@@ -905,6 +910,124 @@ export type AdNegativeKeywordListKeyword = {
|
|
|
905
910
|
|
|
906
911
|
export type matchType2 = 'broad' | 'phrase' | 'exact';
|
|
907
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
|
+
|
|
908
1031
|
/**
|
|
909
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).
|
|
910
1033
|
*/
|
|
@@ -983,6 +1106,23 @@ export type AdsTimelineResponse = {
|
|
|
983
1106
|
}>;
|
|
984
1107
|
};
|
|
985
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
|
+
|
|
986
1126
|
/**
|
|
987
1127
|
* Ad set (or ad group/line item depending on platform) with rolled-up metrics and child ads
|
|
988
1128
|
*/
|
|
@@ -2814,6 +2954,11 @@ export type actionSource = 'web' | 'app' | 'offline' | 'crm' | 'phone_call' | 's
|
|
|
2814
2954
|
*
|
|
2815
2955
|
*/
|
|
2816
2956
|
export type CtwaAdRequestBody = {
|
|
2957
|
+
/**
|
|
2958
|
+
* Meta enhancement settings for single or attached ads, and defaults for creatives[]. An item replaces the entire map, including with an empty object.
|
|
2959
|
+
*/
|
|
2960
|
+
creativeFeatures?: MetaCreativeFeatures;
|
|
2961
|
+
tracking?: AdTracking;
|
|
2817
2962
|
/**
|
|
2818
2963
|
* Facebook or Instagram SocialAccount ID.
|
|
2819
2964
|
*/
|
|
@@ -2922,6 +3067,10 @@ export type CtwaAdRequestBody = {
|
|
|
2922
3067
|
* Messaging and CTWA only. Raw Facebook pageId_postId reference, used as object_story_id even with an Instagram account. Mutually exclusive with existingPostId and fresh creative fields.
|
|
2923
3068
|
*/
|
|
2924
3069
|
objectStoryId?: string;
|
|
3070
|
+
/**
|
|
3071
|
+
* Replaces the top-level creativeFeatures map for this item. Omit to inherit; an empty object clears inherited enrollment choices.
|
|
3072
|
+
*/
|
|
3073
|
+
creativeFeatures?: MetaCreativeFeatures;
|
|
2925
3074
|
headline?: string;
|
|
2926
3075
|
/**
|
|
2927
3076
|
* Primary text shown above the image / video.
|
|
@@ -5390,6 +5539,64 @@ export type MetaAdsPlatformData = {
|
|
|
5390
5539
|
lifetimeMinSpendTarget?: number;
|
|
5391
5540
|
};
|
|
5392
5541
|
|
|
5542
|
+
/**
|
|
5543
|
+
* Meta Advantage+ creative enhancements. Map snake_case feature names to OPT_IN or OPT_OUT; Meta validates supported keys and unspecified features default to OPT_OUT. auto_promotion_tag is an enhancement; use the separate promotion field for an explicit offer. The deprecated standard_enhancements bundle is rejected by Meta.
|
|
5544
|
+
*/
|
|
5545
|
+
export type MetaCreativeFeatures = {
|
|
5546
|
+
[key: string]: ('OPT_IN' | 'OPT_OUT');
|
|
5547
|
+
};
|
|
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
|
+
|
|
5564
|
+
/**
|
|
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.
|
|
5566
|
+
*/
|
|
5567
|
+
export type MetaPromotion = {
|
|
5568
|
+
/**
|
|
5569
|
+
* Promotion type accepted by Meta. PERCENTAGE_OFF values cannot exceed 100.
|
|
5570
|
+
*/
|
|
5571
|
+
type: 'AMOUNT_OFF' | 'FREE_RETURN' | 'FREE_SHIPPING' | 'PERCENTAGE_OFF' | 'PROMO_CODE';
|
|
5572
|
+
/**
|
|
5573
|
+
* Nonnegative promotion value passed to Meta unchanged. AMOUNT_OFF units are not confirmed, including major versus minor currency units. For PERCENTAGE_OFF this is the percentage discount, at most 100.
|
|
5574
|
+
*/
|
|
5575
|
+
value: number;
|
|
5576
|
+
/**
|
|
5577
|
+
* Optional promotion code.
|
|
5578
|
+
*/
|
|
5579
|
+
code?: string;
|
|
5580
|
+
/**
|
|
5581
|
+
* Optional ISO 8601 start timestamp with a timezone offset or Z.
|
|
5582
|
+
*/
|
|
5583
|
+
startDate?: string;
|
|
5584
|
+
/**
|
|
5585
|
+
* Optional ISO 8601 end timestamp with a timezone offset or Z. Must be after startDate when both are set.
|
|
5586
|
+
*/
|
|
5587
|
+
endDate?: string;
|
|
5588
|
+
} | null;
|
|
5589
|
+
|
|
5590
|
+
/**
|
|
5591
|
+
* Promotion type accepted by Meta. PERCENTAGE_OFF values cannot exceed 100.
|
|
5592
|
+
*/
|
|
5593
|
+
export type type8 = 'AMOUNT_OFF' | 'FREE_RETURN' | 'FREE_SHIPPING' | 'PERCENTAGE_OFF' | 'PROMO_CODE';
|
|
5594
|
+
|
|
5595
|
+
/**
|
|
5596
|
+
* Meta creative readback result. applied means Meta returned promotion metadata; not_returned means the read succeeded without promotion metadata; unavailable means the read failed. Only applied confirms the returned offer. Missing metadata is not proof that Ads Manager displays the requested Promotion.
|
|
5597
|
+
*/
|
|
5598
|
+
export type MetaPromotionStatus = 'applied' | 'not_returned' | 'unavailable';
|
|
5599
|
+
|
|
5393
5600
|
export type Money = {
|
|
5394
5601
|
/**
|
|
5395
5602
|
* ISO 4217 currency code (e.g. USD, EUR)
|
|
@@ -5641,7 +5848,7 @@ export type PortfolioBidStrategy = {
|
|
|
5641
5848
|
targetRoas?: (number) | null;
|
|
5642
5849
|
};
|
|
5643
5850
|
|
|
5644
|
-
export type
|
|
5851
|
+
export type type9 = 'TARGET_CPA' | 'TARGET_ROAS' | 'MAXIMIZE_CONVERSIONS' | 'MAXIMIZE_CONVERSION_VALUE';
|
|
5645
5852
|
|
|
5646
5853
|
export type Post = {
|
|
5647
5854
|
_id?: string;
|
|
@@ -6373,6 +6580,14 @@ export type platform8 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linke
|
|
|
6373
6580
|
*
|
|
6374
6581
|
*/
|
|
6375
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)>;
|
|
6376
6591
|
/**
|
|
6377
6592
|
* ISO 3166-1 alpha-2 country codes (e.g. ['US']).
|
|
6378
6593
|
*/
|
|
@@ -6937,7 +7152,7 @@ export type UploadedFile = {
|
|
|
6937
7152
|
mimeType?: string;
|
|
6938
7153
|
};
|
|
6939
7154
|
|
|
6940
|
-
export type
|
|
7155
|
+
export type type10 = 'image' | 'video' | 'document';
|
|
6941
7156
|
|
|
6942
7157
|
export type UploadTokenResponse = {
|
|
6943
7158
|
token?: string;
|
|
@@ -10036,7 +10251,7 @@ export type WhatsAppTemplateButton = {
|
|
|
10036
10251
|
navigate_screen?: string;
|
|
10037
10252
|
};
|
|
10038
10253
|
|
|
10039
|
-
export type
|
|
10254
|
+
export type type11 = 'quick_reply' | 'url' | 'phone_number' | 'otp' | 'copy_code' | 'flow' | 'mpm' | 'catalog';
|
|
10040
10255
|
|
|
10041
10256
|
/**
|
|
10042
10257
|
* Required when type is otp
|
|
@@ -10198,7 +10413,7 @@ export type WorkflowNode = {
|
|
|
10198
10413
|
* integrations (webhook, ai, handoff, start_call).
|
|
10199
10414
|
*
|
|
10200
10415
|
*/
|
|
10201
|
-
export type
|
|
10416
|
+
export type type12 = 'trigger' | 'send_message' | 'wait_for_reply' | 'condition' | 'set_variable' | 'delay' | 'webhook' | 'ai' | 'handoff' | 'start_call' | 'a_b_split' | 'set_field' | 'enroll_sequence' | 'add_tag' | 'remove_tag' | 'end';
|
|
10202
10417
|
|
|
10203
10418
|
/**
|
|
10204
10419
|
* A single X API operation with its per-call price and the Zernio platform methods that trigger it.
|
|
@@ -10334,7 +10549,7 @@ export type XArticleBlock = {
|
|
|
10334
10549
|
entity_ranges?: Array<XArticleEntityRange>;
|
|
10335
10550
|
};
|
|
10336
10551
|
|
|
10337
|
-
export type
|
|
10552
|
+
export type type13 = 'unstyled' | 'header-one' | 'header-two' | 'header-three' | 'unordered-list-item' | 'ordered-list-item' | 'blockquote' | 'atomic';
|
|
10338
10553
|
|
|
10339
10554
|
/**
|
|
10340
10555
|
* X's snake_case content-state shape. Standard DraftJS camelCase fields such as entityMap, inlineStyleRanges, and entityRanges are rejected.
|
|
@@ -10413,7 +10628,7 @@ export type XArticleEntity = {
|
|
|
10413
10628
|
|
|
10414
10629
|
export type mutability = 'immutable' | 'mutable' | 'segmented';
|
|
10415
10630
|
|
|
10416
|
-
export type
|
|
10631
|
+
export type type14 = 'divider' | 'latex';
|
|
10417
10632
|
|
|
10418
10633
|
/**
|
|
10419
10634
|
* The referenced entity must exist, and offset plus length must not exceed the containing block's text length.
|
|
@@ -31894,6 +32109,19 @@ export type CreateAdCampaignData = {
|
|
|
31894
32109
|
* Mapped to the ODAX objective (same mapping as POST /v1/ads/create).
|
|
31895
32110
|
*/
|
|
31896
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;
|
|
31897
32125
|
specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'ISSUES_ELECTIONS_POLITICS' | 'FINANCIAL_PRODUCTS_SERVICES' | 'ONLINE_GAMBLING_AND_GAMING')>;
|
|
31898
32126
|
/**
|
|
31899
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.
|
|
@@ -31927,6 +32155,18 @@ export type CreateAdCampaignData = {
|
|
|
31927
32155
|
};
|
|
31928
32156
|
|
|
31929
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
|
+
} | {
|
|
31930
32170
|
adAccountId?: string;
|
|
31931
32171
|
/**
|
|
31932
32172
|
* Platform id of the new campaign
|
|
@@ -33022,13 +33262,19 @@ export type GetAdData = {
|
|
|
33022
33262
|
*/
|
|
33023
33263
|
adId: string;
|
|
33024
33264
|
};
|
|
33265
|
+
query?: {
|
|
33266
|
+
/**
|
|
33267
|
+
* Meta only. Read current promotion metadata from Meta and include promotionStatus. Omit for stored creative settings with no promotion-specific Graph call.
|
|
33268
|
+
*/
|
|
33269
|
+
refreshPromotion?: boolean;
|
|
33270
|
+
};
|
|
33025
33271
|
};
|
|
33026
33272
|
|
|
33027
33273
|
export type GetAdResponse = ({
|
|
33028
33274
|
ad?: Ad;
|
|
33029
33275
|
});
|
|
33030
33276
|
|
|
33031
|
-
export type GetAdError = ({
|
|
33277
|
+
export type GetAdError = (ErrorResponse | {
|
|
33032
33278
|
error?: string;
|
|
33033
33279
|
});
|
|
33034
33280
|
|
|
@@ -33119,6 +33365,10 @@ export type UpdateAdData = {
|
|
|
33119
33365
|
* GET /v1/ads/creatives and ignores every other field. Meta creatives are
|
|
33120
33366
|
* immutable, so any change creates a new creative and repoints the ad; the old
|
|
33121
33367
|
* creative is retained on the ad account for historical reporting.
|
|
33368
|
+
* `promotion` and `creativeFeatures` are Meta-only. Omitted settings are
|
|
33369
|
+
* preserved from the live creative, including full rebuilds. Send
|
|
33370
|
+
* `promotion: null` to remove the explicit offer from the replacement.
|
|
33371
|
+
* A supplied creativeFeatures map overrides individual existing keys.
|
|
33122
33372
|
* - **TikTok**: patch-style. Pass any subset; `headline` is ignored (TikTok creatives
|
|
33123
33373
|
* have no headline slot). `body` becomes the in-feed `ad_text`; `linkUrl` becomes
|
|
33124
33374
|
* `landing_page_url`; `videoUrl` triggers a fresh upload. `description`, `videoId`
|
|
@@ -33131,6 +33381,8 @@ export type UpdateAdData = {
|
|
|
33131
33381
|
*
|
|
33132
33382
|
*/
|
|
33133
33383
|
creative?: {
|
|
33384
|
+
promotion?: MetaPromotion;
|
|
33385
|
+
creativeFeatures?: MetaCreativeFeatures;
|
|
33134
33386
|
/**
|
|
33135
33387
|
* Meta and LinkedIn (TikTok has no headline slot)
|
|
33136
33388
|
*/
|
|
@@ -33887,7 +34139,7 @@ export type UpdateAdTrackingTagsError = ({
|
|
|
33887
34139
|
export type GetAdCommentsData = {
|
|
33888
34140
|
path: {
|
|
33889
34141
|
/**
|
|
33890
|
-
* Internal Zernio ad ID
|
|
34142
|
+
* Internal Zernio ad ID or indexed platform ad/post ID.
|
|
33891
34143
|
*/
|
|
33892
34144
|
adId: string;
|
|
33893
34145
|
};
|
|
@@ -33901,6 +34153,14 @@ export type GetAdCommentsData = {
|
|
|
33901
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.
|
|
33902
34154
|
*/
|
|
33903
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;
|
|
33904
34164
|
};
|
|
33905
34165
|
};
|
|
33906
34166
|
|
|
@@ -33915,25 +34175,37 @@ export type GetAdCommentsResponse = ({
|
|
|
33915
34175
|
};
|
|
33916
34176
|
meta: {
|
|
33917
34177
|
/**
|
|
33918
|
-
*
|
|
34178
|
+
* Platform of the comments.
|
|
33919
34179
|
*/
|
|
33920
|
-
platform: 'facebook' | 'instagram';
|
|
34180
|
+
platform: 'facebook' | 'instagram' | 'tiktok';
|
|
33921
34181
|
/**
|
|
33922
34182
|
* The placement these comments are for, useful when you didn't pass ?placement= and want to know which one you got.
|
|
33923
34183
|
*/
|
|
33924
|
-
placement
|
|
34184
|
+
placement?: 'facebook' | 'instagram';
|
|
33925
34185
|
/**
|
|
33926
34186
|
* Internal Zernio ad ID.
|
|
33927
34187
|
*/
|
|
33928
34188
|
adId: string;
|
|
33929
34189
|
/**
|
|
33930
|
-
*
|
|
34190
|
+
* Platform ad ID.
|
|
33931
34191
|
*/
|
|
33932
|
-
platformAdId
|
|
34192
|
+
platformAdId?: string;
|
|
33933
34193
|
/**
|
|
33934
34194
|
* Underlying post ID the comments belong to. effective_object_story_id for the Facebook side, effective_instagram_media_id for the Instagram side.
|
|
33935
34195
|
*/
|
|
33936
|
-
effectiveStoryId
|
|
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;
|
|
33937
34209
|
/**
|
|
33938
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).
|
|
33939
34211
|
*/
|
|
@@ -33962,6 +34234,127 @@ export type GetAdCommentsError = (unknown | {
|
|
|
33962
34234
|
error?: string;
|
|
33963
34235
|
});
|
|
33964
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
|
+
|
|
33965
34358
|
export type ListAdsBusinessCentersData = {
|
|
33966
34359
|
query: {
|
|
33967
34360
|
/**
|
|
@@ -34178,6 +34571,140 @@ export type ListAdStudiesError = (unknown | {
|
|
|
34178
34571
|
error?: string;
|
|
34179
34572
|
});
|
|
34180
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
|
+
|
|
34181
34708
|
export type ListMetaBusinessesData = {
|
|
34182
34709
|
query: {
|
|
34183
34710
|
/**
|
|
@@ -34429,12 +34956,11 @@ export type CreateAdCreativeData = {
|
|
|
34429
34956
|
* Appended to every outbound URL (e.g. utm_source=fb).
|
|
34430
34957
|
*/
|
|
34431
34958
|
urlTags?: string;
|
|
34959
|
+
promotion?: MetaPromotion;
|
|
34432
34960
|
/**
|
|
34433
|
-
*
|
|
34961
|
+
* Meta only. Applied to each new creative, including standalone and attach shapes. With creatives[], these are defaults; an item replaces the whole feature map, including an empty map. auto_promotion_tag is an enhancement; an explicit offer uses promotion.
|
|
34434
34962
|
*/
|
|
34435
|
-
creativeFeatures?:
|
|
34436
|
-
[key: string]: ('OPT_IN' | 'OPT_OUT');
|
|
34437
|
-
};
|
|
34963
|
+
creativeFeatures?: MetaCreativeFeatures;
|
|
34438
34964
|
/**
|
|
34439
34965
|
* Meta only. Multi-advertiser ads: whether Meta may show this ad alongside other advertisers' in one unit. Meta auto-enrols since Aug 2024, so send OPT_OUT to leave. It is a top-level creative field, NOT a `creativeFeatures` key, and Meta rejects it there.
|
|
34440
34966
|
*/
|
|
@@ -34448,6 +34974,8 @@ export type CreateAdCreativeResponse = ({
|
|
|
34448
34974
|
* Platform creative id, reusable via existingCreativeId.
|
|
34449
34975
|
*/
|
|
34450
34976
|
creativeId?: string;
|
|
34977
|
+
promotion?: MetaPromotion;
|
|
34978
|
+
promotionStatus?: MetaPromotionStatus;
|
|
34451
34979
|
});
|
|
34452
34980
|
|
|
34453
34981
|
export type CreateAdCreativeError = (unknown | {
|
|
@@ -35273,6 +35801,7 @@ export type GetDsaRecommendationsError = (unknown | {
|
|
|
35273
35801
|
|
|
35274
35802
|
export type BoostPostData = {
|
|
35275
35803
|
body: {
|
|
35804
|
+
creativeFeatures?: MetaCreativeFeatures;
|
|
35276
35805
|
/**
|
|
35277
35806
|
* Zernio post ID (provide this or platformPostId)
|
|
35278
35807
|
*/
|
|
@@ -35626,22 +36155,7 @@ export type CreateStandaloneAdData = {
|
|
|
35626
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.)
|
|
35627
36156
|
*/
|
|
35628
36157
|
adName?: string;
|
|
35629
|
-
|
|
35630
|
-
* 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.
|
|
35631
|
-
*/
|
|
35632
|
-
tracking?: {
|
|
35633
|
-
/**
|
|
35634
|
-
* Meta Pixel ID to attach for offsite-conversion measurement.
|
|
35635
|
-
*/
|
|
35636
|
-
pixelId?: string;
|
|
35637
|
-
/**
|
|
35638
|
-
* 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.
|
|
35639
|
-
*/
|
|
35640
|
-
urlTags?: Array<{
|
|
35641
|
-
key: string;
|
|
35642
|
-
value: string;
|
|
35643
|
-
}>;
|
|
35644
|
-
};
|
|
36158
|
+
tracking?: AdTracking;
|
|
35645
36159
|
/**
|
|
35646
36160
|
* Required on legacy and multi-creative shapes; the attach shape inherits it from the ad set. Available goals vary by platform.
|
|
35647
36161
|
*
|
|
@@ -35683,18 +36197,17 @@ export type CreateStandaloneAdData = {
|
|
|
35683
36197
|
* Meta only. The RESERVED prediction id the R&F ad set runs on (reserving mints a new id, so pass that one). Requires buyingType RESERVED.
|
|
35684
36198
|
*/
|
|
35685
36199
|
rfPredictionId?: string;
|
|
36200
|
+
promotion?: MetaPromotion;
|
|
35686
36201
|
/**
|
|
35687
|
-
* Meta only.
|
|
36202
|
+
* Meta only. Applied to each new creative, including standalone and attach shapes. With creatives[], these are defaults; an item replaces the whole feature map, including an empty map. auto_promotion_tag is an enhancement; an explicit offer uses promotion.
|
|
35688
36203
|
*/
|
|
35689
|
-
creativeFeatures?:
|
|
35690
|
-
[key: string]: ('OPT_IN' | 'OPT_OUT');
|
|
35691
|
-
};
|
|
36204
|
+
creativeFeatures?: MetaCreativeFeatures;
|
|
35692
36205
|
/**
|
|
35693
36206
|
* Meta only. Multi-advertiser ads: whether Meta may show this ad alongside other advertisers' in one unit. Meta auto-enrols since Aug 2024, so send OPT_OUT to leave. It is a top-level creative field, NOT a `creativeFeatures` key, and Meta rejects it there.
|
|
35694
36207
|
*/
|
|
35695
36208
|
multiAdvertiser?: 'OPT_IN' | 'OPT_OUT';
|
|
35696
36209
|
/**
|
|
35697
|
-
* Meta only
|
|
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.
|
|
35698
36211
|
*/
|
|
35699
36212
|
validateOnly?: boolean;
|
|
35700
36213
|
/**
|
|
@@ -35823,6 +36336,14 @@ export type CreateStandaloneAdData = {
|
|
|
35823
36336
|
*
|
|
35824
36337
|
*/
|
|
35825
36338
|
creatives?: Array<{
|
|
36339
|
+
/**
|
|
36340
|
+
* Overrides the top-level offer for this item. Omit to inherit; null disables the inherited offer.
|
|
36341
|
+
*/
|
|
36342
|
+
promotion?: MetaPromotion;
|
|
36343
|
+
/**
|
|
36344
|
+
* Replaces the entire top-level creativeFeatures map for this item. Omit to inherit; an empty map clears these defaults.
|
|
36345
|
+
*/
|
|
36346
|
+
creativeFeatures?: MetaCreativeFeatures;
|
|
35826
36347
|
/**
|
|
35827
36348
|
* Exact name for this ad. Falls back to `<name> #N` (N = 1-based position).
|
|
35828
36349
|
*/
|
|
@@ -35854,7 +36375,8 @@ export type CreateStandaloneAdData = {
|
|
|
35854
36375
|
* are inherited from the ad set on Meta, and passing `bidStrategy`
|
|
35855
36376
|
* in attach mode returns 400. To change an existing ad set's
|
|
35856
36377
|
* bid, use `PUT /v1/ads/ad-sets/{adSetId}`. Mutually exclusive
|
|
35857
|
-
* with `creatives[]`.
|
|
36378
|
+
* with `creatives[]`. `dynamicCreative` returns 400 in attach mode: create
|
|
36379
|
+
* a new dynamic ad set by omitting `adSetId` instead.
|
|
35858
36380
|
*
|
|
35859
36381
|
* The attached ad takes the full single-creative surface:
|
|
35860
36382
|
* `headline`/`body`/`description`/`callToAction` plus either
|
|
@@ -36169,7 +36691,10 @@ export type CreateStandaloneAdData = {
|
|
|
36169
36691
|
* (`imageUrl`, `headline`, `body`, `linkUrl`, `callToAction`) are ignored. Mutually
|
|
36170
36692
|
* exclusive with the `creatives[]` multi-creative shape. Exactly ONE of `imageUrls` /
|
|
36171
36693
|
* `videoUrls` is required (Meta allows one ad format per asset feed; sending both →
|
|
36172
|
-
* 400).
|
|
36694
|
+
* 400). Limits remain 10 images or videos and 5 bodies, titles or descriptions.
|
|
36695
|
+
* The ad set is created with `is_dynamic_creative: true`. Combining this field
|
|
36696
|
+
* with `adSetId` returns 400: omit `adSetId` to create a new dynamic ad set.
|
|
36697
|
+
* Multiple headlines go in `titles`; multiple primary texts go in `bodies`.
|
|
36173
36698
|
*
|
|
36174
36699
|
*/
|
|
36175
36700
|
dynamicCreative?: {
|
|
@@ -36651,118 +37176,22 @@ export type CreateStandaloneAdData = {
|
|
|
36651
37176
|
*/
|
|
36652
37177
|
smartPlus?: boolean;
|
|
36653
37178
|
/**
|
|
36654
|
-
*
|
|
36655
|
-
|
|
36656
|
-
|
|
36657
|
-
|
|
36658
|
-
*
|
|
36659
|
-
|
|
36660
|
-
|
|
36661
|
-
|
|
36662
|
-
*
|
|
36663
|
-
|
|
36664
|
-
|
|
36665
|
-
|
|
36666
|
-
*
|
|
36667
|
-
|
|
36668
|
-
|
|
36669
|
-
|
|
36670
|
-
* optimise for). Optional on the regular conversions flow, required on Smart+.
|
|
36671
|
-
* See the `customEventType` field below for the valid TikTok codes.
|
|
36672
|
-
* - `applicationId` (Smart+ `goal: app_promotion` only) maps to the ad group's `app_id`:
|
|
36673
|
-
* the App ID of an app registered on the TikTok Ads account (Assets → Events →
|
|
36674
|
-
* App Events). Install optimization needs the app's MMP tracking configured.
|
|
36675
|
-
*
|
|
36676
|
-
* The remaining `promotedObject.*` fields are Meta-only. Platforms other than
|
|
36677
|
-
* Meta and TikTok ignore `promotedObject` entirely.
|
|
36678
|
-
*
|
|
36679
|
-
*/
|
|
36680
|
-
promotedObject?: {
|
|
36681
|
-
/**
|
|
36682
|
-
* Pixel ID. **Meta:** Facebook Pixel ID, required for `goal: conversions`.
|
|
36683
|
-
* Requires `customEventType` alongside it; Meta rejects any promoted_object
|
|
36684
|
-
* carrying `pixel_id` without `custom_event_type` (error_subcode 1885014),
|
|
36685
|
-
* even when `customConversionId` is also present.
|
|
36686
|
-
* **TikTok:** TikTok Pixel ID, required for `goal: conversions`.
|
|
36687
|
-
* To discover the pixels an ad account can use, call
|
|
36688
|
-
* `GET /v1/accounts/{accountId}/tracking-tags?adAccountId=act_...` (each entry
|
|
36689
|
-
* carries `kind` and `ownerAdAccountId`), or
|
|
36690
|
-
* `GET /v1/accounts/{accountId}/conversion-destinations`. Note this is a
|
|
36691
|
-
* different resource from `GET /v1/ads/{adId}/tracking-tags`, which reads an
|
|
36692
|
-
* ad's click-URL params (`url_tags`), not pixels.
|
|
36693
|
-
*
|
|
36694
|
-
*/
|
|
36695
|
-
pixelId?: string;
|
|
36696
|
-
/**
|
|
36697
|
-
* The event the campaign/ad group optimises against.
|
|
36698
|
-
*
|
|
36699
|
-
* **Meta:** standard event like `PURCHASE`, `LEAD`, `COMPLETE_REGISTRATION`,
|
|
36700
|
-
* `ADD_TO_CART`. Uppercased internally so callers can pass any case. Required
|
|
36701
|
-
* for `goal: conversions`.
|
|
36702
|
-
*
|
|
36703
|
-
* **TikTok:** an `optimization_event` code (UPPER_SNAKE, not Meta's vocabulary
|
|
36704
|
-
* and not PascalCase), OR the exact event name shown in TikTok Events Manager
|
|
36705
|
-
* (auto-resolved to its code). Must be one of the event types your TikTok
|
|
36706
|
-
* Pixel tracks; custom events are not optimizable. Current taxonomy:
|
|
36707
|
-
* `SHOPPING` (Purchase), `ON_WEB_CART` (Add to Cart), `INITIATE_ORDER`
|
|
36708
|
-
* (Initiate Checkout), `FORM` (Lead), `ON_WEB_REGISTER` (Complete
|
|
36709
|
-
* Registration), `ON_WEB_DETAIL` (View Content). `ON_WEB_ORDER` is
|
|
36710
|
-
* deprecated. On rejection the error lists the event types your pixel
|
|
36711
|
-
* actually tracks. Optional for `goal: conversions`.
|
|
36712
|
-
*
|
|
36713
|
-
*/
|
|
36714
|
-
customEventType?: string;
|
|
36715
|
-
/**
|
|
36716
|
-
* Meta only. Pixel custom-event name to optimise against (Meta's
|
|
36717
|
-
* `custom_event_str`), exactly as it appears in Events Manager and in your
|
|
36718
|
-
* CAPI payloads (case-sensitive, not uppercased). Requires
|
|
36719
|
-
* `customEventType: OTHER`, and `OTHER` requires this field (400 either way).
|
|
36720
|
-
* The same as picking a custom event in Ads Manager's conversion-event
|
|
36721
|
-
* dropdown. For rule-based Custom Conversions use `customConversionId`
|
|
36722
|
-
* instead.
|
|
36723
|
-
*
|
|
36724
|
-
*/
|
|
36725
|
-
customEventStr?: string;
|
|
36726
|
-
/**
|
|
36727
|
-
* Facebook Page ID. Used by `goal: lead_generation`. Auto-filled from the
|
|
36728
|
-
* connected Page when omitted.
|
|
36729
|
-
*
|
|
36730
|
-
*/
|
|
36731
|
-
pageId?: string;
|
|
36732
|
-
/**
|
|
36733
|
-
* App ID. Required for `goal: app_promotion`.
|
|
36734
|
-
*/
|
|
36735
|
-
applicationId?: string;
|
|
36736
|
-
/**
|
|
36737
|
-
* App Store / Play Store listing URL. Required for `goal: app_promotion`.
|
|
36738
|
-
*/
|
|
36739
|
-
objectStoreUrl?: string;
|
|
36740
|
-
/**
|
|
36741
|
-
* Custom Conversion ID, when optimising against one instead of a standard
|
|
36742
|
-
* event. Accepted alone by this API, without `pixelId` or `customEventType`.
|
|
36743
|
-
* If `pixelId` is also sent, `customEventType` is still required on the
|
|
36744
|
-
* promoted_object (Meta rejects `pixel_id` without `custom_event_type`,
|
|
36745
|
-
* error_subcode 1885014).
|
|
36746
|
-
*
|
|
36747
|
-
*/
|
|
36748
|
-
customConversionId?: string;
|
|
36749
|
-
/**
|
|
36750
|
-
* Catalog ID for catalog/Advantage+ Shopping campaigns.
|
|
36751
|
-
*/
|
|
36752
|
-
productCatalogId?: string;
|
|
36753
|
-
/**
|
|
36754
|
-
* Product Set ID inside the catalog.
|
|
36755
|
-
*/
|
|
36756
|
-
productSetId?: string;
|
|
36757
|
-
/**
|
|
36758
|
-
* 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).
|
|
36759
|
-
*/
|
|
36760
|
-
offlineConversionDataSetId?: string;
|
|
36761
|
-
/**
|
|
36762
|
-
* Meta only. WhatsApp number on messaging-destination ad sets.
|
|
36763
|
-
*/
|
|
36764
|
-
whatsappPhoneNumber?: string;
|
|
36765
|
-
};
|
|
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;
|
|
36766
37195
|
};
|
|
36767
37196
|
headers?: {
|
|
36768
37197
|
/**
|