@zernio/node 0.2.60 → 0.2.62
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 +43 -43
- package/dist/index.d.mts +42 -39
- package/dist/index.d.ts +42 -39
- package/package.json +1 -1
- package/src/generated/sdk.gen.ts +134 -100
- package/src/generated/types.gen.ts +42 -39
package/src/generated/sdk.gen.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { ValidatePostLengthData, ValidatePostLengthError, ValidatePostLengt
|
|
|
6
6
|
export const client = createClient(createConfig());
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Validate
|
|
9
|
+
* Validate character count
|
|
10
10
|
* Check weighted character count per platform and whether the text is within each platform's limit.
|
|
11
11
|
*
|
|
12
12
|
* Twitter/X uses weighted counting (URLs = 23 chars via t.co, emojis = 2 chars). All other platforms use plain character length.
|
|
@@ -25,7 +25,7 @@ export const validatePostLength = <ThrowOnError extends boolean = false>(options
|
|
|
25
25
|
* Validate post content
|
|
26
26
|
* Dry-run the full post validation pipeline without publishing. Catches issues like missing media for Instagram/TikTok/YouTube, hashtag limits, invalid thread formats, Facebook Reel requirements, and character limit violations.
|
|
27
27
|
*
|
|
28
|
-
* Accepts the same body as
|
|
28
|
+
* Accepts the same body as POST /v1/posts. Does NOT validate accounts, process media, or track usage. This is content-only validation.
|
|
29
29
|
*
|
|
30
30
|
* Returns errors for failures and warnings for near-limit content (>90% of character limit).
|
|
31
31
|
*
|
|
@@ -57,7 +57,7 @@ export const validateMedia = <ThrowOnError extends boolean = false>(options: Opt
|
|
|
57
57
|
* Check subreddit existence
|
|
58
58
|
* Check if a subreddit exists and return basic info (title, subscriber count, NSFW status, post types allowed).
|
|
59
59
|
*
|
|
60
|
-
* When accountId is provided, uses authenticated Reddit OAuth API with automatic token refresh (recommended). Falls back to Reddit's public JSON API, which may be unreliable from server IPs. Returns
|
|
60
|
+
* When accountId is provided, uses authenticated Reddit OAuth API with automatic token refresh (recommended). Falls back to Reddit's public JSON API, which may be unreliable from server IPs. Returns exists: false for private, banned, or nonexistent subreddits.
|
|
61
61
|
*
|
|
62
62
|
*/
|
|
63
63
|
export const validateSubreddit = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ValidateSubredditData, ThrowOnError>) => {
|
|
@@ -73,7 +73,7 @@ export const validateSubreddit = <ThrowOnError extends boolean = false>(options:
|
|
|
73
73
|
* Accepts both Zernio Post IDs and External Post IDs (auto-resolved). fromDate defaults to 90 days ago if omitted, max range 366 days.
|
|
74
74
|
* Single post lookups may return 202 (sync pending) or 424 (all platforms failed). For follower stats, use /v1/accounts/follower-stats.
|
|
75
75
|
*
|
|
76
|
-
*
|
|
76
|
+
* LinkedIn personal accounts: Analytics are only available for posts published through Zernio. LinkedIn's API only returns metrics for posts authored by the authenticated user. Organization/company page analytics work for all posts.
|
|
77
77
|
*
|
|
78
78
|
*/
|
|
79
79
|
export const getAnalytics = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetAnalyticsData, ThrowOnError>) => {
|
|
@@ -97,7 +97,7 @@ export const getYouTubeDailyViews = <ThrowOnError extends boolean = false>(optio
|
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
|
-
* Get Instagram
|
|
100
|
+
* Get Instagram insights
|
|
101
101
|
* Returns account-level Instagram insights such as reach, views, accounts engaged, and total interactions.
|
|
102
102
|
* These metrics reflect the entire account's performance across all content surfaces (feed, stories, explore, profile),
|
|
103
103
|
* and are fundamentally different from post-level metrics. Data may be delayed up to 48 hours.
|
|
@@ -112,7 +112,7 @@ export const getInstagramAccountInsights = <ThrowOnError extends boolean = false
|
|
|
112
112
|
};
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
|
-
* Get Instagram
|
|
115
|
+
* Get Instagram demographics
|
|
116
116
|
* Returns audience demographic insights for an Instagram account, broken down by age, city, country, and/or gender.
|
|
117
117
|
* Requires at least 100 followers. Returns top 45 entries per dimension.
|
|
118
118
|
* Data may be delayed up to 48 hours. Requires the Analytics add-on.
|
|
@@ -126,7 +126,7 @@ export const getInstagramDemographics = <ThrowOnError extends boolean = false>(o
|
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
|
-
* Get YouTube
|
|
129
|
+
* Get YouTube demographics
|
|
130
130
|
* Returns audience demographic insights for a YouTube channel, broken down by age, gender, and/or country.
|
|
131
131
|
* Age and gender values are viewer percentages (0-100). Country values are view counts.
|
|
132
132
|
* Data is based on signed-in viewers only, with a 2-3 day delay. Requires the Analytics add-on.
|
|
@@ -183,7 +183,7 @@ export const getContentDecay = <ThrowOnError extends boolean = false>(options?:
|
|
|
183
183
|
};
|
|
184
184
|
|
|
185
185
|
/**
|
|
186
|
-
* Get
|
|
186
|
+
* Get frequency vs engagement
|
|
187
187
|
* Returns the correlation between posting frequency (posts per week) and engagement rate, broken down by platform.
|
|
188
188
|
* Helps find the optimal posting cadence for each platform. Each row represents a specific (platform, posts_per_week) combination
|
|
189
189
|
* with the average engagement rate observed across all weeks matching that frequency.
|
|
@@ -212,7 +212,7 @@ export const getPostTimeline = <ThrowOnError extends boolean = false>(options: O
|
|
|
212
212
|
};
|
|
213
213
|
|
|
214
214
|
/**
|
|
215
|
-
* Get
|
|
215
|
+
* Get GBP performance metrics
|
|
216
216
|
* Returns daily performance metrics for a Google Business Profile location.
|
|
217
217
|
* Metrics include impressions (Maps/Search, desktop/mobile), website clicks,
|
|
218
218
|
* call clicks, direction requests, conversations, bookings, and food orders.
|
|
@@ -228,7 +228,7 @@ export const getGoogleBusinessPerformance = <ThrowOnError extends boolean = fals
|
|
|
228
228
|
};
|
|
229
229
|
|
|
230
230
|
/**
|
|
231
|
-
* Get
|
|
231
|
+
* Get GBP search keywords
|
|
232
232
|
* Returns search keywords that triggered impressions for a Google Business Profile location.
|
|
233
233
|
* Data is aggregated monthly. Keywords below a minimum impression threshold set by Google are excluded.
|
|
234
234
|
* Max 18 months of historical data. Requires the Analytics add-on.
|
|
@@ -286,7 +286,7 @@ export const deleteAccountGroup = <ThrowOnError extends boolean = false>(options
|
|
|
286
286
|
};
|
|
287
287
|
|
|
288
288
|
/**
|
|
289
|
-
* Get
|
|
289
|
+
* Get upload URL
|
|
290
290
|
* Get a presigned URL to upload files directly to cloud storage (up to 5GB). Returns an uploadUrl and publicUrl. PUT your file to the uploadUrl, then use the publicUrl in your posts.
|
|
291
291
|
*/
|
|
292
292
|
export const getMediaPresignedUrl = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetMediaPresignedUrlData, ThrowOnError>) => {
|
|
@@ -433,7 +433,7 @@ export const unpublishPost = <ThrowOnError extends boolean = false>(options: Opt
|
|
|
433
433
|
* Edit published post
|
|
434
434
|
* Edit a published post on a social media platform. Currently only supported for X (Twitter).
|
|
435
435
|
*
|
|
436
|
-
*
|
|
436
|
+
* Requirements:
|
|
437
437
|
* - Connected X account must have an active X Premium subscription
|
|
438
438
|
* - Must be within 1 hour of original publish time
|
|
439
439
|
* - Maximum 5 edits per tweet (enforced by X)
|
|
@@ -454,11 +454,11 @@ export const editPost = <ThrowOnError extends boolean = false>(options: OptionsL
|
|
|
454
454
|
* Updates metadata of a published video on the specified platform without re-uploading.
|
|
455
455
|
* Currently only supported for YouTube. At least one updatable field is required.
|
|
456
456
|
*
|
|
457
|
-
*
|
|
457
|
+
* Two modes:
|
|
458
458
|
*
|
|
459
|
-
* 1.
|
|
460
|
-
* 2.
|
|
461
|
-
* and pass
|
|
459
|
+
* 1. Post-based (video published through Zernio): pass the Zernio postId in the URL and platform in the body.
|
|
460
|
+
* 2. Direct video ID (video uploaded outside Zernio, e.g. directly to YouTube): use _ as the postId,
|
|
461
|
+
* and pass videoId + accountId + platform in the body. The accountId is the Zernio social account ID
|
|
462
462
|
* for the connected YouTube channel.
|
|
463
463
|
*
|
|
464
464
|
*/
|
|
@@ -701,13 +701,13 @@ export const handleOAuthCallback = <ThrowOnError extends boolean = false>(option
|
|
|
701
701
|
* Connect ads for a platform
|
|
702
702
|
* Unified ads connection endpoint. Creates a dedicated ads SocialAccount for the specified platform.
|
|
703
703
|
*
|
|
704
|
-
*
|
|
704
|
+
* Same-token platforms (facebook, instagram, linkedin, pinterest): Creates an ads SocialAccount (metaads, linkedinads, pinterestads) with a copied OAuth token from the parent posting account. If the ads account already exists, returns alreadyConnected: true. No extra OAuth needed.
|
|
705
705
|
*
|
|
706
|
-
*
|
|
706
|
+
* Separate-token platforms (tiktok, twitter): Starts the platform-specific marketing API OAuth flow and creates an ads SocialAccount (tiktokads, xads) with its own token. Requires an existing posting account (accountId param). If the ads account already exists, returns alreadyConnected: true.
|
|
707
707
|
*
|
|
708
|
-
*
|
|
708
|
+
* Standalone platforms (googleads): Starts the Google Ads OAuth flow and creates a standalone ads SocialAccount (googleads) with no parent. If the account already exists, returns alreadyConnected: true.
|
|
709
709
|
*
|
|
710
|
-
* Ads accounts appear as regular SocialAccount documents with ads platform values (e.g.,
|
|
710
|
+
* Ads accounts appear as regular SocialAccount documents with ads platform values (e.g., metaads, tiktokads) in GET /v1/accounts.
|
|
711
711
|
*
|
|
712
712
|
*/
|
|
713
713
|
export const connectAds = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ConnectAdsData, ThrowOnError>) => {
|
|
@@ -1023,7 +1023,7 @@ export const connectBlueskyCredentials = <ThrowOnError extends boolean = false>(
|
|
|
1023
1023
|
* 1. Go to Meta Business Suite (business.facebook.com)
|
|
1024
1024
|
* 2. Create or select a WhatsApp Business Account
|
|
1025
1025
|
* 3. In Business Settings > System Users, create a System User
|
|
1026
|
-
* 4. Assign it the
|
|
1026
|
+
* 4. Assign it the whatsapp_business_management and whatsapp_business_messaging permissions
|
|
1027
1027
|
* 5. Generate a permanent access token
|
|
1028
1028
|
* 6. Get the WABA ID from WhatsApp Manager > Account Tools > Phone Numbers
|
|
1029
1029
|
* 7. Get the Phone Number ID from the same page (click on the number)
|
|
@@ -1130,7 +1130,7 @@ export const getLinkedInPostAnalytics = <ThrowOnError extends boolean = false>(o
|
|
|
1130
1130
|
* Get LinkedIn post reactions
|
|
1131
1131
|
* Returns individual reactions for a specific LinkedIn post, including reactor profiles
|
|
1132
1132
|
* (name, headline/job title, profile picture, profile URL, reaction type).
|
|
1133
|
-
* Only works for
|
|
1133
|
+
* Only works for organization/company page accounts. LinkedIn restricts reaction
|
|
1134
1134
|
* data for personal profiles (r_member_social_feed is a closed permission).
|
|
1135
1135
|
*
|
|
1136
1136
|
*/
|
|
@@ -1156,22 +1156,22 @@ export const updateLinkedInOrganization = <ThrowOnError extends boolean = false>
|
|
|
1156
1156
|
* Resolve LinkedIn mention
|
|
1157
1157
|
* Converts a LinkedIn profile or company URL to a URN for @mentions in posts.
|
|
1158
1158
|
*
|
|
1159
|
-
*
|
|
1159
|
+
* How to use LinkedIn @mentions (2-step workflow):
|
|
1160
1160
|
*
|
|
1161
1161
|
* 1. Call this endpoint with the LinkedIn profile/company URL to get the mention URN and format.
|
|
1162
|
-
* 2. Embed the returned
|
|
1162
|
+
* 2. Embed the returned mentionFormat (e.g. @[Vincent Jong](urn:li:person:xxx)) directly in your post's content field.
|
|
1163
1163
|
*
|
|
1164
|
-
*
|
|
1165
|
-
* - Resolve:
|
|
1166
|
-
* - Returns:
|
|
1167
|
-
* - Use in post content:
|
|
1164
|
+
* Example:
|
|
1165
|
+
* - Resolve: GET /v1/accounts/{id}/linkedin-mentions?url=linkedin.com/in/vincentjong&displayName=Vincent Jong
|
|
1166
|
+
* - Returns: mentionFormat: "@[Vincent Jong](urn:li:person:xxx)"
|
|
1167
|
+
* - Use in post content: "Great talk with @[Vincent Jong](urn:li:person:xxx) today!"
|
|
1168
1168
|
*
|
|
1169
|
-
*
|
|
1169
|
+
* Important: The mentions array field in POST /v1/posts is stored for reference only and does NOT trigger @mentions on LinkedIn. You must embed the mention format directly in the content text.
|
|
1170
1170
|
*
|
|
1171
|
-
*
|
|
1172
|
-
* -
|
|
1173
|
-
* -
|
|
1174
|
-
* - For person mentions to be clickable, the
|
|
1171
|
+
* Requirements:
|
|
1172
|
+
* - Person mentions require the LinkedIn account to be admin of at least one organization. This is a LinkedIn API limitation: the only endpoints that resolve profile URLs to member URNs (vanityUrl, peopleTypeahead) are scoped to organization followers. There is no public LinkedIn API to resolve a vanity URL without organization context.
|
|
1173
|
+
* - Organization mentions (e.g. @Microsoft) work without this requirement.
|
|
1174
|
+
* - For person mentions to be clickable, the displayName parameter must exactly match the name shown on their LinkedIn profile.
|
|
1175
1175
|
* - Person mentions DO work when published from personal profiles (the URN just needs to be valid). The limitation is only in the resolution step (URL to URN), not in publishing.
|
|
1176
1176
|
*
|
|
1177
1177
|
*/
|
|
@@ -1206,7 +1206,7 @@ export const updatePinterestBoards = <ThrowOnError extends boolean = false>(opti
|
|
|
1206
1206
|
|
|
1207
1207
|
/**
|
|
1208
1208
|
* List YouTube playlists
|
|
1209
|
-
* Returns the playlists available for a connected YouTube account. Use this to get a playlist ID when creating a YouTube post with the
|
|
1209
|
+
* Returns the playlists available for a connected YouTube account. Use this to get a playlist ID when creating a YouTube post with the playlistId field.
|
|
1210
1210
|
*/
|
|
1211
1211
|
export const getYoutubePlaylists = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetYoutubePlaylistsData, ThrowOnError>) => {
|
|
1212
1212
|
return (options?.client ?? client).get<GetYoutubePlaylistsResponse, GetYoutubePlaylistsError, ThrowOnError>({
|
|
@@ -1217,7 +1217,7 @@ export const getYoutubePlaylists = <ThrowOnError extends boolean = false>(option
|
|
|
1217
1217
|
|
|
1218
1218
|
/**
|
|
1219
1219
|
* Set default YouTube playlist
|
|
1220
|
-
* Sets the default playlist used when publishing videos for this account. When a post does not specify a
|
|
1220
|
+
* Sets the default playlist used when publishing videos for this account. When a post does not specify a playlistId, the default playlist is not automatically used (it is stored for client-side convenience).
|
|
1221
1221
|
*/
|
|
1222
1222
|
export const updateYoutubeDefaultPlaylist = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateYoutubeDefaultPlaylistData, ThrowOnError>) => {
|
|
1223
1223
|
return (options?.client ?? client).put<UpdateYoutubeDefaultPlaylistResponse, UpdateYoutubeDefaultPlaylistError, ThrowOnError>({
|
|
@@ -1432,7 +1432,7 @@ export const listLogs = <ThrowOnError extends boolean = false>(options?: Options
|
|
|
1432
1432
|
* Fetch conversations (DMs) from all connected messaging accounts in a single API call. Supports filtering by profile and platform. Results are aggregated and deduplicated.
|
|
1433
1433
|
* Supported platforms: Facebook, Instagram, Twitter/X, Bluesky, Reddit, Telegram.
|
|
1434
1434
|
*
|
|
1435
|
-
*
|
|
1435
|
+
* Twitter/X limitation: X has replaced traditional DMs with encrypted "X Chat" for many accounts. Messages sent or received through encrypted X Chat are not accessible via X's API (the /2/dm_events endpoint only returns legacy unencrypted DMs). This means some Twitter/X conversations may show only outgoing messages or appear empty. This is an X platform limitation that affects all third-party applications. See X's docs on encrypted messaging for more details.
|
|
1436
1436
|
*
|
|
1437
1437
|
*/
|
|
1438
1438
|
export const listInboxConversations = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListInboxConversationsData, ThrowOnError>) => {
|
|
@@ -1446,13 +1446,13 @@ export const listInboxConversations = <ThrowOnError extends boolean = false>(opt
|
|
|
1446
1446
|
* Create conversation
|
|
1447
1447
|
* Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread.
|
|
1448
1448
|
*
|
|
1449
|
-
*
|
|
1449
|
+
* Currently supported platforms: Twitter/X only. Other platforms will return PLATFORM_NOT_SUPPORTED.
|
|
1450
1450
|
*
|
|
1451
|
-
*
|
|
1451
|
+
* DM eligibility: Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility.
|
|
1452
1452
|
*
|
|
1453
|
-
*
|
|
1453
|
+
* X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials.
|
|
1454
1454
|
*
|
|
1455
|
-
*
|
|
1455
|
+
* Rate limits: 200 requests per 15 minutes, 1,000 per 24 hours per user, 15,000 per 24 hours per app (shared across all DM endpoints).
|
|
1456
1456
|
*
|
|
1457
1457
|
*/
|
|
1458
1458
|
export const createInboxConversation = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateInboxConversationData, ThrowOnError>) => {
|
|
@@ -1488,7 +1488,7 @@ export const updateInboxConversation = <ThrowOnError extends boolean = false>(op
|
|
|
1488
1488
|
* List messages
|
|
1489
1489
|
* Fetch messages for a specific conversation. Requires accountId query parameter.
|
|
1490
1490
|
*
|
|
1491
|
-
*
|
|
1491
|
+
* Twitter/X limitation: X's encrypted "X Chat" messages are not accessible via the API. Conversations where the other participant uses encrypted X Chat may only show your outgoing messages. See the list conversations endpoint for more details.
|
|
1492
1492
|
*
|
|
1493
1493
|
*/
|
|
1494
1494
|
export const getInboxConversationMessages = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetInboxConversationMessagesData, ThrowOnError>) => {
|
|
@@ -1525,11 +1525,11 @@ export const editInboxMessage = <ThrowOnError extends boolean = false>(options:
|
|
|
1525
1525
|
/**
|
|
1526
1526
|
* Delete message
|
|
1527
1527
|
* Delete a message from a conversation. Platform support varies:
|
|
1528
|
-
* -
|
|
1529
|
-
* -
|
|
1530
|
-
* -
|
|
1531
|
-
* -
|
|
1532
|
-
* -
|
|
1528
|
+
* - Telegram: Full delete (bot's own messages anytime, others if admin)
|
|
1529
|
+
* - X/Twitter: Full delete (own DM events only)
|
|
1530
|
+
* - Bluesky: Delete for self only (recipient still sees it)
|
|
1531
|
+
* - Reddit: Delete from sender's view only
|
|
1532
|
+
* - Facebook, Instagram, WhatsApp: Not supported (returns 400)
|
|
1533
1533
|
*
|
|
1534
1534
|
*/
|
|
1535
1535
|
export const deleteInboxMessage = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteInboxMessageData, ThrowOnError>) => {
|
|
@@ -1542,9 +1542,9 @@ export const deleteInboxMessage = <ThrowOnError extends boolean = false>(options
|
|
|
1542
1542
|
/**
|
|
1543
1543
|
* Send typing indicator
|
|
1544
1544
|
* Show a typing indicator in a conversation. Platform support:
|
|
1545
|
-
* -
|
|
1546
|
-
* -
|
|
1547
|
-
* -
|
|
1545
|
+
* - Facebook Messenger: Shows "Page is typing..." for 20 seconds
|
|
1546
|
+
* - Telegram: Shows "Bot is typing..." for 5 seconds
|
|
1547
|
+
* - All others: Returns 200 but no-op (platform doesn't support it)
|
|
1548
1548
|
*
|
|
1549
1549
|
* Typing indicators are best-effort. The endpoint always returns 200 even if the platform call fails.
|
|
1550
1550
|
*
|
|
@@ -1559,9 +1559,9 @@ export const sendTypingIndicator = <ThrowOnError extends boolean = false>(option
|
|
|
1559
1559
|
/**
|
|
1560
1560
|
* Add reaction
|
|
1561
1561
|
* Add an emoji reaction to a message. Platform support:
|
|
1562
|
-
* -
|
|
1563
|
-
* -
|
|
1564
|
-
* -
|
|
1562
|
+
* - Telegram: Supports a subset of Unicode emoji reactions
|
|
1563
|
+
* - WhatsApp: Supports any standard emoji (one reaction per message per sender)
|
|
1564
|
+
* - All others: Returns 400 (not supported)
|
|
1565
1565
|
*
|
|
1566
1566
|
*/
|
|
1567
1567
|
export const addMessageReaction = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<AddMessageReactionData, ThrowOnError>) => {
|
|
@@ -1574,9 +1574,9 @@ export const addMessageReaction = <ThrowOnError extends boolean = false>(options
|
|
|
1574
1574
|
/**
|
|
1575
1575
|
* Remove reaction
|
|
1576
1576
|
* Remove a reaction from a message. Platform support:
|
|
1577
|
-
* -
|
|
1578
|
-
* -
|
|
1579
|
-
* -
|
|
1577
|
+
* - Telegram: Send empty reaction array to clear
|
|
1578
|
+
* - WhatsApp: Send empty emoji to remove
|
|
1579
|
+
* - All others: Returns 400 (not supported)
|
|
1580
1580
|
*
|
|
1581
1581
|
*/
|
|
1582
1582
|
export const removeMessageReaction = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<RemoveMessageReactionData, ThrowOnError>) => {
|
|
@@ -1589,12 +1589,12 @@ export const removeMessageReaction = <ThrowOnError extends boolean = false>(opti
|
|
|
1589
1589
|
/**
|
|
1590
1590
|
* Upload media file
|
|
1591
1591
|
* Upload a media file using API key authentication and get back a publicly accessible URL.
|
|
1592
|
-
* The URL can be used as
|
|
1592
|
+
* The URL can be used as attachmentUrl when sending inbox messages.
|
|
1593
1593
|
*
|
|
1594
1594
|
* Files are stored in temporary storage and auto-delete after 7 days.
|
|
1595
1595
|
* Maximum file size is 25MB.
|
|
1596
1596
|
*
|
|
1597
|
-
* Unlike
|
|
1597
|
+
* Unlike /v1/media/upload (which uses upload tokens for end-user flows),
|
|
1598
1598
|
* this endpoint uses standard Bearer token authentication for programmatic use.
|
|
1599
1599
|
*
|
|
1600
1600
|
*/
|
|
@@ -1947,11 +1947,11 @@ export const getWhatsAppTemplates = <ThrowOnError extends boolean = false>(optio
|
|
|
1947
1947
|
* Create template
|
|
1948
1948
|
* Create a new message template. Supports two modes:
|
|
1949
1949
|
*
|
|
1950
|
-
*
|
|
1950
|
+
* Custom template: Provide components with your own content. Submitted to Meta for review (can take up to 24h).
|
|
1951
1951
|
*
|
|
1952
|
-
*
|
|
1953
|
-
* from Meta's template library. Library templates are
|
|
1954
|
-
* customize parameters and buttons via
|
|
1952
|
+
* Library template: Provide library_template_name instead of components to use a pre-built template
|
|
1953
|
+
* from Meta's template library. Library templates are pre-approved (no review wait). You can optionally
|
|
1954
|
+
* customize parameters and buttons via library_template_body_inputs and library_template_button_inputs.
|
|
1955
1955
|
*
|
|
1956
1956
|
* Browse available library templates at: https://business.facebook.com/wa/manage/message-templates/
|
|
1957
1957
|
*
|
|
@@ -2045,7 +2045,7 @@ export const uploadWhatsAppProfilePhoto = <ThrowOnError extends boolean = false>
|
|
|
2045
2045
|
};
|
|
2046
2046
|
|
|
2047
2047
|
/**
|
|
2048
|
-
* Get display name
|
|
2048
|
+
* Get display name status
|
|
2049
2049
|
* Fetch the current display name and its Meta review status for a WhatsApp Business account.
|
|
2050
2050
|
* Display name changes require Meta approval and can take 1-3 business days.
|
|
2051
2051
|
*
|
|
@@ -2354,9 +2354,9 @@ export const uploadWhatsAppFlowJson = <ThrowOnError extends boolean = false>(opt
|
|
|
2354
2354
|
|
|
2355
2355
|
/**
|
|
2356
2356
|
* Publish flow
|
|
2357
|
-
* Publish a DRAFT flow.
|
|
2357
|
+
* Publish a DRAFT flow. This is irreversible. Once published, the flow and its JSON
|
|
2358
2358
|
* become immutable and the flow can be sent to users. To update a published flow,
|
|
2359
|
-
* create a new flow (optionally cloning this one via
|
|
2359
|
+
* create a new flow (optionally cloning this one via cloneFlowId).
|
|
2360
2360
|
*
|
|
2361
2361
|
*/
|
|
2362
2362
|
export const publishWhatsAppFlow = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<PublishWhatsAppFlowData, ThrowOnError>) => {
|
|
@@ -2368,7 +2368,7 @@ export const publishWhatsAppFlow = <ThrowOnError extends boolean = false>(option
|
|
|
2368
2368
|
|
|
2369
2369
|
/**
|
|
2370
2370
|
* Deprecate flow
|
|
2371
|
-
* Deprecate a PUBLISHED flow.
|
|
2371
|
+
* Deprecate a PUBLISHED flow. This is irreversible. Deprecated flows cannot be sent
|
|
2372
2372
|
* or opened, but existing active sessions may continue until they complete.
|
|
2373
2373
|
*
|
|
2374
2374
|
*/
|
|
@@ -2405,7 +2405,7 @@ export const listContacts = <ThrowOnError extends boolean = false>(options?: Opt
|
|
|
2405
2405
|
};
|
|
2406
2406
|
|
|
2407
2407
|
/**
|
|
2408
|
-
* Create
|
|
2408
|
+
* Create contact
|
|
2409
2409
|
* Create a new contact. Optionally create a platform channel in the same request by providing accountId, platform, and platformIdentifier.
|
|
2410
2410
|
*/
|
|
2411
2411
|
export const createContact = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateContactData, ThrowOnError>) => {
|
|
@@ -2416,7 +2416,8 @@ export const createContact = <ThrowOnError extends boolean = false>(options: Opt
|
|
|
2416
2416
|
};
|
|
2417
2417
|
|
|
2418
2418
|
/**
|
|
2419
|
-
* Get contact
|
|
2419
|
+
* Get contact
|
|
2420
|
+
* Returns a contact with all associated messaging channels.
|
|
2420
2421
|
*/
|
|
2421
2422
|
export const getContact = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetContactData, ThrowOnError>) => {
|
|
2422
2423
|
return (options?.client ?? client).get<GetContactResponse, GetContactError, ThrowOnError>({
|
|
@@ -2426,7 +2427,8 @@ export const getContact = <ThrowOnError extends boolean = false>(options: Option
|
|
|
2426
2427
|
};
|
|
2427
2428
|
|
|
2428
2429
|
/**
|
|
2429
|
-
* Update
|
|
2430
|
+
* Update contact
|
|
2431
|
+
* Update one or more fields on a contact. Only provided fields are changed.
|
|
2430
2432
|
*/
|
|
2431
2433
|
export const updateContact = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateContactData, ThrowOnError>) => {
|
|
2432
2434
|
return (options?.client ?? client).patch<UpdateContactResponse, UpdateContactError, ThrowOnError>({
|
|
@@ -2436,7 +2438,8 @@ export const updateContact = <ThrowOnError extends boolean = false>(options: Opt
|
|
|
2436
2438
|
};
|
|
2437
2439
|
|
|
2438
2440
|
/**
|
|
2439
|
-
* Delete
|
|
2441
|
+
* Delete contact
|
|
2442
|
+
* Permanently deletes a contact and all associated channels.
|
|
2440
2443
|
*/
|
|
2441
2444
|
export const deleteContact = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteContactData, ThrowOnError>) => {
|
|
2442
2445
|
return (options?.client ?? client).delete<DeleteContactResponse, DeleteContactError, ThrowOnError>({
|
|
@@ -2447,6 +2450,7 @@ export const deleteContact = <ThrowOnError extends boolean = false>(options: Opt
|
|
|
2447
2450
|
|
|
2448
2451
|
/**
|
|
2449
2452
|
* List channels for a contact
|
|
2453
|
+
* Returns all messaging channels linked to a contact (e.g. Instagram DM, Telegram, WhatsApp).
|
|
2450
2454
|
*/
|
|
2451
2455
|
export const getContactChannels = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetContactChannelsData, ThrowOnError>) => {
|
|
2452
2456
|
return (options?.client ?? client).get<GetContactChannelsResponse, GetContactChannelsError, ThrowOnError>({
|
|
@@ -2467,7 +2471,8 @@ export const bulkCreateContacts = <ThrowOnError extends boolean = false>(options
|
|
|
2467
2471
|
};
|
|
2468
2472
|
|
|
2469
2473
|
/**
|
|
2470
|
-
* Set
|
|
2474
|
+
* Set custom field value
|
|
2475
|
+
* Set or overwrite a custom field value on a contact. The value type must match the field definition.
|
|
2471
2476
|
*/
|
|
2472
2477
|
export const setContactFieldValue = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SetContactFieldValueData, ThrowOnError>) => {
|
|
2473
2478
|
return (options?.client ?? client).put<SetContactFieldValueResponse, SetContactFieldValueError, ThrowOnError>({
|
|
@@ -2477,7 +2482,8 @@ export const setContactFieldValue = <ThrowOnError extends boolean = false>(optio
|
|
|
2477
2482
|
};
|
|
2478
2483
|
|
|
2479
2484
|
/**
|
|
2480
|
-
* Clear
|
|
2485
|
+
* Clear custom field value
|
|
2486
|
+
* Remove a custom field value from a contact. The field definition is not affected.
|
|
2481
2487
|
*/
|
|
2482
2488
|
export const clearContactFieldValue = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ClearContactFieldValueData, ThrowOnError>) => {
|
|
2483
2489
|
return (options?.client ?? client).delete<ClearContactFieldValueResponse, ClearContactFieldValueError, ThrowOnError>({
|
|
@@ -2488,6 +2494,7 @@ export const clearContactFieldValue = <ThrowOnError extends boolean = false>(opt
|
|
|
2488
2494
|
|
|
2489
2495
|
/**
|
|
2490
2496
|
* List custom field definitions
|
|
2497
|
+
* Returns all custom field definitions. Optionally filter by profile.
|
|
2491
2498
|
*/
|
|
2492
2499
|
export const listCustomFields = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListCustomFieldsData, ThrowOnError>) => {
|
|
2493
2500
|
return (options?.client ?? client).get<ListCustomFieldsResponse, ListCustomFieldsError, ThrowOnError>({
|
|
@@ -2497,7 +2504,8 @@ export const listCustomFields = <ThrowOnError extends boolean = false>(options?:
|
|
|
2497
2504
|
};
|
|
2498
2505
|
|
|
2499
2506
|
/**
|
|
2500
|
-
* Create
|
|
2507
|
+
* Create custom field
|
|
2508
|
+
* Create a new custom field definition. Supported types are text, number, date, boolean, and select.
|
|
2501
2509
|
*/
|
|
2502
2510
|
export const createCustomField = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateCustomFieldData, ThrowOnError>) => {
|
|
2503
2511
|
return (options?.client ?? client).post<CreateCustomFieldResponse, CreateCustomFieldError, ThrowOnError>({
|
|
@@ -2507,7 +2515,8 @@ export const createCustomField = <ThrowOnError extends boolean = false>(options:
|
|
|
2507
2515
|
};
|
|
2508
2516
|
|
|
2509
2517
|
/**
|
|
2510
|
-
* Update
|
|
2518
|
+
* Update custom field
|
|
2519
|
+
* Update a custom field definition. The field type cannot be changed after creation.
|
|
2511
2520
|
*/
|
|
2512
2521
|
export const updateCustomField = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateCustomFieldData, ThrowOnError>) => {
|
|
2513
2522
|
return (options?.client ?? client).patch<UpdateCustomFieldResponse, UpdateCustomFieldError, ThrowOnError>({
|
|
@@ -2517,7 +2526,8 @@ export const updateCustomField = <ThrowOnError extends boolean = false>(options:
|
|
|
2517
2526
|
};
|
|
2518
2527
|
|
|
2519
2528
|
/**
|
|
2520
|
-
* Delete
|
|
2529
|
+
* Delete custom field
|
|
2530
|
+
* Delete a custom field definition and remove its values from all contacts.
|
|
2521
2531
|
*/
|
|
2522
2532
|
export const deleteCustomField = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteCustomFieldData, ThrowOnError>) => {
|
|
2523
2533
|
return (options?.client ?? client).delete<DeleteCustomFieldResponse, DeleteCustomFieldError, ThrowOnError>({
|
|
@@ -2528,6 +2538,7 @@ export const deleteCustomField = <ThrowOnError extends boolean = false>(options:
|
|
|
2528
2538
|
|
|
2529
2539
|
/**
|
|
2530
2540
|
* List broadcasts
|
|
2541
|
+
* Returns broadcasts with delivery stats. Filter by status, platform, or profile.
|
|
2531
2542
|
*/
|
|
2532
2543
|
export const listBroadcasts = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListBroadcastsData, ThrowOnError>) => {
|
|
2533
2544
|
return (options?.client ?? client).get<ListBroadcastsResponse, ListBroadcastsError, ThrowOnError>({
|
|
@@ -2537,7 +2548,8 @@ export const listBroadcasts = <ThrowOnError extends boolean = false>(options?: O
|
|
|
2537
2548
|
};
|
|
2538
2549
|
|
|
2539
2550
|
/**
|
|
2540
|
-
* Create
|
|
2551
|
+
* Create broadcast draft
|
|
2552
|
+
* Create a broadcast in draft status. Add recipients and then send or schedule it.
|
|
2541
2553
|
*/
|
|
2542
2554
|
export const createBroadcast = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateBroadcastData, ThrowOnError>) => {
|
|
2543
2555
|
return (options?.client ?? client).post<CreateBroadcastResponse, CreateBroadcastError, ThrowOnError>({
|
|
@@ -2548,6 +2560,7 @@ export const createBroadcast = <ThrowOnError extends boolean = false>(options: O
|
|
|
2548
2560
|
|
|
2549
2561
|
/**
|
|
2550
2562
|
* Get broadcast details
|
|
2563
|
+
* Returns a broadcast with its full configuration and delivery stats.
|
|
2551
2564
|
*/
|
|
2552
2565
|
export const getBroadcast = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetBroadcastData, ThrowOnError>) => {
|
|
2553
2566
|
return (options?.client ?? client).get<GetBroadcastResponse, GetBroadcastError, ThrowOnError>({
|
|
@@ -2557,7 +2570,8 @@ export const getBroadcast = <ThrowOnError extends boolean = false>(options: Opti
|
|
|
2557
2570
|
};
|
|
2558
2571
|
|
|
2559
2572
|
/**
|
|
2560
|
-
* Update
|
|
2573
|
+
* Update broadcast
|
|
2574
|
+
* Update a broadcast's name, message, template, or segment filters. Only draft broadcasts can be updated.
|
|
2561
2575
|
*/
|
|
2562
2576
|
export const updateBroadcast = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateBroadcastData, ThrowOnError>) => {
|
|
2563
2577
|
return (options?.client ?? client).patch<UpdateBroadcastResponse, UpdateBroadcastError, ThrowOnError>({
|
|
@@ -2567,7 +2581,8 @@ export const updateBroadcast = <ThrowOnError extends boolean = false>(options: O
|
|
|
2567
2581
|
};
|
|
2568
2582
|
|
|
2569
2583
|
/**
|
|
2570
|
-
* Delete
|
|
2584
|
+
* Delete broadcast
|
|
2585
|
+
* Permanently delete a broadcast. Only drafts can be deleted.
|
|
2571
2586
|
*/
|
|
2572
2587
|
export const deleteBroadcast = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteBroadcastData, ThrowOnError>) => {
|
|
2573
2588
|
return (options?.client ?? client).delete<DeleteBroadcastResponse, DeleteBroadcastError, ThrowOnError>({
|
|
@@ -2577,7 +2592,8 @@ export const deleteBroadcast = <ThrowOnError extends boolean = false>(options: O
|
|
|
2577
2592
|
};
|
|
2578
2593
|
|
|
2579
2594
|
/**
|
|
2580
|
-
*
|
|
2595
|
+
* Send broadcast now
|
|
2596
|
+
* Immediately start sending a draft broadcast to its recipients.
|
|
2581
2597
|
*/
|
|
2582
2598
|
export const sendBroadcast = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SendBroadcastData, ThrowOnError>) => {
|
|
2583
2599
|
return (options?.client ?? client).post<SendBroadcastResponse, SendBroadcastError, ThrowOnError>({
|
|
@@ -2588,6 +2604,7 @@ export const sendBroadcast = <ThrowOnError extends boolean = false>(options: Opt
|
|
|
2588
2604
|
|
|
2589
2605
|
/**
|
|
2590
2606
|
* Schedule broadcast for later
|
|
2607
|
+
* Schedule a draft broadcast to be sent at a future date and time.
|
|
2591
2608
|
*/
|
|
2592
2609
|
export const scheduleBroadcast = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ScheduleBroadcastData, ThrowOnError>) => {
|
|
2593
2610
|
return (options?.client ?? client).post<ScheduleBroadcastResponse, ScheduleBroadcastError, ThrowOnError>({
|
|
@@ -2597,7 +2614,8 @@ export const scheduleBroadcast = <ThrowOnError extends boolean = false>(options:
|
|
|
2597
2614
|
};
|
|
2598
2615
|
|
|
2599
2616
|
/**
|
|
2600
|
-
* Cancel
|
|
2617
|
+
* Cancel broadcast
|
|
2618
|
+
* Cancel a scheduled or in-progress broadcast. Already-sent messages are not affected.
|
|
2601
2619
|
*/
|
|
2602
2620
|
export const cancelBroadcast = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CancelBroadcastData, ThrowOnError>) => {
|
|
2603
2621
|
return (options?.client ?? client).post<CancelBroadcastResponse, CancelBroadcastError, ThrowOnError>({
|
|
@@ -2608,6 +2626,7 @@ export const cancelBroadcast = <ThrowOnError extends boolean = false>(options: O
|
|
|
2608
2626
|
|
|
2609
2627
|
/**
|
|
2610
2628
|
* List broadcast recipients
|
|
2629
|
+
* Returns recipients for a broadcast with individual delivery status. Filter by status.
|
|
2611
2630
|
*/
|
|
2612
2631
|
export const listBroadcastRecipients = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListBroadcastRecipientsData, ThrowOnError>) => {
|
|
2613
2632
|
return (options?.client ?? client).get<ListBroadcastRecipientsResponse, ListBroadcastRecipientsError, ThrowOnError>({
|
|
@@ -2618,6 +2637,7 @@ export const listBroadcastRecipients = <ThrowOnError extends boolean = false>(op
|
|
|
2618
2637
|
|
|
2619
2638
|
/**
|
|
2620
2639
|
* Add recipients to a broadcast
|
|
2640
|
+
* Add recipients by contact IDs, raw phone numbers, or from the broadcast's segment filters.
|
|
2621
2641
|
*/
|
|
2622
2642
|
export const addBroadcastRecipients = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<AddBroadcastRecipientsData, ThrowOnError>) => {
|
|
2623
2643
|
return (options?.client ?? client).post<AddBroadcastRecipientsResponse, AddBroadcastRecipientsError, ThrowOnError>({
|
|
@@ -2628,6 +2648,7 @@ export const addBroadcastRecipients = <ThrowOnError extends boolean = false>(opt
|
|
|
2628
2648
|
|
|
2629
2649
|
/**
|
|
2630
2650
|
* List sequences
|
|
2651
|
+
* Returns sequences with enrollment stats. Filter by status, platform, or profile.
|
|
2631
2652
|
*/
|
|
2632
2653
|
export const listSequences = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListSequencesData, ThrowOnError>) => {
|
|
2633
2654
|
return (options?.client ?? client).get<ListSequencesResponse, ListSequencesError, ThrowOnError>({
|
|
@@ -2637,7 +2658,8 @@ export const listSequences = <ThrowOnError extends boolean = false>(options?: Op
|
|
|
2637
2658
|
};
|
|
2638
2659
|
|
|
2639
2660
|
/**
|
|
2640
|
-
* Create
|
|
2661
|
+
* Create sequence
|
|
2662
|
+
* Create a multi-step messaging sequence. Each step has a delay and a message or WhatsApp template.
|
|
2641
2663
|
*/
|
|
2642
2664
|
export const createSequence = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateSequenceData, ThrowOnError>) => {
|
|
2643
2665
|
return (options?.client ?? client).post<CreateSequenceResponse, CreateSequenceError, ThrowOnError>({
|
|
@@ -2648,6 +2670,7 @@ export const createSequence = <ThrowOnError extends boolean = false>(options: Op
|
|
|
2648
2670
|
|
|
2649
2671
|
/**
|
|
2650
2672
|
* Get sequence with steps
|
|
2673
|
+
* Returns a sequence with all its steps and enrollment stats.
|
|
2651
2674
|
*/
|
|
2652
2675
|
export const getSequence = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetSequenceData, ThrowOnError>) => {
|
|
2653
2676
|
return (options?.client ?? client).get<GetSequenceResponse, GetSequenceError, ThrowOnError>({
|
|
@@ -2657,7 +2680,8 @@ export const getSequence = <ThrowOnError extends boolean = false>(options: Optio
|
|
|
2657
2680
|
};
|
|
2658
2681
|
|
|
2659
2682
|
/**
|
|
2660
|
-
* Update
|
|
2683
|
+
* Update sequence
|
|
2684
|
+
* Update a sequence's name, steps, or exit conditions. Active sequences can be updated without pausing.
|
|
2661
2685
|
*/
|
|
2662
2686
|
export const updateSequence = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateSequenceData, ThrowOnError>) => {
|
|
2663
2687
|
return (options?.client ?? client).patch<UpdateSequenceResponse, UpdateSequenceError, ThrowOnError>({
|
|
@@ -2667,7 +2691,8 @@ export const updateSequence = <ThrowOnError extends boolean = false>(options: Op
|
|
|
2667
2691
|
};
|
|
2668
2692
|
|
|
2669
2693
|
/**
|
|
2670
|
-
* Delete
|
|
2694
|
+
* Delete sequence
|
|
2695
|
+
* Permanently delete a sequence. Active enrollments are stopped.
|
|
2671
2696
|
*/
|
|
2672
2697
|
export const deleteSequence = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteSequenceData, ThrowOnError>) => {
|
|
2673
2698
|
return (options?.client ?? client).delete<DeleteSequenceResponse, DeleteSequenceError, ThrowOnError>({
|
|
@@ -2677,7 +2702,8 @@ export const deleteSequence = <ThrowOnError extends boolean = false>(options: Op
|
|
|
2677
2702
|
};
|
|
2678
2703
|
|
|
2679
2704
|
/**
|
|
2680
|
-
* Activate
|
|
2705
|
+
* Activate sequence
|
|
2706
|
+
* Start a draft or paused sequence. The sequence must have at least one step.
|
|
2681
2707
|
*/
|
|
2682
2708
|
export const activateSequence = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ActivateSequenceData, ThrowOnError>) => {
|
|
2683
2709
|
return (options?.client ?? client).post<ActivateSequenceResponse, ActivateSequenceError, ThrowOnError>({
|
|
@@ -2687,7 +2713,8 @@ export const activateSequence = <ThrowOnError extends boolean = false>(options:
|
|
|
2687
2713
|
};
|
|
2688
2714
|
|
|
2689
2715
|
/**
|
|
2690
|
-
* Pause
|
|
2716
|
+
* Pause sequence
|
|
2717
|
+
* Pause an active sequence. Enrolled contacts stop receiving messages until the sequence is reactivated.
|
|
2691
2718
|
*/
|
|
2692
2719
|
export const pauseSequence = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<PauseSequenceData, ThrowOnError>) => {
|
|
2693
2720
|
return (options?.client ?? client).post<PauseSequenceResponse, PauseSequenceError, ThrowOnError>({
|
|
@@ -2698,6 +2725,7 @@ export const pauseSequence = <ThrowOnError extends boolean = false>(options: Opt
|
|
|
2698
2725
|
|
|
2699
2726
|
/**
|
|
2700
2727
|
* Enroll contacts in a sequence
|
|
2728
|
+
* Enroll one or more contacts into a sequence. Contacts already enrolled are skipped.
|
|
2701
2729
|
*/
|
|
2702
2730
|
export const enrollContacts = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<EnrollContactsData, ThrowOnError>) => {
|
|
2703
2731
|
return (options?.client ?? client).post<EnrollContactsResponse, EnrollContactsError, ThrowOnError>({
|
|
@@ -2707,7 +2735,8 @@ export const enrollContacts = <ThrowOnError extends boolean = false>(options: Op
|
|
|
2707
2735
|
};
|
|
2708
2736
|
|
|
2709
2737
|
/**
|
|
2710
|
-
* Unenroll
|
|
2738
|
+
* Unenroll contact
|
|
2739
|
+
* Remove a contact from a sequence. No further messages will be sent to this contact.
|
|
2711
2740
|
*/
|
|
2712
2741
|
export const unenrollContact = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UnenrollContactData, ThrowOnError>) => {
|
|
2713
2742
|
return (options?.client ?? client).delete<UnenrollContactResponse, UnenrollContactError, ThrowOnError>({
|
|
@@ -2718,6 +2747,7 @@ export const unenrollContact = <ThrowOnError extends boolean = false>(options: O
|
|
|
2718
2747
|
|
|
2719
2748
|
/**
|
|
2720
2749
|
* List enrollments for a sequence
|
|
2750
|
+
* Returns enrolled contacts with their progress, status, and next scheduled step.
|
|
2721
2751
|
*/
|
|
2722
2752
|
export const listSequenceEnrollments = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListSequenceEnrollmentsData, ThrowOnError>) => {
|
|
2723
2753
|
return (options?.client ?? client).get<ListSequenceEnrollmentsResponse, ListSequenceEnrollmentsError, ThrowOnError>({
|
|
@@ -2738,7 +2768,7 @@ export const listCommentAutomations = <ThrowOnError extends boolean = false>(opt
|
|
|
2738
2768
|
};
|
|
2739
2769
|
|
|
2740
2770
|
/**
|
|
2741
|
-
* Create
|
|
2771
|
+
* Create comment-to-DM automation
|
|
2742
2772
|
* Create a keyword-triggered DM automation on an Instagram or Facebook post.
|
|
2743
2773
|
* When someone comments a matching keyword, they automatically receive a DM.
|
|
2744
2774
|
* Only one active automation per post is allowed.
|
|
@@ -2752,7 +2782,8 @@ export const createCommentAutomation = <ThrowOnError extends boolean = false>(op
|
|
|
2752
2782
|
};
|
|
2753
2783
|
|
|
2754
2784
|
/**
|
|
2755
|
-
* Get automation details
|
|
2785
|
+
* Get automation details
|
|
2786
|
+
* Returns an automation with its configuration, stats, and recent trigger logs.
|
|
2756
2787
|
*/
|
|
2757
2788
|
export const getCommentAutomation = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetCommentAutomationData, ThrowOnError>) => {
|
|
2758
2789
|
return (options?.client ?? client).get<GetCommentAutomationResponse, GetCommentAutomationError, ThrowOnError>({
|
|
@@ -2763,6 +2794,7 @@ export const getCommentAutomation = <ThrowOnError extends boolean = false>(optio
|
|
|
2763
2794
|
|
|
2764
2795
|
/**
|
|
2765
2796
|
* Update automation settings
|
|
2797
|
+
* Update an automation's keywords, DM message, comment reply, or active status.
|
|
2766
2798
|
*/
|
|
2767
2799
|
export const updateCommentAutomation = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateCommentAutomationData, ThrowOnError>) => {
|
|
2768
2800
|
return (options?.client ?? client).patch<UpdateCommentAutomationResponse, UpdateCommentAutomationError, ThrowOnError>({
|
|
@@ -2772,7 +2804,8 @@ export const updateCommentAutomation = <ThrowOnError extends boolean = false>(op
|
|
|
2772
2804
|
};
|
|
2773
2805
|
|
|
2774
2806
|
/**
|
|
2775
|
-
* Delete automation
|
|
2807
|
+
* Delete automation
|
|
2808
|
+
* Permanently delete an automation and all its trigger logs.
|
|
2776
2809
|
*/
|
|
2777
2810
|
export const deleteCommentAutomation = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteCommentAutomationData, ThrowOnError>) => {
|
|
2778
2811
|
return (options?.client ?? client).delete<DeleteCommentAutomationResponse, DeleteCommentAutomationError, ThrowOnError>({
|
|
@@ -2782,7 +2815,7 @@ export const deleteCommentAutomation = <ThrowOnError extends boolean = false>(op
|
|
|
2782
2815
|
};
|
|
2783
2816
|
|
|
2784
2817
|
/**
|
|
2785
|
-
* List
|
|
2818
|
+
* List automation logs
|
|
2786
2819
|
* Paginated list of every comment that triggered this automation, with send status and commenter info.
|
|
2787
2820
|
*/
|
|
2788
2821
|
export const listCommentAutomationLogs = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListCommentAutomationLogsData, ThrowOnError>) => {
|
|
@@ -2795,7 +2828,7 @@ export const listCommentAutomationLogs = <ThrowOnError extends boolean = false>(
|
|
|
2795
2828
|
/**
|
|
2796
2829
|
* List ads
|
|
2797
2830
|
* Returns a paginated list of ads with metrics computed over an optional date range.
|
|
2798
|
-
* Use
|
|
2831
|
+
* Use source=all to include externally-synced ads from platform ad managers.
|
|
2799
2832
|
* If no date range is provided, defaults to the last 90 days. Date range is capped at 90 days max.
|
|
2800
2833
|
*
|
|
2801
2834
|
*/
|
|
@@ -2807,7 +2840,7 @@ export const listAds = <ThrowOnError extends boolean = false>(options?: OptionsL
|
|
|
2807
2840
|
};
|
|
2808
2841
|
|
|
2809
2842
|
/**
|
|
2810
|
-
* List campaigns
|
|
2843
|
+
* List campaigns
|
|
2811
2844
|
* Returns campaigns as virtual aggregations over ad documents grouped by platform campaign ID.
|
|
2812
2845
|
* Metrics (spend, impressions, clicks, etc.) are summed across all ads in each campaign.
|
|
2813
2846
|
* Campaign status is derived from child ad statuses (active > pending_review > paused > error > completed > cancelled > rejected).
|
|
@@ -2834,7 +2867,7 @@ export const updateAdCampaignStatus = <ThrowOnError extends boolean = false>(opt
|
|
|
2834
2867
|
};
|
|
2835
2868
|
|
|
2836
2869
|
/**
|
|
2837
|
-
* Get
|
|
2870
|
+
* Get campaign tree
|
|
2838
2871
|
* Returns a nested Campaign > Ad Set > Ad hierarchy with rolled-up metrics at each level.
|
|
2839
2872
|
* Uses a two-stage aggregation: ads are grouped into ad sets, then ad sets into campaigns.
|
|
2840
2873
|
* Metrics are computed over an optional date range, then rolled up from ad level to ad set
|
|
@@ -2852,6 +2885,7 @@ export const getAdTree = <ThrowOnError extends boolean = false>(options?: Option
|
|
|
2852
2885
|
|
|
2853
2886
|
/**
|
|
2854
2887
|
* Get ad details
|
|
2888
|
+
* Returns an ad with its creative, targeting, status, and performance metrics.
|
|
2855
2889
|
*/
|
|
2856
2890
|
export const getAd = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetAdData, ThrowOnError>) => {
|
|
2857
2891
|
return (options?.client ?? client).get<GetAdResponse, GetAdError, ThrowOnError>({
|
|
@@ -2861,7 +2895,7 @@ export const getAd = <ThrowOnError extends boolean = false>(options: OptionsLega
|
|
|
2861
2895
|
};
|
|
2862
2896
|
|
|
2863
2897
|
/**
|
|
2864
|
-
* Update ad
|
|
2898
|
+
* Update ad
|
|
2865
2899
|
* Update one or more fields on an ad. Status changes and budget updates are propagated to the platform. Targeting updates are Meta-only.
|
|
2866
2900
|
*/
|
|
2867
2901
|
export const updateAd = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateAdData, ThrowOnError>) => {
|
|
@@ -2883,7 +2917,7 @@ export const deleteAd = <ThrowOnError extends boolean = false>(options: OptionsL
|
|
|
2883
2917
|
};
|
|
2884
2918
|
|
|
2885
2919
|
/**
|
|
2886
|
-
* Get ad analytics
|
|
2920
|
+
* Get ad analytics
|
|
2887
2921
|
* Returns detailed performance analytics for an ad. Includes summary metrics, a daily timeline
|
|
2888
2922
|
* over the requested date range, and optional demographic breakdowns (Meta and TikTok only).
|
|
2889
2923
|
* If no date range is provided, defaults to the last 90 days. Date range is capped at 90 days max.
|
|
@@ -2897,7 +2931,7 @@ export const getAdAnalytics = <ThrowOnError extends boolean = false>(options: Op
|
|
|
2897
2931
|
};
|
|
2898
2932
|
|
|
2899
2933
|
/**
|
|
2900
|
-
* List ad accounts
|
|
2934
|
+
* List ad accounts
|
|
2901
2935
|
* Returns the platform ad accounts available for the given social account (e.g. Meta ad accounts, TikTok advertiser IDs, Google Ads customer IDs).
|
|
2902
2936
|
*/
|
|
2903
2937
|
export const listAdAccounts = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListAdAccountsData, ThrowOnError>) => {
|
|
@@ -2908,7 +2942,7 @@ export const listAdAccounts = <ThrowOnError extends boolean = false>(options: Op
|
|
|
2908
2942
|
};
|
|
2909
2943
|
|
|
2910
2944
|
/**
|
|
2911
|
-
* Boost
|
|
2945
|
+
* Boost post as ad
|
|
2912
2946
|
* Creates a paid ad campaign from an existing published post. Creates the full platform campaign hierarchy (campaign, ad set, ad).
|
|
2913
2947
|
*/
|
|
2914
2948
|
export const boostPost = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<BoostPostData, ThrowOnError>) => {
|
|
@@ -2919,7 +2953,7 @@ export const boostPost = <ThrowOnError extends boolean = false>(options: Options
|
|
|
2919
2953
|
};
|
|
2920
2954
|
|
|
2921
2955
|
/**
|
|
2922
|
-
* Create
|
|
2956
|
+
* Create standalone ad
|
|
2923
2957
|
* Creates a paid ad with custom creative (headline, body, image/video, link). Creates the full platform campaign hierarchy.
|
|
2924
2958
|
*/
|
|
2925
2959
|
export const createStandaloneAd = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateStandaloneAdData, ThrowOnError>) => {
|
|
@@ -2952,7 +2986,7 @@ export const listAdAudiences = <ThrowOnError extends boolean = false>(options: O
|
|
|
2952
2986
|
};
|
|
2953
2987
|
|
|
2954
2988
|
/**
|
|
2955
|
-
* Create
|
|
2989
|
+
* Create custom audience
|
|
2956
2990
|
* Create a customer list, website retargeting, or lookalike audience on Meta (Facebook/Instagram).
|
|
2957
2991
|
*/
|
|
2958
2992
|
export const createAdAudience = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateAdAudienceData, ThrowOnError>) => {
|
|
@@ -2974,7 +3008,7 @@ export const getAdAudience = <ThrowOnError extends boolean = false>(options: Opt
|
|
|
2974
3008
|
};
|
|
2975
3009
|
|
|
2976
3010
|
/**
|
|
2977
|
-
* Delete
|
|
3011
|
+
* Delete custom audience
|
|
2978
3012
|
* Deletes the audience from both Meta and the local database.
|
|
2979
3013
|
*/
|
|
2980
3014
|
export const deleteAdAudience = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteAdAudienceData, ThrowOnError>) => {
|
|
@@ -2985,7 +3019,7 @@ export const deleteAdAudience = <ThrowOnError extends boolean = false>(options:
|
|
|
2985
3019
|
};
|
|
2986
3020
|
|
|
2987
3021
|
/**
|
|
2988
|
-
* Add users to
|
|
3022
|
+
* Add users to audience
|
|
2989
3023
|
* Upload user data (emails and/or phone numbers) to a customer_list audience. Data is SHA256-hashed server-side before sending to Meta. Max 10,000 users per request.
|
|
2990
3024
|
*/
|
|
2991
3025
|
export const addUsersToAdAudience = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<AddUsersToAdAudienceData, ThrowOnError>) => {
|