@zernio/node 0.2.61 → 0.2.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +56 -56
- package/dist/index.d.ts +56 -56
- package/package.json +1 -1
- package/src/generated/sdk.gen.ts +91 -57
- package/src/generated/types.gen.ts +56 -56
package/src/generated/sdk.gen.ts
CHANGED
|
@@ -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>) => {
|
|
@@ -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
|
*
|
|
@@ -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
|
*/
|
|
@@ -2417,6 +2417,7 @@ export const createContact = <ThrowOnError extends boolean = false>(options: Opt
|
|
|
2417
2417
|
|
|
2418
2418
|
/**
|
|
2419
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>({
|
|
@@ -2427,6 +2428,7 @@ export const getContact = <ThrowOnError extends boolean = false>(options: Option
|
|
|
2427
2428
|
|
|
2428
2429
|
/**
|
|
2429
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>({
|
|
@@ -2437,6 +2439,7 @@ export const updateContact = <ThrowOnError extends boolean = false>(options: Opt
|
|
|
2437
2439
|
|
|
2438
2440
|
/**
|
|
2439
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>({
|
|
@@ -2468,6 +2472,7 @@ export const bulkCreateContacts = <ThrowOnError extends boolean = false>(options
|
|
|
2468
2472
|
|
|
2469
2473
|
/**
|
|
2470
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>({
|
|
@@ -2478,6 +2483,7 @@ export const setContactFieldValue = <ThrowOnError extends boolean = false>(optio
|
|
|
2478
2483
|
|
|
2479
2484
|
/**
|
|
2480
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>({
|
|
@@ -2498,6 +2505,7 @@ export const listCustomFields = <ThrowOnError extends boolean = false>(options?:
|
|
|
2498
2505
|
|
|
2499
2506
|
/**
|
|
2500
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>({
|
|
@@ -2508,6 +2516,7 @@ export const createCustomField = <ThrowOnError extends boolean = false>(options:
|
|
|
2508
2516
|
|
|
2509
2517
|
/**
|
|
2510
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>({
|
|
@@ -2518,6 +2527,7 @@ export const updateCustomField = <ThrowOnError extends boolean = false>(options:
|
|
|
2518
2527
|
|
|
2519
2528
|
/**
|
|
2520
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>({
|
|
@@ -2538,6 +2549,7 @@ export const listBroadcasts = <ThrowOnError extends boolean = false>(options?: O
|
|
|
2538
2549
|
|
|
2539
2550
|
/**
|
|
2540
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>({
|
|
@@ -2558,6 +2571,7 @@ export const getBroadcast = <ThrowOnError extends boolean = false>(options: Opti
|
|
|
2558
2571
|
|
|
2559
2572
|
/**
|
|
2560
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>({
|
|
@@ -2568,6 +2582,7 @@ export const updateBroadcast = <ThrowOnError extends boolean = false>(options: O
|
|
|
2568
2582
|
|
|
2569
2583
|
/**
|
|
2570
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>({
|
|
@@ -2578,6 +2593,7 @@ export const deleteBroadcast = <ThrowOnError extends boolean = false>(options: O
|
|
|
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>({
|
|
@@ -2598,6 +2615,7 @@ export const scheduleBroadcast = <ThrowOnError extends boolean = false>(options:
|
|
|
2598
2615
|
|
|
2599
2616
|
/**
|
|
2600
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>({
|
|
@@ -2638,6 +2659,7 @@ export const listSequences = <ThrowOnError extends boolean = false>(options?: Op
|
|
|
2638
2659
|
|
|
2639
2660
|
/**
|
|
2640
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>({
|
|
@@ -2658,6 +2681,7 @@ export const getSequence = <ThrowOnError extends boolean = false>(options: Optio
|
|
|
2658
2681
|
|
|
2659
2682
|
/**
|
|
2660
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>({
|
|
@@ -2668,6 +2692,7 @@ export const updateSequence = <ThrowOnError extends boolean = false>(options: Op
|
|
|
2668
2692
|
|
|
2669
2693
|
/**
|
|
2670
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>({
|
|
@@ -2678,6 +2703,7 @@ export const deleteSequence = <ThrowOnError extends boolean = false>(options: Op
|
|
|
2678
2703
|
|
|
2679
2704
|
/**
|
|
2680
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>({
|
|
@@ -2688,6 +2714,7 @@ export const activateSequence = <ThrowOnError extends boolean = false>(options:
|
|
|
2688
2714
|
|
|
2689
2715
|
/**
|
|
2690
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>({
|
|
@@ -2708,6 +2736,7 @@ export const enrollContacts = <ThrowOnError extends boolean = false>(options: Op
|
|
|
2708
2736
|
|
|
2709
2737
|
/**
|
|
2710
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>({
|
|
@@ -2753,6 +2783,7 @@ export const createCommentAutomation = <ThrowOnError extends boolean = false>(op
|
|
|
2753
2783
|
|
|
2754
2784
|
/**
|
|
2755
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>({
|
|
@@ -2773,6 +2805,7 @@ export const updateCommentAutomation = <ThrowOnError extends boolean = false>(op
|
|
|
2773
2805
|
|
|
2774
2806
|
/**
|
|
2775
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>({
|
|
@@ -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
|
*/
|
|
@@ -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>({
|