@zernio/node 0.1.58

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.
@@ -0,0 +1,2259 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import { createClient, createConfig, type OptionsLegacyParser, formDataBodySerializer } from '@hey-api/client-fetch';
4
+ import type { DownloadYouTubeVideoData, DownloadYouTubeVideoError, DownloadYouTubeVideoResponse, GetYouTubeTranscriptData, GetYouTubeTranscriptError, GetYouTubeTranscriptResponse, DownloadInstagramMediaData, DownloadInstagramMediaError, DownloadInstagramMediaResponse, CheckInstagramHashtagsData, CheckInstagramHashtagsError, CheckInstagramHashtagsResponse, DownloadTikTokVideoData, DownloadTikTokVideoError, DownloadTikTokVideoResponse, DownloadTwitterMediaData, DownloadTwitterMediaError, DownloadTwitterMediaResponse, DownloadFacebookVideoData, DownloadFacebookVideoError, DownloadFacebookVideoResponse, DownloadLinkedInVideoData, DownloadLinkedInVideoError, DownloadLinkedInVideoResponse, DownloadBlueskyMediaData, DownloadBlueskyMediaError, DownloadBlueskyMediaResponse, ValidatePostLengthData, ValidatePostLengthError, ValidatePostLengthResponse, ValidatePostData, ValidatePostError, ValidatePostResponse, ValidateMediaData, ValidateMediaError, ValidateMediaResponse, ValidateSubredditData, ValidateSubredditError, ValidateSubredditResponse, GetAnalyticsData, GetAnalyticsError, GetAnalyticsResponse, GetYouTubeDailyViewsData, GetYouTubeDailyViewsError, GetYouTubeDailyViewsResponse, GetDailyMetricsData, GetDailyMetricsError, GetDailyMetricsResponse, GetBestTimeToPostData, GetBestTimeToPostError, GetBestTimeToPostResponse, GetContentDecayData, GetContentDecayError, GetContentDecayResponse, GetPostingFrequencyData, GetPostingFrequencyError, GetPostingFrequencyResponse, GetPostTimelineData, GetPostTimelineError, GetPostTimelineResponse, ListAccountGroupsError, ListAccountGroupsResponse, CreateAccountGroupData, CreateAccountGroupError, CreateAccountGroupResponse, UpdateAccountGroupData, UpdateAccountGroupError, UpdateAccountGroupResponse, DeleteAccountGroupData, DeleteAccountGroupError, DeleteAccountGroupResponse, GetMediaPresignedUrlData, GetMediaPresignedUrlError, GetMediaPresignedUrlResponse, SearchRedditData, SearchRedditError, SearchRedditResponse, GetRedditFeedData, GetRedditFeedError, GetRedditFeedResponse, GetUsageStatsError, GetUsageStatsResponse, ListPostsData, ListPostsError, ListPostsResponse, CreatePostData, CreatePostError, CreatePostResponse, GetPostData, GetPostError, GetPostResponse, UpdatePostData, UpdatePostError, UpdatePostResponse, DeletePostData, DeletePostError, DeletePostResponse, BulkUploadPostsData, BulkUploadPostsError, BulkUploadPostsResponse, RetryPostData, RetryPostError, RetryPostResponse, UnpublishPostData, UnpublishPostError, UnpublishPostResponse, ListUsersError, ListUsersResponse, GetUserData, GetUserError, GetUserResponse, ListProfilesData, ListProfilesError, ListProfilesResponse, CreateProfileData, CreateProfileError, CreateProfileResponse, GetProfileData, GetProfileError, GetProfileResponse, UpdateProfileData, UpdateProfileError, UpdateProfileResponse, DeleteProfileData, DeleteProfileError, DeleteProfileResponse, ListAccountsData, ListAccountsError, ListAccountsResponse, GetFollowerStatsData, GetFollowerStatsError, GetFollowerStatsResponse, UpdateAccountData, UpdateAccountError, UpdateAccountResponse, DeleteAccountData, DeleteAccountError, DeleteAccountResponse, GetAllAccountsHealthData, GetAllAccountsHealthError, GetAllAccountsHealthResponse, GetAccountHealthData, GetAccountHealthError, GetAccountHealthResponse, ListApiKeysError, ListApiKeysResponse, CreateApiKeyData, CreateApiKeyError, CreateApiKeyResponse, DeleteApiKeyData, DeleteApiKeyError, DeleteApiKeyResponse, CreateInviteTokenData, CreateInviteTokenError, CreateInviteTokenResponse, GetConnectUrlData, GetConnectUrlError, GetConnectUrlResponse, HandleOAuthCallbackData, HandleOAuthCallbackError, HandleOAuthCallbackResponse, ListFacebookPagesData, ListFacebookPagesError, ListFacebookPagesResponse, SelectFacebookPageData, SelectFacebookPageError, SelectFacebookPageResponse, ListGoogleBusinessLocationsData, ListGoogleBusinessLocationsError, ListGoogleBusinessLocationsResponse, SelectGoogleBusinessLocationData, SelectGoogleBusinessLocationError, SelectGoogleBusinessLocationResponse, GetGoogleBusinessReviewsData, GetGoogleBusinessReviewsError, GetGoogleBusinessReviewsResponse, GetGoogleBusinessFoodMenusData, GetGoogleBusinessFoodMenusError, GetGoogleBusinessFoodMenusResponse, UpdateGoogleBusinessFoodMenusData, UpdateGoogleBusinessFoodMenusError, UpdateGoogleBusinessFoodMenusResponse, GetGoogleBusinessLocationDetailsData, GetGoogleBusinessLocationDetailsError, GetGoogleBusinessLocationDetailsResponse, UpdateGoogleBusinessLocationDetailsData, UpdateGoogleBusinessLocationDetailsError, UpdateGoogleBusinessLocationDetailsResponse, ListGoogleBusinessMediaData, ListGoogleBusinessMediaError, ListGoogleBusinessMediaResponse, CreateGoogleBusinessMediaData, CreateGoogleBusinessMediaError, CreateGoogleBusinessMediaResponse, DeleteGoogleBusinessMediaData, DeleteGoogleBusinessMediaError, DeleteGoogleBusinessMediaResponse, GetGoogleBusinessAttributesData, GetGoogleBusinessAttributesError, GetGoogleBusinessAttributesResponse, UpdateGoogleBusinessAttributesData, UpdateGoogleBusinessAttributesError, UpdateGoogleBusinessAttributesResponse, ListGoogleBusinessPlaceActionsData, ListGoogleBusinessPlaceActionsError, ListGoogleBusinessPlaceActionsResponse, CreateGoogleBusinessPlaceActionData, CreateGoogleBusinessPlaceActionError, CreateGoogleBusinessPlaceActionResponse, DeleteGoogleBusinessPlaceActionData, DeleteGoogleBusinessPlaceActionError, DeleteGoogleBusinessPlaceActionResponse, GetPendingOAuthDataData, GetPendingOAuthDataError, GetPendingOAuthDataResponse, ListLinkedInOrganizationsData, ListLinkedInOrganizationsError, ListLinkedInOrganizationsResponse, SelectLinkedInOrganizationData, SelectLinkedInOrganizationError, SelectLinkedInOrganizationResponse, ListPinterestBoardsForSelectionData, ListPinterestBoardsForSelectionError, ListPinterestBoardsForSelectionResponse, SelectPinterestBoardData, SelectPinterestBoardError, SelectPinterestBoardResponse, ListSnapchatProfilesData, ListSnapchatProfilesError, ListSnapchatProfilesResponse, SelectSnapchatProfileData, SelectSnapchatProfileError, SelectSnapchatProfileResponse, ConnectBlueskyCredentialsData, ConnectBlueskyCredentialsError, ConnectBlueskyCredentialsResponse, ConnectWhatsAppCredentialsData, ConnectWhatsAppCredentialsError, ConnectWhatsAppCredentialsResponse, GetTelegramConnectStatusData, GetTelegramConnectStatusError, GetTelegramConnectStatusResponse, InitiateTelegramConnectData, InitiateTelegramConnectError, InitiateTelegramConnectResponse, CompleteTelegramConnectData, CompleteTelegramConnectError, CompleteTelegramConnectResponse, GetFacebookPagesData, GetFacebookPagesError, GetFacebookPagesResponse, UpdateFacebookPageData, UpdateFacebookPageError, UpdateFacebookPageResponse, GetLinkedInOrganizationsData, GetLinkedInOrganizationsError, GetLinkedInOrganizationsResponse, GetLinkedInAggregateAnalyticsData, GetLinkedInAggregateAnalyticsError, GetLinkedInAggregateAnalyticsResponse, GetLinkedInPostAnalyticsData, GetLinkedInPostAnalyticsError, GetLinkedInPostAnalyticsResponse, GetLinkedInPostReactionsData, GetLinkedInPostReactionsError, GetLinkedInPostReactionsResponse, UpdateLinkedInOrganizationData, UpdateLinkedInOrganizationError, UpdateLinkedInOrganizationResponse, GetLinkedInMentionsData, GetLinkedInMentionsError, GetLinkedInMentionsResponse, GetPinterestBoardsData, GetPinterestBoardsError, GetPinterestBoardsResponse, UpdatePinterestBoardsData, UpdatePinterestBoardsError, UpdatePinterestBoardsResponse, GetGmbLocationsData, GetGmbLocationsError, GetGmbLocationsResponse, UpdateGmbLocationData, UpdateGmbLocationError, UpdateGmbLocationResponse, GetRedditSubredditsData, GetRedditSubredditsError, GetRedditSubredditsResponse, UpdateRedditSubredditsData, UpdateRedditSubredditsError, UpdateRedditSubredditsResponse, GetRedditFlairsData, GetRedditFlairsError, GetRedditFlairsResponse, ListQueueSlotsData, ListQueueSlotsError, ListQueueSlotsResponse, CreateQueueSlotData, CreateQueueSlotError, CreateQueueSlotResponse, UpdateQueueSlotData, UpdateQueueSlotError, UpdateQueueSlotResponse, DeleteQueueSlotData, DeleteQueueSlotError, DeleteQueueSlotResponse, PreviewQueueData, PreviewQueueError, PreviewQueueResponse, GetNextQueueSlotData, GetNextQueueSlotError, GetNextQueueSlotResponse, GetWebhookSettingsError, GetWebhookSettingsResponse, CreateWebhookSettingsData, CreateWebhookSettingsError, CreateWebhookSettingsResponse, UpdateWebhookSettingsData, UpdateWebhookSettingsError, UpdateWebhookSettingsResponse, DeleteWebhookSettingsData, DeleteWebhookSettingsError, DeleteWebhookSettingsResponse, TestWebhookData, TestWebhookError, TestWebhookResponse, GetWebhookLogsData, GetWebhookLogsError, GetWebhookLogsResponse, ListPostsLogsData, ListPostsLogsError, ListPostsLogsResponse, ListConnectionLogsData, ListConnectionLogsError, ListConnectionLogsResponse, GetPostLogsData, GetPostLogsError, GetPostLogsResponse, ListInboxConversationsData, ListInboxConversationsError, ListInboxConversationsResponse, GetInboxConversationData, GetInboxConversationError, GetInboxConversationResponse, UpdateInboxConversationData, UpdateInboxConversationError, UpdateInboxConversationResponse, GetInboxConversationMessagesData, GetInboxConversationMessagesError, GetInboxConversationMessagesResponse, SendInboxMessageData, SendInboxMessageError, SendInboxMessageResponse, EditInboxMessageData, EditInboxMessageError, EditInboxMessageResponse, GetMessengerMenuData, GetMessengerMenuError, GetMessengerMenuResponse, SetMessengerMenuData, SetMessengerMenuError, SetMessengerMenuResponse, DeleteMessengerMenuData, DeleteMessengerMenuError, DeleteMessengerMenuResponse, GetInstagramIceBreakersData, GetInstagramIceBreakersError, GetInstagramIceBreakersResponse, SetInstagramIceBreakersData, SetInstagramIceBreakersError, SetInstagramIceBreakersResponse, DeleteInstagramIceBreakersData, DeleteInstagramIceBreakersError, DeleteInstagramIceBreakersResponse, GetTelegramCommandsData, GetTelegramCommandsError, GetTelegramCommandsResponse, SetTelegramCommandsData, SetTelegramCommandsError, SetTelegramCommandsResponse, DeleteTelegramCommandsData, DeleteTelegramCommandsError, DeleteTelegramCommandsResponse, ListInboxCommentsData, ListInboxCommentsError, ListInboxCommentsResponse, GetInboxPostCommentsData, GetInboxPostCommentsError, GetInboxPostCommentsResponse, ReplyToInboxPostData, ReplyToInboxPostError, ReplyToInboxPostResponse, DeleteInboxCommentData, DeleteInboxCommentError, DeleteInboxCommentResponse, HideInboxCommentData, HideInboxCommentError, HideInboxCommentResponse, UnhideInboxCommentData, UnhideInboxCommentError, UnhideInboxCommentResponse, LikeInboxCommentData, LikeInboxCommentError, LikeInboxCommentResponse, UnlikeInboxCommentData, UnlikeInboxCommentError, UnlikeInboxCommentResponse, SendPrivateReplyToCommentData, SendPrivateReplyToCommentError, SendPrivateReplyToCommentResponse, RetweetPostData, RetweetPostError, RetweetPostResponse, UndoRetweetData, UndoRetweetError, UndoRetweetResponse, BookmarkPostData, BookmarkPostError, BookmarkPostResponse, RemoveBookmarkData, RemoveBookmarkError, RemoveBookmarkResponse, FollowUserData, FollowUserError, FollowUserResponse, UnfollowUserData, UnfollowUserError, UnfollowUserResponse, ListInboxReviewsData, ListInboxReviewsError, ListInboxReviewsResponse, ReplyToInboxReviewData, ReplyToInboxReviewError, ReplyToInboxReviewResponse, DeleteInboxReviewReplyData, DeleteInboxReviewReplyError, DeleteInboxReviewReplyResponse, SendWhatsAppBulkData, SendWhatsAppBulkError, SendWhatsAppBulkResponse, GetWhatsAppContactsData, GetWhatsAppContactsError, GetWhatsAppContactsResponse, CreateWhatsAppContactData, CreateWhatsAppContactError, CreateWhatsAppContactResponse, GetWhatsAppContactData, GetWhatsAppContactError, GetWhatsAppContactResponse, UpdateWhatsAppContactData, UpdateWhatsAppContactError, UpdateWhatsAppContactResponse, DeleteWhatsAppContactData, DeleteWhatsAppContactError, DeleteWhatsAppContactResponse, ImportWhatsAppContactsData, ImportWhatsAppContactsError, ImportWhatsAppContactsResponse, BulkUpdateWhatsAppContactsData, BulkUpdateWhatsAppContactsError, BulkUpdateWhatsAppContactsResponse, BulkDeleteWhatsAppContactsData, BulkDeleteWhatsAppContactsError, BulkDeleteWhatsAppContactsResponse, GetWhatsAppGroupsData, GetWhatsAppGroupsError, GetWhatsAppGroupsResponse, RenameWhatsAppGroupData, RenameWhatsAppGroupError, RenameWhatsAppGroupResponse, DeleteWhatsAppGroupData, DeleteWhatsAppGroupError, DeleteWhatsAppGroupResponse, GetWhatsAppTemplatesData, GetWhatsAppTemplatesError, GetWhatsAppTemplatesResponse, CreateWhatsAppTemplateData, CreateWhatsAppTemplateError, CreateWhatsAppTemplateResponse, GetWhatsAppTemplateData, GetWhatsAppTemplateError, GetWhatsAppTemplateResponse, UpdateWhatsAppTemplateData, UpdateWhatsAppTemplateError, UpdateWhatsAppTemplateResponse, DeleteWhatsAppTemplateData, DeleteWhatsAppTemplateError, DeleteWhatsAppTemplateResponse, GetWhatsAppBroadcastsData, GetWhatsAppBroadcastsError, GetWhatsAppBroadcastsResponse, CreateWhatsAppBroadcastData, CreateWhatsAppBroadcastError, CreateWhatsAppBroadcastResponse, GetWhatsAppBroadcastData, GetWhatsAppBroadcastError, GetWhatsAppBroadcastResponse, DeleteWhatsAppBroadcastData, DeleteWhatsAppBroadcastError, DeleteWhatsAppBroadcastResponse, SendWhatsAppBroadcastData, SendWhatsAppBroadcastError, SendWhatsAppBroadcastResponse, ScheduleWhatsAppBroadcastData, ScheduleWhatsAppBroadcastError, ScheduleWhatsAppBroadcastResponse, CancelWhatsAppBroadcastScheduleData, CancelWhatsAppBroadcastScheduleError, CancelWhatsAppBroadcastScheduleResponse, GetWhatsAppBroadcastRecipientsData, GetWhatsAppBroadcastRecipientsError, GetWhatsAppBroadcastRecipientsResponse, AddWhatsAppBroadcastRecipientsData, AddWhatsAppBroadcastRecipientsError, AddWhatsAppBroadcastRecipientsResponse, RemoveWhatsAppBroadcastRecipientsData, RemoveWhatsAppBroadcastRecipientsError, RemoveWhatsAppBroadcastRecipientsResponse, GetWhatsAppBusinessProfileData, GetWhatsAppBusinessProfileError, GetWhatsAppBusinessProfileResponse, UpdateWhatsAppBusinessProfileData, UpdateWhatsAppBusinessProfileError, UpdateWhatsAppBusinessProfileResponse, UploadWhatsAppProfilePhotoData, UploadWhatsAppProfilePhotoError, UploadWhatsAppProfilePhotoResponse, GetWhatsAppDisplayNameData, GetWhatsAppDisplayNameError, GetWhatsAppDisplayNameResponse, UpdateWhatsAppDisplayNameData, UpdateWhatsAppDisplayNameError, UpdateWhatsAppDisplayNameResponse, GetWhatsAppPhoneNumbersData, GetWhatsAppPhoneNumbersError, GetWhatsAppPhoneNumbersResponse, PurchaseWhatsAppPhoneNumberData, PurchaseWhatsAppPhoneNumberError, PurchaseWhatsAppPhoneNumberResponse, GetWhatsAppPhoneNumberData, GetWhatsAppPhoneNumberError, GetWhatsAppPhoneNumberResponse, ReleaseWhatsAppPhoneNumberData, ReleaseWhatsAppPhoneNumberError, ReleaseWhatsAppPhoneNumberResponse } from './types.gen';
5
+
6
+ export const client = createClient(createConfig());
7
+
8
+ /**
9
+ * Download YouTube video
10
+ * Download YouTube videos or audio. Returns available formats or direct download URL.
11
+ *
12
+ * Rate limits: Build (50/day), Accelerate (500/day), Unlimited (unlimited).
13
+ *
14
+ */
15
+ export const downloadYouTubeVideo = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DownloadYouTubeVideoData, ThrowOnError>) => {
16
+ return (options?.client ?? client).get<DownloadYouTubeVideoResponse, DownloadYouTubeVideoError, ThrowOnError>({
17
+ ...options,
18
+ url: '/v1/tools/youtube/download'
19
+ });
20
+ };
21
+
22
+ /**
23
+ * Get YouTube transcript
24
+ * Extract transcript/captions from a YouTube video.
25
+ *
26
+ * Rate limits: Build (50/day), Accelerate (500/day), Unlimited (unlimited).
27
+ *
28
+ */
29
+ export const getYouTubeTranscript = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetYouTubeTranscriptData, ThrowOnError>) => {
30
+ return (options?.client ?? client).get<GetYouTubeTranscriptResponse, GetYouTubeTranscriptError, ThrowOnError>({
31
+ ...options,
32
+ url: '/v1/tools/youtube/transcript'
33
+ });
34
+ };
35
+
36
+ /**
37
+ * Download Instagram media
38
+ * Download Instagram reels, posts, or photos.
39
+ *
40
+ * Rate limits: Build (50/day), Accelerate (500/day), Unlimited (unlimited).
41
+ *
42
+ */
43
+ export const downloadInstagramMedia = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DownloadInstagramMediaData, ThrowOnError>) => {
44
+ return (options?.client ?? client).get<DownloadInstagramMediaResponse, DownloadInstagramMediaError, ThrowOnError>({
45
+ ...options,
46
+ url: '/v1/tools/instagram/download'
47
+ });
48
+ };
49
+
50
+ /**
51
+ * Check IG hashtag bans
52
+ * Check if Instagram hashtags are banned, restricted, or safe to use.
53
+ *
54
+ * Rate limits: Build (50/day), Accelerate (500/day), Unlimited (unlimited).
55
+ *
56
+ */
57
+ export const checkInstagramHashtags = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CheckInstagramHashtagsData, ThrowOnError>) => {
58
+ return (options?.client ?? client).post<CheckInstagramHashtagsResponse, CheckInstagramHashtagsError, ThrowOnError>({
59
+ ...options,
60
+ url: '/v1/tools/instagram/hashtag-checker'
61
+ });
62
+ };
63
+
64
+ /**
65
+ * Download TikTok video
66
+ * Download TikTok videos with or without watermark.
67
+ *
68
+ * Rate limits: Build (50/day), Accelerate (500/day), Unlimited (unlimited).
69
+ *
70
+ */
71
+ export const downloadTikTokVideo = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DownloadTikTokVideoData, ThrowOnError>) => {
72
+ return (options?.client ?? client).get<DownloadTikTokVideoResponse, DownloadTikTokVideoError, ThrowOnError>({
73
+ ...options,
74
+ url: '/v1/tools/tiktok/download'
75
+ });
76
+ };
77
+
78
+ /**
79
+ * Download Twitter/X media
80
+ * Download videos from Twitter/X posts.
81
+ *
82
+ * Rate limits: Build (50/day), Accelerate (500/day), Unlimited (unlimited).
83
+ *
84
+ */
85
+ export const downloadTwitterMedia = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DownloadTwitterMediaData, ThrowOnError>) => {
86
+ return (options?.client ?? client).get<DownloadTwitterMediaResponse, DownloadTwitterMediaError, ThrowOnError>({
87
+ ...options,
88
+ url: '/v1/tools/twitter/download'
89
+ });
90
+ };
91
+
92
+ /**
93
+ * Download Facebook video
94
+ * Download videos and reels from Facebook.
95
+ *
96
+ * Rate limits: Build (50/day), Accelerate (500/day), Unlimited (unlimited).
97
+ *
98
+ */
99
+ export const downloadFacebookVideo = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DownloadFacebookVideoData, ThrowOnError>) => {
100
+ return (options?.client ?? client).get<DownloadFacebookVideoResponse, DownloadFacebookVideoError, ThrowOnError>({
101
+ ...options,
102
+ url: '/v1/tools/facebook/download'
103
+ });
104
+ };
105
+
106
+ /**
107
+ * Download LinkedIn video
108
+ * Download videos from LinkedIn posts.
109
+ *
110
+ * Rate limits: Build (50/day), Accelerate (500/day), Unlimited (unlimited).
111
+ *
112
+ */
113
+ export const downloadLinkedInVideo = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DownloadLinkedInVideoData, ThrowOnError>) => {
114
+ return (options?.client ?? client).get<DownloadLinkedInVideoResponse, DownloadLinkedInVideoError, ThrowOnError>({
115
+ ...options,
116
+ url: '/v1/tools/linkedin/download'
117
+ });
118
+ };
119
+
120
+ /**
121
+ * Download Bluesky media
122
+ * Download videos from Bluesky posts.
123
+ *
124
+ * Rate limits: Build (50/day), Accelerate (500/day), Unlimited (unlimited).
125
+ *
126
+ */
127
+ export const downloadBlueskyMedia = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DownloadBlueskyMediaData, ThrowOnError>) => {
128
+ return (options?.client ?? client).get<DownloadBlueskyMediaResponse, DownloadBlueskyMediaError, ThrowOnError>({
129
+ ...options,
130
+ url: '/v1/tools/bluesky/download'
131
+ });
132
+ };
133
+
134
+ /**
135
+ * Validate post character count
136
+ * Check weighted character count per platform and whether the text is within each platform's limit.
137
+ *
138
+ * Twitter/X uses weighted counting (URLs = 23 chars via t.co, emojis = 2 chars). All other platforms use plain character length.
139
+ *
140
+ * Returns counts and limits for all 15 supported platform variants.
141
+ *
142
+ */
143
+ export const validatePostLength = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ValidatePostLengthData, ThrowOnError>) => {
144
+ return (options?.client ?? client).post<ValidatePostLengthResponse, ValidatePostLengthError, ThrowOnError>({
145
+ ...options,
146
+ url: '/v1/tools/validate/post-length'
147
+ });
148
+ };
149
+
150
+ /**
151
+ * Validate post content
152
+ * 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.
153
+ *
154
+ * Accepts the same body as `POST /v1/posts`. Does NOT validate accounts, process media, or track usage. This is content-only validation.
155
+ *
156
+ * Returns errors for failures and warnings for near-limit content (>90% of character limit).
157
+ *
158
+ */
159
+ export const validatePost = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ValidatePostData, ThrowOnError>) => {
160
+ return (options?.client ?? client).post<ValidatePostResponse, ValidatePostError, ThrowOnError>({
161
+ ...options,
162
+ url: '/v1/tools/validate/post'
163
+ });
164
+ };
165
+
166
+ /**
167
+ * Validate media URL
168
+ * Check if a media URL is accessible and return metadata (content type, file size) plus per-platform size limit comparisons.
169
+ *
170
+ * Performs a HEAD request (with GET fallback) to detect content type and size. Rejects private/localhost URLs for SSRF protection.
171
+ *
172
+ * Platform limits are sourced from each platform's actual upload constraints.
173
+ *
174
+ */
175
+ export const validateMedia = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ValidateMediaData, ThrowOnError>) => {
176
+ return (options?.client ?? client).post<ValidateMediaResponse, ValidateMediaError, ThrowOnError>({
177
+ ...options,
178
+ url: '/v1/tools/validate/media'
179
+ });
180
+ };
181
+
182
+ /**
183
+ * Check subreddit existence
184
+ * Check if a subreddit exists and return basic info (title, subscriber count, NSFW status, post types allowed).
185
+ *
186
+ * Uses Reddit's public JSON API (no Reddit auth needed). Returns `exists: false` for private, banned, or nonexistent subreddits.
187
+ *
188
+ */
189
+ export const validateSubreddit = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ValidateSubredditData, ThrowOnError>) => {
190
+ return (options?.client ?? client).get<ValidateSubredditResponse, ValidateSubredditError, ThrowOnError>({
191
+ ...options,
192
+ url: '/v1/tools/validate/subreddit'
193
+ });
194
+ };
195
+
196
+ /**
197
+ * Get post analytics
198
+ * Returns analytics for posts. With postId, returns a single post. Without it, returns a paginated list with overview stats.
199
+ * Accepts both Zernio Post IDs and External Post IDs (auto-resolved). fromDate defaults to 90 days ago if omitted, max range 366 days.
200
+ * Single post lookups may return 202 (sync pending) or 424 (all platforms failed). For follower stats, use /v1/accounts/follower-stats.
201
+ *
202
+ */
203
+ export const getAnalytics = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetAnalyticsData, ThrowOnError>) => {
204
+ return (options?.client ?? client).get<GetAnalyticsResponse, GetAnalyticsError, ThrowOnError>({
205
+ ...options,
206
+ url: '/v1/analytics'
207
+ });
208
+ };
209
+
210
+ /**
211
+ * Get YouTube daily views
212
+ * Returns daily view counts for a YouTube video including views, watch time, and subscriber changes.
213
+ * Requires yt-analytics.readonly scope (re-authorization may be needed). Data has a 2-3 day delay. Max 90 days, defaults to last 30 days.
214
+ *
215
+ */
216
+ export const getYouTubeDailyViews = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetYouTubeDailyViewsData, ThrowOnError>) => {
217
+ return (options?.client ?? client).get<GetYouTubeDailyViewsResponse, GetYouTubeDailyViewsError, ThrowOnError>({
218
+ ...options,
219
+ url: '/v1/analytics/youtube/daily-views'
220
+ });
221
+ };
222
+
223
+ /**
224
+ * Get daily aggregated metrics
225
+ * Returns daily aggregated analytics metrics and a per-platform breakdown.
226
+ * Each day includes post count, platform distribution, and summed metrics (impressions, reach, likes, comments, shares, saves, clicks, views).
227
+ * Defaults to the last 180 days. Requires the Analytics add-on.
228
+ *
229
+ */
230
+ export const getDailyMetrics = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetDailyMetricsData, ThrowOnError>) => {
231
+ return (options?.client ?? client).get<GetDailyMetricsResponse, GetDailyMetricsError, ThrowOnError>({
232
+ ...options,
233
+ url: '/v1/analytics/daily-metrics'
234
+ });
235
+ };
236
+
237
+ /**
238
+ * Get best times to post
239
+ * Returns the best times to post based on historical engagement data.
240
+ * Groups all published posts by day of week and hour (UTC), calculating average engagement per slot.
241
+ * Use this to auto-schedule posts at optimal times. Requires the Analytics add-on.
242
+ *
243
+ */
244
+ export const getBestTimeToPost = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetBestTimeToPostData, ThrowOnError>) => {
245
+ return (options?.client ?? client).get<GetBestTimeToPostResponse, GetBestTimeToPostError, ThrowOnError>({
246
+ ...options,
247
+ url: '/v1/analytics/best-time'
248
+ });
249
+ };
250
+
251
+ /**
252
+ * Get content performance decay
253
+ * Returns how engagement accumulates over time after a post is published.
254
+ * Each bucket shows what percentage of the post's total engagement had been reached by that time window.
255
+ * Useful for understanding content lifespan (e.g. "posts reach 78% of total engagement within 24 hours").
256
+ * Requires the Analytics add-on.
257
+ *
258
+ */
259
+ export const getContentDecay = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetContentDecayData, ThrowOnError>) => {
260
+ return (options?.client ?? client).get<GetContentDecayResponse, GetContentDecayError, ThrowOnError>({
261
+ ...options,
262
+ url: '/v1/analytics/content-decay'
263
+ });
264
+ };
265
+
266
+ /**
267
+ * Get posting frequency vs engagement
268
+ * Returns the correlation between posting frequency (posts per week) and engagement rate, broken down by platform.
269
+ * Helps find the optimal posting cadence for each platform. Each row represents a specific (platform, posts_per_week) combination
270
+ * with the average engagement rate observed across all weeks matching that frequency.
271
+ * Requires the Analytics add-on.
272
+ *
273
+ */
274
+ export const getPostingFrequency = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetPostingFrequencyData, ThrowOnError>) => {
275
+ return (options?.client ?? client).get<GetPostingFrequencyResponse, GetPostingFrequencyError, ThrowOnError>({
276
+ ...options,
277
+ url: '/v1/analytics/posting-frequency'
278
+ });
279
+ };
280
+
281
+ /**
282
+ * Get post analytics timeline
283
+ * Returns a daily timeline of analytics metrics for a specific post, showing how impressions, likes,
284
+ * and other metrics evolved day-by-day since publishing. Each row represents one day of data per platform.
285
+ * For multi-platform Zernio posts, returns separate rows for each platform. Requires the Analytics add-on.
286
+ *
287
+ */
288
+ export const getPostTimeline = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetPostTimelineData, ThrowOnError>) => {
289
+ return (options?.client ?? client).get<GetPostTimelineResponse, GetPostTimelineError, ThrowOnError>({
290
+ ...options,
291
+ url: '/v1/analytics/post-timeline'
292
+ });
293
+ };
294
+
295
+ /**
296
+ * List groups
297
+ * Returns all account groups for the authenticated user, including group names and associated account IDs.
298
+ */
299
+ export const listAccountGroups = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => {
300
+ return (options?.client ?? client).get<ListAccountGroupsResponse, ListAccountGroupsError, ThrowOnError>({
301
+ ...options,
302
+ url: '/v1/account-groups'
303
+ });
304
+ };
305
+
306
+ /**
307
+ * Create group
308
+ * Creates a new account group with a name and a list of social account IDs.
309
+ */
310
+ export const createAccountGroup = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateAccountGroupData, ThrowOnError>) => {
311
+ return (options?.client ?? client).post<CreateAccountGroupResponse, CreateAccountGroupError, ThrowOnError>({
312
+ ...options,
313
+ url: '/v1/account-groups'
314
+ });
315
+ };
316
+
317
+ /**
318
+ * Update group
319
+ * Updates the name or account list of an existing group. You can rename the group, change its accounts, or both.
320
+ */
321
+ export const updateAccountGroup = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateAccountGroupData, ThrowOnError>) => {
322
+ return (options?.client ?? client).put<UpdateAccountGroupResponse, UpdateAccountGroupError, ThrowOnError>({
323
+ ...options,
324
+ url: '/v1/account-groups/{groupId}'
325
+ });
326
+ };
327
+
328
+ /**
329
+ * Delete group
330
+ * Permanently deletes an account group. The accounts themselves are not affected.
331
+ */
332
+ export const deleteAccountGroup = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteAccountGroupData, ThrowOnError>) => {
333
+ return (options?.client ?? client).delete<DeleteAccountGroupResponse, DeleteAccountGroupError, ThrowOnError>({
334
+ ...options,
335
+ url: '/v1/account-groups/{groupId}'
336
+ });
337
+ };
338
+
339
+ /**
340
+ * Get presigned upload URL
341
+ * 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.
342
+ */
343
+ export const getMediaPresignedUrl = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetMediaPresignedUrlData, ThrowOnError>) => {
344
+ return (options?.client ?? client).post<GetMediaPresignedUrlResponse, GetMediaPresignedUrlError, ThrowOnError>({
345
+ ...options,
346
+ url: '/v1/media/presign'
347
+ });
348
+ };
349
+
350
+ /**
351
+ * Search posts
352
+ * Search Reddit posts using a connected account. Optionally scope to a specific subreddit.
353
+ */
354
+ export const searchReddit = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SearchRedditData, ThrowOnError>) => {
355
+ return (options?.client ?? client).get<SearchRedditResponse, SearchRedditError, ThrowOnError>({
356
+ ...options,
357
+ url: '/v1/reddit/search'
358
+ });
359
+ };
360
+
361
+ /**
362
+ * Get subreddit feed
363
+ * Fetch posts from a subreddit feed. Supports sorting, time filtering, and cursor-based pagination.
364
+ */
365
+ export const getRedditFeed = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetRedditFeedData, ThrowOnError>) => {
366
+ return (options?.client ?? client).get<GetRedditFeedResponse, GetRedditFeedError, ThrowOnError>({
367
+ ...options,
368
+ url: '/v1/reddit/feed'
369
+ });
370
+ };
371
+
372
+ /**
373
+ * Get plan and usage stats
374
+ * Returns the current plan name, billing period, plan limits, and usage counts.
375
+ */
376
+ export const getUsageStats = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => {
377
+ return (options?.client ?? client).get<GetUsageStatsResponse, GetUsageStatsError, ThrowOnError>({
378
+ ...options,
379
+ url: '/v1/usage-stats'
380
+ });
381
+ };
382
+
383
+ /**
384
+ * List posts
385
+ * Returns a paginated list of posts. Published posts include platformPostUrl with the public URL on each platform.
386
+ */
387
+ export const listPosts = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListPostsData, ThrowOnError>) => {
388
+ return (options?.client ?? client).get<ListPostsResponse, ListPostsError, ThrowOnError>({
389
+ ...options,
390
+ url: '/v1/posts'
391
+ });
392
+ };
393
+
394
+ /**
395
+ * Create post
396
+ * Create and optionally publish a post. Immediate posts (publishNow: true) include platformPostUrl in the response.
397
+ * Content is optional when media is attached or all platforms have customContent. See each platform's schema for media constraints.
398
+ *
399
+ */
400
+ export const createPost = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreatePostData, ThrowOnError>) => {
401
+ return (options?.client ?? client).post<CreatePostResponse, CreatePostError, ThrowOnError>({
402
+ ...options,
403
+ url: '/v1/posts'
404
+ });
405
+ };
406
+
407
+ /**
408
+ * Get post
409
+ * Fetch a single post by ID. For published posts, this returns platformPostUrl for each platform.
410
+ *
411
+ */
412
+ export const getPost = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetPostData, ThrowOnError>) => {
413
+ return (options?.client ?? client).get<GetPostResponse, GetPostError, ThrowOnError>({
414
+ ...options,
415
+ url: '/v1/posts/{postId}'
416
+ });
417
+ };
418
+
419
+ /**
420
+ * Update post
421
+ * Update an existing post. Only draft, scheduled, failed, and partial posts can be edited.
422
+ * Published, publishing, and cancelled posts cannot be modified.
423
+ *
424
+ */
425
+ export const updatePost = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdatePostData, ThrowOnError>) => {
426
+ return (options?.client ?? client).put<UpdatePostResponse, UpdatePostError, ThrowOnError>({
427
+ ...options,
428
+ url: '/v1/posts/{postId}'
429
+ });
430
+ };
431
+
432
+ /**
433
+ * Delete post
434
+ * Delete a draft or scheduled post from Zernio. Published posts cannot be deleted; use the Unpublish endpoint instead. Upload quota is automatically refunded.
435
+ */
436
+ export const deletePost = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeletePostData, ThrowOnError>) => {
437
+ return (options?.client ?? client).delete<DeletePostResponse, DeletePostError, ThrowOnError>({
438
+ ...options,
439
+ url: '/v1/posts/{postId}'
440
+ });
441
+ };
442
+
443
+ /**
444
+ * Bulk upload from CSV
445
+ * Create multiple posts by uploading a CSV file. Use dryRun=true to validate without creating posts.
446
+ */
447
+ export const bulkUploadPosts = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<BulkUploadPostsData, ThrowOnError>) => {
448
+ return (options?.client ?? client).post<BulkUploadPostsResponse, BulkUploadPostsError, ThrowOnError>({
449
+ ...options,
450
+ ...formDataBodySerializer,
451
+ headers: {
452
+ 'Content-Type': null,
453
+ ...options?.headers
454
+ },
455
+ url: '/v1/posts/bulk-upload'
456
+ });
457
+ };
458
+
459
+ /**
460
+ * Retry failed post
461
+ * Immediately retries publishing a failed post. Returns the updated post with its new status.
462
+ */
463
+ export const retryPost = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<RetryPostData, ThrowOnError>) => {
464
+ return (options?.client ?? client).post<RetryPostResponse, RetryPostError, ThrowOnError>({
465
+ ...options,
466
+ url: '/v1/posts/{postId}/retry'
467
+ });
468
+ };
469
+
470
+ /**
471
+ * Unpublish post
472
+ * Deletes a published post from the specified platform. The post record in Zernio is kept but its status is updated to cancelled.
473
+ * Not supported on Instagram, TikTok, or Snapchat. Threaded posts delete all items. YouTube deletion is permanent.
474
+ *
475
+ */
476
+ export const unpublishPost = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UnpublishPostData, ThrowOnError>) => {
477
+ return (options?.client ?? client).post<UnpublishPostResponse, UnpublishPostError, ThrowOnError>({
478
+ ...options,
479
+ url: '/v1/posts/{postId}/unpublish'
480
+ });
481
+ };
482
+
483
+ /**
484
+ * List users
485
+ * Returns all users in the workspace including roles and profile access. Also returns the currentUserId of the caller.
486
+ */
487
+ export const listUsers = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => {
488
+ return (options?.client ?? client).get<ListUsersResponse, ListUsersError, ThrowOnError>({
489
+ ...options,
490
+ url: '/v1/users'
491
+ });
492
+ };
493
+
494
+ /**
495
+ * Get user
496
+ * Returns a single user's details by ID, including name, email, and role.
497
+ */
498
+ export const getUser = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetUserData, ThrowOnError>) => {
499
+ return (options?.client ?? client).get<GetUserResponse, GetUserError, ThrowOnError>({
500
+ ...options,
501
+ url: '/v1/users/{userId}'
502
+ });
503
+ };
504
+
505
+ /**
506
+ * List profiles
507
+ * Returns profiles sorted by creation date. Use includeOverLimit=true to include profiles that exceed the plan limit.
508
+ */
509
+ export const listProfiles = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListProfilesData, ThrowOnError>) => {
510
+ return (options?.client ?? client).get<ListProfilesResponse, ListProfilesError, ThrowOnError>({
511
+ ...options,
512
+ url: '/v1/profiles'
513
+ });
514
+ };
515
+
516
+ /**
517
+ * Create profile
518
+ * Creates a new profile with a name, optional description, and color.
519
+ */
520
+ export const createProfile = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateProfileData, ThrowOnError>) => {
521
+ return (options?.client ?? client).post<CreateProfileResponse, CreateProfileError, ThrowOnError>({
522
+ ...options,
523
+ url: '/v1/profiles'
524
+ });
525
+ };
526
+
527
+ /**
528
+ * Get profile
529
+ * Returns a single profile by ID, including its name, color, and default status.
530
+ */
531
+ export const getProfile = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetProfileData, ThrowOnError>) => {
532
+ return (options?.client ?? client).get<GetProfileResponse, GetProfileError, ThrowOnError>({
533
+ ...options,
534
+ url: '/v1/profiles/{profileId}'
535
+ });
536
+ };
537
+
538
+ /**
539
+ * Update profile
540
+ * Updates a profile's name, description, color, or default status.
541
+ */
542
+ export const updateProfile = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateProfileData, ThrowOnError>) => {
543
+ return (options?.client ?? client).put<UpdateProfileResponse, UpdateProfileError, ThrowOnError>({
544
+ ...options,
545
+ url: '/v1/profiles/{profileId}'
546
+ });
547
+ };
548
+
549
+ /**
550
+ * Delete profile
551
+ * Permanently deletes a profile by ID.
552
+ */
553
+ export const deleteProfile = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteProfileData, ThrowOnError>) => {
554
+ return (options?.client ?? client).delete<DeleteProfileResponse, DeleteProfileError, ThrowOnError>({
555
+ ...options,
556
+ url: '/v1/profiles/{profileId}'
557
+ });
558
+ };
559
+
560
+ /**
561
+ * List accounts
562
+ * Returns connected social accounts. Only includes accounts within the plan limit by default. Follower data requires analytics add-on.
563
+ */
564
+ export const listAccounts = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListAccountsData, ThrowOnError>) => {
565
+ return (options?.client ?? client).get<ListAccountsResponse, ListAccountsError, ThrowOnError>({
566
+ ...options,
567
+ url: '/v1/accounts'
568
+ });
569
+ };
570
+
571
+ /**
572
+ * Get follower stats
573
+ * Returns follower count history and growth metrics for connected social accounts.
574
+ * Requires analytics add-on subscription. Follower counts are refreshed once per day.
575
+ *
576
+ */
577
+ export const getFollowerStats = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetFollowerStatsData, ThrowOnError>) => {
578
+ return (options?.client ?? client).get<GetFollowerStatsResponse, GetFollowerStatsError, ThrowOnError>({
579
+ ...options,
580
+ url: '/v1/accounts/follower-stats'
581
+ });
582
+ };
583
+
584
+ /**
585
+ * Update account
586
+ * Updates a connected social account's display name or username override.
587
+ */
588
+ export const updateAccount = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateAccountData, ThrowOnError>) => {
589
+ return (options?.client ?? client).put<UpdateAccountResponse, UpdateAccountError, ThrowOnError>({
590
+ ...options,
591
+ url: '/v1/accounts/{accountId}'
592
+ });
593
+ };
594
+
595
+ /**
596
+ * Disconnect account
597
+ * Disconnects and removes a connected social account.
598
+ */
599
+ export const deleteAccount = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteAccountData, ThrowOnError>) => {
600
+ return (options?.client ?? client).delete<DeleteAccountResponse, DeleteAccountError, ThrowOnError>({
601
+ ...options,
602
+ url: '/v1/accounts/{accountId}'
603
+ });
604
+ };
605
+
606
+ /**
607
+ * Check accounts health
608
+ * Returns health status of all connected accounts including token validity, permissions, and issues needing attention.
609
+ */
610
+ export const getAllAccountsHealth = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetAllAccountsHealthData, ThrowOnError>) => {
611
+ return (options?.client ?? client).get<GetAllAccountsHealthResponse, GetAllAccountsHealthError, ThrowOnError>({
612
+ ...options,
613
+ url: '/v1/accounts/health'
614
+ });
615
+ };
616
+
617
+ /**
618
+ * Check account health
619
+ * Returns detailed health info for a specific account including token status, permissions, and recommendations.
620
+ */
621
+ export const getAccountHealth = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetAccountHealthData, ThrowOnError>) => {
622
+ return (options?.client ?? client).get<GetAccountHealthResponse, GetAccountHealthError, ThrowOnError>({
623
+ ...options,
624
+ url: '/v1/accounts/{accountId}/health'
625
+ });
626
+ };
627
+
628
+ /**
629
+ * List keys
630
+ * Returns all API keys for the authenticated user. Keys are returned with a preview only, not the full key value.
631
+ */
632
+ export const listApiKeys = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => {
633
+ return (options?.client ?? client).get<ListApiKeysResponse, ListApiKeysError, ThrowOnError>({
634
+ ...options,
635
+ url: '/v1/api-keys'
636
+ });
637
+ };
638
+
639
+ /**
640
+ * Create key
641
+ * Creates a new API key with an optional expiry. The full key value is only returned once in the response.
642
+ */
643
+ export const createApiKey = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateApiKeyData, ThrowOnError>) => {
644
+ return (options?.client ?? client).post<CreateApiKeyResponse, CreateApiKeyError, ThrowOnError>({
645
+ ...options,
646
+ url: '/v1/api-keys'
647
+ });
648
+ };
649
+
650
+ /**
651
+ * Delete key
652
+ * Permanently revokes and deletes an API key.
653
+ */
654
+ export const deleteApiKey = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteApiKeyData, ThrowOnError>) => {
655
+ return (options?.client ?? client).delete<DeleteApiKeyResponse, DeleteApiKeyError, ThrowOnError>({
656
+ ...options,
657
+ url: '/v1/api-keys/{keyId}'
658
+ });
659
+ };
660
+
661
+ /**
662
+ * Create invite token
663
+ * Generate a secure invite link to grant team members access to your profiles.
664
+ * Invites expire after 7 days and are single-use.
665
+ *
666
+ */
667
+ export const createInviteToken = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateInviteTokenData, ThrowOnError>) => {
668
+ return (options?.client ?? client).post<CreateInviteTokenResponse, CreateInviteTokenError, ThrowOnError>({
669
+ ...options,
670
+ url: '/v1/invite/tokens'
671
+ });
672
+ };
673
+
674
+ /**
675
+ * Get OAuth connect URL
676
+ * Initiate an OAuth connection flow. Returns an authUrl to redirect the user to.
677
+ * Standard flow: Zernio hosts the selection UI, then redirects to your redirect_url. Headless mode (headless=true): user is redirected to your redirect_url with OAuth data for custom UI. Use the platform-specific selection endpoints to complete.
678
+ *
679
+ */
680
+ export const getConnectUrl = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetConnectUrlData, ThrowOnError>) => {
681
+ return (options?.client ?? client).get<GetConnectUrlResponse, GetConnectUrlError, ThrowOnError>({
682
+ ...options,
683
+ url: '/v1/connect/{platform}'
684
+ });
685
+ };
686
+
687
+ /**
688
+ * Complete OAuth callback
689
+ * Exchange the OAuth authorization code for tokens and connect the account to the specified profile.
690
+ */
691
+ export const handleOAuthCallback = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<HandleOAuthCallbackData, ThrowOnError>) => {
692
+ return (options?.client ?? client).post<HandleOAuthCallbackResponse, HandleOAuthCallbackError, ThrowOnError>({
693
+ ...options,
694
+ url: '/v1/connect/{platform}'
695
+ });
696
+ };
697
+
698
+ /**
699
+ * List Facebook pages
700
+ * Returns the list of Facebook Pages the user can manage after OAuth. Extract tempToken and userProfile from the OAuth redirect params and pass them here. Use the X-Connect-Token header if connecting via API key.
701
+ */
702
+ export const listFacebookPages = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListFacebookPagesData, ThrowOnError>) => {
703
+ return (options?.client ?? client).get<ListFacebookPagesResponse, ListFacebookPagesError, ThrowOnError>({
704
+ ...options,
705
+ url: '/v1/connect/facebook/select-page'
706
+ });
707
+ };
708
+
709
+ /**
710
+ * Select Facebook page
711
+ * Complete the headless flow by saving the user's selected Facebook page. Pass the userProfile from the OAuth redirect and use X-Connect-Token if connecting via API key.
712
+ */
713
+ export const selectFacebookPage = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SelectFacebookPageData, ThrowOnError>) => {
714
+ return (options?.client ?? client).post<SelectFacebookPageResponse, SelectFacebookPageError, ThrowOnError>({
715
+ ...options,
716
+ url: '/v1/connect/facebook/select-page'
717
+ });
718
+ };
719
+
720
+ /**
721
+ * List GBP locations
722
+ * For headless flows. Returns the list of GBP locations the user can manage. Use X-Connect-Token if connecting via API key.
723
+ */
724
+ export const listGoogleBusinessLocations = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListGoogleBusinessLocationsData, ThrowOnError>) => {
725
+ return (options?.client ?? client).get<ListGoogleBusinessLocationsResponse, ListGoogleBusinessLocationsError, ThrowOnError>({
726
+ ...options,
727
+ url: '/v1/connect/googlebusiness/locations'
728
+ });
729
+ };
730
+
731
+ /**
732
+ * Select GBP location
733
+ * Complete the headless flow by saving the user's selected GBP location. Include userProfile from the OAuth redirect (contains refresh token). Use X-Connect-Token if connecting via API key.
734
+ */
735
+ export const selectGoogleBusinessLocation = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SelectGoogleBusinessLocationData, ThrowOnError>) => {
736
+ return (options?.client ?? client).post<SelectGoogleBusinessLocationResponse, SelectGoogleBusinessLocationError, ThrowOnError>({
737
+ ...options,
738
+ url: '/v1/connect/googlebusiness/select-location'
739
+ });
740
+ };
741
+
742
+ /**
743
+ * Get reviews
744
+ * Returns reviews for a GBP account including ratings, comments, and owner replies. Use nextPageToken for pagination.
745
+ */
746
+ export const getGoogleBusinessReviews = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetGoogleBusinessReviewsData, ThrowOnError>) => {
747
+ return (options?.client ?? client).get<GetGoogleBusinessReviewsResponse, GetGoogleBusinessReviewsError, ThrowOnError>({
748
+ ...options,
749
+ url: '/v1/accounts/{accountId}/gmb-reviews'
750
+ });
751
+ };
752
+
753
+ /**
754
+ * Get food menus
755
+ * Returns food menus for a GBP location including sections, items, pricing, and dietary info. Only for locations with food menu support.
756
+ */
757
+ export const getGoogleBusinessFoodMenus = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetGoogleBusinessFoodMenusData, ThrowOnError>) => {
758
+ return (options?.client ?? client).get<GetGoogleBusinessFoodMenusResponse, GetGoogleBusinessFoodMenusError, ThrowOnError>({
759
+ ...options,
760
+ url: '/v1/accounts/{accountId}/gmb-food-menus'
761
+ });
762
+ };
763
+
764
+ /**
765
+ * Update food menus
766
+ * Updates food menus for a GBP location. Send the full menus array. Use updateMask for partial updates.
767
+ */
768
+ export const updateGoogleBusinessFoodMenus = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateGoogleBusinessFoodMenusData, ThrowOnError>) => {
769
+ return (options?.client ?? client).put<UpdateGoogleBusinessFoodMenusResponse, UpdateGoogleBusinessFoodMenusError, ThrowOnError>({
770
+ ...options,
771
+ url: '/v1/accounts/{accountId}/gmb-food-menus'
772
+ });
773
+ };
774
+
775
+ /**
776
+ * Get location details
777
+ * Returns detailed GBP location info (hours, description, phone, website, categories, services). Use readMask to request specific fields.
778
+ */
779
+ export const getGoogleBusinessLocationDetails = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetGoogleBusinessLocationDetailsData, ThrowOnError>) => {
780
+ return (options?.client ?? client).get<GetGoogleBusinessLocationDetailsResponse, GetGoogleBusinessLocationDetailsError, ThrowOnError>({
781
+ ...options,
782
+ url: '/v1/accounts/{accountId}/gmb-location-details'
783
+ });
784
+ };
785
+
786
+ /**
787
+ * Update location details
788
+ * Updates GBP location details. The updateMask field is required and specifies which fields to update.
789
+ * This endpoint proxies Google's Business Information API locations.patch, so any valid updateMask field is supported.
790
+ * Common fields: regularHours, specialHours, profile.description, websiteUri, phoneNumbers, categories, serviceItems.
791
+ *
792
+ */
793
+ export const updateGoogleBusinessLocationDetails = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateGoogleBusinessLocationDetailsData, ThrowOnError>) => {
794
+ return (options?.client ?? client).put<UpdateGoogleBusinessLocationDetailsResponse, UpdateGoogleBusinessLocationDetailsError, ThrowOnError>({
795
+ ...options,
796
+ url: '/v1/accounts/{accountId}/gmb-location-details'
797
+ });
798
+ };
799
+
800
+ /**
801
+ * List media
802
+ * Lists media items (photos) for a Google Business Profile location.
803
+ * Returns photo URLs, descriptions, categories, and metadata.
804
+ *
805
+ */
806
+ export const listGoogleBusinessMedia = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListGoogleBusinessMediaData, ThrowOnError>) => {
807
+ return (options?.client ?? client).get<ListGoogleBusinessMediaResponse, ListGoogleBusinessMediaError, ThrowOnError>({
808
+ ...options,
809
+ url: '/v1/accounts/{accountId}/gmb-media'
810
+ });
811
+ };
812
+
813
+ /**
814
+ * Upload photo
815
+ * Creates a media item (photo) for a location from a publicly accessible URL.
816
+ *
817
+ * Categories determine where the photo appears: COVER, PROFILE, LOGO, EXTERIOR, INTERIOR, FOOD_AND_DRINK, MENU, PRODUCT, TEAMS, ADDITIONAL.
818
+ *
819
+ */
820
+ export const createGoogleBusinessMedia = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateGoogleBusinessMediaData, ThrowOnError>) => {
821
+ return (options?.client ?? client).post<CreateGoogleBusinessMediaResponse, CreateGoogleBusinessMediaError, ThrowOnError>({
822
+ ...options,
823
+ url: '/v1/accounts/{accountId}/gmb-media'
824
+ });
825
+ };
826
+
827
+ /**
828
+ * Delete photo
829
+ * Deletes a photo or media item from a GBP location.
830
+ */
831
+ export const deleteGoogleBusinessMedia = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteGoogleBusinessMediaData, ThrowOnError>) => {
832
+ return (options?.client ?? client).delete<DeleteGoogleBusinessMediaResponse, DeleteGoogleBusinessMediaError, ThrowOnError>({
833
+ ...options,
834
+ url: '/v1/accounts/{accountId}/gmb-media'
835
+ });
836
+ };
837
+
838
+ /**
839
+ * Get attributes
840
+ * Returns GBP location attributes (amenities, services, accessibility, payment types). Available attributes vary by business category.
841
+ */
842
+ export const getGoogleBusinessAttributes = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetGoogleBusinessAttributesData, ThrowOnError>) => {
843
+ return (options?.client ?? client).get<GetGoogleBusinessAttributesResponse, GetGoogleBusinessAttributesError, ThrowOnError>({
844
+ ...options,
845
+ url: '/v1/accounts/{accountId}/gmb-attributes'
846
+ });
847
+ };
848
+
849
+ /**
850
+ * Update attributes
851
+ * Updates location attributes (amenities, services, etc.).
852
+ *
853
+ * The attributeMask specifies which attributes to update (comma-separated).
854
+ *
855
+ */
856
+ export const updateGoogleBusinessAttributes = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateGoogleBusinessAttributesData, ThrowOnError>) => {
857
+ return (options?.client ?? client).put<UpdateGoogleBusinessAttributesResponse, UpdateGoogleBusinessAttributesError, ThrowOnError>({
858
+ ...options,
859
+ url: '/v1/accounts/{accountId}/gmb-attributes'
860
+ });
861
+ };
862
+
863
+ /**
864
+ * List action links
865
+ * Lists place action links for a Google Business Profile location.
866
+ *
867
+ * Place actions are the booking, ordering, and reservation buttons that appear on your listing.
868
+ *
869
+ */
870
+ export const listGoogleBusinessPlaceActions = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListGoogleBusinessPlaceActionsData, ThrowOnError>) => {
871
+ return (options?.client ?? client).get<ListGoogleBusinessPlaceActionsResponse, ListGoogleBusinessPlaceActionsError, ThrowOnError>({
872
+ ...options,
873
+ url: '/v1/accounts/{accountId}/gmb-place-actions'
874
+ });
875
+ };
876
+
877
+ /**
878
+ * Create action link
879
+ * Creates a place action link for a location.
880
+ *
881
+ * Available action types: APPOINTMENT, ONLINE_APPOINTMENT, DINING_RESERVATION, FOOD_ORDERING, FOOD_DELIVERY, FOOD_TAKEOUT, SHOP_ONLINE.
882
+ *
883
+ */
884
+ export const createGoogleBusinessPlaceAction = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateGoogleBusinessPlaceActionData, ThrowOnError>) => {
885
+ return (options?.client ?? client).post<CreateGoogleBusinessPlaceActionResponse, CreateGoogleBusinessPlaceActionError, ThrowOnError>({
886
+ ...options,
887
+ url: '/v1/accounts/{accountId}/gmb-place-actions'
888
+ });
889
+ };
890
+
891
+ /**
892
+ * Delete action link
893
+ * Deletes a place action link (e.g. booking or ordering URL) from a GBP location.
894
+ */
895
+ export const deleteGoogleBusinessPlaceAction = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteGoogleBusinessPlaceActionData, ThrowOnError>) => {
896
+ return (options?.client ?? client).delete<DeleteGoogleBusinessPlaceActionResponse, DeleteGoogleBusinessPlaceActionError, ThrowOnError>({
897
+ ...options,
898
+ url: '/v1/accounts/{accountId}/gmb-place-actions'
899
+ });
900
+ };
901
+
902
+ /**
903
+ * Get pending OAuth data
904
+ * Fetch pending OAuth data for headless mode using the pendingDataToken from the redirect URL. One-time use, expires after 10 minutes. No authentication required.
905
+ */
906
+ export const getPendingOAuthData = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetPendingOAuthDataData, ThrowOnError>) => {
907
+ return (options?.client ?? client).get<GetPendingOAuthDataResponse, GetPendingOAuthDataError, ThrowOnError>({
908
+ ...options,
909
+ url: '/v1/connect/pending-data'
910
+ });
911
+ };
912
+
913
+ /**
914
+ * List LinkedIn orgs
915
+ * Fetch full LinkedIn organization details (logos, vanity names, websites) for custom UI. No authentication required, just the tempToken from OAuth.
916
+ */
917
+ export const listLinkedInOrganizations = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListLinkedInOrganizationsData, ThrowOnError>) => {
918
+ return (options?.client ?? client).get<ListLinkedInOrganizationsResponse, ListLinkedInOrganizationsError, ThrowOnError>({
919
+ ...options,
920
+ url: '/v1/connect/linkedin/organizations'
921
+ });
922
+ };
923
+
924
+ /**
925
+ * Select LinkedIn org
926
+ * Complete the LinkedIn connection flow. Set accountType to "personal" or "organization" to connect as a company page. Use X-Connect-Token if connecting via API key.
927
+ */
928
+ export const selectLinkedInOrganization = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SelectLinkedInOrganizationData, ThrowOnError>) => {
929
+ return (options?.client ?? client).post<SelectLinkedInOrganizationResponse, SelectLinkedInOrganizationError, ThrowOnError>({
930
+ ...options,
931
+ url: '/v1/connect/linkedin/select-organization'
932
+ });
933
+ };
934
+
935
+ /**
936
+ * List Pinterest boards
937
+ * For headless flows. Returns Pinterest boards the user can post to. Use X-Connect-Token from the redirect URL.
938
+ */
939
+ export const listPinterestBoardsForSelection = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListPinterestBoardsForSelectionData, ThrowOnError>) => {
940
+ return (options?.client ?? client).get<ListPinterestBoardsForSelectionResponse, ListPinterestBoardsForSelectionError, ThrowOnError>({
941
+ ...options,
942
+ url: '/v1/connect/pinterest/select-board'
943
+ });
944
+ };
945
+
946
+ /**
947
+ * Select Pinterest board
948
+ * Complete the Pinterest connection flow. After OAuth, use this endpoint to save the selected board and complete the account connection. Use the X-Connect-Token header if you initiated the connection via API key.
949
+ *
950
+ */
951
+ export const selectPinterestBoard = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SelectPinterestBoardData, ThrowOnError>) => {
952
+ return (options?.client ?? client).post<SelectPinterestBoardResponse, SelectPinterestBoardError, ThrowOnError>({
953
+ ...options,
954
+ url: '/v1/connect/pinterest/select-board'
955
+ });
956
+ };
957
+
958
+ /**
959
+ * List Snapchat profiles
960
+ * For headless flows. Returns Snapchat Public Profiles the user can post to. Use X-Connect-Token from the redirect URL.
961
+ */
962
+ export const listSnapchatProfiles = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListSnapchatProfilesData, ThrowOnError>) => {
963
+ return (options?.client ?? client).get<ListSnapchatProfilesResponse, ListSnapchatProfilesError, ThrowOnError>({
964
+ ...options,
965
+ url: '/v1/connect/snapchat/select-profile'
966
+ });
967
+ };
968
+
969
+ /**
970
+ * Select Snapchat profile
971
+ * Complete the Snapchat connection flow by saving the selected Public Profile. Snapchat requires a Public Profile to publish content. Use X-Connect-Token if connecting via API key.
972
+ */
973
+ export const selectSnapchatProfile = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SelectSnapchatProfileData, ThrowOnError>) => {
974
+ return (options?.client ?? client).post<SelectSnapchatProfileResponse, SelectSnapchatProfileError, ThrowOnError>({
975
+ ...options,
976
+ url: '/v1/connect/snapchat/select-profile'
977
+ });
978
+ };
979
+
980
+ /**
981
+ * Connect Bluesky account
982
+ * Connect a Bluesky account using identifier (handle or email) and an app password.
983
+ * To get your userId for the state parameter, call GET /v1/users which includes a currentUserId field.
984
+ *
985
+ */
986
+ export const connectBlueskyCredentials = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ConnectBlueskyCredentialsData, ThrowOnError>) => {
987
+ return (options?.client ?? client).post<ConnectBlueskyCredentialsResponse, ConnectBlueskyCredentialsError, ThrowOnError>({
988
+ ...options,
989
+ url: '/v1/connect/bluesky/credentials'
990
+ });
991
+ };
992
+
993
+ /**
994
+ * Connect WhatsApp via credentials
995
+ * Connect a WhatsApp Business Account by providing Meta credentials directly.
996
+ * This is the headless alternative to the Embedded Signup browser flow.
997
+ *
998
+ * To get the required credentials:
999
+ * 1. Go to Meta Business Suite (business.facebook.com)
1000
+ * 2. Create or select a WhatsApp Business Account
1001
+ * 3. In Business Settings > System Users, create a System User
1002
+ * 4. Assign it the `whatsapp_business_management` and `whatsapp_business_messaging` permissions
1003
+ * 5. Generate a permanent access token
1004
+ * 6. Get the WABA ID from WhatsApp Manager > Account Tools > Phone Numbers
1005
+ * 7. Get the Phone Number ID from the same page (click on the number)
1006
+ *
1007
+ */
1008
+ export const connectWhatsAppCredentials = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ConnectWhatsAppCredentialsData, ThrowOnError>) => {
1009
+ return (options?.client ?? client).post<ConnectWhatsAppCredentialsResponse, ConnectWhatsAppCredentialsError, ThrowOnError>({
1010
+ ...options,
1011
+ url: '/v1/connect/whatsapp/credentials'
1012
+ });
1013
+ };
1014
+
1015
+ /**
1016
+ * Generate Telegram code
1017
+ * Generate an access code (valid 15 minutes) for connecting a Telegram channel or group. Add the bot as admin, then send the code + @yourchannel to the bot. Poll PATCH /v1/connect/telegram to check status.
1018
+ */
1019
+ export const getTelegramConnectStatus = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetTelegramConnectStatusData, ThrowOnError>) => {
1020
+ return (options?.client ?? client).get<GetTelegramConnectStatusResponse, GetTelegramConnectStatusError, ThrowOnError>({
1021
+ ...options,
1022
+ url: '/v1/connect/telegram'
1023
+ });
1024
+ };
1025
+
1026
+ /**
1027
+ * Connect Telegram directly
1028
+ * Connect a Telegram channel/group directly using the chat ID. Alternative to the access code flow. The bot must already be an admin in the channel/group.
1029
+ */
1030
+ export const initiateTelegramConnect = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<InitiateTelegramConnectData, ThrowOnError>) => {
1031
+ return (options?.client ?? client).post<InitiateTelegramConnectResponse, InitiateTelegramConnectError, ThrowOnError>({
1032
+ ...options,
1033
+ url: '/v1/connect/telegram'
1034
+ });
1035
+ };
1036
+
1037
+ /**
1038
+ * Check Telegram status
1039
+ * Poll this endpoint to check if a Telegram access code has been used to connect a channel/group. Recommended polling interval: 3 seconds.
1040
+ * Status values: pending (waiting for user), connected (channel/group linked), expired (generate a new code).
1041
+ *
1042
+ */
1043
+ export const completeTelegramConnect = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CompleteTelegramConnectData, ThrowOnError>) => {
1044
+ return (options?.client ?? client).patch<CompleteTelegramConnectResponse, CompleteTelegramConnectError, ThrowOnError>({
1045
+ ...options,
1046
+ url: '/v1/connect/telegram'
1047
+ });
1048
+ };
1049
+
1050
+ /**
1051
+ * List Facebook pages
1052
+ * Returns all Facebook pages the connected account has access to, including the currently selected page.
1053
+ */
1054
+ export const getFacebookPages = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetFacebookPagesData, ThrowOnError>) => {
1055
+ return (options?.client ?? client).get<GetFacebookPagesResponse, GetFacebookPagesError, ThrowOnError>({
1056
+ ...options,
1057
+ url: '/v1/accounts/{accountId}/facebook-page'
1058
+ });
1059
+ };
1060
+
1061
+ /**
1062
+ * Update Facebook page
1063
+ * Switch which Facebook Page is active for a connected account.
1064
+ */
1065
+ export const updateFacebookPage = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateFacebookPageData, ThrowOnError>) => {
1066
+ return (options?.client ?? client).put<UpdateFacebookPageResponse, UpdateFacebookPageError, ThrowOnError>({
1067
+ ...options,
1068
+ url: '/v1/accounts/{accountId}/facebook-page'
1069
+ });
1070
+ };
1071
+
1072
+ /**
1073
+ * List LinkedIn orgs
1074
+ * Returns LinkedIn organizations (company pages) the connected account has admin access to.
1075
+ */
1076
+ export const getLinkedInOrganizations = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetLinkedInOrganizationsData, ThrowOnError>) => {
1077
+ return (options?.client ?? client).get<GetLinkedInOrganizationsResponse, GetLinkedInOrganizationsError, ThrowOnError>({
1078
+ ...options,
1079
+ url: '/v1/accounts/{accountId}/linkedin-organizations'
1080
+ });
1081
+ };
1082
+
1083
+ /**
1084
+ * Get LinkedIn aggregate stats
1085
+ * Returns aggregate analytics across all posts for a LinkedIn personal account. Org accounts should use /v1/analytics instead. Requires r_member_postAnalytics scope.
1086
+ */
1087
+ export const getLinkedInAggregateAnalytics = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetLinkedInAggregateAnalyticsData, ThrowOnError>) => {
1088
+ return (options?.client ?? client).get<GetLinkedInAggregateAnalyticsResponse, GetLinkedInAggregateAnalyticsError, ThrowOnError>({
1089
+ ...options,
1090
+ url: '/v1/accounts/{accountId}/linkedin-aggregate-analytics'
1091
+ });
1092
+ };
1093
+
1094
+ /**
1095
+ * Get LinkedIn post stats
1096
+ * Returns analytics for a specific LinkedIn post by URN. Works for both personal and organization accounts.
1097
+ */
1098
+ export const getLinkedInPostAnalytics = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetLinkedInPostAnalyticsData, ThrowOnError>) => {
1099
+ return (options?.client ?? client).get<GetLinkedInPostAnalyticsResponse, GetLinkedInPostAnalyticsError, ThrowOnError>({
1100
+ ...options,
1101
+ url: '/v1/accounts/{accountId}/linkedin-post-analytics'
1102
+ });
1103
+ };
1104
+
1105
+ /**
1106
+ * Get LinkedIn post reactions
1107
+ * Returns individual reactions for a specific LinkedIn post, including reactor profiles
1108
+ * (name, headline/job title, profile picture, profile URL, reaction type).
1109
+ * Only works for **organization/company page** accounts. LinkedIn restricts reaction
1110
+ * data for personal profiles (r_member_social_feed is a closed permission).
1111
+ *
1112
+ */
1113
+ export const getLinkedInPostReactions = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetLinkedInPostReactionsData, ThrowOnError>) => {
1114
+ return (options?.client ?? client).get<GetLinkedInPostReactionsResponse, GetLinkedInPostReactionsError, ThrowOnError>({
1115
+ ...options,
1116
+ url: '/v1/accounts/{accountId}/linkedin-post-reactions'
1117
+ });
1118
+ };
1119
+
1120
+ /**
1121
+ * Switch LinkedIn account type
1122
+ * Switch a LinkedIn account between personal profile and organization (company page) posting.
1123
+ */
1124
+ export const updateLinkedInOrganization = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateLinkedInOrganizationData, ThrowOnError>) => {
1125
+ return (options?.client ?? client).put<UpdateLinkedInOrganizationResponse, UpdateLinkedInOrganizationError, ThrowOnError>({
1126
+ ...options,
1127
+ url: '/v1/accounts/{accountId}/linkedin-organization'
1128
+ });
1129
+ };
1130
+
1131
+ /**
1132
+ * Resolve LinkedIn mention
1133
+ * Converts a LinkedIn profile or company URL to a URN for @mentions in posts. Person mentions require org admin access. Use the returned mentionFormat in post content.
1134
+ */
1135
+ export const getLinkedInMentions = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetLinkedInMentionsData, ThrowOnError>) => {
1136
+ return (options?.client ?? client).get<GetLinkedInMentionsResponse, GetLinkedInMentionsError, ThrowOnError>({
1137
+ ...options,
1138
+ url: '/v1/accounts/{accountId}/linkedin-mentions'
1139
+ });
1140
+ };
1141
+
1142
+ /**
1143
+ * List Pinterest boards
1144
+ * Returns the boards available for a connected Pinterest account. Use this to get a board ID when creating a Pinterest post.
1145
+ */
1146
+ export const getPinterestBoards = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetPinterestBoardsData, ThrowOnError>) => {
1147
+ return (options?.client ?? client).get<GetPinterestBoardsResponse, GetPinterestBoardsError, ThrowOnError>({
1148
+ ...options,
1149
+ url: '/v1/accounts/{accountId}/pinterest-boards'
1150
+ });
1151
+ };
1152
+
1153
+ /**
1154
+ * Set default Pinterest board
1155
+ * Sets the default board used when publishing pins for this account.
1156
+ */
1157
+ export const updatePinterestBoards = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdatePinterestBoardsData, ThrowOnError>) => {
1158
+ return (options?.client ?? client).put<UpdatePinterestBoardsResponse, UpdatePinterestBoardsError, ThrowOnError>({
1159
+ ...options,
1160
+ url: '/v1/accounts/{accountId}/pinterest-boards'
1161
+ });
1162
+ };
1163
+
1164
+ /**
1165
+ * List GBP locations
1166
+ * Returns all Google Business Profile locations the connected account has access to, including the currently selected location.
1167
+ */
1168
+ export const getGmbLocations = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetGmbLocationsData, ThrowOnError>) => {
1169
+ return (options?.client ?? client).get<GetGmbLocationsResponse, GetGmbLocationsError, ThrowOnError>({
1170
+ ...options,
1171
+ url: '/v1/accounts/{accountId}/gmb-locations'
1172
+ });
1173
+ };
1174
+
1175
+ /**
1176
+ * Update GBP location
1177
+ * Switch which GBP location is active for a connected account.
1178
+ */
1179
+ export const updateGmbLocation = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateGmbLocationData, ThrowOnError>) => {
1180
+ return (options?.client ?? client).put<UpdateGmbLocationResponse, UpdateGmbLocationError, ThrowOnError>({
1181
+ ...options,
1182
+ url: '/v1/accounts/{accountId}/gmb-locations'
1183
+ });
1184
+ };
1185
+
1186
+ /**
1187
+ * List Reddit subreddits
1188
+ * Returns the subreddits the connected Reddit account can post to. Use this to get a subreddit name when creating a Reddit post.
1189
+ */
1190
+ export const getRedditSubreddits = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetRedditSubredditsData, ThrowOnError>) => {
1191
+ return (options?.client ?? client).get<GetRedditSubredditsResponse, GetRedditSubredditsError, ThrowOnError>({
1192
+ ...options,
1193
+ url: '/v1/accounts/{accountId}/reddit-subreddits'
1194
+ });
1195
+ };
1196
+
1197
+ /**
1198
+ * Set default subreddit
1199
+ * Sets the default subreddit used when publishing posts for this Reddit account.
1200
+ */
1201
+ export const updateRedditSubreddits = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateRedditSubredditsData, ThrowOnError>) => {
1202
+ return (options?.client ?? client).put<UpdateRedditSubredditsResponse, UpdateRedditSubredditsError, ThrowOnError>({
1203
+ ...options,
1204
+ url: '/v1/accounts/{accountId}/reddit-subreddits'
1205
+ });
1206
+ };
1207
+
1208
+ /**
1209
+ * List subreddit flairs
1210
+ * Returns available post flairs for a subreddit. Some subreddits require a flair when posting.
1211
+ */
1212
+ export const getRedditFlairs = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetRedditFlairsData, ThrowOnError>) => {
1213
+ return (options?.client ?? client).get<GetRedditFlairsResponse, GetRedditFlairsError, ThrowOnError>({
1214
+ ...options,
1215
+ url: '/v1/accounts/{accountId}/reddit-flairs'
1216
+ });
1217
+ };
1218
+
1219
+ /**
1220
+ * List schedules
1221
+ * Returns queue schedules for a profile. Use all=true for all queues, or queueId for a specific one. Defaults to the default queue.
1222
+ */
1223
+ export const listQueueSlots = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListQueueSlotsData, ThrowOnError>) => {
1224
+ return (options?.client ?? client).get<ListQueueSlotsResponse, ListQueueSlotsError, ThrowOnError>({
1225
+ ...options,
1226
+ url: '/v1/queue/slots'
1227
+ });
1228
+ };
1229
+
1230
+ /**
1231
+ * Create schedule
1232
+ * Create an additional queue for a profile. The first queue created becomes the default.
1233
+ * Subsequent queues are non-default unless explicitly set.
1234
+ *
1235
+ */
1236
+ export const createQueueSlot = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateQueueSlotData, ThrowOnError>) => {
1237
+ return (options?.client ?? client).post<CreateQueueSlotResponse, CreateQueueSlotError, ThrowOnError>({
1238
+ ...options,
1239
+ url: '/v1/queue/slots'
1240
+ });
1241
+ };
1242
+
1243
+ /**
1244
+ * Update schedule
1245
+ * Create a new queue or update an existing one. Without queueId, creates/updates the default queue. With queueId, updates a specific queue. With setAsDefault=true, makes this queue the default for the profile.
1246
+ *
1247
+ */
1248
+ export const updateQueueSlot = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateQueueSlotData, ThrowOnError>) => {
1249
+ return (options?.client ?? client).put<UpdateQueueSlotResponse, UpdateQueueSlotError, ThrowOnError>({
1250
+ ...options,
1251
+ url: '/v1/queue/slots'
1252
+ });
1253
+ };
1254
+
1255
+ /**
1256
+ * Delete schedule
1257
+ * Delete a queue from a profile. Requires queueId to specify which queue to delete.
1258
+ * If deleting the default queue, another queue will be promoted to default.
1259
+ *
1260
+ */
1261
+ export const deleteQueueSlot = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteQueueSlotData, ThrowOnError>) => {
1262
+ return (options?.client ?? client).delete<DeleteQueueSlotResponse, DeleteQueueSlotError, ThrowOnError>({
1263
+ ...options,
1264
+ url: '/v1/queue/slots'
1265
+ });
1266
+ };
1267
+
1268
+ /**
1269
+ * Preview upcoming slots
1270
+ * Returns the next N upcoming queue slot times for a profile as ISO datetime strings.
1271
+ */
1272
+ export const previewQueue = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<PreviewQueueData, ThrowOnError>) => {
1273
+ return (options?.client ?? client).get<PreviewQueueResponse, PreviewQueueError, ThrowOnError>({
1274
+ ...options,
1275
+ url: '/v1/queue/preview'
1276
+ });
1277
+ };
1278
+
1279
+ /**
1280
+ * Get next available slot
1281
+ * Returns the next available queue slot for preview purposes. To create a queue post, use POST /v1/posts with queuedFromProfile instead of scheduledFor.
1282
+ */
1283
+ export const getNextQueueSlot = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetNextQueueSlotData, ThrowOnError>) => {
1284
+ return (options?.client ?? client).get<GetNextQueueSlotResponse, GetNextQueueSlotError, ThrowOnError>({
1285
+ ...options,
1286
+ url: '/v1/queue/next-slot'
1287
+ });
1288
+ };
1289
+
1290
+ /**
1291
+ * List webhooks
1292
+ * Retrieve all configured webhooks for the authenticated user. Supports up to 10 webhooks per user.
1293
+ */
1294
+ export const getWebhookSettings = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => {
1295
+ return (options?.client ?? client).get<GetWebhookSettingsResponse, GetWebhookSettingsError, ThrowOnError>({
1296
+ ...options,
1297
+ url: '/v1/webhooks/settings'
1298
+ });
1299
+ };
1300
+
1301
+ /**
1302
+ * Create webhook
1303
+ * Create a new webhook configuration. Maximum 10 webhooks per user.
1304
+ *
1305
+ * Webhooks are automatically disabled after 10 consecutive delivery failures.
1306
+ *
1307
+ */
1308
+ export const createWebhookSettings = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateWebhookSettingsData, ThrowOnError>) => {
1309
+ return (options?.client ?? client).post<CreateWebhookSettingsResponse, CreateWebhookSettingsError, ThrowOnError>({
1310
+ ...options,
1311
+ url: '/v1/webhooks/settings'
1312
+ });
1313
+ };
1314
+
1315
+ /**
1316
+ * Update webhook
1317
+ * Update an existing webhook configuration. All fields except _id are optional; only provided fields will be updated.
1318
+ *
1319
+ * Webhooks are automatically disabled after 10 consecutive delivery failures.
1320
+ *
1321
+ */
1322
+ export const updateWebhookSettings = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateWebhookSettingsData, ThrowOnError>) => {
1323
+ return (options?.client ?? client).put<UpdateWebhookSettingsResponse, UpdateWebhookSettingsError, ThrowOnError>({
1324
+ ...options,
1325
+ url: '/v1/webhooks/settings'
1326
+ });
1327
+ };
1328
+
1329
+ /**
1330
+ * Delete webhook
1331
+ * Permanently delete a webhook configuration.
1332
+ */
1333
+ export const deleteWebhookSettings = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteWebhookSettingsData, ThrowOnError>) => {
1334
+ return (options?.client ?? client).delete<DeleteWebhookSettingsResponse, DeleteWebhookSettingsError, ThrowOnError>({
1335
+ ...options,
1336
+ url: '/v1/webhooks/settings'
1337
+ });
1338
+ };
1339
+
1340
+ /**
1341
+ * Send test webhook
1342
+ * Send a test webhook to verify your endpoint is configured correctly. The test payload includes event: "webhook.test" to distinguish it from real events.
1343
+ *
1344
+ */
1345
+ export const testWebhook = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<TestWebhookData, ThrowOnError>) => {
1346
+ return (options?.client ?? client).post<TestWebhookResponse, TestWebhookError, ThrowOnError>({
1347
+ ...options,
1348
+ url: '/v1/webhooks/test'
1349
+ });
1350
+ };
1351
+
1352
+ /**
1353
+ * Get delivery logs
1354
+ * Retrieve webhook delivery history. Logs are automatically deleted after 7 days.
1355
+ *
1356
+ */
1357
+ export const getWebhookLogs = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetWebhookLogsData, ThrowOnError>) => {
1358
+ return (options?.client ?? client).get<GetWebhookLogsResponse, GetWebhookLogsError, ThrowOnError>({
1359
+ ...options,
1360
+ url: '/v1/webhooks/logs'
1361
+ });
1362
+ };
1363
+
1364
+ /**
1365
+ * List publishing logs
1366
+ * Retrieve publishing logs for all posts with detailed information about each publishing attempt. Filter by status, platform, or action. Logs are automatically deleted after 7 days.
1367
+ *
1368
+ */
1369
+ export const listPostsLogs = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListPostsLogsData, ThrowOnError>) => {
1370
+ return (options?.client ?? client).get<ListPostsLogsResponse, ListPostsLogsError, ThrowOnError>({
1371
+ ...options,
1372
+ url: '/v1/posts/logs'
1373
+ });
1374
+ };
1375
+
1376
+ /**
1377
+ * List connection logs
1378
+ * Retrieve connection event logs showing account connection and disconnection history. Event types: connect_success, connect_failed, disconnect, reconnect_success, reconnect_failed.
1379
+ * Logs are automatically deleted after 7 days.
1380
+ *
1381
+ */
1382
+ export const listConnectionLogs = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListConnectionLogsData, ThrowOnError>) => {
1383
+ return (options?.client ?? client).get<ListConnectionLogsResponse, ListConnectionLogsError, ThrowOnError>({
1384
+ ...options,
1385
+ url: '/v1/connections/logs'
1386
+ });
1387
+ };
1388
+
1389
+ /**
1390
+ * Get post logs
1391
+ * Retrieve all publishing logs for a specific post. Shows the complete history
1392
+ * of publishing attempts for that post across all platforms.
1393
+ *
1394
+ */
1395
+ export const getPostLogs = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetPostLogsData, ThrowOnError>) => {
1396
+ return (options?.client ?? client).get<GetPostLogsResponse, GetPostLogsError, ThrowOnError>({
1397
+ ...options,
1398
+ url: '/v1/posts/{postId}/logs'
1399
+ });
1400
+ };
1401
+
1402
+ /**
1403
+ * List conversations
1404
+ * Fetch conversations (DMs) from all connected messaging accounts in a single API call. Supports filtering by profile and platform. Results are aggregated and deduplicated.
1405
+ * Supported platforms: Facebook, Instagram, Twitter/X, Bluesky, Reddit, Telegram.
1406
+ *
1407
+ */
1408
+ export const listInboxConversations = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListInboxConversationsData, ThrowOnError>) => {
1409
+ return (options?.client ?? client).get<ListInboxConversationsResponse, ListInboxConversationsError, ThrowOnError>({
1410
+ ...options,
1411
+ url: '/v1/inbox/conversations'
1412
+ });
1413
+ };
1414
+
1415
+ /**
1416
+ * Get conversation
1417
+ * Retrieve details and metadata for a specific conversation. Requires accountId query parameter.
1418
+ */
1419
+ export const getInboxConversation = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetInboxConversationData, ThrowOnError>) => {
1420
+ return (options?.client ?? client).get<GetInboxConversationResponse, GetInboxConversationError, ThrowOnError>({
1421
+ ...options,
1422
+ url: '/v1/inbox/conversations/{conversationId}'
1423
+ });
1424
+ };
1425
+
1426
+ /**
1427
+ * Update conversation status
1428
+ * Archive or activate a conversation. Requires accountId in request body.
1429
+ */
1430
+ export const updateInboxConversation = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateInboxConversationData, ThrowOnError>) => {
1431
+ return (options?.client ?? client).put<UpdateInboxConversationResponse, UpdateInboxConversationError, ThrowOnError>({
1432
+ ...options,
1433
+ url: '/v1/inbox/conversations/{conversationId}'
1434
+ });
1435
+ };
1436
+
1437
+ /**
1438
+ * List messages
1439
+ * Fetch messages for a specific conversation. Requires accountId query parameter.
1440
+ */
1441
+ export const getInboxConversationMessages = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetInboxConversationMessagesData, ThrowOnError>) => {
1442
+ return (options?.client ?? client).get<GetInboxConversationMessagesResponse, GetInboxConversationMessagesError, ThrowOnError>({
1443
+ ...options,
1444
+ url: '/v1/inbox/conversations/{conversationId}/messages'
1445
+ });
1446
+ };
1447
+
1448
+ /**
1449
+ * Send message
1450
+ * Send a message in a conversation. Supports text, attachments, quick replies, buttons, and message tags. Attachment and interactive message support varies by platform.
1451
+ */
1452
+ export const sendInboxMessage = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SendInboxMessageData, ThrowOnError>) => {
1453
+ return (options?.client ?? client).post<SendInboxMessageResponse, SendInboxMessageError, ThrowOnError>({
1454
+ ...options,
1455
+ url: '/v1/inbox/conversations/{conversationId}/messages'
1456
+ });
1457
+ };
1458
+
1459
+ /**
1460
+ * Edit message
1461
+ * Edit the text and/or reply markup of a previously sent Telegram message.
1462
+ * Only supported for Telegram. Returns 400 for other platforms.
1463
+ *
1464
+ */
1465
+ export const editInboxMessage = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<EditInboxMessageData, ThrowOnError>) => {
1466
+ return (options?.client ?? client).patch<EditInboxMessageResponse, EditInboxMessageError, ThrowOnError>({
1467
+ ...options,
1468
+ url: '/v1/inbox/conversations/{conversationId}/messages/{messageId}'
1469
+ });
1470
+ };
1471
+
1472
+ /**
1473
+ * Get FB persistent menu
1474
+ * Get the persistent menu configuration for a Facebook Messenger account.
1475
+ */
1476
+ export const getMessengerMenu = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetMessengerMenuData, ThrowOnError>) => {
1477
+ return (options?.client ?? client).get<GetMessengerMenuResponse, GetMessengerMenuError, ThrowOnError>({
1478
+ ...options,
1479
+ url: '/v1/accounts/{accountId}/messenger-menu'
1480
+ });
1481
+ };
1482
+
1483
+ /**
1484
+ * Set FB persistent menu
1485
+ * Set the persistent menu for a Facebook Messenger account. Max 3 top-level items, max 5 nested items.
1486
+ */
1487
+ export const setMessengerMenu = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SetMessengerMenuData, ThrowOnError>) => {
1488
+ return (options?.client ?? client).put<SetMessengerMenuResponse, SetMessengerMenuError, ThrowOnError>({
1489
+ ...options,
1490
+ url: '/v1/accounts/{accountId}/messenger-menu'
1491
+ });
1492
+ };
1493
+
1494
+ /**
1495
+ * Delete FB persistent menu
1496
+ * Removes the persistent menu from Facebook Messenger conversations for this account.
1497
+ */
1498
+ export const deleteMessengerMenu = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteMessengerMenuData, ThrowOnError>) => {
1499
+ return (options?.client ?? client).delete<DeleteMessengerMenuResponse, DeleteMessengerMenuError, ThrowOnError>({
1500
+ ...options,
1501
+ url: '/v1/accounts/{accountId}/messenger-menu'
1502
+ });
1503
+ };
1504
+
1505
+ /**
1506
+ * Get IG ice breakers
1507
+ * Get the ice breaker configuration for an Instagram account.
1508
+ */
1509
+ export const getInstagramIceBreakers = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetInstagramIceBreakersData, ThrowOnError>) => {
1510
+ return (options?.client ?? client).get<GetInstagramIceBreakersResponse, GetInstagramIceBreakersError, ThrowOnError>({
1511
+ ...options,
1512
+ url: '/v1/accounts/{accountId}/instagram-ice-breakers'
1513
+ });
1514
+ };
1515
+
1516
+ /**
1517
+ * Set IG ice breakers
1518
+ * Set ice breakers for an Instagram account. Max 4 ice breakers, question max 80 chars.
1519
+ */
1520
+ export const setInstagramIceBreakers = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SetInstagramIceBreakersData, ThrowOnError>) => {
1521
+ return (options?.client ?? client).put<SetInstagramIceBreakersResponse, SetInstagramIceBreakersError, ThrowOnError>({
1522
+ ...options,
1523
+ url: '/v1/accounts/{accountId}/instagram-ice-breakers'
1524
+ });
1525
+ };
1526
+
1527
+ /**
1528
+ * Delete IG ice breakers
1529
+ * Removes the ice breaker questions from an Instagram account's Messenger experience.
1530
+ */
1531
+ export const deleteInstagramIceBreakers = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteInstagramIceBreakersData, ThrowOnError>) => {
1532
+ return (options?.client ?? client).delete<DeleteInstagramIceBreakersResponse, DeleteInstagramIceBreakersError, ThrowOnError>({
1533
+ ...options,
1534
+ url: '/v1/accounts/{accountId}/instagram-ice-breakers'
1535
+ });
1536
+ };
1537
+
1538
+ /**
1539
+ * Get TG bot commands
1540
+ * Get the bot commands configuration for a Telegram account.
1541
+ */
1542
+ export const getTelegramCommands = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetTelegramCommandsData, ThrowOnError>) => {
1543
+ return (options?.client ?? client).get<GetTelegramCommandsResponse, GetTelegramCommandsError, ThrowOnError>({
1544
+ ...options,
1545
+ url: '/v1/accounts/{accountId}/telegram-commands'
1546
+ });
1547
+ };
1548
+
1549
+ /**
1550
+ * Set TG bot commands
1551
+ * Set bot commands for a Telegram account.
1552
+ */
1553
+ export const setTelegramCommands = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SetTelegramCommandsData, ThrowOnError>) => {
1554
+ return (options?.client ?? client).put<SetTelegramCommandsResponse, SetTelegramCommandsError, ThrowOnError>({
1555
+ ...options,
1556
+ url: '/v1/accounts/{accountId}/telegram-commands'
1557
+ });
1558
+ };
1559
+
1560
+ /**
1561
+ * Delete TG bot commands
1562
+ * Clears all bot commands configured for a Telegram bot account.
1563
+ */
1564
+ export const deleteTelegramCommands = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteTelegramCommandsData, ThrowOnError>) => {
1565
+ return (options?.client ?? client).delete<DeleteTelegramCommandsResponse, DeleteTelegramCommandsError, ThrowOnError>({
1566
+ ...options,
1567
+ url: '/v1/accounts/{accountId}/telegram-commands'
1568
+ });
1569
+ };
1570
+
1571
+ /**
1572
+ * List commented posts
1573
+ * Returns posts with comment counts from all connected accounts. Aggregates data across multiple accounts.
1574
+ */
1575
+ export const listInboxComments = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListInboxCommentsData, ThrowOnError>) => {
1576
+ return (options?.client ?? client).get<ListInboxCommentsResponse, ListInboxCommentsError, ThrowOnError>({
1577
+ ...options,
1578
+ url: '/v1/inbox/comments'
1579
+ });
1580
+ };
1581
+
1582
+ /**
1583
+ * Get post comments
1584
+ * Fetch comments for a specific post. Requires accountId query parameter.
1585
+ */
1586
+ export const getInboxPostComments = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetInboxPostCommentsData, ThrowOnError>) => {
1587
+ return (options?.client ?? client).get<GetInboxPostCommentsResponse, GetInboxPostCommentsError, ThrowOnError>({
1588
+ ...options,
1589
+ url: '/v1/inbox/comments/{postId}'
1590
+ });
1591
+ };
1592
+
1593
+ /**
1594
+ * Reply to comment
1595
+ * Post a reply to a post or specific comment. Requires accountId in request body.
1596
+ */
1597
+ export const replyToInboxPost = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ReplyToInboxPostData, ThrowOnError>) => {
1598
+ return (options?.client ?? client).post<ReplyToInboxPostResponse, ReplyToInboxPostError, ThrowOnError>({
1599
+ ...options,
1600
+ url: '/v1/inbox/comments/{postId}'
1601
+ });
1602
+ };
1603
+
1604
+ /**
1605
+ * Delete comment
1606
+ * Delete a comment on a post. Supported by Facebook, Instagram, Bluesky, Reddit, YouTube, and LinkedIn.
1607
+ * Requires accountId and commentId query parameters.
1608
+ *
1609
+ */
1610
+ export const deleteInboxComment = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteInboxCommentData, ThrowOnError>) => {
1611
+ return (options?.client ?? client).delete<DeleteInboxCommentResponse, DeleteInboxCommentError, ThrowOnError>({
1612
+ ...options,
1613
+ url: '/v1/inbox/comments/{postId}'
1614
+ });
1615
+ };
1616
+
1617
+ /**
1618
+ * Hide comment
1619
+ * Hide a comment on a post. Supported by Facebook, Instagram, Threads, and X/Twitter.
1620
+ * Hidden comments are only visible to the commenter and page admin.
1621
+ * For X/Twitter, the reply must belong to a conversation started by the authenticated user.
1622
+ *
1623
+ */
1624
+ export const hideInboxComment = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<HideInboxCommentData, ThrowOnError>) => {
1625
+ return (options?.client ?? client).post<HideInboxCommentResponse, HideInboxCommentError, ThrowOnError>({
1626
+ ...options,
1627
+ url: '/v1/inbox/comments/{postId}/{commentId}/hide'
1628
+ });
1629
+ };
1630
+
1631
+ /**
1632
+ * Unhide comment
1633
+ * Unhide a previously hidden comment. Supported by Facebook, Instagram, Threads, and X/Twitter.
1634
+ *
1635
+ */
1636
+ export const unhideInboxComment = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UnhideInboxCommentData, ThrowOnError>) => {
1637
+ return (options?.client ?? client).delete<UnhideInboxCommentResponse, UnhideInboxCommentError, ThrowOnError>({
1638
+ ...options,
1639
+ url: '/v1/inbox/comments/{postId}/{commentId}/hide'
1640
+ });
1641
+ };
1642
+
1643
+ /**
1644
+ * Like comment
1645
+ * Like or upvote a comment on a post. Supported platforms: Facebook, Twitter/X, Bluesky, Reddit.
1646
+ * For Bluesky, the cid (content identifier) is required in the request body.
1647
+ *
1648
+ */
1649
+ export const likeInboxComment = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<LikeInboxCommentData, ThrowOnError>) => {
1650
+ return (options?.client ?? client).post<LikeInboxCommentResponse, LikeInboxCommentError, ThrowOnError>({
1651
+ ...options,
1652
+ url: '/v1/inbox/comments/{postId}/{commentId}/like'
1653
+ });
1654
+ };
1655
+
1656
+ /**
1657
+ * Unlike comment
1658
+ * Remove a like from a comment. Supported platforms: Facebook, Twitter/X, Bluesky, Reddit.
1659
+ * For Bluesky, the likeUri query parameter is required.
1660
+ *
1661
+ */
1662
+ export const unlikeInboxComment = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UnlikeInboxCommentData, ThrowOnError>) => {
1663
+ return (options?.client ?? client).delete<UnlikeInboxCommentResponse, UnlikeInboxCommentError, ThrowOnError>({
1664
+ ...options,
1665
+ url: '/v1/inbox/comments/{postId}/{commentId}/like'
1666
+ });
1667
+ };
1668
+
1669
+ /**
1670
+ * Send private reply
1671
+ * Send a private message to the author of a comment. Supported on Instagram and Facebook only. One reply per comment, must be sent within 7 days, text only.
1672
+ */
1673
+ export const sendPrivateReplyToComment = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SendPrivateReplyToCommentData, ThrowOnError>) => {
1674
+ return (options?.client ?? client).post<SendPrivateReplyToCommentResponse, SendPrivateReplyToCommentError, ThrowOnError>({
1675
+ ...options,
1676
+ url: '/v1/inbox/comments/{postId}/{commentId}/private-reply'
1677
+ });
1678
+ };
1679
+
1680
+ /**
1681
+ * Retweet a post
1682
+ * Retweet (repost) a tweet by ID.
1683
+ * Rate limit: 50 requests per 15-min window. Shares the 300/3hr creation limit with tweet creation.
1684
+ *
1685
+ */
1686
+ export const retweetPost = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<RetweetPostData, ThrowOnError>) => {
1687
+ return (options?.client ?? client).post<RetweetPostResponse, RetweetPostError, ThrowOnError>({
1688
+ ...options,
1689
+ url: '/v1/twitter/retweet'
1690
+ });
1691
+ };
1692
+
1693
+ /**
1694
+ * Undo retweet
1695
+ * Undo a retweet (un-repost a tweet).
1696
+ *
1697
+ */
1698
+ export const undoRetweet = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UndoRetweetData, ThrowOnError>) => {
1699
+ return (options?.client ?? client).delete<UndoRetweetResponse, UndoRetweetError, ThrowOnError>({
1700
+ ...options,
1701
+ url: '/v1/twitter/retweet'
1702
+ });
1703
+ };
1704
+
1705
+ /**
1706
+ * Bookmark a tweet
1707
+ * Bookmark a tweet by ID.
1708
+ * Requires the bookmark.write OAuth scope.
1709
+ * Rate limit: 50 requests per 15-min window.
1710
+ *
1711
+ */
1712
+ export const bookmarkPost = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<BookmarkPostData, ThrowOnError>) => {
1713
+ return (options?.client ?? client).post<BookmarkPostResponse, BookmarkPostError, ThrowOnError>({
1714
+ ...options,
1715
+ url: '/v1/twitter/bookmark'
1716
+ });
1717
+ };
1718
+
1719
+ /**
1720
+ * Remove bookmark
1721
+ * Remove a bookmark from a tweet.
1722
+ *
1723
+ */
1724
+ export const removeBookmark = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<RemoveBookmarkData, ThrowOnError>) => {
1725
+ return (options?.client ?? client).delete<RemoveBookmarkResponse, RemoveBookmarkError, ThrowOnError>({
1726
+ ...options,
1727
+ url: '/v1/twitter/bookmark'
1728
+ });
1729
+ };
1730
+
1731
+ /**
1732
+ * Follow a user
1733
+ * Follow a user on X/Twitter.
1734
+ * Requires the follows.write OAuth scope.
1735
+ * For protected accounts, a follow request is sent instead (pending_follow will be true).
1736
+ *
1737
+ */
1738
+ export const followUser = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<FollowUserData, ThrowOnError>) => {
1739
+ return (options?.client ?? client).post<FollowUserResponse, FollowUserError, ThrowOnError>({
1740
+ ...options,
1741
+ url: '/v1/twitter/follow'
1742
+ });
1743
+ };
1744
+
1745
+ /**
1746
+ * Unfollow a user
1747
+ * Unfollow a user on X/Twitter.
1748
+ *
1749
+ */
1750
+ export const unfollowUser = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UnfollowUserData, ThrowOnError>) => {
1751
+ return (options?.client ?? client).delete<UnfollowUserResponse, UnfollowUserError, ThrowOnError>({
1752
+ ...options,
1753
+ url: '/v1/twitter/follow'
1754
+ });
1755
+ };
1756
+
1757
+ /**
1758
+ * List reviews
1759
+ * Fetch reviews from all connected Facebook Pages and Google Business accounts. Aggregates data with filtering and sorting options.
1760
+ * Supported platforms: Facebook, Google Business.
1761
+ *
1762
+ */
1763
+ export const listInboxReviews = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListInboxReviewsData, ThrowOnError>) => {
1764
+ return (options?.client ?? client).get<ListInboxReviewsResponse, ListInboxReviewsError, ThrowOnError>({
1765
+ ...options,
1766
+ url: '/v1/inbox/reviews'
1767
+ });
1768
+ };
1769
+
1770
+ /**
1771
+ * Reply to review
1772
+ * Post a reply to a review. Requires accountId in request body.
1773
+ */
1774
+ export const replyToInboxReview = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ReplyToInboxReviewData, ThrowOnError>) => {
1775
+ return (options?.client ?? client).post<ReplyToInboxReviewResponse, ReplyToInboxReviewError, ThrowOnError>({
1776
+ ...options,
1777
+ url: '/v1/inbox/reviews/{reviewId}/reply'
1778
+ });
1779
+ };
1780
+
1781
+ /**
1782
+ * Delete review reply
1783
+ * Delete a reply to a review (Google Business only). Requires accountId in request body.
1784
+ */
1785
+ export const deleteInboxReviewReply = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteInboxReviewReplyData, ThrowOnError>) => {
1786
+ return (options?.client ?? client).delete<DeleteInboxReviewReplyResponse, DeleteInboxReviewReplyError, ThrowOnError>({
1787
+ ...options,
1788
+ url: '/v1/inbox/reviews/{reviewId}/reply'
1789
+ });
1790
+ };
1791
+
1792
+ /**
1793
+ * Bulk send template messages
1794
+ * Send a template message to multiple recipients in a single request. Maximum 100 recipients per request.
1795
+ * Only template messages are supported for bulk sending (not free-form text).
1796
+ *
1797
+ * Each recipient can have optional per-recipient template variables for personalization.
1798
+ * Returns detailed results for each recipient.
1799
+ *
1800
+ */
1801
+ export const sendWhatsAppBulk = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SendWhatsAppBulkData, ThrowOnError>) => {
1802
+ return (options?.client ?? client).post<SendWhatsAppBulkResponse, SendWhatsAppBulkError, ThrowOnError>({
1803
+ ...options,
1804
+ url: '/v1/whatsapp/bulk'
1805
+ });
1806
+ };
1807
+
1808
+ /**
1809
+ * List contacts
1810
+ * List WhatsApp contacts for an account. Supports filtering by tags, groups, opt-in status,
1811
+ * and text search. Returns contacts sorted by name with available filter options.
1812
+ *
1813
+ */
1814
+ export const getWhatsAppContacts = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetWhatsAppContactsData, ThrowOnError>) => {
1815
+ return (options?.client ?? client).get<GetWhatsAppContactsResponse, GetWhatsAppContactsError, ThrowOnError>({
1816
+ ...options,
1817
+ url: '/v1/whatsapp/contacts'
1818
+ });
1819
+ };
1820
+
1821
+ /**
1822
+ * Create contact
1823
+ * Create a new WhatsApp contact. Phone number must be unique per account
1824
+ * and in E.164 format (e.g., +1234567890).
1825
+ *
1826
+ */
1827
+ export const createWhatsAppContact = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateWhatsAppContactData, ThrowOnError>) => {
1828
+ return (options?.client ?? client).post<CreateWhatsAppContactResponse, CreateWhatsAppContactError, ThrowOnError>({
1829
+ ...options,
1830
+ url: '/v1/whatsapp/contacts'
1831
+ });
1832
+ };
1833
+
1834
+ /**
1835
+ * Get contact
1836
+ * Retrieve a single WhatsApp contact by ID with full details.
1837
+ */
1838
+ export const getWhatsAppContact = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetWhatsAppContactData, ThrowOnError>) => {
1839
+ return (options?.client ?? client).get<GetWhatsAppContactResponse, GetWhatsAppContactError, ThrowOnError>({
1840
+ ...options,
1841
+ url: '/v1/whatsapp/contacts/{contactId}'
1842
+ });
1843
+ };
1844
+
1845
+ /**
1846
+ * Update contact
1847
+ * Update an existing WhatsApp contact. All fields are optional; only provided fields will be updated.
1848
+ * Custom fields are merged with existing values. Set a custom field to null to remove it.
1849
+ *
1850
+ */
1851
+ export const updateWhatsAppContact = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateWhatsAppContactData, ThrowOnError>) => {
1852
+ return (options?.client ?? client).put<UpdateWhatsAppContactResponse, UpdateWhatsAppContactError, ThrowOnError>({
1853
+ ...options,
1854
+ url: '/v1/whatsapp/contacts/{contactId}'
1855
+ });
1856
+ };
1857
+
1858
+ /**
1859
+ * Delete contact
1860
+ * Permanently delete a WhatsApp contact.
1861
+ */
1862
+ export const deleteWhatsAppContact = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteWhatsAppContactData, ThrowOnError>) => {
1863
+ return (options?.client ?? client).delete<DeleteWhatsAppContactResponse, DeleteWhatsAppContactError, ThrowOnError>({
1864
+ ...options,
1865
+ url: '/v1/whatsapp/contacts/{contactId}'
1866
+ });
1867
+ };
1868
+
1869
+ /**
1870
+ * Bulk import contacts
1871
+ * Import up to 1000 contacts at once. Each contact requires a phone number and name.
1872
+ * Duplicates are skipped by default. Supports default tags and groups applied to all imported contacts.
1873
+ *
1874
+ */
1875
+ export const importWhatsAppContacts = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ImportWhatsAppContactsData, ThrowOnError>) => {
1876
+ return (options?.client ?? client).post<ImportWhatsAppContactsResponse, ImportWhatsAppContactsError, ThrowOnError>({
1877
+ ...options,
1878
+ url: '/v1/whatsapp/contacts/import'
1879
+ });
1880
+ };
1881
+
1882
+ /**
1883
+ * Bulk update contacts
1884
+ * Perform bulk operations on multiple contacts (max 500 per request). Supported actions:
1885
+ * addTags, removeTags, addGroups, removeGroups, optIn, optOut, block, unblock.
1886
+ *
1887
+ */
1888
+ export const bulkUpdateWhatsAppContacts = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<BulkUpdateWhatsAppContactsData, ThrowOnError>) => {
1889
+ return (options?.client ?? client).post<BulkUpdateWhatsAppContactsResponse, BulkUpdateWhatsAppContactsError, ThrowOnError>({
1890
+ ...options,
1891
+ url: '/v1/whatsapp/contacts/bulk'
1892
+ });
1893
+ };
1894
+
1895
+ /**
1896
+ * Bulk delete contacts
1897
+ * Permanently delete multiple contacts at once (max 500 per request).
1898
+ */
1899
+ export const bulkDeleteWhatsAppContacts = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<BulkDeleteWhatsAppContactsData, ThrowOnError>) => {
1900
+ return (options?.client ?? client).delete<BulkDeleteWhatsAppContactsResponse, BulkDeleteWhatsAppContactsError, ThrowOnError>({
1901
+ ...options,
1902
+ url: '/v1/whatsapp/contacts/bulk'
1903
+ });
1904
+ };
1905
+
1906
+ /**
1907
+ * List contact groups
1908
+ * List all contact groups for a WhatsApp account with contact counts.
1909
+ * Groups are derived from the groups field on contacts, not stored as separate documents.
1910
+ *
1911
+ */
1912
+ export const getWhatsAppGroups = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetWhatsAppGroupsData, ThrowOnError>) => {
1913
+ return (options?.client ?? client).get<GetWhatsAppGroupsResponse, GetWhatsAppGroupsError, ThrowOnError>({
1914
+ ...options,
1915
+ url: '/v1/whatsapp/groups'
1916
+ });
1917
+ };
1918
+
1919
+ /**
1920
+ * Rename group
1921
+ * Rename a contact group. This updates the group name on all contacts that belong to the group.
1922
+ */
1923
+ export const renameWhatsAppGroup = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<RenameWhatsAppGroupData, ThrowOnError>) => {
1924
+ return (options?.client ?? client).post<RenameWhatsAppGroupResponse, RenameWhatsAppGroupError, ThrowOnError>({
1925
+ ...options,
1926
+ url: '/v1/whatsapp/groups'
1927
+ });
1928
+ };
1929
+
1930
+ /**
1931
+ * Delete group
1932
+ * Delete a contact group. This removes the group from all contacts but does not delete the contacts themselves.
1933
+ */
1934
+ export const deleteWhatsAppGroup = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteWhatsAppGroupData, ThrowOnError>) => {
1935
+ return (options?.client ?? client).delete<DeleteWhatsAppGroupResponse, DeleteWhatsAppGroupError, ThrowOnError>({
1936
+ ...options,
1937
+ url: '/v1/whatsapp/groups'
1938
+ });
1939
+ };
1940
+
1941
+ /**
1942
+ * List templates
1943
+ * List all message templates for the WhatsApp Business Account (WABA) associated with the given account.
1944
+ * Templates are fetched directly from the WhatsApp Cloud API.
1945
+ *
1946
+ */
1947
+ export const getWhatsAppTemplates = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetWhatsAppTemplatesData, ThrowOnError>) => {
1948
+ return (options?.client ?? client).get<GetWhatsAppTemplatesResponse, GetWhatsAppTemplatesError, ThrowOnError>({
1949
+ ...options,
1950
+ url: '/v1/whatsapp/templates'
1951
+ });
1952
+ };
1953
+
1954
+ /**
1955
+ * Create template
1956
+ * Create a new message template. Supports two modes:
1957
+ *
1958
+ * **Custom template:** Provide `components` with your own content. Submitted to Meta for review (can take up to 24h).
1959
+ *
1960
+ * **Library template:** Provide `library_template_name` instead of `components` to use a pre-built template
1961
+ * from Meta's template library. Library templates are **pre-approved** (no review wait). You can optionally
1962
+ * customize parameters and buttons via `library_template_body_inputs` and `library_template_button_inputs`.
1963
+ *
1964
+ * Browse available library templates at: https://business.facebook.com/wa/manage/message-templates/
1965
+ *
1966
+ */
1967
+ export const createWhatsAppTemplate = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateWhatsAppTemplateData, ThrowOnError>) => {
1968
+ return (options?.client ?? client).post<CreateWhatsAppTemplateResponse, CreateWhatsAppTemplateError, ThrowOnError>({
1969
+ ...options,
1970
+ url: '/v1/whatsapp/templates'
1971
+ });
1972
+ };
1973
+
1974
+ /**
1975
+ * Get template
1976
+ * Retrieve a single message template by name.
1977
+ */
1978
+ export const getWhatsAppTemplate = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetWhatsAppTemplateData, ThrowOnError>) => {
1979
+ return (options?.client ?? client).get<GetWhatsAppTemplateResponse, GetWhatsAppTemplateError, ThrowOnError>({
1980
+ ...options,
1981
+ url: '/v1/whatsapp/templates/{templateName}'
1982
+ });
1983
+ };
1984
+
1985
+ /**
1986
+ * Update template
1987
+ * Update a message template's components. Only certain fields can be updated depending on
1988
+ * the template's current approval state. Approved templates can only have components updated.
1989
+ *
1990
+ */
1991
+ export const updateWhatsAppTemplate = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateWhatsAppTemplateData, ThrowOnError>) => {
1992
+ return (options?.client ?? client).patch<UpdateWhatsAppTemplateResponse, UpdateWhatsAppTemplateError, ThrowOnError>({
1993
+ ...options,
1994
+ url: '/v1/whatsapp/templates/{templateName}'
1995
+ });
1996
+ };
1997
+
1998
+ /**
1999
+ * Delete template
2000
+ * Permanently delete a message template by name.
2001
+ */
2002
+ export const deleteWhatsAppTemplate = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteWhatsAppTemplateData, ThrowOnError>) => {
2003
+ return (options?.client ?? client).delete<DeleteWhatsAppTemplateResponse, DeleteWhatsAppTemplateError, ThrowOnError>({
2004
+ ...options,
2005
+ url: '/v1/whatsapp/templates/{templateName}'
2006
+ });
2007
+ };
2008
+
2009
+ /**
2010
+ * List broadcasts
2011
+ * List all WhatsApp broadcasts for an account. Returns broadcasts sorted by creation date
2012
+ * (newest first) without the full recipients list for performance.
2013
+ *
2014
+ */
2015
+ export const getWhatsAppBroadcasts = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetWhatsAppBroadcastsData, ThrowOnError>) => {
2016
+ return (options?.client ?? client).get<GetWhatsAppBroadcastsResponse, GetWhatsAppBroadcastsError, ThrowOnError>({
2017
+ ...options,
2018
+ url: '/v1/whatsapp/broadcasts'
2019
+ });
2020
+ };
2021
+
2022
+ /**
2023
+ * Create broadcast
2024
+ * Create a new draft broadcast. Optionally include initial recipients.
2025
+ * After creation, add recipients and then send or schedule the broadcast.
2026
+ *
2027
+ */
2028
+ export const createWhatsAppBroadcast = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateWhatsAppBroadcastData, ThrowOnError>) => {
2029
+ return (options?.client ?? client).post<CreateWhatsAppBroadcastResponse, CreateWhatsAppBroadcastError, ThrowOnError>({
2030
+ ...options,
2031
+ url: '/v1/whatsapp/broadcasts'
2032
+ });
2033
+ };
2034
+
2035
+ /**
2036
+ * Get broadcast
2037
+ * Retrieve detailed information about a single broadcast including delivery statistics.
2038
+ */
2039
+ export const getWhatsAppBroadcast = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetWhatsAppBroadcastData, ThrowOnError>) => {
2040
+ return (options?.client ?? client).get<GetWhatsAppBroadcastResponse, GetWhatsAppBroadcastError, ThrowOnError>({
2041
+ ...options,
2042
+ url: '/v1/whatsapp/broadcasts/{broadcastId}'
2043
+ });
2044
+ };
2045
+
2046
+ /**
2047
+ * Delete broadcast
2048
+ * Delete a broadcast. Only draft or cancelled broadcasts can be deleted.
2049
+ */
2050
+ export const deleteWhatsAppBroadcast = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteWhatsAppBroadcastData, ThrowOnError>) => {
2051
+ return (options?.client ?? client).delete<DeleteWhatsAppBroadcastResponse, DeleteWhatsAppBroadcastError, ThrowOnError>({
2052
+ ...options,
2053
+ url: '/v1/whatsapp/broadcasts/{broadcastId}'
2054
+ });
2055
+ };
2056
+
2057
+ /**
2058
+ * Send broadcast
2059
+ * Start sending a broadcast immediately. The broadcast must be in draft or scheduled status
2060
+ * and have at least one recipient. Messages are sent sequentially with rate limiting.
2061
+ *
2062
+ */
2063
+ export const sendWhatsAppBroadcast = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SendWhatsAppBroadcastData, ThrowOnError>) => {
2064
+ return (options?.client ?? client).post<SendWhatsAppBroadcastResponse, SendWhatsAppBroadcastError, ThrowOnError>({
2065
+ ...options,
2066
+ url: '/v1/whatsapp/broadcasts/{broadcastId}/send'
2067
+ });
2068
+ };
2069
+
2070
+ /**
2071
+ * Schedule broadcast
2072
+ * Schedule a draft broadcast for future sending. The scheduled time must be in the future
2073
+ * and no more than 30 days in advance. The broadcast must be in draft status and have recipients.
2074
+ *
2075
+ */
2076
+ export const scheduleWhatsAppBroadcast = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ScheduleWhatsAppBroadcastData, ThrowOnError>) => {
2077
+ return (options?.client ?? client).post<ScheduleWhatsAppBroadcastResponse, ScheduleWhatsAppBroadcastError, ThrowOnError>({
2078
+ ...options,
2079
+ url: '/v1/whatsapp/broadcasts/{broadcastId}/schedule'
2080
+ });
2081
+ };
2082
+
2083
+ /**
2084
+ * Cancel scheduled broadcast
2085
+ * Cancel a scheduled broadcast and return it to draft status. Only broadcasts in
2086
+ * scheduled status can be cancelled.
2087
+ *
2088
+ */
2089
+ export const cancelWhatsAppBroadcastSchedule = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CancelWhatsAppBroadcastScheduleData, ThrowOnError>) => {
2090
+ return (options?.client ?? client).delete<CancelWhatsAppBroadcastScheduleResponse, CancelWhatsAppBroadcastScheduleError, ThrowOnError>({
2091
+ ...options,
2092
+ url: '/v1/whatsapp/broadcasts/{broadcastId}/schedule'
2093
+ });
2094
+ };
2095
+
2096
+ /**
2097
+ * List recipients
2098
+ * List recipients of a broadcast with their delivery status. Supports filtering
2099
+ * by delivery status and pagination.
2100
+ *
2101
+ */
2102
+ export const getWhatsAppBroadcastRecipients = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetWhatsAppBroadcastRecipientsData, ThrowOnError>) => {
2103
+ return (options?.client ?? client).get<GetWhatsAppBroadcastRecipientsResponse, GetWhatsAppBroadcastRecipientsError, ThrowOnError>({
2104
+ ...options,
2105
+ url: '/v1/whatsapp/broadcasts/{broadcastId}/recipients'
2106
+ });
2107
+ };
2108
+
2109
+ /**
2110
+ * Add recipients
2111
+ * Add recipients to a draft broadcast. Maximum 1000 recipients per request.
2112
+ * Duplicate phone numbers are automatically skipped.
2113
+ *
2114
+ */
2115
+ export const addWhatsAppBroadcastRecipients = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<AddWhatsAppBroadcastRecipientsData, ThrowOnError>) => {
2116
+ return (options?.client ?? client).patch<AddWhatsAppBroadcastRecipientsResponse, AddWhatsAppBroadcastRecipientsError, ThrowOnError>({
2117
+ ...options,
2118
+ url: '/v1/whatsapp/broadcasts/{broadcastId}/recipients'
2119
+ });
2120
+ };
2121
+
2122
+ /**
2123
+ * Remove recipients
2124
+ * Remove recipients from a draft broadcast by phone number.
2125
+ */
2126
+ export const removeWhatsAppBroadcastRecipients = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<RemoveWhatsAppBroadcastRecipientsData, ThrowOnError>) => {
2127
+ return (options?.client ?? client).delete<RemoveWhatsAppBroadcastRecipientsResponse, RemoveWhatsAppBroadcastRecipientsError, ThrowOnError>({
2128
+ ...options,
2129
+ url: '/v1/whatsapp/broadcasts/{broadcastId}/recipients'
2130
+ });
2131
+ };
2132
+
2133
+ /**
2134
+ * Get business profile
2135
+ * Retrieve the WhatsApp Business profile for the account (about, address, description, email, websites, etc.).
2136
+ */
2137
+ export const getWhatsAppBusinessProfile = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetWhatsAppBusinessProfileData, ThrowOnError>) => {
2138
+ return (options?.client ?? client).get<GetWhatsAppBusinessProfileResponse, GetWhatsAppBusinessProfileError, ThrowOnError>({
2139
+ ...options,
2140
+ url: '/v1/whatsapp/business-profile'
2141
+ });
2142
+ };
2143
+
2144
+ /**
2145
+ * Update business profile
2146
+ * Update the WhatsApp Business profile. All fields are optional; only provided fields will be updated.
2147
+ * Constraints: about max 139 chars, description max 512 chars, max 2 websites.
2148
+ *
2149
+ */
2150
+ export const updateWhatsAppBusinessProfile = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateWhatsAppBusinessProfileData, ThrowOnError>) => {
2151
+ return (options?.client ?? client).post<UpdateWhatsAppBusinessProfileResponse, UpdateWhatsAppBusinessProfileError, ThrowOnError>({
2152
+ ...options,
2153
+ url: '/v1/whatsapp/business-profile'
2154
+ });
2155
+ };
2156
+
2157
+ /**
2158
+ * Upload profile picture
2159
+ * Upload a new profile picture for the WhatsApp Business Profile.
2160
+ * Uses Meta's resumable upload API under the hood: creates an upload session,
2161
+ * uploads the image bytes, then updates the business profile with the resulting handle.
2162
+ *
2163
+ */
2164
+ export const uploadWhatsAppProfilePhoto = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UploadWhatsAppProfilePhotoData, ThrowOnError>) => {
2165
+ return (options?.client ?? client).post<UploadWhatsAppProfilePhotoResponse, UploadWhatsAppProfilePhotoError, ThrowOnError>({
2166
+ ...options,
2167
+ ...formDataBodySerializer,
2168
+ headers: {
2169
+ 'Content-Type': null,
2170
+ ...options?.headers
2171
+ },
2172
+ url: '/v1/whatsapp/business-profile/photo'
2173
+ });
2174
+ };
2175
+
2176
+ /**
2177
+ * Get display name and review status
2178
+ * Fetch the current display name and its Meta review status for a WhatsApp Business account.
2179
+ * Display name changes require Meta approval and can take 1-3 business days.
2180
+ *
2181
+ */
2182
+ export const getWhatsAppDisplayName = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetWhatsAppDisplayNameData, ThrowOnError>) => {
2183
+ return (options?.client ?? client).get<GetWhatsAppDisplayNameResponse, GetWhatsAppDisplayNameError, ThrowOnError>({
2184
+ ...options,
2185
+ url: '/v1/whatsapp/business-profile/display-name'
2186
+ });
2187
+ };
2188
+
2189
+ /**
2190
+ * Request display name change
2191
+ * Submit a display name change request for the WhatsApp Business account.
2192
+ * The new name must follow WhatsApp naming guidelines (3-512 characters, must represent your business).
2193
+ * Changes require Meta review and approval, which typically takes 1-3 business days.
2194
+ *
2195
+ */
2196
+ export const updateWhatsAppDisplayName = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateWhatsAppDisplayNameData, ThrowOnError>) => {
2197
+ return (options?.client ?? client).post<UpdateWhatsAppDisplayNameResponse, UpdateWhatsAppDisplayNameError, ThrowOnError>({
2198
+ ...options,
2199
+ url: '/v1/whatsapp/business-profile/display-name'
2200
+ });
2201
+ };
2202
+
2203
+ /**
2204
+ * List phone numbers
2205
+ * List all WhatsApp phone numbers purchased by the authenticated user.
2206
+ * By default, released numbers are excluded.
2207
+ *
2208
+ */
2209
+ export const getWhatsAppPhoneNumbers = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetWhatsAppPhoneNumbersData, ThrowOnError>) => {
2210
+ return (options?.client ?? client).get<GetWhatsAppPhoneNumbersResponse, GetWhatsAppPhoneNumbersError, ThrowOnError>({
2211
+ ...options,
2212
+ url: '/v1/whatsapp/phone-numbers'
2213
+ });
2214
+ };
2215
+
2216
+ /**
2217
+ * Purchase phone number
2218
+ * Initiate purchasing a WhatsApp phone number. Payment-first flow: the user does not pick
2219
+ * a specific number. The system either creates a Stripe Checkout Session (first number)
2220
+ * or increments the existing subscription quantity and provisions inline (subsequent numbers).
2221
+ *
2222
+ * Requires a paid plan. The maximum number of phone numbers is determined by the user's plan.
2223
+ *
2224
+ */
2225
+ export const purchaseWhatsAppPhoneNumber = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<PurchaseWhatsAppPhoneNumberData, ThrowOnError>) => {
2226
+ return (options?.client ?? client).post<PurchaseWhatsAppPhoneNumberResponse, PurchaseWhatsAppPhoneNumberError, ThrowOnError>({
2227
+ ...options,
2228
+ url: '/v1/whatsapp/phone-numbers/purchase'
2229
+ });
2230
+ };
2231
+
2232
+ /**
2233
+ * Get phone number
2234
+ * Retrieve the current status of a purchased phone number. Used to poll for
2235
+ * Meta pre-verification completion after purchase.
2236
+ *
2237
+ */
2238
+ export const getWhatsAppPhoneNumber = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetWhatsAppPhoneNumberData, ThrowOnError>) => {
2239
+ return (options?.client ?? client).get<GetWhatsAppPhoneNumberResponse, GetWhatsAppPhoneNumberError, ThrowOnError>({
2240
+ ...options,
2241
+ url: '/v1/whatsapp/phone-numbers/{phoneNumberId}'
2242
+ });
2243
+ };
2244
+
2245
+ /**
2246
+ * Release phone number
2247
+ * Release a purchased phone number. This will:
2248
+ * 1. Disconnect any linked WhatsApp social account
2249
+ * 2. Decrement the Stripe subscription quantity (or cancel if last number)
2250
+ * 3. Release the number from Telnyx
2251
+ * 4. Mark the number as released
2252
+ *
2253
+ */
2254
+ export const releaseWhatsAppPhoneNumber = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ReleaseWhatsAppPhoneNumberData, ThrowOnError>) => {
2255
+ return (options?.client ?? client).delete<ReleaseWhatsAppPhoneNumberResponse, ReleaseWhatsAppPhoneNumberError, ThrowOnError>({
2256
+ ...options,
2257
+ url: '/v1/whatsapp/phone-numbers/{phoneNumberId}'
2258
+ });
2259
+ };