@getlatedev/node 0.2.474 → 0.2.476
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/dist/index.d.mts +44 -13
- package/dist/index.d.ts +44 -13
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/generated/sdk.gen.ts +14 -0
- package/src/generated/types.gen.ts +44 -13
package/dist/index.d.mts
CHANGED
|
@@ -24646,6 +24646,10 @@ type ListAdCampaignsData = {
|
|
|
24646
24646
|
* Start of metrics date range (YYYY-MM-DD, inclusive). Defaults to 90 days ago when both date params are omitted.
|
|
24647
24647
|
*/
|
|
24648
24648
|
fromDate?: string;
|
|
24649
|
+
/**
|
|
24650
|
+
* Meta only. Campaign reads aggregate over ad documents, so a campaign with ZERO ads is normally invisible here — the state the two-step create (campaign, then ads via `existingCampaignId`) leaves behind whenever Meta rejects the ad step. Set true to list those too, with `adCount: 0` and zeroed metrics. Requires `accountId` and `adAccountId`, since an empty campaign has no ad row to resolve a token or ad account from.
|
|
24651
|
+
*/
|
|
24652
|
+
includeEmpty?: boolean;
|
|
24649
24653
|
limit?: number;
|
|
24650
24654
|
/**
|
|
24651
24655
|
* Page number (1-based)
|
|
@@ -24698,13 +24702,13 @@ type CreateAdCampaignData = {
|
|
|
24698
24702
|
goal: 'engagement' | 'traffic' | 'awareness' | 'video_views' | 'lead_generation' | 'lead_conversion' | 'job_applicants' | 'conversions' | 'app_promotion' | 'catalog_sales';
|
|
24699
24703
|
specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'ISSUES_ELECTIONS_POLITICS' | 'FINANCIAL_PRODUCTS_SERVICES' | 'ONLINE_GAMBLING_AND_GAMING')>;
|
|
24700
24704
|
/**
|
|
24701
|
-
* Campaign-level (CBO) budget in
|
|
24705
|
+
* 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.
|
|
24702
24706
|
*/
|
|
24703
24707
|
budgetAmount?: number;
|
|
24704
24708
|
budgetType?: 'daily' | 'lifetime';
|
|
24705
24709
|
status?: 'ACTIVE' | 'PAUSED';
|
|
24706
24710
|
/**
|
|
24707
|
-
* Campaign bid strategy. Meta
|
|
24711
|
+
* Campaign bid strategy. Meta stores `bid_strategy` alongside the budget, so this REQUIRES `budgetAmount` + `budgetType` on the same request; sending it without a campaign budget is a 400. A campaign carrying a strategy without its `bid_amount` makes every ad set created under it fail with an error that names the ad set (code 100, subcode 1815857), so the bad state is rejected up front rather than accepted. To bid at ad-set level, set the strategy there instead.
|
|
24708
24712
|
*/
|
|
24709
24713
|
bidStrategy?: 'LOWEST_COST_WITHOUT_CAP' | 'LOWEST_COST_WITH_BID_CAP' | 'COST_CAP' | 'LOWEST_COST_WITH_MIN_ROAS';
|
|
24710
24714
|
/**
|
|
@@ -24770,6 +24774,10 @@ type UpdateAdCampaignStatusError = (unknown | {
|
|
|
24770
24774
|
});
|
|
24771
24775
|
type UpdateAdCampaignData = {
|
|
24772
24776
|
body: {
|
|
24777
|
+
/**
|
|
24778
|
+
* Zernio SocialAccount id owning the ad account. Required only to update an EMPTY campaign (zero ads), which has no local Ad documents to resolve a token from.
|
|
24779
|
+
*/
|
|
24780
|
+
accountId?: string;
|
|
24773
24781
|
platform: 'facebook' | 'instagram';
|
|
24774
24782
|
budget?: {
|
|
24775
24783
|
/**
|
|
@@ -24821,6 +24829,10 @@ type UpdateAdCampaignError = (unknown | {
|
|
|
24821
24829
|
type DeleteAdCampaignData = {
|
|
24822
24830
|
body: {
|
|
24823
24831
|
platform: 'facebook' | 'instagram';
|
|
24832
|
+
/**
|
|
24833
|
+
* Zernio SocialAccount id owning the ad account. Required only to delete an EMPTY campaign (zero ads), which has no local Ad documents to resolve a token from.
|
|
24834
|
+
*/
|
|
24835
|
+
accountId?: string;
|
|
24824
24836
|
};
|
|
24825
24837
|
path: {
|
|
24826
24838
|
/**
|
|
@@ -27061,7 +27073,7 @@ type CreateStandaloneAdData = {
|
|
|
27061
27073
|
*/
|
|
27062
27074
|
validateOnly?: boolean;
|
|
27063
27075
|
/**
|
|
27064
|
-
* Required on legacy + multi-creative shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
|
|
27076
|
+
* 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. Required on legacy + multi-creative shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
|
|
27065
27077
|
*/
|
|
27066
27078
|
budgetAmount?: number;
|
|
27067
27079
|
/**
|
|
@@ -27499,7 +27511,7 @@ type CreateStandaloneAdData = {
|
|
|
27499
27511
|
callToAction?: string;
|
|
27500
27512
|
}>;
|
|
27501
27513
|
/**
|
|
27502
|
-
* Meta only. Language the top-level copy is written in (e.g. `en`, `pt_BR`), used by the `translations` default rule. Defaults to `en`. Meta rejects a language asset feed whose default rule carries no locales of its own.
|
|
27514
|
+
* Meta only. Language the top-level copy is written in (e.g. `en`, `pt_BR`), used by the `translations` default rule. Defaults to `en`. Meta rejects a language asset feed whose default rule carries no locales of its own. Must NOT also appear as an entry in `translations`.
|
|
27503
27515
|
*/
|
|
27504
27516
|
defaultLocale?: string;
|
|
27505
27517
|
/**
|
|
@@ -27508,9 +27520,28 @@ type CreateStandaloneAdData = {
|
|
|
27508
27520
|
* Manager. Keeps social proof (likes/comments/shares) on a SINGLE post instead of
|
|
27509
27521
|
* splitting it across one ad per language.
|
|
27510
27522
|
*
|
|
27511
|
-
* The ad's top-level copy
|
|
27512
|
-
*
|
|
27513
|
-
*
|
|
27523
|
+
* The ad's top-level copy is the DEFAULT shown to every locale you do NOT list,
|
|
27524
|
+
* and it counts as one of the language variants.
|
|
27525
|
+
*
|
|
27526
|
+
* IMPORTANT, and the opposite of what you might expect: text does NOT inherit.
|
|
27527
|
+
* Every entry must carry its own `headline`, `body` AND `description`, and all of
|
|
27528
|
+
* them must be DISTINCT from each other and from the ad's top-level copy. Meta
|
|
27529
|
+
* deduplicates identical strings inside the asset feed, so two locales sharing a
|
|
27530
|
+
* string collapse into one asset and the create fails with a misleading "Too few
|
|
27531
|
+
* ... texts provided in asset creation" (subcode 1885817) that names a field which
|
|
27532
|
+
* is actually present. We validate this before calling Meta and return a 400
|
|
27533
|
+
* naming the offending locale and field. `description` is therefore effectively
|
|
27534
|
+
* required on the ad whenever `translations` is present, even though it is
|
|
27535
|
+
* optional otherwise.
|
|
27536
|
+
*
|
|
27537
|
+
* Do NOT list `defaultLocale` inside `translations`: Meta rejects the duplicate
|
|
27538
|
+
* with "The language asset feed includes an unsupported targeting field"
|
|
27539
|
+
* (subcode 1885985).
|
|
27540
|
+
*
|
|
27541
|
+
* Media DOES inherit and is uploaded once when shared. Note that Meta enforces
|
|
27542
|
+
* Dynamic Creative image dimensions on language feeds, so an `imageUrl` that
|
|
27543
|
+
* works on a normal ad may be rejected with "The following images have invalid
|
|
27544
|
+
* dimensions for Dynamic Creative" (subcode 1885558). Video is not affected.
|
|
27514
27545
|
*
|
|
27515
27546
|
* Mutually exclusive with `dynamicCreative`, `placementAssets`, `carouselCards` and
|
|
27516
27547
|
* `existingCreativeId` — Meta allows one `asset_feed_spec` shape per creative.
|
|
@@ -27522,17 +27553,17 @@ type CreateStandaloneAdData = {
|
|
|
27522
27553
|
*/
|
|
27523
27554
|
locale: string;
|
|
27524
27555
|
/**
|
|
27525
|
-
* Headline for this language.
|
|
27556
|
+
* Headline for this language. REQUIRED, and must differ from every other locale and from the ad's top-level headline.
|
|
27526
27557
|
*/
|
|
27527
|
-
headline
|
|
27558
|
+
headline: string;
|
|
27528
27559
|
/**
|
|
27529
|
-
* Primary text for this language.
|
|
27560
|
+
* Primary text for this language. REQUIRED, and must differ from every other locale and from the ad's top-level body.
|
|
27530
27561
|
*/
|
|
27531
|
-
body
|
|
27562
|
+
body: string;
|
|
27532
27563
|
/**
|
|
27533
|
-
* Link description for this language.
|
|
27564
|
+
* Link description for this language. REQUIRED, and must differ from every other locale and from the ad's top-level description.
|
|
27534
27565
|
*/
|
|
27535
|
-
description
|
|
27566
|
+
description: string;
|
|
27536
27567
|
/**
|
|
27537
27568
|
* Image for this language. Inherits the ad's `imageUrl` when omitted. The feed is all-image OR all-video.
|
|
27538
27569
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -24646,6 +24646,10 @@ type ListAdCampaignsData = {
|
|
|
24646
24646
|
* Start of metrics date range (YYYY-MM-DD, inclusive). Defaults to 90 days ago when both date params are omitted.
|
|
24647
24647
|
*/
|
|
24648
24648
|
fromDate?: string;
|
|
24649
|
+
/**
|
|
24650
|
+
* Meta only. Campaign reads aggregate over ad documents, so a campaign with ZERO ads is normally invisible here — the state the two-step create (campaign, then ads via `existingCampaignId`) leaves behind whenever Meta rejects the ad step. Set true to list those too, with `adCount: 0` and zeroed metrics. Requires `accountId` and `adAccountId`, since an empty campaign has no ad row to resolve a token or ad account from.
|
|
24651
|
+
*/
|
|
24652
|
+
includeEmpty?: boolean;
|
|
24649
24653
|
limit?: number;
|
|
24650
24654
|
/**
|
|
24651
24655
|
* Page number (1-based)
|
|
@@ -24698,13 +24702,13 @@ type CreateAdCampaignData = {
|
|
|
24698
24702
|
goal: 'engagement' | 'traffic' | 'awareness' | 'video_views' | 'lead_generation' | 'lead_conversion' | 'job_applicants' | 'conversions' | 'app_promotion' | 'catalog_sales';
|
|
24699
24703
|
specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'ISSUES_ELECTIONS_POLITICS' | 'FINANCIAL_PRODUCTS_SERVICES' | 'ONLINE_GAMBLING_AND_GAMING')>;
|
|
24700
24704
|
/**
|
|
24701
|
-
* Campaign-level (CBO) budget in
|
|
24705
|
+
* 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.
|
|
24702
24706
|
*/
|
|
24703
24707
|
budgetAmount?: number;
|
|
24704
24708
|
budgetType?: 'daily' | 'lifetime';
|
|
24705
24709
|
status?: 'ACTIVE' | 'PAUSED';
|
|
24706
24710
|
/**
|
|
24707
|
-
* Campaign bid strategy. Meta
|
|
24711
|
+
* Campaign bid strategy. Meta stores `bid_strategy` alongside the budget, so this REQUIRES `budgetAmount` + `budgetType` on the same request; sending it without a campaign budget is a 400. A campaign carrying a strategy without its `bid_amount` makes every ad set created under it fail with an error that names the ad set (code 100, subcode 1815857), so the bad state is rejected up front rather than accepted. To bid at ad-set level, set the strategy there instead.
|
|
24708
24712
|
*/
|
|
24709
24713
|
bidStrategy?: 'LOWEST_COST_WITHOUT_CAP' | 'LOWEST_COST_WITH_BID_CAP' | 'COST_CAP' | 'LOWEST_COST_WITH_MIN_ROAS';
|
|
24710
24714
|
/**
|
|
@@ -24770,6 +24774,10 @@ type UpdateAdCampaignStatusError = (unknown | {
|
|
|
24770
24774
|
});
|
|
24771
24775
|
type UpdateAdCampaignData = {
|
|
24772
24776
|
body: {
|
|
24777
|
+
/**
|
|
24778
|
+
* Zernio SocialAccount id owning the ad account. Required only to update an EMPTY campaign (zero ads), which has no local Ad documents to resolve a token from.
|
|
24779
|
+
*/
|
|
24780
|
+
accountId?: string;
|
|
24773
24781
|
platform: 'facebook' | 'instagram';
|
|
24774
24782
|
budget?: {
|
|
24775
24783
|
/**
|
|
@@ -24821,6 +24829,10 @@ type UpdateAdCampaignError = (unknown | {
|
|
|
24821
24829
|
type DeleteAdCampaignData = {
|
|
24822
24830
|
body: {
|
|
24823
24831
|
platform: 'facebook' | 'instagram';
|
|
24832
|
+
/**
|
|
24833
|
+
* Zernio SocialAccount id owning the ad account. Required only to delete an EMPTY campaign (zero ads), which has no local Ad documents to resolve a token from.
|
|
24834
|
+
*/
|
|
24835
|
+
accountId?: string;
|
|
24824
24836
|
};
|
|
24825
24837
|
path: {
|
|
24826
24838
|
/**
|
|
@@ -27061,7 +27073,7 @@ type CreateStandaloneAdData = {
|
|
|
27061
27073
|
*/
|
|
27062
27074
|
validateOnly?: boolean;
|
|
27063
27075
|
/**
|
|
27064
|
-
* Required on legacy + multi-creative shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
|
|
27076
|
+
* 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. Required on legacy + multi-creative shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
|
|
27065
27077
|
*/
|
|
27066
27078
|
budgetAmount?: number;
|
|
27067
27079
|
/**
|
|
@@ -27499,7 +27511,7 @@ type CreateStandaloneAdData = {
|
|
|
27499
27511
|
callToAction?: string;
|
|
27500
27512
|
}>;
|
|
27501
27513
|
/**
|
|
27502
|
-
* Meta only. Language the top-level copy is written in (e.g. `en`, `pt_BR`), used by the `translations` default rule. Defaults to `en`. Meta rejects a language asset feed whose default rule carries no locales of its own.
|
|
27514
|
+
* Meta only. Language the top-level copy is written in (e.g. `en`, `pt_BR`), used by the `translations` default rule. Defaults to `en`. Meta rejects a language asset feed whose default rule carries no locales of its own. Must NOT also appear as an entry in `translations`.
|
|
27503
27515
|
*/
|
|
27504
27516
|
defaultLocale?: string;
|
|
27505
27517
|
/**
|
|
@@ -27508,9 +27520,28 @@ type CreateStandaloneAdData = {
|
|
|
27508
27520
|
* Manager. Keeps social proof (likes/comments/shares) on a SINGLE post instead of
|
|
27509
27521
|
* splitting it across one ad per language.
|
|
27510
27522
|
*
|
|
27511
|
-
* The ad's top-level copy
|
|
27512
|
-
*
|
|
27513
|
-
*
|
|
27523
|
+
* The ad's top-level copy is the DEFAULT shown to every locale you do NOT list,
|
|
27524
|
+
* and it counts as one of the language variants.
|
|
27525
|
+
*
|
|
27526
|
+
* IMPORTANT, and the opposite of what you might expect: text does NOT inherit.
|
|
27527
|
+
* Every entry must carry its own `headline`, `body` AND `description`, and all of
|
|
27528
|
+
* them must be DISTINCT from each other and from the ad's top-level copy. Meta
|
|
27529
|
+
* deduplicates identical strings inside the asset feed, so two locales sharing a
|
|
27530
|
+
* string collapse into one asset and the create fails with a misleading "Too few
|
|
27531
|
+
* ... texts provided in asset creation" (subcode 1885817) that names a field which
|
|
27532
|
+
* is actually present. We validate this before calling Meta and return a 400
|
|
27533
|
+
* naming the offending locale and field. `description` is therefore effectively
|
|
27534
|
+
* required on the ad whenever `translations` is present, even though it is
|
|
27535
|
+
* optional otherwise.
|
|
27536
|
+
*
|
|
27537
|
+
* Do NOT list `defaultLocale` inside `translations`: Meta rejects the duplicate
|
|
27538
|
+
* with "The language asset feed includes an unsupported targeting field"
|
|
27539
|
+
* (subcode 1885985).
|
|
27540
|
+
*
|
|
27541
|
+
* Media DOES inherit and is uploaded once when shared. Note that Meta enforces
|
|
27542
|
+
* Dynamic Creative image dimensions on language feeds, so an `imageUrl` that
|
|
27543
|
+
* works on a normal ad may be rejected with "The following images have invalid
|
|
27544
|
+
* dimensions for Dynamic Creative" (subcode 1885558). Video is not affected.
|
|
27514
27545
|
*
|
|
27515
27546
|
* Mutually exclusive with `dynamicCreative`, `placementAssets`, `carouselCards` and
|
|
27516
27547
|
* `existingCreativeId` — Meta allows one `asset_feed_spec` shape per creative.
|
|
@@ -27522,17 +27553,17 @@ type CreateStandaloneAdData = {
|
|
|
27522
27553
|
*/
|
|
27523
27554
|
locale: string;
|
|
27524
27555
|
/**
|
|
27525
|
-
* Headline for this language.
|
|
27556
|
+
* Headline for this language. REQUIRED, and must differ from every other locale and from the ad's top-level headline.
|
|
27526
27557
|
*/
|
|
27527
|
-
headline
|
|
27558
|
+
headline: string;
|
|
27528
27559
|
/**
|
|
27529
|
-
* Primary text for this language.
|
|
27560
|
+
* Primary text for this language. REQUIRED, and must differ from every other locale and from the ad's top-level body.
|
|
27530
27561
|
*/
|
|
27531
|
-
body
|
|
27562
|
+
body: string;
|
|
27532
27563
|
/**
|
|
27533
|
-
* Link description for this language.
|
|
27564
|
+
* Link description for this language. REQUIRED, and must differ from every other locale and from the ad's top-level description.
|
|
27534
27565
|
*/
|
|
27535
|
-
description
|
|
27566
|
+
description: string;
|
|
27536
27567
|
/**
|
|
27537
27568
|
* Image for this language. Inherits the ad's `imageUrl` when omitted. The feed is all-image OR all-video.
|
|
27538
27569
|
*/
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
36
36
|
// package.json
|
|
37
37
|
var package_default = {
|
|
38
38
|
name: "@getlatedev/node",
|
|
39
|
-
version: "0.2.
|
|
39
|
+
version: "0.2.476",
|
|
40
40
|
description: "The official Node.js library for the Zernio API",
|
|
41
41
|
main: "dist/index.js",
|
|
42
42
|
module: "dist/index.mjs",
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5
5
|
// package.json
|
|
6
6
|
var package_default = {
|
|
7
7
|
name: "@getlatedev/node",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.476",
|
|
9
9
|
description: "The official Node.js library for the Zernio API",
|
|
10
10
|
main: "dist/index.js",
|
|
11
11
|
module: "dist/index.mjs",
|
package/package.json
CHANGED
package/src/generated/sdk.gen.ts
CHANGED
|
@@ -6697,6 +6697,12 @@ export const updateAdCampaignStatus = <ThrowOnError extends boolean = false>(opt
|
|
|
6697
6697
|
* Update a campaign
|
|
6698
6698
|
* Campaign-level edits. At least one of `budget`, `bidStrategy`, `name` or `platformSpecificData` is required.
|
|
6699
6699
|
*
|
|
6700
|
+
* **Empty campaigns.** A campaign with zero ads has no local Ad documents to
|
|
6701
|
+
* resolve, so this would 404 even though it exists on Meta. Send `accountId`
|
|
6702
|
+
* in the body to skip the local lookup and forward the update to Meta. The
|
|
6703
|
+
* response then carries `updated: 0`, since there are no local rows to mirror
|
|
6704
|
+
* onto. `accountId` is ignored when the campaign does have ads.
|
|
6705
|
+
*
|
|
6700
6706
|
* - `budget` updates the CBO (Campaign Budget Optimization) budget. For ABO campaigns
|
|
6701
6707
|
* (where the budget lives on the ad set), use PUT /v1/ads/ad-sets/{adSetId} instead — this endpoint
|
|
6702
6708
|
* will return 409 with code BUDGET_LEVEL_MISMATCH.
|
|
@@ -6724,6 +6730,14 @@ export const updateAdCampaign = <ThrowOnError extends boolean = false>(options:
|
|
|
6724
6730
|
* Meta-only for now. Other platforms return 501 Not Implemented — fall
|
|
6725
6731
|
* back to DELETE /v1/ads/{adId} per ad in the meantime.
|
|
6726
6732
|
*
|
|
6733
|
+
* **Empty campaigns.** A campaign with zero ads has no local Ad documents
|
|
6734
|
+
* to resolve, so it is invisible to `/v1/ads/tree` and this endpoint would
|
|
6735
|
+
* 404. That state is produced by the two-step create flow (campaign, then
|
|
6736
|
+
* ads via `existingCampaignId`) whenever Meta rejects the ad step. To
|
|
6737
|
+
* delete such a shell, send `accountId` in the body: we skip the local
|
|
6738
|
+
* lookup entirely and forward the delete to Meta. `accountId` is ignored
|
|
6739
|
+
* when the campaign does have ads.
|
|
6740
|
+
*
|
|
6727
6741
|
*/
|
|
6728
6742
|
export const deleteAdCampaign = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteAdCampaignData, ThrowOnError>) => {
|
|
6729
6743
|
return (options?.client ?? client).delete<DeleteAdCampaignResponse, DeleteAdCampaignError, ThrowOnError>({
|
|
@@ -25022,6 +25022,10 @@ export type ListAdCampaignsData = {
|
|
|
25022
25022
|
* Start of metrics date range (YYYY-MM-DD, inclusive). Defaults to 90 days ago when both date params are omitted.
|
|
25023
25023
|
*/
|
|
25024
25024
|
fromDate?: string;
|
|
25025
|
+
/**
|
|
25026
|
+
* Meta only. Campaign reads aggregate over ad documents, so a campaign with ZERO ads is normally invisible here — the state the two-step create (campaign, then ads via `existingCampaignId`) leaves behind whenever Meta rejects the ad step. Set true to list those too, with `adCount: 0` and zeroed metrics. Requires `accountId` and `adAccountId`, since an empty campaign has no ad row to resolve a token or ad account from.
|
|
25027
|
+
*/
|
|
25028
|
+
includeEmpty?: boolean;
|
|
25025
25029
|
limit?: number;
|
|
25026
25030
|
/**
|
|
25027
25031
|
* Page number (1-based)
|
|
@@ -25077,13 +25081,13 @@ export type CreateAdCampaignData = {
|
|
|
25077
25081
|
goal: 'engagement' | 'traffic' | 'awareness' | 'video_views' | 'lead_generation' | 'lead_conversion' | 'job_applicants' | 'conversions' | 'app_promotion' | 'catalog_sales';
|
|
25078
25082
|
specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'ISSUES_ELECTIONS_POLITICS' | 'FINANCIAL_PRODUCTS_SERVICES' | 'ONLINE_GAMBLING_AND_GAMING')>;
|
|
25079
25083
|
/**
|
|
25080
|
-
* Campaign-level (CBO) budget in
|
|
25084
|
+
* 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.
|
|
25081
25085
|
*/
|
|
25082
25086
|
budgetAmount?: number;
|
|
25083
25087
|
budgetType?: 'daily' | 'lifetime';
|
|
25084
25088
|
status?: 'ACTIVE' | 'PAUSED';
|
|
25085
25089
|
/**
|
|
25086
|
-
* Campaign bid strategy. Meta
|
|
25090
|
+
* Campaign bid strategy. Meta stores `bid_strategy` alongside the budget, so this REQUIRES `budgetAmount` + `budgetType` on the same request; sending it without a campaign budget is a 400. A campaign carrying a strategy without its `bid_amount` makes every ad set created under it fail with an error that names the ad set (code 100, subcode 1815857), so the bad state is rejected up front rather than accepted. To bid at ad-set level, set the strategy there instead.
|
|
25087
25091
|
*/
|
|
25088
25092
|
bidStrategy?: 'LOWEST_COST_WITHOUT_CAP' | 'LOWEST_COST_WITH_BID_CAP' | 'COST_CAP' | 'LOWEST_COST_WITH_MIN_ROAS';
|
|
25089
25093
|
/**
|
|
@@ -25155,6 +25159,10 @@ export type UpdateAdCampaignStatusError = (unknown | {
|
|
|
25155
25159
|
|
|
25156
25160
|
export type UpdateAdCampaignData = {
|
|
25157
25161
|
body: {
|
|
25162
|
+
/**
|
|
25163
|
+
* Zernio SocialAccount id owning the ad account. Required only to update an EMPTY campaign (zero ads), which has no local Ad documents to resolve a token from.
|
|
25164
|
+
*/
|
|
25165
|
+
accountId?: string;
|
|
25158
25166
|
platform: 'facebook' | 'instagram';
|
|
25159
25167
|
budget?: {
|
|
25160
25168
|
/**
|
|
@@ -25209,6 +25217,10 @@ export type UpdateAdCampaignError = (unknown | {
|
|
|
25209
25217
|
export type DeleteAdCampaignData = {
|
|
25210
25218
|
body: {
|
|
25211
25219
|
platform: 'facebook' | 'instagram';
|
|
25220
|
+
/**
|
|
25221
|
+
* Zernio SocialAccount id owning the ad account. Required only to delete an EMPTY campaign (zero ads), which has no local Ad documents to resolve a token from.
|
|
25222
|
+
*/
|
|
25223
|
+
accountId?: string;
|
|
25212
25224
|
};
|
|
25213
25225
|
path: {
|
|
25214
25226
|
/**
|
|
@@ -27590,7 +27602,7 @@ export type CreateStandaloneAdData = {
|
|
|
27590
27602
|
*/
|
|
27591
27603
|
validateOnly?: boolean;
|
|
27592
27604
|
/**
|
|
27593
|
-
* Required on legacy + multi-creative shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
|
|
27605
|
+
* 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. Required on legacy + multi-creative shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
|
|
27594
27606
|
*/
|
|
27595
27607
|
budgetAmount?: number;
|
|
27596
27608
|
/**
|
|
@@ -28028,7 +28040,7 @@ export type CreateStandaloneAdData = {
|
|
|
28028
28040
|
callToAction?: string;
|
|
28029
28041
|
}>;
|
|
28030
28042
|
/**
|
|
28031
|
-
* Meta only. Language the top-level copy is written in (e.g. `en`, `pt_BR`), used by the `translations` default rule. Defaults to `en`. Meta rejects a language asset feed whose default rule carries no locales of its own.
|
|
28043
|
+
* Meta only. Language the top-level copy is written in (e.g. `en`, `pt_BR`), used by the `translations` default rule. Defaults to `en`. Meta rejects a language asset feed whose default rule carries no locales of its own. Must NOT also appear as an entry in `translations`.
|
|
28032
28044
|
*/
|
|
28033
28045
|
defaultLocale?: string;
|
|
28034
28046
|
/**
|
|
@@ -28037,9 +28049,28 @@ export type CreateStandaloneAdData = {
|
|
|
28037
28049
|
* Manager. Keeps social proof (likes/comments/shares) on a SINGLE post instead of
|
|
28038
28050
|
* splitting it across one ad per language.
|
|
28039
28051
|
*
|
|
28040
|
-
* The ad's top-level copy
|
|
28041
|
-
*
|
|
28042
|
-
*
|
|
28052
|
+
* The ad's top-level copy is the DEFAULT shown to every locale you do NOT list,
|
|
28053
|
+
* and it counts as one of the language variants.
|
|
28054
|
+
*
|
|
28055
|
+
* IMPORTANT, and the opposite of what you might expect: text does NOT inherit.
|
|
28056
|
+
* Every entry must carry its own `headline`, `body` AND `description`, and all of
|
|
28057
|
+
* them must be DISTINCT from each other and from the ad's top-level copy. Meta
|
|
28058
|
+
* deduplicates identical strings inside the asset feed, so two locales sharing a
|
|
28059
|
+
* string collapse into one asset and the create fails with a misleading "Too few
|
|
28060
|
+
* ... texts provided in asset creation" (subcode 1885817) that names a field which
|
|
28061
|
+
* is actually present. We validate this before calling Meta and return a 400
|
|
28062
|
+
* naming the offending locale and field. `description` is therefore effectively
|
|
28063
|
+
* required on the ad whenever `translations` is present, even though it is
|
|
28064
|
+
* optional otherwise.
|
|
28065
|
+
*
|
|
28066
|
+
* Do NOT list `defaultLocale` inside `translations`: Meta rejects the duplicate
|
|
28067
|
+
* with "The language asset feed includes an unsupported targeting field"
|
|
28068
|
+
* (subcode 1885985).
|
|
28069
|
+
*
|
|
28070
|
+
* Media DOES inherit and is uploaded once when shared. Note that Meta enforces
|
|
28071
|
+
* Dynamic Creative image dimensions on language feeds, so an `imageUrl` that
|
|
28072
|
+
* works on a normal ad may be rejected with "The following images have invalid
|
|
28073
|
+
* dimensions for Dynamic Creative" (subcode 1885558). Video is not affected.
|
|
28043
28074
|
*
|
|
28044
28075
|
* Mutually exclusive with `dynamicCreative`, `placementAssets`, `carouselCards` and
|
|
28045
28076
|
* `existingCreativeId` — Meta allows one `asset_feed_spec` shape per creative.
|
|
@@ -28051,17 +28082,17 @@ export type CreateStandaloneAdData = {
|
|
|
28051
28082
|
*/
|
|
28052
28083
|
locale: string;
|
|
28053
28084
|
/**
|
|
28054
|
-
* Headline for this language.
|
|
28085
|
+
* Headline for this language. REQUIRED, and must differ from every other locale and from the ad's top-level headline.
|
|
28055
28086
|
*/
|
|
28056
|
-
headline
|
|
28087
|
+
headline: string;
|
|
28057
28088
|
/**
|
|
28058
|
-
* Primary text for this language.
|
|
28089
|
+
* Primary text for this language. REQUIRED, and must differ from every other locale and from the ad's top-level body.
|
|
28059
28090
|
*/
|
|
28060
|
-
body
|
|
28091
|
+
body: string;
|
|
28061
28092
|
/**
|
|
28062
|
-
* Link description for this language.
|
|
28093
|
+
* Link description for this language. REQUIRED, and must differ from every other locale and from the ad's top-level description.
|
|
28063
28094
|
*/
|
|
28064
|
-
description
|
|
28095
|
+
description: string;
|
|
28065
28096
|
/**
|
|
28066
28097
|
* Image for this language. Inherits the ad's `imageUrl` when omitted. The feed is all-image OR all-video.
|
|
28067
28098
|
*/
|