@zernio/node 0.2.111 → 0.2.113
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 +12 -0
- package/dist/index.d.mts +467 -16
- package/dist/index.d.ts +467 -16
- package/dist/index.js +61 -0
- package/dist/index.mjs +61 -0
- package/package.json +1 -1
- package/src/client.ts +22 -0
- package/src/generated/sdk.gen.ts +130 -2
- package/src/generated/types.gen.ts +487 -15
|
@@ -918,6 +918,54 @@ export type ConversionEvent = {
|
|
|
918
918
|
*/
|
|
919
919
|
export type actionSource = 'web' | 'app' | 'offline' | 'crm' | 'phone_call' | 'system_generated';
|
|
920
920
|
|
|
921
|
+
export type CreateLeadFormBody = {
|
|
922
|
+
/**
|
|
923
|
+
* Facebook social account ID (Late SocialAccount _id).
|
|
924
|
+
*/
|
|
925
|
+
accountId: string;
|
|
926
|
+
name: string;
|
|
927
|
+
questions: Array<LeadGenFormQuestion>;
|
|
928
|
+
/**
|
|
929
|
+
* Required by Meta. Must be reachable from Meta's crawler.
|
|
930
|
+
*/
|
|
931
|
+
privacyPolicyUrl: string;
|
|
932
|
+
privacyPolicyLinkText?: string;
|
|
933
|
+
followUpActionUrl?: string;
|
|
934
|
+
locale?: string;
|
|
935
|
+
thankYouTitle?: string;
|
|
936
|
+
thankYouBody?: string;
|
|
937
|
+
thankYouButtonText?: string;
|
|
938
|
+
/**
|
|
939
|
+
* Meta enum (e.g. VIEW_WEBSITE, CALL_BUSINESS, DOWNLOAD)
|
|
940
|
+
*/
|
|
941
|
+
thankYouButtonType?: string;
|
|
942
|
+
thankYouWebsiteUrl?: string;
|
|
943
|
+
isOptimizedForQuality?: boolean;
|
|
944
|
+
contextCard?: {
|
|
945
|
+
title?: string;
|
|
946
|
+
style?: 'LIST_STYLE' | 'PARAGRAPH_STYLE';
|
|
947
|
+
content?: Array<(string)>;
|
|
948
|
+
buttonText?: string;
|
|
949
|
+
};
|
|
950
|
+
legalContent?: {
|
|
951
|
+
customDisclaimer?: {
|
|
952
|
+
title?: string;
|
|
953
|
+
body?: string;
|
|
954
|
+
};
|
|
955
|
+
};
|
|
956
|
+
/**
|
|
957
|
+
* Up to 20 key/value pairs surfaced on every lead for attribution.
|
|
958
|
+
*/
|
|
959
|
+
trackingParameters?: {
|
|
960
|
+
[key: string]: (string);
|
|
961
|
+
};
|
|
962
|
+
questionPageCustomHeadline?: string;
|
|
963
|
+
allowOrganicLead?: boolean;
|
|
964
|
+
blockDisplayForNonTargetedViewer?: boolean;
|
|
965
|
+
};
|
|
966
|
+
|
|
967
|
+
export type style = 'LIST_STYLE' | 'PARAGRAPH_STYLE';
|
|
968
|
+
|
|
921
969
|
/**
|
|
922
970
|
* Discord message settings. Supports plain text (2,000 chars), rich embeds (up to 10), native polls, forum posts, threads, and announcement crossposts. Media attachments support images (JPEG, PNG, GIF, WebP), videos (MP4), and documents (up to 10 files, 25 MB each). Webhook identity (username + avatar) can be customized per-account via PATCH /v1/connect/discord or per-post via webhookUsername/webhookAvatarUrl.
|
|
923
971
|
*
|
|
@@ -1617,6 +1665,111 @@ export type contentType2 = 'story';
|
|
|
1617
1665
|
*/
|
|
1618
1666
|
export type graduationStrategy = 'MANUAL' | 'SS_PERFORMANCE';
|
|
1619
1667
|
|
|
1668
|
+
/**
|
|
1669
|
+
* A single lead submission returned by the leads endpoint and the lead.received webhook.
|
|
1670
|
+
*/
|
|
1671
|
+
export type Lead = {
|
|
1672
|
+
/**
|
|
1673
|
+
* Meta `leadgen_id`.
|
|
1674
|
+
*/
|
|
1675
|
+
id?: string;
|
|
1676
|
+
createdTime?: string;
|
|
1677
|
+
/**
|
|
1678
|
+
* Meta ad ID that surfaced the form. Organic leads omit this.
|
|
1679
|
+
*/
|
|
1680
|
+
adId?: (string) | null;
|
|
1681
|
+
formId?: string;
|
|
1682
|
+
/**
|
|
1683
|
+
* Flattened key→value map of answers (multi-value fields joined with ", ").
|
|
1684
|
+
*/
|
|
1685
|
+
fields?: {
|
|
1686
|
+
[key: string]: (string);
|
|
1687
|
+
};
|
|
1688
|
+
/**
|
|
1689
|
+
* Raw `field_data` from Meta (one entry per question).
|
|
1690
|
+
*/
|
|
1691
|
+
fieldData?: Array<{
|
|
1692
|
+
name?: string;
|
|
1693
|
+
values?: Array<(string)>;
|
|
1694
|
+
}>;
|
|
1695
|
+
};
|
|
1696
|
+
|
|
1697
|
+
/**
|
|
1698
|
+
* Common meta-block returned alongside lead-form responses for traceability.
|
|
1699
|
+
*/
|
|
1700
|
+
export type LeadFormResponseMeta = {
|
|
1701
|
+
platform?: string;
|
|
1702
|
+
accountId?: string;
|
|
1703
|
+
formId?: (string) | null;
|
|
1704
|
+
leadId?: (string) | null;
|
|
1705
|
+
pageId?: (string) | null;
|
|
1706
|
+
lastUpdated?: string;
|
|
1707
|
+
};
|
|
1708
|
+
|
|
1709
|
+
/**
|
|
1710
|
+
* A Meta Lead Gen (Instant) Form definition.
|
|
1711
|
+
*/
|
|
1712
|
+
export type LeadGenForm = {
|
|
1713
|
+
id?: string;
|
|
1714
|
+
name?: string;
|
|
1715
|
+
status?: 'ACTIVE' | 'ARCHIVED' | 'DELETED' | 'DRAFT';
|
|
1716
|
+
locale?: string;
|
|
1717
|
+
created_time?: string;
|
|
1718
|
+
/**
|
|
1719
|
+
* Total leads (real + organic).
|
|
1720
|
+
*/
|
|
1721
|
+
leads_count?: number;
|
|
1722
|
+
organic_leads_count?: (number) | null;
|
|
1723
|
+
expired_leads_count?: (number) | null;
|
|
1724
|
+
questions?: Array<LeadGenFormQuestion>;
|
|
1725
|
+
privacy_policy_url?: (string) | null;
|
|
1726
|
+
follow_up_action_url?: (string) | null;
|
|
1727
|
+
thank_you_page?: {
|
|
1728
|
+
[key: string]: unknown;
|
|
1729
|
+
} | null;
|
|
1730
|
+
context_card?: {
|
|
1731
|
+
[key: string]: unknown;
|
|
1732
|
+
} | null;
|
|
1733
|
+
question_page_custom_headline?: (string) | null;
|
|
1734
|
+
is_optimized_for_quality?: (boolean) | null;
|
|
1735
|
+
page_id?: (string) | null;
|
|
1736
|
+
};
|
|
1737
|
+
|
|
1738
|
+
export type status3 = 'ACTIVE' | 'ARCHIVED' | 'DELETED' | 'DRAFT';
|
|
1739
|
+
|
|
1740
|
+
/**
|
|
1741
|
+
* A single question on a Meta Instant Form. The `type` enum spans Meta's
|
|
1742
|
+
* prefill set (FULL_NAME, EMAIL, PHONE, STREET_ADDRESS, CITY, STATE,
|
|
1743
|
+
* COUNTRY, POST_CODE, DOB, GENDER, JOB_TITLE, COMPANY_NAME, etc.) plus
|
|
1744
|
+
* custom types (CUSTOM, MULTIPLE_CHOICE, CONDITIONAL, STORE_LOOKUP,
|
|
1745
|
+
* APPOINTMENT_REQUEST). See Meta's Lead Ads docs for the full list —
|
|
1746
|
+
* we forward whatever string the caller sends so new types work without
|
|
1747
|
+
* a Zernio release.
|
|
1748
|
+
*
|
|
1749
|
+
*/
|
|
1750
|
+
export type LeadGenFormQuestion = {
|
|
1751
|
+
/**
|
|
1752
|
+
* Stable key returned in `field_data` on each lead. If omitted, Meta auto-derives one from `label`.
|
|
1753
|
+
*/
|
|
1754
|
+
key?: string;
|
|
1755
|
+
/**
|
|
1756
|
+
* Display text shown above the input.
|
|
1757
|
+
*/
|
|
1758
|
+
label?: string;
|
|
1759
|
+
type: string;
|
|
1760
|
+
/**
|
|
1761
|
+
* Required for MULTIPLE_CHOICE / CONDITIONAL questions.
|
|
1762
|
+
*/
|
|
1763
|
+
options?: Array<{
|
|
1764
|
+
key?: string;
|
|
1765
|
+
value?: string;
|
|
1766
|
+
}>;
|
|
1767
|
+
/**
|
|
1768
|
+
* Help text rendered below the field.
|
|
1769
|
+
*/
|
|
1770
|
+
inline_context?: string;
|
|
1771
|
+
};
|
|
1772
|
+
|
|
1620
1773
|
/**
|
|
1621
1774
|
* Response for DAILY aggregation (time series breakdown)
|
|
1622
1775
|
*/
|
|
@@ -1867,7 +2020,7 @@ export type PlatformAnalytics = {
|
|
|
1867
2020
|
errorMessage?: (string) | null;
|
|
1868
2021
|
};
|
|
1869
2022
|
|
|
1870
|
-
export type
|
|
2023
|
+
export type status4 = 'published' | 'failed';
|
|
1871
2024
|
|
|
1872
2025
|
/**
|
|
1873
2026
|
* Sync state of analytics for this platform
|
|
@@ -1977,7 +2130,7 @@ export type Post = {
|
|
|
1977
2130
|
updatedAt?: string;
|
|
1978
2131
|
};
|
|
1979
2132
|
|
|
1980
|
-
export type
|
|
2133
|
+
export type status5 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
1981
2134
|
|
|
1982
2135
|
export type visibility = 'public' | 'private' | 'unlisted';
|
|
1983
2136
|
|
|
@@ -2644,7 +2797,7 @@ export type UploadTokenResponse = {
|
|
|
2644
2797
|
status?: 'pending' | 'completed' | 'expired';
|
|
2645
2798
|
};
|
|
2646
2799
|
|
|
2647
|
-
export type
|
|
2800
|
+
export type status6 = 'pending' | 'completed' | 'expired';
|
|
2648
2801
|
|
|
2649
2802
|
export type UploadTokenStatusResponse = {
|
|
2650
2803
|
token?: string;
|
|
@@ -2715,7 +2868,7 @@ export type Webhook = {
|
|
|
2715
2868
|
/**
|
|
2716
2869
|
* Events subscribed to
|
|
2717
2870
|
*/
|
|
2718
|
-
events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'comment.received' | 'review.new' | 'review.updated')>;
|
|
2871
|
+
events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received')>;
|
|
2719
2872
|
/**
|
|
2720
2873
|
* Whether webhook delivery is enabled
|
|
2721
2874
|
*/
|
|
@@ -2768,6 +2921,20 @@ export type WebhookPayloadAccountAdsInitialSyncCompleted = {
|
|
|
2768
2921
|
* URL of the account's profile picture, when available.
|
|
2769
2922
|
*/
|
|
2770
2923
|
profilePicture?: string;
|
|
2924
|
+
/**
|
|
2925
|
+
* When the consumer scoped the connect call to a single ad account, this echoes
|
|
2926
|
+
* that ID back so the webhook can be correlated to the originating connect
|
|
2927
|
+
* request without consulting the consumer's DB. Meta uses the `act_*` shape.
|
|
2928
|
+
*
|
|
2929
|
+
*/
|
|
2930
|
+
platformAdAccountId?: string;
|
|
2931
|
+
/**
|
|
2932
|
+
* Every ad-account ID that the connected token could see at discovery time.
|
|
2933
|
+
* Useful for "we synced ads from these accounts" UX without a follow-up API call.
|
|
2934
|
+
* Empty array when the token had no ad-account visibility.
|
|
2935
|
+
*
|
|
2936
|
+
*/
|
|
2937
|
+
platformAdAccountIds?: Array<(string)>;
|
|
2771
2938
|
};
|
|
2772
2939
|
/**
|
|
2773
2940
|
* Summary of the initial ads sync backfill results.
|
|
@@ -2789,6 +2956,37 @@ export type WebhookPayloadAccountAdsInitialSyncCompleted = {
|
|
|
2789
2956
|
* Number of ads that failed to sync.
|
|
2790
2957
|
*/
|
|
2791
2958
|
failed: number;
|
|
2959
|
+
/**
|
|
2960
|
+
* Free-form error message from the platform (typically Meta's Marketing API).
|
|
2961
|
+
* Truncated to ~2KB. Present when `status` is `failure` (and sometimes on `success`
|
|
2962
|
+
* when discovery saw zero ad accounts). For UX branching prefer `errorCategory`;
|
|
2963
|
+
* this field is for human display and debugging.
|
|
2964
|
+
*
|
|
2965
|
+
*/
|
|
2966
|
+
error?: string;
|
|
2967
|
+
/**
|
|
2968
|
+
* Platform-native error code if parsed (e.g. Meta `190`, `10`, `200`).
|
|
2969
|
+
*/
|
|
2970
|
+
errorCode?: string;
|
|
2971
|
+
/**
|
|
2972
|
+
* Platform-native error subcode if parsed.
|
|
2973
|
+
*/
|
|
2974
|
+
errorSubcode?: string;
|
|
2975
|
+
/**
|
|
2976
|
+
* Stable category for UX branching. New values may be added; existing ones are
|
|
2977
|
+
* stable. Mapping:
|
|
2978
|
+
* - `token_invalid`: access token is expired or revoked. Reconnect.
|
|
2979
|
+
* - `permission_denied`: token lacks required scope, or the user has no role
|
|
2980
|
+
* on the Business Manager that owns the ad account. Reconnect with full
|
|
2981
|
+
* permissions, or have an admin grant access.
|
|
2982
|
+
* - `no_ad_accounts`: token is valid but sees zero ad accounts. The user
|
|
2983
|
+
* needs to connect a Business Manager that owns ad accounts.
|
|
2984
|
+
* - `rate_limited`: platform throttled us. Sync will retry automatically.
|
|
2985
|
+
* - `discovery_failed`: any other platform-side failure. Inspect `error`.
|
|
2986
|
+
* - `unknown`: classifier could not categorize the failure.
|
|
2987
|
+
*
|
|
2988
|
+
*/
|
|
2989
|
+
errorCategory?: 'token_invalid' | 'permission_denied' | 'no_ad_accounts' | 'rate_limited' | 'discovery_failed' | 'unknown';
|
|
2792
2990
|
};
|
|
2793
2991
|
timestamp: string;
|
|
2794
2992
|
};
|
|
@@ -2798,7 +2996,23 @@ export type event = 'account.ads.initial_sync_completed';
|
|
|
2798
2996
|
/**
|
|
2799
2997
|
* Overall outcome of the initial sync.
|
|
2800
2998
|
*/
|
|
2801
|
-
export type
|
|
2999
|
+
export type status7 = 'success' | 'failure';
|
|
3000
|
+
|
|
3001
|
+
/**
|
|
3002
|
+
* Stable category for UX branching. New values may be added; existing ones are
|
|
3003
|
+
* stable. Mapping:
|
|
3004
|
+
* - `token_invalid`: access token is expired or revoked. Reconnect.
|
|
3005
|
+
* - `permission_denied`: token lacks required scope, or the user has no role
|
|
3006
|
+
* on the Business Manager that owns the ad account. Reconnect with full
|
|
3007
|
+
* permissions, or have an admin grant access.
|
|
3008
|
+
* - `no_ad_accounts`: token is valid but sees zero ad accounts. The user
|
|
3009
|
+
* needs to connect a Business Manager that owns ad accounts.
|
|
3010
|
+
* - `rate_limited`: platform throttled us. Sync will retry automatically.
|
|
3011
|
+
* - `discovery_failed`: any other platform-side failure. Inspect `error`.
|
|
3012
|
+
* - `unknown`: classifier could not categorize the failure.
|
|
3013
|
+
*
|
|
3014
|
+
*/
|
|
3015
|
+
export type errorCategory2 = 'token_invalid' | 'permission_denied' | 'no_ad_accounts' | 'rate_limited' | 'discovery_failed' | 'unknown';
|
|
2802
3016
|
|
|
2803
3017
|
/**
|
|
2804
3018
|
* Webhook payload for account connected events
|
|
@@ -2962,6 +3176,34 @@ export type event4 = 'comment.received';
|
|
|
2962
3176
|
|
|
2963
3177
|
export type platform6 = 'instagram' | 'facebook' | 'twitter' | 'youtube' | 'linkedin' | 'bluesky' | 'reddit';
|
|
2964
3178
|
|
|
3179
|
+
/**
|
|
3180
|
+
* Webhook payload for the lead.received event. Fired when a Meta Lead Gen
|
|
3181
|
+
* Form receives a new submission. Real-time delivery requires the page to
|
|
3182
|
+
* be subscribed to the `leadgen` webhook field — Zernio subscribes
|
|
3183
|
+
* on connect; existing accounts get backfilled by
|
|
3184
|
+
* `scripts/backfill-fb-webhook-subscriptions.ts`.
|
|
3185
|
+
*
|
|
3186
|
+
* Requires the Ads add-on. Subscribers without the add-on are filtered at
|
|
3187
|
+
* delivery time.
|
|
3188
|
+
*
|
|
3189
|
+
*/
|
|
3190
|
+
export type WebhookPayloadLeadReceived = {
|
|
3191
|
+
/**
|
|
3192
|
+
* Stable webhook event ID
|
|
3193
|
+
*/
|
|
3194
|
+
id: string;
|
|
3195
|
+
event: 'lead.received';
|
|
3196
|
+
lead: Lead;
|
|
3197
|
+
account: {
|
|
3198
|
+
id: string;
|
|
3199
|
+
platform: string;
|
|
3200
|
+
username: string;
|
|
3201
|
+
};
|
|
3202
|
+
timestamp: string;
|
|
3203
|
+
};
|
|
3204
|
+
|
|
3205
|
+
export type event5 = 'lead.received';
|
|
3206
|
+
|
|
2965
3207
|
/**
|
|
2966
3208
|
* Webhook payload for message received events
|
|
2967
3209
|
*/
|
|
@@ -3177,7 +3419,7 @@ export type WebhookPayloadMessage = {
|
|
|
3177
3419
|
timestamp: string;
|
|
3178
3420
|
};
|
|
3179
3421
|
|
|
3180
|
-
export type
|
|
3422
|
+
export type event6 = 'message.received';
|
|
3181
3423
|
|
|
3182
3424
|
/**
|
|
3183
3425
|
* WhatsApp only. Which kind of interactive reply the user sent:
|
|
@@ -3209,7 +3451,7 @@ export type WebhookPayloadMessageDeleted = {
|
|
|
3209
3451
|
timestamp: string;
|
|
3210
3452
|
};
|
|
3211
3453
|
|
|
3212
|
-
export type
|
|
3454
|
+
export type event7 = 'message.deleted';
|
|
3213
3455
|
|
|
3214
3456
|
/**
|
|
3215
3457
|
* Shared payload for message.delivered, message.read, and
|
|
@@ -3244,7 +3486,7 @@ export type WebhookPayloadMessageDeliveryStatus = {
|
|
|
3244
3486
|
timestamp: string;
|
|
3245
3487
|
};
|
|
3246
3488
|
|
|
3247
|
-
export type
|
|
3489
|
+
export type event8 = 'message.delivered' | 'message.read' | 'message.failed';
|
|
3248
3490
|
|
|
3249
3491
|
/**
|
|
3250
3492
|
* Webhook payload for message.edited events. Fires when the sender
|
|
@@ -3286,7 +3528,7 @@ export type WebhookPayloadMessageEdited = {
|
|
|
3286
3528
|
timestamp: string;
|
|
3287
3529
|
};
|
|
3288
3530
|
|
|
3289
|
-
export type
|
|
3531
|
+
export type event9 = 'message.edited';
|
|
3290
3532
|
|
|
3291
3533
|
/**
|
|
3292
3534
|
* Webhook payload for message sent events (fired when a message is sent via the API)
|
|
@@ -3362,7 +3604,7 @@ export type WebhookPayloadMessageSent = {
|
|
|
3362
3604
|
timestamp: string;
|
|
3363
3605
|
};
|
|
3364
3606
|
|
|
3365
|
-
export type
|
|
3607
|
+
export type event10 = 'message.sent';
|
|
3366
3608
|
|
|
3367
3609
|
/**
|
|
3368
3610
|
* Webhook payload for post events
|
|
@@ -3390,7 +3632,7 @@ export type WebhookPayloadPost = {
|
|
|
3390
3632
|
timestamp: string;
|
|
3391
3633
|
};
|
|
3392
3634
|
|
|
3393
|
-
export type
|
|
3635
|
+
export type event11 = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled';
|
|
3394
3636
|
|
|
3395
3637
|
/**
|
|
3396
3638
|
* Webhook payload for the review.new event (new review posted on a connected account).
|
|
@@ -3410,7 +3652,7 @@ export type WebhookPayloadReviewNew = {
|
|
|
3410
3652
|
timestamp: string;
|
|
3411
3653
|
};
|
|
3412
3654
|
|
|
3413
|
-
export type
|
|
3655
|
+
export type event12 = 'review.new';
|
|
3414
3656
|
|
|
3415
3657
|
/**
|
|
3416
3658
|
* Webhook payload for the review.updated event. Fired when the reviewer edits
|
|
@@ -3434,7 +3676,7 @@ export type WebhookPayloadReviewUpdated = {
|
|
|
3434
3676
|
timestamp: string;
|
|
3435
3677
|
};
|
|
3436
3678
|
|
|
3437
|
-
export type
|
|
3679
|
+
export type event13 = 'review.updated';
|
|
3438
3680
|
|
|
3439
3681
|
/**
|
|
3440
3682
|
* Webhook payload for test deliveries
|
|
@@ -3452,7 +3694,7 @@ export type WebhookPayloadTest = {
|
|
|
3452
3694
|
timestamp: string;
|
|
3453
3695
|
};
|
|
3454
3696
|
|
|
3455
|
-
export type
|
|
3697
|
+
export type event14 = 'webhook.test';
|
|
3456
3698
|
|
|
3457
3699
|
export type WhatsAppBodyComponent = {
|
|
3458
3700
|
type: 'body';
|
|
@@ -4676,6 +4918,13 @@ export type ListAccountGroupsResponse = ({
|
|
|
4676
4918
|
_id?: string;
|
|
4677
4919
|
name?: string;
|
|
4678
4920
|
accountIds?: Array<(string)>;
|
|
4921
|
+
createdBy?: string;
|
|
4922
|
+
/**
|
|
4923
|
+
* Legacy field. Present only on groups created before
|
|
4924
|
+
* cross-profile groups were supported. New groups omit it.
|
|
4925
|
+
*
|
|
4926
|
+
*/
|
|
4927
|
+
profileId?: string;
|
|
4679
4928
|
}>;
|
|
4680
4929
|
});
|
|
4681
4930
|
|
|
@@ -4687,6 +4936,13 @@ export type CreateAccountGroupData = {
|
|
|
4687
4936
|
body: {
|
|
4688
4937
|
name: string;
|
|
4689
4938
|
accountIds: Array<(string)>;
|
|
4939
|
+
/**
|
|
4940
|
+
* Deprecated. Accepted for backward compatibility but ignored.
|
|
4941
|
+
* Groups are no longer scoped to a single profile.
|
|
4942
|
+
*
|
|
4943
|
+
* @deprecated
|
|
4944
|
+
*/
|
|
4945
|
+
profileId?: string;
|
|
4690
4946
|
};
|
|
4691
4947
|
};
|
|
4692
4948
|
|
|
@@ -5772,6 +6028,25 @@ export type ConnectAdsData = {
|
|
|
5772
6028
|
*
|
|
5773
6029
|
*/
|
|
5774
6030
|
accountId?: string;
|
|
6031
|
+
/**
|
|
6032
|
+
* (metaads only) Scope ad sync to a single Meta ad account. Without this
|
|
6033
|
+
* param, sync covers every `act_*` the connected token can see. Pass this
|
|
6034
|
+
* to limit `sync.totalAds` / `synced` and the resulting ads to one ad
|
|
6035
|
+
* account. Format: `act_<digits>` (matches what `/me/adaccounts` returns).
|
|
6036
|
+
* Validated against the connected token; unreachable IDs return 400.
|
|
6037
|
+
* For multiple accounts use `adAccountIds` instead.
|
|
6038
|
+
*
|
|
6039
|
+
*/
|
|
6040
|
+
adAccountId?: string;
|
|
6041
|
+
/**
|
|
6042
|
+
* (metaads only) Scope ad sync to multiple Meta ad accounts. Repeat the
|
|
6043
|
+
* param (`?adAccountIds=act_1&adAccountIds=act_2`) or comma-separate
|
|
6044
|
+
* (`?adAccountIds=act_1,act_2`). Validated against the connected token.
|
|
6045
|
+
* Persisted server-side; latest call wins. Omitting both `adAccountId`
|
|
6046
|
+
* and `adAccountIds` keeps any previously persisted scope unchanged.
|
|
6047
|
+
*
|
|
6048
|
+
*/
|
|
6049
|
+
adAccountIds?: Array<(string)>;
|
|
5775
6050
|
/**
|
|
5776
6051
|
* Enable headless mode (same-token platforms only)
|
|
5777
6052
|
*/
|
|
@@ -5793,6 +6068,12 @@ export type ConnectAdsResponse = (({
|
|
|
5793
6068
|
platform?: string;
|
|
5794
6069
|
username?: string;
|
|
5795
6070
|
displayName?: string;
|
|
6071
|
+
/**
|
|
6072
|
+
* Echo of the persisted ad-account scope when the caller passed
|
|
6073
|
+
* `adAccountId` / `adAccountIds`. Omitted when no scope is set.
|
|
6074
|
+
*
|
|
6075
|
+
*/
|
|
6076
|
+
scopedAdAccountIds?: Array<(string)>;
|
|
5796
6077
|
} | {
|
|
5797
6078
|
authUrl?: string;
|
|
5798
6079
|
state?: string;
|
|
@@ -13443,9 +13724,13 @@ export type CreateStandaloneAdData = {
|
|
|
13443
13724
|
*/
|
|
13444
13725
|
body?: string;
|
|
13445
13726
|
/**
|
|
13446
|
-
* Required on legacy + attach shapes for Meta. Honoured on TikTok too — passes through to the Spark Ad creative's `call_to_action`. Ignored by other platforms.
|
|
13727
|
+
* Required on legacy + attach shapes for Meta. Honoured on TikTok too — passes through to the Spark Ad creative's `call_to_action`. Ignored by other platforms. Ignored on Meta when `leadGenFormId` is set — lead ads force CTA type to SIGN_UP.
|
|
13447
13728
|
*/
|
|
13448
13729
|
callToAction?: 'LEARN_MORE' | 'SHOP_NOW' | 'SIGN_UP' | 'BOOK_TRAVEL' | 'CONTACT_US' | 'DOWNLOAD' | 'GET_OFFER' | 'GET_QUOTE' | 'SUBSCRIBE' | 'WATCH_MORE';
|
|
13730
|
+
/**
|
|
13731
|
+
* Meta-only. Attaches a Lead Gen (Instant) Form to the creative. Required when `goal="lead_generation"`. Force-overrides the CTA to SIGN_UP. Create a form first via POST /v1/ads/lead-forms. On the multi-creative shape this can also be set per `creatives[i]` to A/B different forms inside one ad set.
|
|
13732
|
+
*/
|
|
13733
|
+
leadGenFormId?: string;
|
|
13449
13734
|
/**
|
|
13450
13735
|
* Required on legacy + attach shapes. Skip for multi-creative.
|
|
13451
13736
|
*/
|
|
@@ -13503,6 +13788,10 @@ export type CreateStandaloneAdData = {
|
|
|
13503
13788
|
};
|
|
13504
13789
|
linkUrl: string;
|
|
13505
13790
|
callToAction: 'LEARN_MORE' | 'SHOP_NOW' | 'SIGN_UP' | 'BOOK_TRAVEL' | 'CONTACT_US' | 'DOWNLOAD' | 'GET_OFFER' | 'GET_QUOTE' | 'SUBSCRIBE' | 'WATCH_MORE';
|
|
13791
|
+
/**
|
|
13792
|
+
* Per-creative Lead Gen Form ID. Wins over the top-level `leadGenFormId` so each ad in a campaign can A/B a different form. Forces CTA to SIGN_UP.
|
|
13793
|
+
*/
|
|
13794
|
+
leadGenFormId?: string;
|
|
13506
13795
|
}>;
|
|
13507
13796
|
/**
|
|
13508
13797
|
* Meta-only. When present, switches to the attach shape: adds
|
|
@@ -13967,6 +14256,189 @@ export type AddUsersToAdAudienceError = (unknown | {
|
|
|
13967
14256
|
error?: string;
|
|
13968
14257
|
});
|
|
13969
14258
|
|
|
14259
|
+
export type ListLeadFormsData = {
|
|
14260
|
+
query: {
|
|
14261
|
+
/**
|
|
14262
|
+
* Facebook social account ID (Late SocialAccount _id)
|
|
14263
|
+
*/
|
|
14264
|
+
accountId: string;
|
|
14265
|
+
/**
|
|
14266
|
+
* Meta `paging.cursors.after` from a prior page
|
|
14267
|
+
*/
|
|
14268
|
+
cursor?: string;
|
|
14269
|
+
limit?: number;
|
|
14270
|
+
};
|
|
14271
|
+
};
|
|
14272
|
+
|
|
14273
|
+
export type ListLeadFormsResponse = ({
|
|
14274
|
+
status?: string;
|
|
14275
|
+
forms?: Array<LeadGenForm>;
|
|
14276
|
+
pagination?: {
|
|
14277
|
+
hasMore?: boolean;
|
|
14278
|
+
cursor?: (string) | null;
|
|
14279
|
+
};
|
|
14280
|
+
meta?: LeadFormResponseMeta;
|
|
14281
|
+
});
|
|
14282
|
+
|
|
14283
|
+
export type ListLeadFormsError = ({
|
|
14284
|
+
error?: string;
|
|
14285
|
+
} | unknown);
|
|
14286
|
+
|
|
14287
|
+
export type CreateLeadFormData = {
|
|
14288
|
+
body: CreateLeadFormBody;
|
|
14289
|
+
};
|
|
14290
|
+
|
|
14291
|
+
export type CreateLeadFormResponse = ({
|
|
14292
|
+
status?: string;
|
|
14293
|
+
form?: {
|
|
14294
|
+
id?: string;
|
|
14295
|
+
name?: string;
|
|
14296
|
+
};
|
|
14297
|
+
meta?: LeadFormResponseMeta;
|
|
14298
|
+
});
|
|
14299
|
+
|
|
14300
|
+
export type CreateLeadFormError = (unknown | {
|
|
14301
|
+
error?: string;
|
|
14302
|
+
});
|
|
14303
|
+
|
|
14304
|
+
export type GetLeadFormData = {
|
|
14305
|
+
path: {
|
|
14306
|
+
/**
|
|
14307
|
+
* Meta lead form ID (numeric string)
|
|
14308
|
+
*/
|
|
14309
|
+
formId: string;
|
|
14310
|
+
};
|
|
14311
|
+
query: {
|
|
14312
|
+
accountId: string;
|
|
14313
|
+
};
|
|
14314
|
+
};
|
|
14315
|
+
|
|
14316
|
+
export type GetLeadFormResponse = ({
|
|
14317
|
+
status?: string;
|
|
14318
|
+
form?: LeadGenForm;
|
|
14319
|
+
meta?: LeadFormResponseMeta;
|
|
14320
|
+
});
|
|
14321
|
+
|
|
14322
|
+
export type GetLeadFormError = ({
|
|
14323
|
+
error?: string;
|
|
14324
|
+
} | unknown);
|
|
14325
|
+
|
|
14326
|
+
export type UpdateLeadFormData = {
|
|
14327
|
+
body: {
|
|
14328
|
+
accountId: string;
|
|
14329
|
+
status: 'ACTIVE' | 'ARCHIVED' | 'DRAFT';
|
|
14330
|
+
};
|
|
14331
|
+
path: {
|
|
14332
|
+
formId: string;
|
|
14333
|
+
};
|
|
14334
|
+
};
|
|
14335
|
+
|
|
14336
|
+
export type UpdateLeadFormResponse = ({
|
|
14337
|
+
status?: string;
|
|
14338
|
+
success?: boolean;
|
|
14339
|
+
meta?: LeadFormResponseMeta;
|
|
14340
|
+
});
|
|
14341
|
+
|
|
14342
|
+
export type UpdateLeadFormError = (unknown | {
|
|
14343
|
+
error?: string;
|
|
14344
|
+
});
|
|
14345
|
+
|
|
14346
|
+
export type DeleteLeadFormData = {
|
|
14347
|
+
path: {
|
|
14348
|
+
formId: string;
|
|
14349
|
+
};
|
|
14350
|
+
query: {
|
|
14351
|
+
accountId: string;
|
|
14352
|
+
};
|
|
14353
|
+
};
|
|
14354
|
+
|
|
14355
|
+
export type DeleteLeadFormResponse = ({
|
|
14356
|
+
status?: string;
|
|
14357
|
+
success?: boolean;
|
|
14358
|
+
meta?: LeadFormResponseMeta;
|
|
14359
|
+
});
|
|
14360
|
+
|
|
14361
|
+
export type DeleteLeadFormError = ({
|
|
14362
|
+
error?: string;
|
|
14363
|
+
} | unknown);
|
|
14364
|
+
|
|
14365
|
+
export type ListLeadFormLeadsData = {
|
|
14366
|
+
path: {
|
|
14367
|
+
formId: string;
|
|
14368
|
+
};
|
|
14369
|
+
query: {
|
|
14370
|
+
accountId: string;
|
|
14371
|
+
cursor?: string;
|
|
14372
|
+
limit?: number;
|
|
14373
|
+
/**
|
|
14374
|
+
* Unix timestamp; only return leads created strictly after this.
|
|
14375
|
+
*/
|
|
14376
|
+
since?: number;
|
|
14377
|
+
};
|
|
14378
|
+
};
|
|
14379
|
+
|
|
14380
|
+
export type ListLeadFormLeadsResponse = ({
|
|
14381
|
+
status?: string;
|
|
14382
|
+
leads?: Array<Lead>;
|
|
14383
|
+
pagination?: {
|
|
14384
|
+
hasMore?: boolean;
|
|
14385
|
+
cursor?: (string) | null;
|
|
14386
|
+
};
|
|
14387
|
+
meta?: LeadFormResponseMeta;
|
|
14388
|
+
});
|
|
14389
|
+
|
|
14390
|
+
export type ListLeadFormLeadsError = ({
|
|
14391
|
+
error?: string;
|
|
14392
|
+
} | unknown);
|
|
14393
|
+
|
|
14394
|
+
export type CreateLeadFormTestLeadData = {
|
|
14395
|
+
body: {
|
|
14396
|
+
accountId: string;
|
|
14397
|
+
fieldData: Array<{
|
|
14398
|
+
/**
|
|
14399
|
+
* Question key (matches `key` from form definition)
|
|
14400
|
+
*/
|
|
14401
|
+
name: string;
|
|
14402
|
+
values: Array<(string)>;
|
|
14403
|
+
}>;
|
|
14404
|
+
};
|
|
14405
|
+
path: {
|
|
14406
|
+
formId: string;
|
|
14407
|
+
};
|
|
14408
|
+
};
|
|
14409
|
+
|
|
14410
|
+
export type CreateLeadFormTestLeadResponse = ({
|
|
14411
|
+
status?: string;
|
|
14412
|
+
testLead?: {
|
|
14413
|
+
id?: string;
|
|
14414
|
+
};
|
|
14415
|
+
meta?: LeadFormResponseMeta;
|
|
14416
|
+
});
|
|
14417
|
+
|
|
14418
|
+
export type CreateLeadFormTestLeadError = ({
|
|
14419
|
+
error?: string;
|
|
14420
|
+
} | unknown);
|
|
14421
|
+
|
|
14422
|
+
export type DeleteLeadFormTestLeadData = {
|
|
14423
|
+
path: {
|
|
14424
|
+
formId: string;
|
|
14425
|
+
leadId: string;
|
|
14426
|
+
};
|
|
14427
|
+
query: {
|
|
14428
|
+
accountId: string;
|
|
14429
|
+
};
|
|
14430
|
+
};
|
|
14431
|
+
|
|
14432
|
+
export type DeleteLeadFormTestLeadResponse = ({
|
|
14433
|
+
status?: string;
|
|
14434
|
+
success?: boolean;
|
|
14435
|
+
meta?: LeadFormResponseMeta;
|
|
14436
|
+
});
|
|
14437
|
+
|
|
14438
|
+
export type DeleteLeadFormTestLeadError = ({
|
|
14439
|
+
error?: string;
|
|
14440
|
+
} | unknown);
|
|
14441
|
+
|
|
13970
14442
|
export type SendConversionsData = {
|
|
13971
14443
|
body: {
|
|
13972
14444
|
/**
|