@getlatedev/node 0.2.388 → 0.2.390
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 +10 -1
- package/dist/index.d.mts +633 -294
- package/dist/index.d.ts +633 -294
- package/dist/index.js +64 -1
- package/dist/index.mjs +64 -1
- package/package.json +1 -1
- package/src/client.ts +18 -0
- package/src/generated/sdk.gen.ts +134 -2
- package/src/generated/types.gen.ts +654 -292
|
@@ -1372,6 +1372,313 @@ export type ConversionEvent = {
|
|
|
1372
1372
|
*/
|
|
1373
1373
|
export type actionSource = 'web' | 'app' | 'offline' | 'crm' | 'phone_call' | 'system_generated';
|
|
1374
1374
|
|
|
1375
|
+
/**
|
|
1376
|
+
* In addition to the `required` list, the request must use
|
|
1377
|
+
* EXACTLY ONE of the two shapes:
|
|
1378
|
+
*
|
|
1379
|
+
* - Single-creative: `headline`, `body`, and one of
|
|
1380
|
+
* `imageUrl` / `video` (mutually exclusive).
|
|
1381
|
+
* - Multi-creative: a non-empty `creatives[]` array. Top-level
|
|
1382
|
+
* `headline` / `body` / `imageUrl` / `video` must NOT be set
|
|
1383
|
+
* on this shape.
|
|
1384
|
+
*
|
|
1385
|
+
* The route enforces this at the Zod boundary; OpenAPI's
|
|
1386
|
+
* `required` cannot express the OR cleanly.
|
|
1387
|
+
*
|
|
1388
|
+
*/
|
|
1389
|
+
export type CtwaAdRequestBody = {
|
|
1390
|
+
/**
|
|
1391
|
+
* Facebook or Instagram SocialAccount ID.
|
|
1392
|
+
*/
|
|
1393
|
+
accountId: string;
|
|
1394
|
+
/**
|
|
1395
|
+
* Meta ad account ID, e.g. `act_123456789`.
|
|
1396
|
+
*/
|
|
1397
|
+
adAccountId: string;
|
|
1398
|
+
/**
|
|
1399
|
+
* Ad display name. Used to derive campaign / ad set names.
|
|
1400
|
+
* On the multi-creative shape, each ad's Meta name gets a
|
|
1401
|
+
* " #N" suffix (1-indexed) so Ads Manager shows them as a
|
|
1402
|
+
* numbered batch.
|
|
1403
|
+
*
|
|
1404
|
+
*/
|
|
1405
|
+
name: string;
|
|
1406
|
+
/**
|
|
1407
|
+
* Single-creative shape only. Mutually exclusive with
|
|
1408
|
+
* `creatives[]`.
|
|
1409
|
+
*
|
|
1410
|
+
*/
|
|
1411
|
+
headline?: string;
|
|
1412
|
+
/**
|
|
1413
|
+
* Primary text shown above the image / video. Single-creative
|
|
1414
|
+
* shape only. Mutually exclusive with `creatives[]`.
|
|
1415
|
+
*
|
|
1416
|
+
*/
|
|
1417
|
+
body?: string;
|
|
1418
|
+
/**
|
|
1419
|
+
* Image asset for single-creative shape. Mutually exclusive
|
|
1420
|
+
* with `video` and with `creatives[]`. Required on the
|
|
1421
|
+
* single-creative shape if `video` is not supplied.
|
|
1422
|
+
*
|
|
1423
|
+
*/
|
|
1424
|
+
imageUrl?: string;
|
|
1425
|
+
/**
|
|
1426
|
+
* Video creative for single-creative shape. Mutually
|
|
1427
|
+
* exclusive with `imageUrl` and with `creatives[]`. Required
|
|
1428
|
+
* on the single-creative shape if `imageUrl` is not supplied.
|
|
1429
|
+
*
|
|
1430
|
+
*/
|
|
1431
|
+
video?: {
|
|
1432
|
+
url: string;
|
|
1433
|
+
/**
|
|
1434
|
+
* Required by Meta for every video creative. Used as the
|
|
1435
|
+
* ad thumbnail.
|
|
1436
|
+
*
|
|
1437
|
+
*/
|
|
1438
|
+
thumbnailUrl: string;
|
|
1439
|
+
};
|
|
1440
|
+
/**
|
|
1441
|
+
* Multi-creative shape: N CTWA ads under one campaign + one
|
|
1442
|
+
* ad set, sharing budget and targeting. Mutually exclusive
|
|
1443
|
+
* with the top-level single-creative fields (`headline` /
|
|
1444
|
+
* `body` / `imageUrl` / `video`). Each entry must supply its
|
|
1445
|
+
* own headline, body, and exactly one of `imageUrl` /
|
|
1446
|
+
* `video`.
|
|
1447
|
+
*
|
|
1448
|
+
*/
|
|
1449
|
+
creatives?: Array<{
|
|
1450
|
+
headline: string;
|
|
1451
|
+
/**
|
|
1452
|
+
* Primary text shown above the image / video.
|
|
1453
|
+
*/
|
|
1454
|
+
body: string;
|
|
1455
|
+
/**
|
|
1456
|
+
* Image asset. Mutually exclusive with this entry's
|
|
1457
|
+
* `video`. Required if `video` is not supplied.
|
|
1458
|
+
*
|
|
1459
|
+
*/
|
|
1460
|
+
imageUrl?: string;
|
|
1461
|
+
/**
|
|
1462
|
+
* Video creative. Mutually exclusive with this entry's
|
|
1463
|
+
* `imageUrl`. Required if `imageUrl` is not supplied.
|
|
1464
|
+
*
|
|
1465
|
+
*/
|
|
1466
|
+
video?: {
|
|
1467
|
+
url: string;
|
|
1468
|
+
/**
|
|
1469
|
+
* Required by Meta for every video creative. Used
|
|
1470
|
+
* as the ad thumbnail.
|
|
1471
|
+
*
|
|
1472
|
+
*/
|
|
1473
|
+
thumbnailUrl: string;
|
|
1474
|
+
};
|
|
1475
|
+
}>;
|
|
1476
|
+
/**
|
|
1477
|
+
* Budget amount in the ad account's currency major units
|
|
1478
|
+
* (e.g. dollars for USD, not cents). Must be > 0.
|
|
1479
|
+
*
|
|
1480
|
+
*/
|
|
1481
|
+
budgetAmount: number;
|
|
1482
|
+
budgetType: 'daily' | 'lifetime';
|
|
1483
|
+
/**
|
|
1484
|
+
* ISO 4217 currency code matching the ad account's currency
|
|
1485
|
+
* (e.g. `USD`). Optional; Meta infers from the ad account
|
|
1486
|
+
* when omitted.
|
|
1487
|
+
*
|
|
1488
|
+
*/
|
|
1489
|
+
currency?: string;
|
|
1490
|
+
/**
|
|
1491
|
+
* ISO 8601 datetime. Required when `budgetType` is `lifetime`.
|
|
1492
|
+
*
|
|
1493
|
+
*/
|
|
1494
|
+
endDate?: string;
|
|
1495
|
+
/**
|
|
1496
|
+
* ISO 3166-1 alpha-2 country codes. Defaults to `["US"]` only
|
|
1497
|
+
* when no other geo (`cities`, `regions`, `zips`, `metros`,
|
|
1498
|
+
* `customLocations`) is supplied.
|
|
1499
|
+
*
|
|
1500
|
+
*/
|
|
1501
|
+
countries?: Array<(string)>;
|
|
1502
|
+
/**
|
|
1503
|
+
* City-level geo targeting for local CTWA campaigns. Each entry maps to Meta's
|
|
1504
|
+
* TargetingGeoLocationCity. `key` is Meta's city ID. `radius`
|
|
1505
|
+
* and `distance_unit` are coupled: set both or neither.
|
|
1506
|
+
* Meta enforces a minimum city radius (~17 km / 10 mi);
|
|
1507
|
+
* smaller values resolve to a 0-size audience and the ad
|
|
1508
|
+
* fails at launch. For a tighter catchment use customLocations
|
|
1509
|
+
* (lat/lng).
|
|
1510
|
+
*
|
|
1511
|
+
*/
|
|
1512
|
+
cities?: Array<{
|
|
1513
|
+
key: string;
|
|
1514
|
+
radius?: number;
|
|
1515
|
+
distance_unit?: 'mile' | 'kilometer';
|
|
1516
|
+
}>;
|
|
1517
|
+
/**
|
|
1518
|
+
* Region / state-level geo targeting. `key` is Meta's region
|
|
1519
|
+
* ID (lookupable via GET /v1/ads/targeting/search?type=region).
|
|
1520
|
+
*
|
|
1521
|
+
*/
|
|
1522
|
+
regions?: Array<{
|
|
1523
|
+
key: string;
|
|
1524
|
+
}>;
|
|
1525
|
+
/**
|
|
1526
|
+
* ZIP / postal-code geo targeting. `key` is the platform's
|
|
1527
|
+
* postal id resolved via /v1/ads/targeting/search.
|
|
1528
|
+
*
|
|
1529
|
+
*/
|
|
1530
|
+
zips?: Array<{
|
|
1531
|
+
key: string;
|
|
1532
|
+
name?: string;
|
|
1533
|
+
}>;
|
|
1534
|
+
/**
|
|
1535
|
+
* DMA / metro-area geo targeting. `key` is Meta's metro id
|
|
1536
|
+
* (e.g. `DMA:807`).
|
|
1537
|
+
*
|
|
1538
|
+
*/
|
|
1539
|
+
metros?: Array<{
|
|
1540
|
+
key: string;
|
|
1541
|
+
name?: string;
|
|
1542
|
+
}>;
|
|
1543
|
+
/**
|
|
1544
|
+
* Point-radius geo (Meta `geo_locations.custom_locations`).
|
|
1545
|
+
* Use for targeting a radius around a specific lat/long when
|
|
1546
|
+
* no Meta city/region key fits. `distanceUnit` is required.
|
|
1547
|
+
*
|
|
1548
|
+
*/
|
|
1549
|
+
customLocations?: Array<{
|
|
1550
|
+
latitude: number;
|
|
1551
|
+
longitude: number;
|
|
1552
|
+
radius: number;
|
|
1553
|
+
distanceUnit: 'mile' | 'kilometer';
|
|
1554
|
+
name?: string;
|
|
1555
|
+
address?: string;
|
|
1556
|
+
}>;
|
|
1557
|
+
ageMin?: number;
|
|
1558
|
+
ageMax?: number;
|
|
1559
|
+
interests?: Array<{
|
|
1560
|
+
id: string;
|
|
1561
|
+
name?: string;
|
|
1562
|
+
}>;
|
|
1563
|
+
/**
|
|
1564
|
+
* Custom audience ID to target.
|
|
1565
|
+
*/
|
|
1566
|
+
audienceId?: string;
|
|
1567
|
+
/**
|
|
1568
|
+
* Manual ad placements on the shared ad set. Omit
|
|
1569
|
+
* for automatic placements. When set, restricts delivery to the chosen surfaces,
|
|
1570
|
+
* mapped onto the ad set's `targeting.{publisher_platforms, facebook_positions, instagram_positions,
|
|
1571
|
+
* messenger_positions, audience_network_positions, threads_positions,
|
|
1572
|
+
* whatsapp_positions, device_platforms}`. Enum membership is validated here; Meta
|
|
1573
|
+
* additionally enforces co-selection rules and restricts which
|
|
1574
|
+
* placements are eligible for click-to-WhatsApp ads, returning an actionable
|
|
1575
|
+
* error which we surface.
|
|
1576
|
+
*
|
|
1577
|
+
*/
|
|
1578
|
+
placements?: {
|
|
1579
|
+
/**
|
|
1580
|
+
* Top-level platforms to deliver on. A position field below is only honoured when its parent platform is included here.
|
|
1581
|
+
*/
|
|
1582
|
+
publisherPlatforms?: Array<('facebook' | 'instagram' | 'threads' | 'messenger' | 'audience_network' | 'whatsapp')>;
|
|
1583
|
+
facebookPositions?: Array<('feed' | 'right_hand_column' | 'marketplace' | 'video_feeds' | 'story' | 'search' | 'instream_video' | 'facebook_reels' | 'facebook_reels_overlay' | 'profile_feed' | 'notification')>;
|
|
1584
|
+
instagramPositions?: Array<('stream' | 'story' | 'explore' | 'explore_home' | 'reels' | 'profile_feed' | 'ig_search' | 'profile_reels')>;
|
|
1585
|
+
messengerPositions?: Array<('messenger_home' | 'sponsored_messages' | 'story')>;
|
|
1586
|
+
audienceNetworkPositions?: Array<('classic' | 'rewarded_video')>;
|
|
1587
|
+
threadsPositions?: Array<('threads_stream')>;
|
|
1588
|
+
whatsappPositions?: Array<('status')>;
|
|
1589
|
+
/**
|
|
1590
|
+
* Restrict by device. Omit to deliver on both mobile and desktop.
|
|
1591
|
+
*/
|
|
1592
|
+
devicePlatforms?: Array<('mobile' | 'desktop')>;
|
|
1593
|
+
};
|
|
1594
|
+
/**
|
|
1595
|
+
* Meta's Advantage+ audience expansion. `0` (default) keeps
|
|
1596
|
+
* targeting strict; `1` lets Meta expand beyond the supplied
|
|
1597
|
+
* targeting when its delivery system finds better matches.
|
|
1598
|
+
* Always sent on CREATE (Meta requires it).
|
|
1599
|
+
*
|
|
1600
|
+
*/
|
|
1601
|
+
advantageAudience?: 0 | 1;
|
|
1602
|
+
/**
|
|
1603
|
+
* Defaults to `OUTCOME_ENGAGEMENT`. `OUTCOME_SALES` and `OUTCOME_LEADS` require
|
|
1604
|
+
* additional account configuration (Dataset linked to the WABA
|
|
1605
|
+
* for sales) and may be rejected by Meta if missing.
|
|
1606
|
+
*
|
|
1607
|
+
*/
|
|
1608
|
+
objective?: 'OUTCOME_ENGAGEMENT' | 'OUTCOME_SALES' | 'OUTCOME_LEADS';
|
|
1609
|
+
/**
|
|
1610
|
+
* Meta bid strategy applied to the shared ad set. Defaults to
|
|
1611
|
+
* `LOWEST_COST_WITHOUT_CAP` (auto-bid) when omitted.
|
|
1612
|
+
* `LOWEST_COST_WITH_BID_CAP` and `COST_CAP` require
|
|
1613
|
+
* `bidAmount`. `LOWEST_COST_WITH_MIN_ROAS` requires
|
|
1614
|
+
* `roasAverageFloor`. CTWA's `optimization_goal` is fixed to
|
|
1615
|
+
* `CONVERSATIONS`, but the bid strategy is independent.
|
|
1616
|
+
*
|
|
1617
|
+
*/
|
|
1618
|
+
bidStrategy?: 'LOWEST_COST_WITHOUT_CAP' | 'LOWEST_COST_WITH_BID_CAP' | 'COST_CAP' | 'LOWEST_COST_WITH_MIN_ROAS';
|
|
1619
|
+
/**
|
|
1620
|
+
* Whole currency units (e.g. `5` = $5.00 on a USD account).
|
|
1621
|
+
* Required when `bidStrategy` is `LOWEST_COST_WITH_BID_CAP`
|
|
1622
|
+
* or `COST_CAP`; rejected otherwise.
|
|
1623
|
+
*
|
|
1624
|
+
*/
|
|
1625
|
+
bidAmount?: number;
|
|
1626
|
+
/**
|
|
1627
|
+
* Decimal ROAS multiplier (e.g. `2.0` = 2.0× ROAS floor).
|
|
1628
|
+
* Required when `bidStrategy` is `LOWEST_COST_WITH_MIN_ROAS`;
|
|
1629
|
+
* rejected otherwise. Meta enforces its own upper bound
|
|
1630
|
+
* server-side.
|
|
1631
|
+
*
|
|
1632
|
+
*/
|
|
1633
|
+
roasAverageFloor?: number;
|
|
1634
|
+
/**
|
|
1635
|
+
* Legal entity that benefits from the ad. Required when targeting EU users
|
|
1636
|
+
* (EU DSA, Article 26). Optional if the ad account has a default beneficiary:
|
|
1637
|
+
* set it once via `PATCH /v1/ads/accounts` or in Meta Ads Manager, and Meta
|
|
1638
|
+
* fills it in whenever the field is omitted.
|
|
1639
|
+
*
|
|
1640
|
+
*/
|
|
1641
|
+
dsaBeneficiary?: string;
|
|
1642
|
+
/**
|
|
1643
|
+
* Legal entity that pays for the ad. Can differ from `dsaBeneficiary`
|
|
1644
|
+
* (for example, an agency paying for a client's ads). Same rules as
|
|
1645
|
+
* `dsaBeneficiary`: required for EU targeting unless the ad account has
|
|
1646
|
+
* a default payor.
|
|
1647
|
+
*
|
|
1648
|
+
*/
|
|
1649
|
+
dsaPayor?: string;
|
|
1650
|
+
};
|
|
1651
|
+
|
|
1652
|
+
export type budgetType = 'daily' | 'lifetime';
|
|
1653
|
+
|
|
1654
|
+
/**
|
|
1655
|
+
* Meta's Advantage+ audience expansion. `0` (default) keeps
|
|
1656
|
+
* targeting strict; `1` lets Meta expand beyond the supplied
|
|
1657
|
+
* targeting when its delivery system finds better matches.
|
|
1658
|
+
* Always sent on CREATE (Meta requires it).
|
|
1659
|
+
*
|
|
1660
|
+
*/
|
|
1661
|
+
export type advantageAudience = 0 | 1;
|
|
1662
|
+
|
|
1663
|
+
/**
|
|
1664
|
+
* Defaults to `OUTCOME_ENGAGEMENT`. `OUTCOME_SALES` and `OUTCOME_LEADS` require
|
|
1665
|
+
* additional account configuration (Dataset linked to the WABA
|
|
1666
|
+
* for sales) and may be rejected by Meta if missing.
|
|
1667
|
+
*
|
|
1668
|
+
*/
|
|
1669
|
+
export type objective = 'OUTCOME_ENGAGEMENT' | 'OUTCOME_SALES' | 'OUTCOME_LEADS';
|
|
1670
|
+
|
|
1671
|
+
/**
|
|
1672
|
+
* Meta bid strategy applied to the shared ad set. Defaults to
|
|
1673
|
+
* `LOWEST_COST_WITHOUT_CAP` (auto-bid) when omitted.
|
|
1674
|
+
* `LOWEST_COST_WITH_BID_CAP` and `COST_CAP` require
|
|
1675
|
+
* `bidAmount`. `LOWEST_COST_WITH_MIN_ROAS` requires
|
|
1676
|
+
* `roasAverageFloor`. CTWA's `optimization_goal` is fixed to
|
|
1677
|
+
* `CONVERSATIONS`, but the bid strategy is independent.
|
|
1678
|
+
*
|
|
1679
|
+
*/
|
|
1680
|
+
export type bidStrategy = 'LOWEST_COST_WITHOUT_CAP' | 'LOWEST_COST_WITH_BID_CAP' | 'COST_CAP' | 'LOWEST_COST_WITH_MIN_ROAS';
|
|
1681
|
+
|
|
1375
1682
|
/**
|
|
1376
1683
|
* Response returned by `POST /v1/ads/ctwa` when the request used the
|
|
1377
1684
|
* multi-creative shape (`creatives[]`). N persisted Ad documents share
|
|
@@ -23401,6 +23708,38 @@ export type DuplicateAdCampaignError = (unknown | {
|
|
|
23401
23708
|
error?: string;
|
|
23402
23709
|
});
|
|
23403
23710
|
|
|
23711
|
+
export type GetAdSetDetailsData = {
|
|
23712
|
+
path: {
|
|
23713
|
+
/**
|
|
23714
|
+
* Meta ad set id (platformAdSetId).
|
|
23715
|
+
*/
|
|
23716
|
+
adSetId: string;
|
|
23717
|
+
};
|
|
23718
|
+
query: {
|
|
23719
|
+
/**
|
|
23720
|
+
* Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
23721
|
+
*/
|
|
23722
|
+
accountId: string;
|
|
23723
|
+
/**
|
|
23724
|
+
* Comma-separated Graph field override (supports nested {} projections).
|
|
23725
|
+
*/
|
|
23726
|
+
fields?: string;
|
|
23727
|
+
};
|
|
23728
|
+
};
|
|
23729
|
+
|
|
23730
|
+
export type GetAdSetDetailsResponse = ({
|
|
23731
|
+
/**
|
|
23732
|
+
* Raw Meta ad set; keys are the requested Graph fields.
|
|
23733
|
+
*/
|
|
23734
|
+
adSet?: {
|
|
23735
|
+
[key: string]: unknown;
|
|
23736
|
+
};
|
|
23737
|
+
});
|
|
23738
|
+
|
|
23739
|
+
export type GetAdSetDetailsError = (unknown | {
|
|
23740
|
+
error?: string;
|
|
23741
|
+
});
|
|
23742
|
+
|
|
23404
23743
|
export type UpdateAdSetData = {
|
|
23405
23744
|
body: {
|
|
23406
23745
|
platform: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter';
|
|
@@ -23886,6 +24225,77 @@ export type GetCampaignAnalyticsError = (ErrorResponse | {
|
|
|
23886
24225
|
error?: string;
|
|
23887
24226
|
} | unknown);
|
|
23888
24227
|
|
|
24228
|
+
export type GenerateAdPreviewsData = {
|
|
24229
|
+
body: {
|
|
24230
|
+
/**
|
|
24231
|
+
* Zernio SocialAccount id used to resolve the Meta token.
|
|
24232
|
+
*/
|
|
24233
|
+
accountId: string;
|
|
24234
|
+
/**
|
|
24235
|
+
* Meta ad account id (act_<n>).
|
|
24236
|
+
*/
|
|
24237
|
+
adAccountId: string;
|
|
24238
|
+
/**
|
|
24239
|
+
* Meta ad_format values, one preview per format. Defaults to [DESKTOP_FEED_STANDARD].
|
|
24240
|
+
*/
|
|
24241
|
+
formats?: Array<(string)>;
|
|
24242
|
+
/**
|
|
24243
|
+
* Preview an existing ad-account creative by id. Mutually exclusive with creativeSpec.
|
|
24244
|
+
*/
|
|
24245
|
+
existingCreativeId?: string;
|
|
24246
|
+
/**
|
|
24247
|
+
* Raw Meta creative spec forwarded verbatim to /generatepreviews. Mutually exclusive with existingCreativeId.
|
|
24248
|
+
*/
|
|
24249
|
+
creativeSpec?: {
|
|
24250
|
+
[key: string]: unknown;
|
|
24251
|
+
};
|
|
24252
|
+
};
|
|
24253
|
+
};
|
|
24254
|
+
|
|
24255
|
+
export type GenerateAdPreviewsResponse = ({
|
|
24256
|
+
previews?: Array<{
|
|
24257
|
+
format?: string;
|
|
24258
|
+
/**
|
|
24259
|
+
* Meta's <iframe> snippet; null when Meta returned no preview for the format.
|
|
24260
|
+
*/
|
|
24261
|
+
html?: (string) | null;
|
|
24262
|
+
}>;
|
|
24263
|
+
});
|
|
24264
|
+
|
|
24265
|
+
export type GenerateAdPreviewsError = (unknown | {
|
|
24266
|
+
error?: string;
|
|
24267
|
+
});
|
|
24268
|
+
|
|
24269
|
+
export type GetAdPreviewsData = {
|
|
24270
|
+
path: {
|
|
24271
|
+
/**
|
|
24272
|
+
* Zernio ad id (24-char hex).
|
|
24273
|
+
*/
|
|
24274
|
+
adId: string;
|
|
24275
|
+
};
|
|
24276
|
+
query?: {
|
|
24277
|
+
/**
|
|
24278
|
+
* Comma-separated Meta ad_format values (max 10), one preview per format. Defaults to DESKTOP_FEED_STANDARD.
|
|
24279
|
+
*/
|
|
24280
|
+
formats?: string;
|
|
24281
|
+
};
|
|
24282
|
+
};
|
|
24283
|
+
|
|
24284
|
+
export type GetAdPreviewsResponse = ({
|
|
24285
|
+
adId?: string;
|
|
24286
|
+
previews?: Array<{
|
|
24287
|
+
format?: string;
|
|
24288
|
+
/**
|
|
24289
|
+
* Meta's <iframe> snippet; null when Meta returned no preview for the format.
|
|
24290
|
+
*/
|
|
24291
|
+
html?: (string) | null;
|
|
24292
|
+
}>;
|
|
24293
|
+
});
|
|
24294
|
+
|
|
24295
|
+
export type GetAdPreviewsError = (unknown | {
|
|
24296
|
+
error?: string;
|
|
24297
|
+
});
|
|
24298
|
+
|
|
23889
24299
|
export type QueryAdInsightsData = {
|
|
23890
24300
|
query: {
|
|
23891
24301
|
/**
|
|
@@ -24330,40 +24740,179 @@ export type ListAdsBusinessCentersError = ({
|
|
|
24330
24740
|
error?: string;
|
|
24331
24741
|
} | unknown);
|
|
24332
24742
|
|
|
24333
|
-
export type
|
|
24743
|
+
export type GetAdsActivityLogData = {
|
|
24334
24744
|
query: {
|
|
24335
24745
|
/**
|
|
24336
|
-
*
|
|
24746
|
+
* Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
24337
24747
|
*/
|
|
24338
24748
|
accountId: string;
|
|
24339
24749
|
/**
|
|
24340
|
-
*
|
|
24750
|
+
* Meta ad account id (act_<n>).
|
|
24341
24751
|
*/
|
|
24342
|
-
adAccountId
|
|
24752
|
+
adAccountId: string;
|
|
24343
24753
|
/**
|
|
24344
|
-
*
|
|
24754
|
+
* Cursor from paging.after of the previous page.
|
|
24345
24755
|
*/
|
|
24346
|
-
|
|
24347
|
-
};
|
|
24348
|
-
};
|
|
24349
|
-
|
|
24350
|
-
export type ListAdAccountsResponse = ({
|
|
24351
|
-
accounts?: Array<{
|
|
24756
|
+
after?: string;
|
|
24352
24757
|
/**
|
|
24353
|
-
*
|
|
24758
|
+
* Rows per page
|
|
24354
24759
|
*/
|
|
24355
|
-
|
|
24356
|
-
name?: string;
|
|
24357
|
-
currency?: string;
|
|
24358
|
-
status?: string;
|
|
24760
|
+
limit?: number;
|
|
24359
24761
|
/**
|
|
24360
|
-
*
|
|
24762
|
+
* Client-side filter to one Meta object id (campaign, ad set or ad).
|
|
24361
24763
|
*/
|
|
24362
|
-
|
|
24764
|
+
objectId?: string;
|
|
24363
24765
|
/**
|
|
24364
|
-
*
|
|
24766
|
+
* Start of range (YYYY-MM-DD).
|
|
24365
24767
|
*/
|
|
24366
|
-
|
|
24768
|
+
since?: string;
|
|
24769
|
+
/**
|
|
24770
|
+
* End of range (YYYY-MM-DD).
|
|
24771
|
+
*/
|
|
24772
|
+
until?: string;
|
|
24773
|
+
};
|
|
24774
|
+
};
|
|
24775
|
+
|
|
24776
|
+
export type GetAdsActivityLogResponse = ({
|
|
24777
|
+
adAccountId?: string;
|
|
24778
|
+
data?: Array<{
|
|
24779
|
+
[key: string]: unknown;
|
|
24780
|
+
}>;
|
|
24781
|
+
paging?: {
|
|
24782
|
+
/**
|
|
24783
|
+
* Cursor for the next page; null when exhausted.
|
|
24784
|
+
*/
|
|
24785
|
+
after?: (string) | null;
|
|
24786
|
+
};
|
|
24787
|
+
});
|
|
24788
|
+
|
|
24789
|
+
export type GetAdsActivityLogError = (unknown | {
|
|
24790
|
+
error?: string;
|
|
24791
|
+
});
|
|
24792
|
+
|
|
24793
|
+
export type ListAdStudiesData = {
|
|
24794
|
+
query: {
|
|
24795
|
+
/**
|
|
24796
|
+
* Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
24797
|
+
*/
|
|
24798
|
+
accountId: string;
|
|
24799
|
+
/**
|
|
24800
|
+
* Meta ad account id (act_<n>).
|
|
24801
|
+
*/
|
|
24802
|
+
adAccountId: string;
|
|
24803
|
+
/**
|
|
24804
|
+
* Cursor from paging.after of the previous page.
|
|
24805
|
+
*/
|
|
24806
|
+
after?: string;
|
|
24807
|
+
/**
|
|
24808
|
+
* Comma-separated Graph field override (supports nested {} projections).
|
|
24809
|
+
*/
|
|
24810
|
+
fields?: string;
|
|
24811
|
+
/**
|
|
24812
|
+
* Rows per page
|
|
24813
|
+
*/
|
|
24814
|
+
limit?: number;
|
|
24815
|
+
};
|
|
24816
|
+
};
|
|
24817
|
+
|
|
24818
|
+
export type ListAdStudiesResponse = ({
|
|
24819
|
+
adAccountId?: string;
|
|
24820
|
+
data?: Array<{
|
|
24821
|
+
[key: string]: unknown;
|
|
24822
|
+
}>;
|
|
24823
|
+
paging?: {
|
|
24824
|
+
/**
|
|
24825
|
+
* Cursor for the next page; null when exhausted.
|
|
24826
|
+
*/
|
|
24827
|
+
after?: (string) | null;
|
|
24828
|
+
};
|
|
24829
|
+
});
|
|
24830
|
+
|
|
24831
|
+
export type ListAdStudiesError = (unknown | {
|
|
24832
|
+
error?: string;
|
|
24833
|
+
});
|
|
24834
|
+
|
|
24835
|
+
export type GetAdAccountFinanceData = {
|
|
24836
|
+
query: {
|
|
24837
|
+
/**
|
|
24838
|
+
* Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
24839
|
+
*/
|
|
24840
|
+
accountId: string;
|
|
24841
|
+
/**
|
|
24842
|
+
* Meta ad account id (act_<n>).
|
|
24843
|
+
*/
|
|
24844
|
+
adAccountId: string;
|
|
24845
|
+
};
|
|
24846
|
+
};
|
|
24847
|
+
|
|
24848
|
+
export type GetAdAccountFinanceResponse = ({
|
|
24849
|
+
adAccountId?: string;
|
|
24850
|
+
/**
|
|
24851
|
+
* ISO 4217 code all money values are expressed in.
|
|
24852
|
+
*/
|
|
24853
|
+
currency?: string;
|
|
24854
|
+
/**
|
|
24855
|
+
* Outstanding/prepaid balance in whole currency units.
|
|
24856
|
+
*/
|
|
24857
|
+
balance?: number;
|
|
24858
|
+
/**
|
|
24859
|
+
* Lifetime amount spent in whole currency units.
|
|
24860
|
+
*/
|
|
24861
|
+
amountSpent?: number;
|
|
24862
|
+
/**
|
|
24863
|
+
* Account spend cap; null when none is set.
|
|
24864
|
+
*/
|
|
24865
|
+
spendCap?: (number) | null;
|
|
24866
|
+
fundingSource?: {
|
|
24867
|
+
/**
|
|
24868
|
+
* Human-readable payment method, e.g. 'Mastercard *4985'.
|
|
24869
|
+
*/
|
|
24870
|
+
displayString?: string;
|
|
24871
|
+
/**
|
|
24872
|
+
* Meta funding source type code.
|
|
24873
|
+
*/
|
|
24874
|
+
type?: number;
|
|
24875
|
+
} | null;
|
|
24876
|
+
});
|
|
24877
|
+
|
|
24878
|
+
export type GetAdAccountFinanceError = (unknown | {
|
|
24879
|
+
error?: string;
|
|
24880
|
+
});
|
|
24881
|
+
|
|
24882
|
+
export type ListAdAccountsData = {
|
|
24883
|
+
query: {
|
|
24884
|
+
/**
|
|
24885
|
+
* Social account ID
|
|
24886
|
+
*/
|
|
24887
|
+
accountId: string;
|
|
24888
|
+
/**
|
|
24889
|
+
* Filter response to a single platform ad account ID (e.g. `act_123` for Meta, advertiser_id for TikTok). Returns at most one item.
|
|
24890
|
+
*/
|
|
24891
|
+
adAccountId?: string;
|
|
24892
|
+
/**
|
|
24893
|
+
* Clamp the returned `accounts[]` length. Useful for typeahead pickers on agency tokens with hundreds of advertisers.
|
|
24894
|
+
*/
|
|
24895
|
+
limit?: number;
|
|
24896
|
+
};
|
|
24897
|
+
};
|
|
24898
|
+
|
|
24899
|
+
export type ListAdAccountsResponse = ({
|
|
24900
|
+
accounts?: Array<{
|
|
24901
|
+
/**
|
|
24902
|
+
* Platform ad account ID (e.g. act_123)
|
|
24903
|
+
*/
|
|
24904
|
+
id?: string;
|
|
24905
|
+
name?: string;
|
|
24906
|
+
currency?: string;
|
|
24907
|
+
status?: string;
|
|
24908
|
+
/**
|
|
24909
|
+
* IANA timezone of the ad account (Meta only). Drives daily-budget reset and Insights day boundaries.
|
|
24910
|
+
*/
|
|
24911
|
+
timezoneName?: string;
|
|
24912
|
+
/**
|
|
24913
|
+
* Signed UTC offset in hours, reflecting current DST (Meta only).
|
|
24914
|
+
*/
|
|
24915
|
+
timezoneOffsetHoursUtc?: number;
|
|
24367
24916
|
/**
|
|
24368
24917
|
* Meta only. Minimum daily budget for the account, in the account currency's major units. This is the impressions-billed minimum; other billing events have higher minimums. Absent when the connected token cannot read it.
|
|
24369
24918
|
*/
|
|
@@ -24632,7 +25181,7 @@ export type BoostPostData = {
|
|
|
24632
25181
|
/**
|
|
24633
25182
|
* Meta only. Required for housing, employment, credit, or political ads.
|
|
24634
25183
|
*/
|
|
24635
|
-
specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'ISSUES_ELECTIONS_POLITICS')>;
|
|
25184
|
+
specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'FINANCIAL_PRODUCTS_SERVICES' | 'ISSUES_ELECTIONS_POLITICS' | 'ONLINE_GAMBLING_AND_GAMING')>;
|
|
24636
25185
|
/**
|
|
24637
25186
|
* TikTok-only. Custom destination URL for the Spark Ad. Without this, TikTok
|
|
24638
25187
|
* Spark Ads have no clickable destination — required for traffic / conversion
|
|
@@ -24794,7 +25343,7 @@ export type CreateStandaloneAdData = {
|
|
|
24794
25343
|
/**
|
|
24795
25344
|
* Required on legacy + attach shapes for Meta. Honoured on TikTok (passes through to the Spark Ad creative's `call_to_action`) and on LinkedIn (the CTA button on the ad; defaults to LEARN_MORE when `linkUrl` is set). LinkedIn accepts: LEARN_MORE, SIGN_UP, DOWNLOAD, SUBSCRIBE, REGISTER, JOIN, ATTEND, REQUEST_DEMO, VIEW_QUOTE, APPLY, SEE_MORE, SHOP_NOW, BUY_NOW. Ignored by Google, Pinterest, and X/Twitter.
|
|
24796
25345
|
*/
|
|
24797
|
-
callToAction?: 'LEARN_MORE' | 'SHOP_NOW' | 'SIGN_UP' | 'BOOK_TRAVEL' | 'CONTACT_US' | 'DOWNLOAD' | 'GET_OFFER' | 'GET_QUOTE' | 'SUBSCRIBE' | 'WATCH_MORE' | 'REGISTER' | 'JOIN' | 'ATTEND' | 'REQUEST_DEMO' | 'VIEW_QUOTE' | 'APPLY' | 'SEE_MORE' | 'BUY_NOW';
|
|
25346
|
+
callToAction?: 'LEARN_MORE' | 'SHOP_NOW' | 'SIGN_UP' | 'BOOK_TRAVEL' | 'CONTACT_US' | 'DOWNLOAD' | 'GET_OFFER' | 'GET_QUOTE' | 'SUBSCRIBE' | 'WATCH_MORE' | 'ADD_TO_CART' | 'APPLY_NOW' | 'BOOK_NOW' | 'BUY_TICKETS' | 'DONATE' | 'DONATE_NOW' | 'GET_DIRECTIONS' | 'GET_SHOWTIMES' | 'LISTEN_NOW' | 'ORDER_NOW' | 'PLAY_GAME' | 'REQUEST_TIME' | 'SEE_MENU' | 'START_ORDER' | 'INSTALL_MOBILE_APP' | 'USE_APP' | 'REGISTER' | 'JOIN' | 'ATTEND' | 'REQUEST_DEMO' | 'VIEW_QUOTE' | 'APPLY' | 'SEE_MORE' | 'BUY_NOW';
|
|
24798
25347
|
/**
|
|
24799
25348
|
* Required on legacy + attach shapes (skip for multi-creative). On LinkedIn it's the ad's destination URL; required for `traffic` ads, optional for `engagement` / `awareness`. NOT required when `goal` is `lead_generation` (the ad opens a Lead Gen form instead of a destination). On LinkedIn, `imageUrl` + `linkUrl` publishes an ARTICLE-content creative; this is LinkedIn's article ad format, with the image as thumbnail and `longHeadline` as description.
|
|
24800
25349
|
*/
|
|
@@ -24863,7 +25412,7 @@ export type CreateStandaloneAdData = {
|
|
|
24863
25412
|
thumbnailUrl?: string;
|
|
24864
25413
|
};
|
|
24865
25414
|
linkUrl: string;
|
|
24866
|
-
callToAction: 'LEARN_MORE' | 'SHOP_NOW' | 'SIGN_UP' | 'BOOK_TRAVEL' | 'CONTACT_US' | 'DOWNLOAD' | 'GET_OFFER' | 'GET_QUOTE' | 'SUBSCRIBE' | 'WATCH_MORE';
|
|
25415
|
+
callToAction: 'LEARN_MORE' | 'SHOP_NOW' | 'SIGN_UP' | 'BOOK_TRAVEL' | 'CONTACT_US' | 'DOWNLOAD' | 'GET_OFFER' | 'GET_QUOTE' | 'SUBSCRIBE' | 'WATCH_MORE' | 'ADD_TO_CART' | 'APPLY_NOW' | 'BOOK_NOW' | 'BUY_TICKETS' | 'DONATE' | 'DONATE_NOW' | 'GET_DIRECTIONS' | 'GET_SHOWTIMES' | 'LISTEN_NOW' | 'ORDER_NOW' | 'PLAY_GAME' | 'REQUEST_TIME' | 'SEE_MENU' | 'START_ORDER' | 'INSTALL_MOBILE_APP' | 'USE_APP';
|
|
24867
25416
|
}>;
|
|
24868
25417
|
/**
|
|
24869
25418
|
* Meta-only. When present, switches to the attach shape: adds
|
|
@@ -25085,7 +25634,7 @@ export type CreateStandaloneAdData = {
|
|
|
25085
25634
|
* category disables income/zip targeting on Meta.
|
|
25086
25635
|
*
|
|
25087
25636
|
*/
|
|
25088
|
-
specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'ISSUES_ELECTIONS_POLITICS')>;
|
|
25637
|
+
specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'FINANCIAL_PRODUCTS_SERVICES' | 'ISSUES_ELECTIONS_POLITICS' | 'ONLINE_GAMBLING_AND_GAMING')>;
|
|
25089
25638
|
/**
|
|
25090
25639
|
* Required for lifetime budgets
|
|
25091
25640
|
*/
|
|
@@ -25139,7 +25688,7 @@ export type CreateStandaloneAdData = {
|
|
|
25139
25688
|
/**
|
|
25140
25689
|
* CTA-button variations. Required.
|
|
25141
25690
|
*/
|
|
25142
|
-
callToActionTypes?: Array<('LEARN_MORE' | 'SHOP_NOW' | 'SIGN_UP' | 'BOOK_TRAVEL' | 'CONTACT_US' | 'DOWNLOAD' | 'GET_OFFER' | 'GET_QUOTE' | 'SUBSCRIBE' | 'WATCH_MORE' | 'REGISTER' | 'JOIN' | 'ATTEND' | 'REQUEST_DEMO' | 'VIEW_QUOTE' | 'APPLY' | 'SEE_MORE' | 'BUY_NOW')>;
|
|
25691
|
+
callToActionTypes?: Array<('LEARN_MORE' | 'SHOP_NOW' | 'SIGN_UP' | 'BOOK_TRAVEL' | 'CONTACT_US' | 'DOWNLOAD' | 'GET_OFFER' | 'GET_QUOTE' | 'SUBSCRIBE' | 'WATCH_MORE' | 'ADD_TO_CART' | 'APPLY_NOW' | 'BOOK_NOW' | 'BUY_TICKETS' | 'DONATE' | 'DONATE_NOW' | 'GET_DIRECTIONS' | 'GET_SHOWTIMES' | 'LISTEN_NOW' | 'ORDER_NOW' | 'PLAY_GAME' | 'REQUEST_TIME' | 'SEE_MENU' | 'START_ORDER' | 'INSTALL_MOBILE_APP' | 'USE_APP' | 'REGISTER' | 'JOIN' | 'ATTEND' | 'REQUEST_DEMO' | 'VIEW_QUOTE' | 'APPLY' | 'SEE_MORE' | 'BUY_NOW')>;
|
|
25143
25692
|
/**
|
|
25144
25693
|
* Asset-feed ad format. Defaults to SINGLE_IMAGE.
|
|
25145
25694
|
*/
|
|
@@ -25716,6 +26265,45 @@ export type CreateTestLeadError = ({
|
|
|
25716
26265
|
error?: string;
|
|
25717
26266
|
});
|
|
25718
26267
|
|
|
26268
|
+
export type UploadAdImageData = {
|
|
26269
|
+
body: {
|
|
26270
|
+
/**
|
|
26271
|
+
* Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
26272
|
+
*/
|
|
26273
|
+
accountId: string;
|
|
26274
|
+
/**
|
|
26275
|
+
* Meta ad account id (act_<n>).
|
|
26276
|
+
*/
|
|
26277
|
+
adAccountId: string;
|
|
26278
|
+
/**
|
|
26279
|
+
* Raw base64 image bytes, or a full data URL (the data:image/...;base64, prefix is stripped).
|
|
26280
|
+
*/
|
|
26281
|
+
imageBase64: string;
|
|
26282
|
+
/**
|
|
26283
|
+
* Optional filename shown in Meta's image library. Defaults to ad_image.jpg.
|
|
26284
|
+
*/
|
|
26285
|
+
filename?: string;
|
|
26286
|
+
};
|
|
26287
|
+
};
|
|
26288
|
+
|
|
26289
|
+
export type UploadAdImageResponse = ({
|
|
26290
|
+
adAccountId?: string;
|
|
26291
|
+
image?: {
|
|
26292
|
+
/**
|
|
26293
|
+
* Meta image hash, reusable wherever image_hash is accepted.
|
|
26294
|
+
*/
|
|
26295
|
+
hash?: string;
|
|
26296
|
+
/**
|
|
26297
|
+
* Meta-hosted image URL; usable as imageUrl on the create endpoints.
|
|
26298
|
+
*/
|
|
26299
|
+
url?: string;
|
|
26300
|
+
};
|
|
26301
|
+
});
|
|
26302
|
+
|
|
26303
|
+
export type UploadAdImageError = (unknown | {
|
|
26304
|
+
error?: string;
|
|
26305
|
+
});
|
|
26306
|
+
|
|
25719
26307
|
export type SearchAdInterestsData = {
|
|
25720
26308
|
query: {
|
|
25721
26309
|
/**
|
|
@@ -26363,8 +26951,12 @@ export type SendConversionsData = {
|
|
|
26363
26951
|
testCode?: string;
|
|
26364
26952
|
/**
|
|
26365
26953
|
* Batch-level user consent. Required by Google for EEA/UK
|
|
26366
|
-
* events under the Feb 2026 restrictions.
|
|
26367
|
-
*
|
|
26954
|
+
* events under the Feb 2026 restrictions. On Meta, any
|
|
26955
|
+
* DENIED flag enables Limited Data Use on every event in
|
|
26956
|
+
* the batch (data_processing_options ["LDU"] with
|
|
26957
|
+
* geolocation, country 0 / state 0); GRANTED or absent
|
|
26958
|
+
* consent sends events with Meta's default processing.
|
|
26959
|
+
* Ignored by LinkedIn.
|
|
26368
26960
|
*
|
|
26369
26961
|
*/
|
|
26370
26962
|
consent?: {
|
|
@@ -27015,272 +27607,42 @@ export type SendWhatsAppConversionError = (unknown | {
|
|
|
27015
27607
|
error?: string;
|
|
27016
27608
|
});
|
|
27017
27609
|
|
|
27610
|
+
export type CreateMessagingAdData = {
|
|
27611
|
+
body: (CtwaAdRequestBody & {
|
|
27612
|
+
/**
|
|
27613
|
+
* Where the conversation opens when the ad is tapped.
|
|
27614
|
+
*/
|
|
27615
|
+
destination: 'whatsapp' | 'messenger' | 'instagram_direct';
|
|
27616
|
+
});
|
|
27617
|
+
};
|
|
27618
|
+
|
|
27619
|
+
export type CreateMessagingAdResponse = (unknown);
|
|
27620
|
+
|
|
27621
|
+
export type CreateMessagingAdError = (unknown | {
|
|
27622
|
+
error?: string;
|
|
27623
|
+
});
|
|
27624
|
+
|
|
27625
|
+
export type CreateCallAdData = {
|
|
27626
|
+
body: (CtwaAdRequestBody & {
|
|
27627
|
+
/**
|
|
27628
|
+
* E.164 number the CALL_NOW CTA dials (e.g. +34600111222).
|
|
27629
|
+
*/
|
|
27630
|
+
phoneNumber: string;
|
|
27631
|
+
/**
|
|
27632
|
+
* Website shown as the creative's link. Required: Meta rejects tel: as link_data.link; the phone number rides only the CTA.
|
|
27633
|
+
*/
|
|
27634
|
+
linkUrl: string;
|
|
27635
|
+
});
|
|
27636
|
+
};
|
|
27637
|
+
|
|
27638
|
+
export type CreateCallAdResponse = (unknown);
|
|
27639
|
+
|
|
27640
|
+
export type CreateCallAdError = (unknown | {
|
|
27641
|
+
error?: string;
|
|
27642
|
+
});
|
|
27643
|
+
|
|
27018
27644
|
export type CreateCtwaAdData = {
|
|
27019
|
-
body:
|
|
27020
|
-
/**
|
|
27021
|
-
* Facebook or Instagram SocialAccount ID.
|
|
27022
|
-
*/
|
|
27023
|
-
accountId: string;
|
|
27024
|
-
/**
|
|
27025
|
-
* Meta ad account ID, e.g. `act_123456789`.
|
|
27026
|
-
*/
|
|
27027
|
-
adAccountId: string;
|
|
27028
|
-
/**
|
|
27029
|
-
* Ad display name. Used to derive campaign / ad set names.
|
|
27030
|
-
* On the multi-creative shape, each ad's Meta name gets a
|
|
27031
|
-
* " #N" suffix (1-indexed) so Ads Manager shows them as a
|
|
27032
|
-
* numbered batch.
|
|
27033
|
-
*
|
|
27034
|
-
*/
|
|
27035
|
-
name: string;
|
|
27036
|
-
/**
|
|
27037
|
-
* Single-creative shape only. Mutually exclusive with
|
|
27038
|
-
* `creatives[]`.
|
|
27039
|
-
*
|
|
27040
|
-
*/
|
|
27041
|
-
headline?: string;
|
|
27042
|
-
/**
|
|
27043
|
-
* Primary text shown above the image / video. Single-creative
|
|
27044
|
-
* shape only. Mutually exclusive with `creatives[]`.
|
|
27045
|
-
*
|
|
27046
|
-
*/
|
|
27047
|
-
body?: string;
|
|
27048
|
-
/**
|
|
27049
|
-
* Image asset for single-creative shape. Mutually exclusive
|
|
27050
|
-
* with `video` and with `creatives[]`. Required on the
|
|
27051
|
-
* single-creative shape if `video` is not supplied.
|
|
27052
|
-
*
|
|
27053
|
-
*/
|
|
27054
|
-
imageUrl?: string;
|
|
27055
|
-
/**
|
|
27056
|
-
* Video creative for single-creative shape. Mutually
|
|
27057
|
-
* exclusive with `imageUrl` and with `creatives[]`. Required
|
|
27058
|
-
* on the single-creative shape if `imageUrl` is not supplied.
|
|
27059
|
-
*
|
|
27060
|
-
*/
|
|
27061
|
-
video?: {
|
|
27062
|
-
url: string;
|
|
27063
|
-
/**
|
|
27064
|
-
* Required by Meta for every video creative. Used as the
|
|
27065
|
-
* ad thumbnail.
|
|
27066
|
-
*
|
|
27067
|
-
*/
|
|
27068
|
-
thumbnailUrl: string;
|
|
27069
|
-
};
|
|
27070
|
-
/**
|
|
27071
|
-
* Multi-creative shape: N CTWA ads under one campaign + one
|
|
27072
|
-
* ad set, sharing budget and targeting. Mutually exclusive
|
|
27073
|
-
* with the top-level single-creative fields (`headline` /
|
|
27074
|
-
* `body` / `imageUrl` / `video`). Each entry must supply its
|
|
27075
|
-
* own headline, body, and exactly one of `imageUrl` /
|
|
27076
|
-
* `video`.
|
|
27077
|
-
*
|
|
27078
|
-
*/
|
|
27079
|
-
creatives?: Array<{
|
|
27080
|
-
headline: string;
|
|
27081
|
-
/**
|
|
27082
|
-
* Primary text shown above the image / video.
|
|
27083
|
-
*/
|
|
27084
|
-
body: string;
|
|
27085
|
-
/**
|
|
27086
|
-
* Image asset. Mutually exclusive with this entry's
|
|
27087
|
-
* `video`. Required if `video` is not supplied.
|
|
27088
|
-
*
|
|
27089
|
-
*/
|
|
27090
|
-
imageUrl?: string;
|
|
27091
|
-
/**
|
|
27092
|
-
* Video creative. Mutually exclusive with this entry's
|
|
27093
|
-
* `imageUrl`. Required if `imageUrl` is not supplied.
|
|
27094
|
-
*
|
|
27095
|
-
*/
|
|
27096
|
-
video?: {
|
|
27097
|
-
url: string;
|
|
27098
|
-
/**
|
|
27099
|
-
* Required by Meta for every video creative. Used
|
|
27100
|
-
* as the ad thumbnail.
|
|
27101
|
-
*
|
|
27102
|
-
*/
|
|
27103
|
-
thumbnailUrl: string;
|
|
27104
|
-
};
|
|
27105
|
-
}>;
|
|
27106
|
-
/**
|
|
27107
|
-
* Budget amount in the ad account's currency major units
|
|
27108
|
-
* (e.g. dollars for USD, not cents). Must be > 0.
|
|
27109
|
-
*
|
|
27110
|
-
*/
|
|
27111
|
-
budgetAmount: number;
|
|
27112
|
-
budgetType: 'daily' | 'lifetime';
|
|
27113
|
-
/**
|
|
27114
|
-
* ISO 4217 currency code matching the ad account's currency
|
|
27115
|
-
* (e.g. `USD`). Optional; Meta infers from the ad account
|
|
27116
|
-
* when omitted.
|
|
27117
|
-
*
|
|
27118
|
-
*/
|
|
27119
|
-
currency?: string;
|
|
27120
|
-
/**
|
|
27121
|
-
* ISO 8601 datetime. Required when `budgetType` is `lifetime`.
|
|
27122
|
-
*
|
|
27123
|
-
*/
|
|
27124
|
-
endDate?: string;
|
|
27125
|
-
/**
|
|
27126
|
-
* ISO 3166-1 alpha-2 country codes. Defaults to `["US"]` only
|
|
27127
|
-
* when no other geo (`cities`, `regions`, `zips`, `metros`,
|
|
27128
|
-
* `customLocations`) is supplied.
|
|
27129
|
-
*
|
|
27130
|
-
*/
|
|
27131
|
-
countries?: Array<(string)>;
|
|
27132
|
-
/**
|
|
27133
|
-
* City-level geo targeting for local CTWA campaigns (e.g.
|
|
27134
|
-
* 25km radius around Milan). Each entry maps to Meta's
|
|
27135
|
-
* TargetingGeoLocationCity. `key` is Meta's city ID
|
|
27136
|
-
* (lookupable via GET /v1/ads/targeting/search). `radius`
|
|
27137
|
-
* and `distance_unit` are coupled: set both or neither.
|
|
27138
|
-
* Meta enforces a minimum city radius (~17 km / 10 mi);
|
|
27139
|
-
* smaller values resolve to a 0-size audience and the ad
|
|
27140
|
-
* fails at launch. For a tighter catchment use customLocations
|
|
27141
|
-
* (lat/lng).
|
|
27142
|
-
*
|
|
27143
|
-
*/
|
|
27144
|
-
cities?: Array<{
|
|
27145
|
-
key: string;
|
|
27146
|
-
radius?: number;
|
|
27147
|
-
distance_unit?: 'mile' | 'kilometer';
|
|
27148
|
-
}>;
|
|
27149
|
-
/**
|
|
27150
|
-
* Region / state-level geo targeting. `key` is Meta's region
|
|
27151
|
-
* ID (lookupable via GET /v1/ads/targeting/search?type=region).
|
|
27152
|
-
*
|
|
27153
|
-
*/
|
|
27154
|
-
regions?: Array<{
|
|
27155
|
-
key: string;
|
|
27156
|
-
}>;
|
|
27157
|
-
/**
|
|
27158
|
-
* ZIP / postal-code geo targeting. `key` is the platform's
|
|
27159
|
-
* postal id resolved via /v1/ads/targeting/search.
|
|
27160
|
-
*
|
|
27161
|
-
*/
|
|
27162
|
-
zips?: Array<{
|
|
27163
|
-
key: string;
|
|
27164
|
-
name?: string;
|
|
27165
|
-
}>;
|
|
27166
|
-
/**
|
|
27167
|
-
* DMA / metro-area geo targeting. `key` is Meta's metro id
|
|
27168
|
-
* (e.g. `DMA:807`).
|
|
27169
|
-
*
|
|
27170
|
-
*/
|
|
27171
|
-
metros?: Array<{
|
|
27172
|
-
key: string;
|
|
27173
|
-
name?: string;
|
|
27174
|
-
}>;
|
|
27175
|
-
/**
|
|
27176
|
-
* Point-radius geo (Meta `geo_locations.custom_locations`).
|
|
27177
|
-
* Use for targeting a radius around a specific lat/long when
|
|
27178
|
-
* no Meta city/region key fits. `distanceUnit` is required.
|
|
27179
|
-
*
|
|
27180
|
-
*/
|
|
27181
|
-
customLocations?: Array<{
|
|
27182
|
-
latitude: number;
|
|
27183
|
-
longitude: number;
|
|
27184
|
-
radius: number;
|
|
27185
|
-
distanceUnit: 'mile' | 'kilometer';
|
|
27186
|
-
name?: string;
|
|
27187
|
-
address?: string;
|
|
27188
|
-
}>;
|
|
27189
|
-
ageMin?: number;
|
|
27190
|
-
ageMax?: number;
|
|
27191
|
-
interests?: Array<{
|
|
27192
|
-
id: string;
|
|
27193
|
-
name?: string;
|
|
27194
|
-
}>;
|
|
27195
|
-
/**
|
|
27196
|
-
* Custom audience ID to target.
|
|
27197
|
-
*/
|
|
27198
|
-
audienceId?: string;
|
|
27199
|
-
/**
|
|
27200
|
-
* Manual ad placements on the shared ad set. Omit
|
|
27201
|
-
* for automatic placements. When set, restricts delivery to the chosen surfaces,
|
|
27202
|
-
* mapped onto the ad set's `targeting.{publisher_platforms, facebook_positions, instagram_positions,
|
|
27203
|
-
* messenger_positions, audience_network_positions, threads_positions,
|
|
27204
|
-
* whatsapp_positions, device_platforms}`. Enum membership is validated here; Meta
|
|
27205
|
-
* additionally enforces co-selection rules and restricts which
|
|
27206
|
-
* placements are eligible for click-to-WhatsApp ads, returning an actionable
|
|
27207
|
-
* error which we surface.
|
|
27208
|
-
*
|
|
27209
|
-
*/
|
|
27210
|
-
placements?: {
|
|
27211
|
-
/**
|
|
27212
|
-
* Top-level platforms to deliver on. A position field below is only honoured when its parent platform is included here.
|
|
27213
|
-
*/
|
|
27214
|
-
publisherPlatforms?: Array<('facebook' | 'instagram' | 'threads' | 'messenger' | 'audience_network' | 'whatsapp')>;
|
|
27215
|
-
facebookPositions?: Array<('feed' | 'right_hand_column' | 'marketplace' | 'video_feeds' | 'story' | 'search' | 'instream_video' | 'facebook_reels' | 'facebook_reels_overlay' | 'profile_feed' | 'notification')>;
|
|
27216
|
-
instagramPositions?: Array<('stream' | 'story' | 'explore' | 'explore_home' | 'reels' | 'profile_feed' | 'ig_search' | 'profile_reels')>;
|
|
27217
|
-
messengerPositions?: Array<('messenger_home' | 'sponsored_messages' | 'story')>;
|
|
27218
|
-
audienceNetworkPositions?: Array<('classic' | 'rewarded_video')>;
|
|
27219
|
-
threadsPositions?: Array<('threads_stream')>;
|
|
27220
|
-
whatsappPositions?: Array<('status')>;
|
|
27221
|
-
/**
|
|
27222
|
-
* Restrict by device. Omit to deliver on both mobile and desktop.
|
|
27223
|
-
*/
|
|
27224
|
-
devicePlatforms?: Array<('mobile' | 'desktop')>;
|
|
27225
|
-
};
|
|
27226
|
-
/**
|
|
27227
|
-
* Meta's Advantage+ audience expansion. `0` (default) keeps
|
|
27228
|
-
* targeting strict; `1` lets Meta expand beyond the supplied
|
|
27229
|
-
* targeting when its delivery system finds better matches.
|
|
27230
|
-
* Always sent on CREATE (Meta requires it).
|
|
27231
|
-
*
|
|
27232
|
-
*/
|
|
27233
|
-
advantageAudience?: 0 | 1;
|
|
27234
|
-
/**
|
|
27235
|
-
* Defaults to `OUTCOME_ENGAGEMENT` (the broadly-supported CTWA
|
|
27236
|
-
* objective). `OUTCOME_SALES` and `OUTCOME_LEADS` require
|
|
27237
|
-
* additional account configuration (Dataset linked to the WABA
|
|
27238
|
-
* for sales) and may be rejected by Meta if missing.
|
|
27239
|
-
*
|
|
27240
|
-
*/
|
|
27241
|
-
objective?: 'OUTCOME_ENGAGEMENT' | 'OUTCOME_SALES' | 'OUTCOME_LEADS';
|
|
27242
|
-
/**
|
|
27243
|
-
* Meta bid strategy applied to the shared ad set. Defaults to
|
|
27244
|
-
* `LOWEST_COST_WITHOUT_CAP` (auto-bid) when omitted.
|
|
27245
|
-
* `LOWEST_COST_WITH_BID_CAP` and `COST_CAP` require
|
|
27246
|
-
* `bidAmount`. `LOWEST_COST_WITH_MIN_ROAS` requires
|
|
27247
|
-
* `roasAverageFloor`. CTWA's `optimization_goal` is fixed to
|
|
27248
|
-
* `CONVERSATIONS`, but the bid strategy is independent.
|
|
27249
|
-
*
|
|
27250
|
-
*/
|
|
27251
|
-
bidStrategy?: 'LOWEST_COST_WITHOUT_CAP' | 'LOWEST_COST_WITH_BID_CAP' | 'COST_CAP' | 'LOWEST_COST_WITH_MIN_ROAS';
|
|
27252
|
-
/**
|
|
27253
|
-
* Whole currency units (e.g. `5` = $5.00 on a USD account).
|
|
27254
|
-
* Required when `bidStrategy` is `LOWEST_COST_WITH_BID_CAP`
|
|
27255
|
-
* or `COST_CAP`; rejected otherwise.
|
|
27256
|
-
*
|
|
27257
|
-
*/
|
|
27258
|
-
bidAmount?: number;
|
|
27259
|
-
/**
|
|
27260
|
-
* Decimal ROAS multiplier (e.g. `2.0` = 2.0× ROAS floor).
|
|
27261
|
-
* Required when `bidStrategy` is `LOWEST_COST_WITH_MIN_ROAS`;
|
|
27262
|
-
* rejected otherwise. Meta enforces its own upper bound
|
|
27263
|
-
* server-side.
|
|
27264
|
-
*
|
|
27265
|
-
*/
|
|
27266
|
-
roasAverageFloor?: number;
|
|
27267
|
-
/**
|
|
27268
|
-
* Legal entity that benefits from the ad. Required when targeting EU users
|
|
27269
|
-
* (EU DSA, Article 26). Optional if the ad account has a default beneficiary:
|
|
27270
|
-
* set it once via `PATCH /v1/ads/accounts` or in Meta Ads Manager, and Meta
|
|
27271
|
-
* fills it in whenever the field is omitted.
|
|
27272
|
-
*
|
|
27273
|
-
*/
|
|
27274
|
-
dsaBeneficiary?: string;
|
|
27275
|
-
/**
|
|
27276
|
-
* Legal entity that pays for the ad. Can differ from `dsaBeneficiary`
|
|
27277
|
-
* (for example, an agency paying for a client's ads). Same rules as
|
|
27278
|
-
* `dsaBeneficiary`: required for EU targeting unless the ad account has
|
|
27279
|
-
* a default payor.
|
|
27280
|
-
*
|
|
27281
|
-
*/
|
|
27282
|
-
dsaPayor?: string;
|
|
27283
|
-
};
|
|
27645
|
+
body: CtwaAdRequestBody;
|
|
27284
27646
|
};
|
|
27285
27647
|
|
|
27286
27648
|
export type CreateCtwaAdResponse = ((CtwaSingleResponse | CtwaMultiResponse));
|