@getlatedev/node 0.1.0

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,4115 @@
1
+ import * as _hey_api_client_fetch from '@hey-api/client-fetch';
2
+
3
+ interface ClientOptions {
4
+ /**
5
+ * API key for authentication. Defaults to process.env['LATE_API_KEY'].
6
+ */
7
+ apiKey?: string | undefined;
8
+ /**
9
+ * Override the default base URL for the API.
10
+ * @default "https://getlate.dev/api"
11
+ */
12
+ baseURL?: string | null | undefined;
13
+ /**
14
+ * The maximum amount of time (in milliseconds) that the client should wait for a response.
15
+ * @default 60000
16
+ */
17
+ timeout?: number;
18
+ /**
19
+ * Default headers to include with every request.
20
+ */
21
+ defaultHeaders?: Record<string, string>;
22
+ }
23
+ /**
24
+ * API Client for the Late API.
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * import Late from '@getlatedev/node';
29
+ *
30
+ * const late = new Late({
31
+ * apiKey: process.env['LATE_API_KEY'], // This is the default and can be omitted
32
+ * });
33
+ *
34
+ * async function main() {
35
+ * const post = await late.posts.create({
36
+ * body: {
37
+ * content: 'Hello from the Late SDK!',
38
+ * platforms: [{ platform: 'twitter', accountId: 'acc_123' }],
39
+ * publishNow: true,
40
+ * },
41
+ * });
42
+ * console.log(post.data);
43
+ * }
44
+ *
45
+ * main();
46
+ * ```
47
+ */
48
+ declare class Late {
49
+ private _options;
50
+ /**
51
+ * API key used for authentication.
52
+ */
53
+ apiKey: string;
54
+ /**
55
+ * Base URL for API requests.
56
+ */
57
+ baseURL: string;
58
+ /**
59
+ * Posts API - Create, schedule, and manage social media posts
60
+ */
61
+ posts: {
62
+ list: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<GetV1PostsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostsListResponse, GetV1PostsError, ThrowOnError>;
63
+ create: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1PostsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostCreateResponse, PostV1PostsError, ThrowOnError>;
64
+ get: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1PostsByPostIdData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostGetResponse, unknown, ThrowOnError>;
65
+ update: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PutV1PostsByPostIdData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<unknown, unknown, ThrowOnError>;
66
+ delete: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<DeleteV1PostsByPostIdData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostDeleteResponse, unknown, ThrowOnError>;
67
+ retry: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1PostsByPostIdRetryData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<unknown, unknown, ThrowOnError>;
68
+ bulkUpload: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1PostsBulkUploadData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<unknown, unknown, ThrowOnError>;
69
+ getLogs: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1PostsByPostIdLogsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1PostsByPostIdLogsResponse, unknown, ThrowOnError>;
70
+ };
71
+ /**
72
+ * Accounts API - Manage connected social media accounts
73
+ */
74
+ accounts: {
75
+ list: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<GetV1AccountsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1AccountsResponse, GetV1AccountsError, ThrowOnError>;
76
+ update: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PutV1AccountsByAccountIdData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PutV1AccountsByAccountIdResponse, unknown, ThrowOnError>;
77
+ delete: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<DeleteV1AccountsByAccountIdData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<DeleteV1AccountsByAccountIdResponse, DeleteV1AccountsByAccountIdError, ThrowOnError>;
78
+ getFollowerStats: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<GetV1AccountsFollowerStatsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1AccountsFollowerStatsResponse, GetV1AccountsFollowerStatsError, ThrowOnError>;
79
+ getAllHealth: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<GetV1AccountsHealthData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1AccountsHealthResponse, GetV1AccountsHealthError, ThrowOnError>;
80
+ getHealth: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1AccountsByAccountIdHealthData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1AccountsByAccountIdHealthResponse, GetV1AccountsByAccountIdHealthError, ThrowOnError>;
81
+ updateFacebookPage: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PutV1AccountsByAccountIdFacebookPageData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PutV1AccountsByAccountIdFacebookPageResponse, unknown, ThrowOnError>;
82
+ getLinkedInOrganizations: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1AccountsByAccountIdLinkedinOrganizationsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1AccountsByAccountIdLinkedinOrganizationsResponse, unknown, ThrowOnError>;
83
+ updateLinkedInOrganization: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PutV1AccountsByAccountIdLinkedinOrganizationData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PutV1AccountsByAccountIdLinkedinOrganizationResponse, unknown, ThrowOnError>;
84
+ getLinkedInMentions: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1AccountsByAccountIdLinkedinMentionsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1AccountsByAccountIdLinkedinMentionsResponse, GetV1AccountsByAccountIdLinkedinMentionsError, ThrowOnError>;
85
+ getPinterestBoards: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1AccountsByAccountIdPinterestBoardsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1AccountsByAccountIdPinterestBoardsResponse, unknown, ThrowOnError>;
86
+ updatePinterestBoards: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PutV1AccountsByAccountIdPinterestBoardsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PutV1AccountsByAccountIdPinterestBoardsResponse, unknown, ThrowOnError>;
87
+ getRedditSubreddits: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1AccountsByAccountIdRedditSubredditsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1AccountsByAccountIdRedditSubredditsResponse, unknown, ThrowOnError>;
88
+ updateRedditSubreddits: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PutV1AccountsByAccountIdRedditSubredditsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PutV1AccountsByAccountIdRedditSubredditsResponse, unknown, ThrowOnError>;
89
+ getGoogleBusinessReviews: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1AccountsByAccountIdGmbReviewsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1AccountsByAccountIdGmbReviewsResponse, GetV1AccountsByAccountIdGmbReviewsError, ThrowOnError>;
90
+ };
91
+ /**
92
+ * Profiles API - Manage workspace profiles
93
+ */
94
+ profiles: {
95
+ list: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<GetV1ProfilesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ProfilesListResponse, GetV1ProfilesError, ThrowOnError>;
96
+ create: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1ProfilesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ProfileCreateResponse, unknown, ThrowOnError>;
97
+ get: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ProfilesByProfileIdData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ProfilesByProfileIdResponse, GetV1ProfilesByProfileIdError, ThrowOnError>;
98
+ update: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PutV1ProfilesByProfileIdData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PutV1ProfilesByProfileIdResponse, PutV1ProfilesByProfileIdError, ThrowOnError>;
99
+ delete: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<DeleteV1ProfilesByProfileIdData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<DeleteV1ProfilesByProfileIdResponse, unknown, ThrowOnError>;
100
+ };
101
+ /**
102
+ * Analytics API - Get performance metrics
103
+ */
104
+ analytics: {
105
+ get: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<GetV1AnalyticsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1AnalyticsResponse, GetV1AnalyticsError, ThrowOnError>;
106
+ getYouTubeDailyViews: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1AnalyticsYoutubeDailyViewsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<YouTubeDailyViewsResponse, GetV1AnalyticsYoutubeDailyViewsError, ThrowOnError>;
107
+ getLinkedInAggregate: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1AccountsByAccountIdLinkedinAggregateAnalyticsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1AccountsByAccountIdLinkedinAggregateAnalyticsResponse, unknown, ThrowOnError>;
108
+ getLinkedInPostAnalytics: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1AccountsByAccountIdLinkedinPostAnalyticsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1AccountsByAccountIdLinkedinPostAnalyticsResponse, unknown, ThrowOnError>;
109
+ };
110
+ /**
111
+ * Account Groups API - Organize accounts into groups
112
+ */
113
+ accountGroups: {
114
+ list: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<unknown, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1AccountGroupsResponse, GetV1AccountGroupsError, ThrowOnError>;
115
+ create: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1AccountGroupsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1AccountGroupsResponse, unknown, ThrowOnError>;
116
+ update: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PutV1AccountGroupsByGroupIdData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PutV1AccountGroupsByGroupIdResponse, unknown, ThrowOnError>;
117
+ delete: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<DeleteV1AccountGroupsByGroupIdData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<DeleteV1AccountGroupsByGroupIdResponse, DeleteV1AccountGroupsByGroupIdError, ThrowOnError>;
118
+ };
119
+ /**
120
+ * Queue API - Manage posting queue
121
+ */
122
+ queue: {
123
+ listSlots: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1QueueSlotsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1QueueSlotsResponse, unknown, ThrowOnError>;
124
+ createSlot: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1QueueSlotsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1QueueSlotsResponse, unknown, ThrowOnError>;
125
+ updateSlot: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PutV1QueueSlotsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PutV1QueueSlotsResponse, unknown, ThrowOnError>;
126
+ deleteSlot: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<DeleteV1QueueSlotsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<DeleteV1QueueSlotsResponse, unknown, ThrowOnError>;
127
+ preview: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1QueuePreviewData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1QueuePreviewResponse, unknown, ThrowOnError>;
128
+ getNextSlot: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1QueueNextSlotData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1QueueNextSlotResponse, unknown, ThrowOnError>;
129
+ };
130
+ /**
131
+ * Webhooks API - Configure event webhooks
132
+ */
133
+ webhooks: {
134
+ getSettings: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<unknown, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1WebhooksSettingsResponse, GetV1WebhooksSettingsError, ThrowOnError>;
135
+ createSettings: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1WebhooksSettingsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1WebhooksSettingsResponse, unknown, ThrowOnError>;
136
+ updateSettings: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PutV1WebhooksSettingsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PutV1WebhooksSettingsResponse, unknown, ThrowOnError>;
137
+ deleteSettings: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<DeleteV1WebhooksSettingsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<DeleteV1WebhooksSettingsResponse, unknown, ThrowOnError>;
138
+ test: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1WebhooksTestData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1WebhooksTestResponse, unknown, ThrowOnError>;
139
+ getLogs: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<GetV1WebhooksLogsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1WebhooksLogsResponse, GetV1WebhooksLogsError, ThrowOnError>;
140
+ };
141
+ /**
142
+ * API Keys API - Manage API keys
143
+ */
144
+ apiKeys: {
145
+ list: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<unknown, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ApiKeysResponse, GetV1ApiKeysError, ThrowOnError>;
146
+ create: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1ApiKeysData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1ApiKeysResponse, unknown, ThrowOnError>;
147
+ delete: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<DeleteV1ApiKeysByKeyIdData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<DeleteV1ApiKeysByKeyIdResponse, DeleteV1ApiKeysByKeyIdError, ThrowOnError>;
148
+ };
149
+ /**
150
+ * Media API - Upload and manage media files
151
+ */
152
+ media: {
153
+ getPresignedUrl: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1MediaPresignData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1MediaPresignResponse, PostV1MediaPresignError, ThrowOnError>;
154
+ };
155
+ /**
156
+ * Tools API - Media download and utilities
157
+ */
158
+ tools: {
159
+ downloadYouTube: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ToolsYoutubeDownloadData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ToolsYoutubeDownloadResponse, unknown, ThrowOnError>;
160
+ getYouTubeTranscript: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ToolsYoutubeTranscriptData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ToolsYoutubeTranscriptResponse, unknown, ThrowOnError>;
161
+ downloadInstagram: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ToolsInstagramDownloadData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ToolsInstagramDownloadResponse, unknown, ThrowOnError>;
162
+ checkInstagramHashtags: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1ToolsInstagramHashtagCheckerData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1ToolsInstagramHashtagCheckerResponse, unknown, ThrowOnError>;
163
+ downloadTikTok: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ToolsTiktokDownloadData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ToolsTiktokDownloadResponse, unknown, ThrowOnError>;
164
+ downloadTwitter: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ToolsTwitterDownloadData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ToolsTwitterDownloadResponse, unknown, ThrowOnError>;
165
+ downloadFacebook: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ToolsFacebookDownloadData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ToolsFacebookDownloadResponse, unknown, ThrowOnError>;
166
+ downloadLinkedIn: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ToolsLinkedinDownloadData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ToolsLinkedinDownloadResponse, unknown, ThrowOnError>;
167
+ downloadBluesky: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ToolsBlueskyDownloadData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ToolsBlueskyDownloadResponse, unknown, ThrowOnError>;
168
+ };
169
+ /**
170
+ * Users API - User management
171
+ */
172
+ users: {
173
+ list: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<unknown, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1UsersResponse, GetV1UsersError, ThrowOnError>;
174
+ get: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1UsersByUserIdData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1UsersByUserIdResponse, unknown, ThrowOnError>;
175
+ };
176
+ /**
177
+ * Usage API - Get usage statistics
178
+ */
179
+ usage: {
180
+ getStats: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<unknown, ThrowOnError>) => _hey_api_client_fetch.RequestResult<UsageStats, GetV1UsageStatsError, ThrowOnError>;
181
+ };
182
+ /**
183
+ * Logs API - Publishing logs
184
+ */
185
+ logs: {
186
+ list: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<GetV1LogsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1LogsResponse, GetV1LogsError, ThrowOnError>;
187
+ get: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1LogsByLogIdData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1LogsByLogIdResponse, unknown, ThrowOnError>;
188
+ };
189
+ /**
190
+ * Connect API - OAuth connection flows
191
+ */
192
+ connect: {
193
+ getUrl: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ConnectByPlatformData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ConnectByPlatformResponse, unknown, ThrowOnError>;
194
+ handleCallback: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1ConnectByPlatformData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<unknown, unknown, ThrowOnError>;
195
+ facebook: {
196
+ listPages: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ConnectFacebookSelectPageData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ConnectFacebookSelectPageResponse, unknown, ThrowOnError>;
197
+ selectPage: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1ConnectFacebookSelectPageData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1ConnectFacebookSelectPageResponse, unknown, ThrowOnError>;
198
+ };
199
+ googleBusiness: {
200
+ listLocations: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ConnectGooglebusinessLocationsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ConnectGooglebusinessLocationsResponse, unknown, ThrowOnError>;
201
+ selectLocation: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1ConnectGooglebusinessSelectLocationData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1ConnectGooglebusinessSelectLocationResponse, unknown, ThrowOnError>;
202
+ };
203
+ linkedIn: {
204
+ listOrganizations: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ConnectLinkedinOrganizationsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ConnectLinkedinOrganizationsResponse, unknown, ThrowOnError>;
205
+ selectOrganization: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1ConnectLinkedinSelectOrganizationData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1ConnectLinkedinSelectOrganizationResponse, unknown, ThrowOnError>;
206
+ };
207
+ pinterest: {
208
+ listBoards: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ConnectPinterestSelectBoardData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ConnectPinterestSelectBoardResponse, unknown, ThrowOnError>;
209
+ selectBoard: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1ConnectPinterestSelectBoardData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1ConnectPinterestSelectBoardResponse, unknown, ThrowOnError>;
210
+ };
211
+ snapchat: {
212
+ listProfiles: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ConnectSnapchatSelectProfileData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ConnectSnapchatSelectProfileResponse, unknown, ThrowOnError>;
213
+ selectProfile: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1ConnectSnapchatSelectProfileData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1ConnectSnapchatSelectProfileResponse, unknown, ThrowOnError>;
214
+ };
215
+ bluesky: {
216
+ connectCredentials: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1ConnectBlueskyCredentialsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1ConnectBlueskyCredentialsResponse, unknown, ThrowOnError>;
217
+ };
218
+ telegram: {
219
+ getStatus: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1ConnectTelegramData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1ConnectTelegramResponse, unknown, ThrowOnError>;
220
+ initiate: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1ConnectTelegramData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1ConnectTelegramResponse, unknown, ThrowOnError>;
221
+ complete: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PatchV1ConnectTelegramData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PatchV1ConnectTelegramResponse, unknown, ThrowOnError>;
222
+ };
223
+ };
224
+ /**
225
+ * Reddit API - Search and feed
226
+ */
227
+ reddit: {
228
+ search: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1RedditSearchData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1RedditSearchResponse, unknown, ThrowOnError>;
229
+ getFeed: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetV1RedditFeedData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1RedditFeedResponse, unknown, ThrowOnError>;
230
+ };
231
+ /**
232
+ * Invites API - Team invitations
233
+ */
234
+ invites: {
235
+ createToken: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1InviteTokensData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1InviteTokensResponse, unknown, ThrowOnError>;
236
+ list: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<GetV1PlatformInvitesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetV1PlatformInvitesResponse, GetV1PlatformInvitesError, ThrowOnError>;
237
+ create: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<PostV1PlatformInvitesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostV1PlatformInvitesResponse, unknown, ThrowOnError>;
238
+ delete: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<DeleteV1PlatformInvitesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<DeleteV1PlatformInvitesResponse, unknown, ThrowOnError>;
239
+ };
240
+ /**
241
+ * Create a new Late API client.
242
+ *
243
+ * @param options - Configuration options for the client
244
+ */
245
+ constructor(options?: ClientOptions);
246
+ }
247
+
248
+ /**
249
+ * Base error class for Late API errors
250
+ */
251
+ declare class LateApiError extends Error {
252
+ readonly statusCode: number;
253
+ readonly code?: string;
254
+ readonly details?: Record<string, unknown>;
255
+ constructor(message: string, statusCode: number, code?: string, details?: Record<string, unknown>);
256
+ /**
257
+ * Check if this is a rate limit error
258
+ */
259
+ isRateLimited(): boolean;
260
+ /**
261
+ * Check if this is an authentication error
262
+ */
263
+ isAuthError(): boolean;
264
+ /**
265
+ * Check if this is a permission/access error
266
+ */
267
+ isForbidden(): boolean;
268
+ /**
269
+ * Check if this is a not found error
270
+ */
271
+ isNotFound(): boolean;
272
+ /**
273
+ * Check if this is a validation error
274
+ */
275
+ isValidationError(): boolean;
276
+ /**
277
+ * Check if this is a payment required error
278
+ */
279
+ isPaymentRequired(): boolean;
280
+ }
281
+ /**
282
+ * Rate limit error with additional rate limit info
283
+ */
284
+ declare class RateLimitError extends LateApiError {
285
+ readonly limit?: number;
286
+ readonly remaining?: number;
287
+ readonly resetAt?: Date;
288
+ constructor(message: string, limit?: number, remaining?: number, resetAt?: Date);
289
+ /**
290
+ * Get seconds until rate limit resets
291
+ */
292
+ getSecondsUntilReset(): number | undefined;
293
+ }
294
+ /**
295
+ * Validation error with field-specific details
296
+ */
297
+ declare class ValidationError extends LateApiError {
298
+ readonly fields?: Record<string, string[]>;
299
+ constructor(message: string, fields?: Record<string, string[]>);
300
+ }
301
+ /**
302
+ * Parse an error response from the API
303
+ */
304
+ declare function parseApiError(response: Response, body?: {
305
+ error?: string;
306
+ message?: string;
307
+ code?: string;
308
+ details?: Record<string, unknown>;
309
+ }): LateApiError;
310
+
311
+ type AccountGetResponse = {
312
+ account?: SocialAccount;
313
+ };
314
+ type AccountsListResponse = {
315
+ accounts?: Array<SocialAccount>;
316
+ /**
317
+ * Whether user has analytics add-on access
318
+ */
319
+ hasAnalyticsAccess?: boolean;
320
+ };
321
+ type AccountWithFollowerStats = SocialAccount & {
322
+ profilePicture?: string;
323
+ /**
324
+ * Current follower count
325
+ */
326
+ currentFollowers?: number;
327
+ lastUpdated?: string;
328
+ /**
329
+ * Follower change over period
330
+ */
331
+ growth?: number;
332
+ /**
333
+ * Percentage growth
334
+ */
335
+ growthPercentage?: number;
336
+ /**
337
+ * Number of historical snapshots
338
+ */
339
+ dataPoints?: number;
340
+ };
341
+ type AnalyticsListResponse = {
342
+ overview?: AnalyticsOverview;
343
+ posts?: Array<{
344
+ _id?: string;
345
+ content?: string;
346
+ scheduledFor?: string;
347
+ publishedAt?: string;
348
+ status?: string;
349
+ analytics?: PostAnalytics;
350
+ platforms?: Array<PlatformAnalytics>;
351
+ platform?: string;
352
+ platformPostUrl?: string;
353
+ isExternal?: boolean;
354
+ thumbnailUrl?: string;
355
+ mediaType?: 'image' | 'video' | 'gif' | 'document';
356
+ mediaItems?: Array<MediaItem>;
357
+ }>;
358
+ pagination?: Pagination;
359
+ /**
360
+ * Connected social accounts (followerCount and followersLastUpdated only included if user has analytics add-on)
361
+ */
362
+ accounts?: Array<SocialAccount>;
363
+ /**
364
+ * Whether user has analytics add-on access
365
+ */
366
+ hasAnalyticsAccess?: boolean;
367
+ };
368
+ type AnalyticsOverview = {
369
+ totalPosts?: number;
370
+ publishedPosts?: number;
371
+ scheduledPosts?: number;
372
+ lastSync?: string;
373
+ };
374
+ type AnalyticsSinglePostResponse = {
375
+ postId?: string;
376
+ status?: string;
377
+ content?: string;
378
+ scheduledFor?: string;
379
+ publishedAt?: string;
380
+ analytics?: PostAnalytics;
381
+ platformAnalytics?: Array<PlatformAnalytics>;
382
+ platform?: string;
383
+ platformPostUrl?: string;
384
+ isExternal?: boolean;
385
+ };
386
+ type ApiKey = {
387
+ id?: string;
388
+ name?: string;
389
+ keyPreview?: string;
390
+ expiresAt?: string;
391
+ createdAt?: string;
392
+ /**
393
+ * Returned only once, on creation
394
+ */
395
+ key?: string;
396
+ };
397
+ type CaptionResponse = {
398
+ caption?: string;
399
+ };
400
+ type DownloadFormat = {
401
+ formatId?: string;
402
+ ext?: string;
403
+ resolution?: string;
404
+ filesize?: number;
405
+ quality?: string;
406
+ };
407
+ type DownloadResponse = {
408
+ url?: string;
409
+ title?: string;
410
+ thumbnail?: string;
411
+ duration?: number;
412
+ formats?: Array<DownloadFormat>;
413
+ };
414
+ type ErrorResponse = {
415
+ error?: string;
416
+ details?: {
417
+ [key: string]: unknown;
418
+ };
419
+ };
420
+ /**
421
+ * Constraints:
422
+ * - Posts cannot mix videos and images.
423
+ * - Multiple images supported via attached_media (up to 10 images for feed posts).
424
+ * - Multiple videos in the same post are not supported.
425
+ * - Stories require media (single image or video); text captions are not displayed with stories.
426
+ * - Stories are ephemeral (disappear after 24 hours).
427
+ *
428
+ */
429
+ type FacebookPlatformData = {
430
+ /**
431
+ * Set to 'story' to publish as a Facebook Page Story (24-hour ephemeral content). Requires media.
432
+ */
433
+ contentType?: 'story';
434
+ /**
435
+ * Optional first comment to post immediately after publishing (feed posts only, not stories)
436
+ */
437
+ firstComment?: string;
438
+ /**
439
+ * Target Facebook Page ID. If omitted, uses the selected/default page on the connection.
440
+ */
441
+ pageId?: string;
442
+ };
443
+ /**
444
+ * Set to 'story' to publish as a Facebook Page Story (24-hour ephemeral content). Requires media.
445
+ */
446
+ type contentType = 'story';
447
+ type FollowerStatsResponse = {
448
+ accounts?: Array<AccountWithFollowerStats>;
449
+ dateRange?: {
450
+ from?: string;
451
+ to?: string;
452
+ };
453
+ aggregation?: 'daily' | 'weekly' | 'monthly';
454
+ };
455
+ type aggregation = 'daily' | 'weekly' | 'monthly';
456
+ /**
457
+ * Google Business Profile post settings:
458
+ * - Posts support text content and a single image (no videos)
459
+ * - Images must be publicly accessible URLs
460
+ * - Call-to-action buttons drive user engagement
461
+ * - Posts appear on your Google Business Profile and in Google Search/Maps
462
+ *
463
+ */
464
+ type GoogleBusinessPlatformData = {
465
+ /**
466
+ * Optional call-to-action button displayed on the post
467
+ */
468
+ callToAction?: {
469
+ /**
470
+ * Button action type:
471
+ * - LEARN_MORE: Link to more information
472
+ * - BOOK: Booking/reservation link
473
+ * - ORDER: Online ordering link
474
+ * - SHOP: E-commerce/shopping link
475
+ * - SIGN_UP: Registration/signup link
476
+ * - CALL: Phone call action
477
+ *
478
+ */
479
+ type: 'LEARN_MORE' | 'BOOK' | 'ORDER' | 'SHOP' | 'SIGN_UP' | 'CALL';
480
+ /**
481
+ * Destination URL for the CTA button (required when callToAction is provided)
482
+ */
483
+ url: string;
484
+ };
485
+ };
486
+ /**
487
+ * Button action type:
488
+ * - LEARN_MORE: Link to more information
489
+ * - BOOK: Booking/reservation link
490
+ * - ORDER: Online ordering link
491
+ * - SHOP: E-commerce/shopping link
492
+ * - SIGN_UP: Registration/signup link
493
+ * - CALL: Phone call action
494
+ *
495
+ */
496
+ type type = 'LEARN_MORE' | 'BOOK' | 'ORDER' | 'SHOP' | 'SIGN_UP' | 'CALL';
497
+ type HashtagCheckResponse = {
498
+ hashtags?: Array<HashtagInfo>;
499
+ };
500
+ type HashtagInfo = {
501
+ hashtag?: string;
502
+ status?: 'safe' | 'banned' | 'restricted' | 'unknown';
503
+ postCount?: number;
504
+ };
505
+ type status = 'safe' | 'banned' | 'restricted' | 'unknown';
506
+ /**
507
+ * Constraints:
508
+ * - Feed posts require images with aspect ratio between 0.8 (4:5 portrait) and 1.91 (1.91:1 landscape).
509
+ * - Images outside this range (e.g., 9:16 Stories/TikTok format) must use contentType 'story'.
510
+ * - Validation happens at post creation; invalid images are rejected immediately with helpful error messages.
511
+ * - Carousels support up to 10 media items.
512
+ * - Stories require media; no captions are published with Stories.
513
+ * - User tags: coordinates range from 0.0 to 1.0 representing position from top-left corner. Tagged users receive notifications.
514
+ *
515
+ * **Automatic Compression (similar to Bluesky):**
516
+ * - All images (story, post, carousel, thumbnails) exceeding 8 MB are automatically compressed using quality reduction and resizing.
517
+ * - Story videos exceeding 100 MB are automatically compressed.
518
+ * - Reel videos exceeding 300 MB are automatically compressed.
519
+ * - Compression uses Sharp (images) and FFmpeg (videos) to maintain quality while meeting size limits.
520
+ * - Original files are preserved; compressed versions are uploaded to blob storage automatically.
521
+ *
522
+ */
523
+ type InstagramPlatformData = {
524
+ /**
525
+ * Set to 'story' to publish as a Story. Default posts become Reels or feed depending on media.
526
+ */
527
+ contentType?: 'story';
528
+ /**
529
+ * For Reels only. When true (default), the Reel appears on both the Reels tab and your main profile feed. Set to false to post to the Reels tab only.
530
+ */
531
+ shareToFeed?: boolean;
532
+ /**
533
+ * Up to 3 Instagram usernames to invite as collaborators (feed/Reels only)
534
+ */
535
+ collaborators?: Array<(string)>;
536
+ /**
537
+ * Optional first comment to add after the post is created (not applied to Stories)
538
+ */
539
+ firstComment?: string;
540
+ /**
541
+ * Trial Reels configuration. Trial reels are only shared to non-followers initially.
542
+ * They can later be "graduated" (converted to regular reels visible to followers)
543
+ * either manually in the Instagram app or automatically based on performance.
544
+ * Only applies to Reels (video posts).
545
+ *
546
+ */
547
+ trialParams?: {
548
+ /**
549
+ * The graduation strategy specifies when a trial reel becomes a regular reel:
550
+ * - MANUAL: The trial reel can only be manually graduated from the native Instagram app.
551
+ * - SS_PERFORMANCE: The trial reel will be automatically graduated if it performs well with non-followers.
552
+ *
553
+ */
554
+ graduationStrategy?: 'MANUAL' | 'SS_PERFORMANCE';
555
+ };
556
+ /**
557
+ * Tag Instagram users in photos by username and position coordinates. Only works for single image posts and the first image of carousel posts. Not supported for stories or videos.
558
+ */
559
+ userTags?: Array<{
560
+ /**
561
+ * Instagram username (@ symbol is optional and will be removed automatically)
562
+ */
563
+ username: string;
564
+ /**
565
+ * X coordinate position from left edge (0.0 = left, 0.5 = center, 1.0 = right)
566
+ */
567
+ x: number;
568
+ /**
569
+ * Y coordinate position from top edge (0.0 = top, 0.5 = center, 1.0 = bottom)
570
+ */
571
+ y: number;
572
+ }>;
573
+ /**
574
+ * Custom name for the original audio in Reels. Replaces the default "Original Audio" label.
575
+ * Only applies to Reels (video posts). Can only be set once - either during creation or
576
+ * later from the Instagram audio page in the app.
577
+ *
578
+ */
579
+ audioName?: string;
580
+ };
581
+ /**
582
+ * The graduation strategy specifies when a trial reel becomes a regular reel:
583
+ * - MANUAL: The trial reel can only be manually graduated from the native Instagram app.
584
+ * - SS_PERFORMANCE: The trial reel will be automatically graduated if it performs well with non-followers.
585
+ *
586
+ */
587
+ type graduationStrategy = 'MANUAL' | 'SS_PERFORMANCE';
588
+ /**
589
+ * Response for DAILY aggregation (time series breakdown)
590
+ */
591
+ type LinkedInAggregateAnalyticsDailyResponse = {
592
+ accountId?: string;
593
+ platform?: string;
594
+ accountType?: string;
595
+ username?: string;
596
+ aggregation?: 'DAILY';
597
+ dateRange?: {
598
+ startDate?: string;
599
+ endDate?: string;
600
+ } | null;
601
+ /**
602
+ * Daily breakdown of each metric. Each metric contains an array of date/count pairs.
603
+ * Note: 'reach' (MEMBERS_REACHED) is not available with DAILY aggregation per LinkedIn API limitations.
604
+ *
605
+ */
606
+ analytics?: {
607
+ impressions?: Array<{
608
+ date?: string;
609
+ count?: number;
610
+ }>;
611
+ reactions?: Array<{
612
+ date?: string;
613
+ count?: number;
614
+ }>;
615
+ comments?: Array<{
616
+ date?: string;
617
+ count?: number;
618
+ }>;
619
+ shares?: Array<{
620
+ date?: string;
621
+ count?: number;
622
+ }>;
623
+ };
624
+ /**
625
+ * Metrics that were skipped due to API limitations
626
+ */
627
+ skippedMetrics?: Array<(string)>;
628
+ note?: string;
629
+ lastUpdated?: string;
630
+ };
631
+ type aggregation2 = 'DAILY';
632
+ /**
633
+ * Response for TOTAL aggregation (lifetime totals)
634
+ */
635
+ type LinkedInAggregateAnalyticsTotalResponse = {
636
+ accountId?: string;
637
+ platform?: string;
638
+ accountType?: string;
639
+ username?: string;
640
+ aggregation?: 'TOTAL';
641
+ dateRange?: {
642
+ startDate?: string;
643
+ endDate?: string;
644
+ } | null;
645
+ analytics?: {
646
+ /**
647
+ * Total impressions across all posts
648
+ */
649
+ impressions?: number;
650
+ /**
651
+ * Unique members reached across all posts
652
+ */
653
+ reach?: number;
654
+ /**
655
+ * Total reactions across all posts
656
+ */
657
+ reactions?: number;
658
+ /**
659
+ * Total comments across all posts
660
+ */
661
+ comments?: number;
662
+ /**
663
+ * Total reshares across all posts
664
+ */
665
+ shares?: number;
666
+ /**
667
+ * Overall engagement rate as percentage
668
+ */
669
+ engagementRate?: number;
670
+ };
671
+ note?: string;
672
+ lastUpdated?: string;
673
+ };
674
+ type aggregation3 = 'TOTAL';
675
+ /**
676
+ * Constraints:
677
+ * - Multi-image posts support up to 20 images.
678
+ * - Multi-video posts are not supported.
679
+ * - Single PDF document posts are supported (max 100MB, ~300 pages). Documents cannot be mixed with other media.
680
+ * - Post ID is returned in the x-restli-id response header.
681
+ * - Link previews are automatically generated for URLs when no media is attached (can be disabled with disableLinkPreview).
682
+ *
683
+ */
684
+ type LinkedInPlatformData = {
685
+ /**
686
+ * Optional first comment to add after the post is created
687
+ */
688
+ firstComment?: string;
689
+ /**
690
+ * Set to true to disable automatic link previews for URLs in the post content (default is false)
691
+ */
692
+ disableLinkPreview?: boolean;
693
+ };
694
+ /**
695
+ * Media referenced in posts. URLs must be publicly reachable over HTTPS by the destination platforms.
696
+ * When using third‑party storage, ensure signed links remain valid until upload completes.
697
+ *
698
+ * **Uploading Media:**
699
+ * Use `POST /v1/media/presign` to get a presigned URL, then upload your file directly to cloud storage.
700
+ * Supports files up to 5GB. See the `/v1/media/presign` endpoint documentation for details.
701
+ *
702
+ * **Automatic Media Compression:**
703
+ * Late automatically compresses media that exceeds platform limits, so you don't need to worry about file size restrictions. Compression happens server-side during publishing.
704
+ *
705
+ * **Image compression by platform:**
706
+ * - Twitter/X: >5 MB
707
+ * - Instagram: >8 MB
708
+ * - Threads: >8 MB
709
+ * - Facebook: >10 MB
710
+ * - LinkedIn: >8 MB
711
+ * - TikTok: >20 MB
712
+ * - Pinterest: >32 MB
713
+ * - Reddit: >20 MB
714
+ * - Snapchat: >20 MB
715
+ * - Telegram: >10 MB
716
+ * - Bluesky: >1 MB
717
+ * - YouTube (thumbnails): >2 MB
718
+ * - Google Business: >5 MB
719
+ *
720
+ * **Video compression by platform:**
721
+ * - Twitter/X: >512 MB
722
+ * - Instagram Stories: >100 MB
723
+ * - Instagram Reels: >300 MB
724
+ * - Facebook: >4 GB
725
+ * - LinkedIn: >5 GB
726
+ * - TikTok: >4 GB
727
+ * - Pinterest: >2 GB
728
+ * - Snapchat: >500 MB
729
+ * - Telegram: >50 MB
730
+ *
731
+ * Note: Videos larger than 200 MB may not be compressed due to server timeout constraints. For best results, compress very large videos before uploading.
732
+ *
733
+ */
734
+ type MediaItem = {
735
+ type?: 'image' | 'video' | 'gif' | 'document';
736
+ url?: string;
737
+ filename?: string;
738
+ /**
739
+ * Optional file size in bytes
740
+ */
741
+ size?: number;
742
+ /**
743
+ * Optional MIME type (e.g. image/jpeg, video/mp4)
744
+ */
745
+ mimeType?: string;
746
+ /**
747
+ * Optional thumbnail image URL for videos
748
+ */
749
+ thumbnail?: string;
750
+ /**
751
+ * Optional custom cover image URL for Instagram Reels
752
+ */
753
+ instagramThumbnail?: string;
754
+ /**
755
+ * Internal flag indicating the image was resized for TikTok
756
+ */
757
+ tiktokProcessed?: boolean;
758
+ };
759
+ type type2 = 'image' | 'video' | 'gif' | 'document';
760
+ type MediaUploadResponse = {
761
+ files?: Array<UploadedFile>;
762
+ };
763
+ type Pagination = {
764
+ page?: number;
765
+ limit?: number;
766
+ total?: number;
767
+ pages?: number;
768
+ };
769
+ /**
770
+ * Page size
771
+ */
772
+ type ParameterLimitParam = number;
773
+ /**
774
+ * Page number (1-based)
775
+ */
776
+ type ParameterPageParam = number;
777
+ type PinterestPlatformData = {
778
+ /**
779
+ * Pin title. Defaults to first line of content or "Pin". Must be ≤ 100 characters.
780
+ */
781
+ title?: string;
782
+ /**
783
+ * Target Pinterest board ID. If omitted, the first available board is used.
784
+ */
785
+ boardId?: string;
786
+ /**
787
+ * Destination link (pin URL)
788
+ */
789
+ link?: string;
790
+ /**
791
+ * Optional cover image for video pins
792
+ */
793
+ coverImageUrl?: string;
794
+ /**
795
+ * Optional key frame time in seconds for derived video cover
796
+ */
797
+ coverImageKeyFrameTime?: number;
798
+ };
799
+ type PlatformAnalytics = {
800
+ platform?: string;
801
+ status?: string;
802
+ accountId?: string;
803
+ accountUsername?: string;
804
+ analytics?: PostAnalytics;
805
+ accountMetrics?: {
806
+ /**
807
+ * Followers/fans count (e.g., Instagram, Facebook Pages, Twitter)
808
+ */
809
+ followers?: (number) | null;
810
+ /**
811
+ * Subscribers count (e.g., YouTube)
812
+ */
813
+ subscribers?: (number) | null;
814
+ lastUpdated?: (string) | null;
815
+ } | null;
816
+ };
817
+ type PlatformTarget = {
818
+ /**
819
+ * Supported values: twitter, threads, instagram, youtube, facebook, linkedin, pinterest, reddit, tiktok, bluesky, googlebusiness, telegram
820
+ */
821
+ platform?: string;
822
+ accountId?: (string | SocialAccount);
823
+ customContent?: string;
824
+ customMedia?: Array<MediaItem>;
825
+ /**
826
+ * Optional per-platform scheduled time override (uses post.scheduledFor when omitted)
827
+ */
828
+ scheduledFor?: string;
829
+ /**
830
+ * Platform-specific overrides and options.
831
+ */
832
+ platformSpecificData?: (TwitterPlatformData | ThreadsPlatformData | FacebookPlatformData | InstagramPlatformData | LinkedInPlatformData | PinterestPlatformData | YouTubePlatformData | GoogleBusinessPlatformData | TikTokPlatformData | TelegramPlatformData | SnapchatPlatformData);
833
+ /**
834
+ * Platform-specific status: pending, publishing, published, failed
835
+ */
836
+ status?: string;
837
+ /**
838
+ * The native post ID on the platform (populated after successful publish)
839
+ */
840
+ platformPostId?: string;
841
+ /**
842
+ * Public URL of the published post on the platform.
843
+ * Populated after successful publish. For immediate posts (publishNow=true),
844
+ * this is included in the response. For scheduled posts, fetch the post
845
+ * via GET /v1/posts/{postId} after the scheduled time.
846
+ *
847
+ */
848
+ platformPostUrl?: string;
849
+ /**
850
+ * Timestamp when the post was published to this platform
851
+ */
852
+ publishedAt?: string;
853
+ };
854
+ type Post = {
855
+ _id?: string;
856
+ userId?: (string | User);
857
+ /**
858
+ * YouTube: title must be ≤ 100 characters.
859
+ *
860
+ */
861
+ title?: string;
862
+ content?: string;
863
+ mediaItems?: Array<MediaItem>;
864
+ platforms?: Array<PlatformTarget>;
865
+ scheduledFor?: string;
866
+ timezone?: string;
867
+ status?: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
868
+ /**
869
+ * YouTube tag constraints when targeting YouTube:
870
+ * - No count cap; duplicates removed.
871
+ * - Each tag must be ≤ 100 chars.
872
+ * - Combined characters across all tags ≤ 500.
873
+ *
874
+ */
875
+ tags?: Array<(string)>;
876
+ hashtags?: Array<(string)>;
877
+ mentions?: Array<(string)>;
878
+ visibility?: 'public' | 'private' | 'unlisted';
879
+ metadata?: {
880
+ [key: string]: unknown;
881
+ };
882
+ /**
883
+ * Profile ID if the post was scheduled via the queue
884
+ */
885
+ queuedFromProfile?: string;
886
+ /**
887
+ * Queue ID if the post was scheduled via a specific queue
888
+ */
889
+ queueId?: string;
890
+ createdAt?: string;
891
+ updatedAt?: string;
892
+ };
893
+ type status2 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
894
+ type visibility = 'public' | 'private' | 'unlisted';
895
+ type PostAnalytics = {
896
+ impressions?: number;
897
+ reach?: number;
898
+ likes?: number;
899
+ comments?: number;
900
+ shares?: number;
901
+ clicks?: number;
902
+ views?: number;
903
+ engagementRate?: number;
904
+ lastUpdated?: string;
905
+ };
906
+ type PostCreateResponse = {
907
+ message?: string;
908
+ post?: Post;
909
+ };
910
+ type PostDeleteResponse = {
911
+ message?: string;
912
+ };
913
+ type PostGetResponse = {
914
+ post?: Post;
915
+ };
916
+ /**
917
+ * Publishing log entry showing details of a post publishing attempt
918
+ */
919
+ type PostLog = {
920
+ _id?: string;
921
+ postId?: (string | {
922
+ _id?: string;
923
+ content?: string;
924
+ status?: string;
925
+ });
926
+ userId?: string;
927
+ profileId?: string;
928
+ platform?: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat';
929
+ accountId?: string;
930
+ accountUsername?: string;
931
+ /**
932
+ * Type of action logged:
933
+ * - `publish` - Initial publish attempt
934
+ * - `retry` - Retry after failure
935
+ * - `media_upload` - Media upload step
936
+ * - `rate_limit_pause` - Account paused due to rate limits
937
+ * - `token_refresh` - Token was refreshed
938
+ * - `cancelled` - Post was cancelled
939
+ *
940
+ */
941
+ action?: 'publish' | 'retry' | 'media_upload' | 'rate_limit_pause' | 'token_refresh' | 'cancelled';
942
+ status?: 'success' | 'failed' | 'pending' | 'skipped';
943
+ /**
944
+ * HTTP status code from platform API
945
+ */
946
+ statusCode?: number;
947
+ /**
948
+ * Platform API endpoint called
949
+ */
950
+ endpoint?: string;
951
+ request?: {
952
+ /**
953
+ * First 200 chars of caption
954
+ */
955
+ contentPreview?: string;
956
+ mediaCount?: number;
957
+ mediaTypes?: Array<(string)>;
958
+ /**
959
+ * URLs of media items sent to platform
960
+ */
961
+ mediaUrls?: Array<(string)>;
962
+ scheduledFor?: string;
963
+ /**
964
+ * Full request body JSON (max 5000 chars)
965
+ */
966
+ rawBody?: string;
967
+ };
968
+ response?: {
969
+ /**
970
+ * ID returned by platform on success
971
+ */
972
+ platformPostId?: string;
973
+ /**
974
+ * URL of published post
975
+ */
976
+ platformPostUrl?: string;
977
+ /**
978
+ * Error message on failure
979
+ */
980
+ errorMessage?: string;
981
+ /**
982
+ * Platform-specific error code
983
+ */
984
+ errorCode?: string;
985
+ /**
986
+ * Full response body JSON (max 5000 chars)
987
+ */
988
+ rawBody?: string;
989
+ };
990
+ /**
991
+ * How long the operation took in milliseconds
992
+ */
993
+ durationMs?: number;
994
+ /**
995
+ * Attempt number (1 for first try, 2+ for retries)
996
+ */
997
+ attemptNumber?: number;
998
+ createdAt?: string;
999
+ };
1000
+ type platform = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat';
1001
+ /**
1002
+ * Type of action logged:
1003
+ * - `publish` - Initial publish attempt
1004
+ * - `retry` - Retry after failure
1005
+ * - `media_upload` - Media upload step
1006
+ * - `rate_limit_pause` - Account paused due to rate limits
1007
+ * - `token_refresh` - Token was refreshed
1008
+ * - `cancelled` - Post was cancelled
1009
+ *
1010
+ */
1011
+ type action = 'publish' | 'retry' | 'media_upload' | 'rate_limit_pause' | 'token_refresh' | 'cancelled';
1012
+ type status3 = 'success' | 'failed' | 'pending' | 'skipped';
1013
+ type PostLogDetail = PostLog & {
1014
+ /**
1015
+ * Populated post with full details
1016
+ */
1017
+ postId?: {
1018
+ _id?: string;
1019
+ content?: string;
1020
+ status?: string;
1021
+ scheduledFor?: string;
1022
+ platforms?: Array<{
1023
+ [key: string]: unknown;
1024
+ }>;
1025
+ mediaItems?: Array<{
1026
+ [key: string]: unknown;
1027
+ }>;
1028
+ };
1029
+ /**
1030
+ * Populated account reference
1031
+ */
1032
+ accountId?: {
1033
+ _id?: string;
1034
+ platform?: string;
1035
+ username?: string;
1036
+ displayName?: string;
1037
+ };
1038
+ /**
1039
+ * Additional metadata (e.g., rate limit info)
1040
+ */
1041
+ metadata?: {
1042
+ [key: string]: unknown;
1043
+ };
1044
+ };
1045
+ type PostRetryResponse = {
1046
+ message?: string;
1047
+ post?: Post;
1048
+ };
1049
+ type PostsListResponse = {
1050
+ posts?: Array<Post>;
1051
+ pagination?: Pagination;
1052
+ };
1053
+ type PostUpdateResponse = {
1054
+ message?: string;
1055
+ post?: Post;
1056
+ };
1057
+ type Profile = {
1058
+ _id?: string;
1059
+ userId?: string;
1060
+ name?: string;
1061
+ description?: string;
1062
+ color?: string;
1063
+ isDefault?: boolean;
1064
+ /**
1065
+ * Only present when `includeOverLimit=true` is used. Indicates if this profile
1066
+ * exceeds the user's plan limit. Over-limit profiles cannot be used for posting
1067
+ * but can be managed (disconnected accounts, deleted).
1068
+ *
1069
+ */
1070
+ isOverLimit?: boolean;
1071
+ createdAt?: string;
1072
+ };
1073
+ type ProfileCreateResponse = {
1074
+ message?: string;
1075
+ profile?: Profile;
1076
+ };
1077
+ type ProfileDeleteResponse = {
1078
+ message?: string;
1079
+ };
1080
+ type ProfileGetResponse = {
1081
+ profile?: Profile;
1082
+ };
1083
+ type ProfilesListResponse = {
1084
+ profiles?: Array<Profile>;
1085
+ };
1086
+ type ProfileUpdateResponse = {
1087
+ message?: string;
1088
+ profile?: Profile;
1089
+ };
1090
+ type QueueDeleteResponse = {
1091
+ success?: boolean;
1092
+ deleted?: boolean;
1093
+ };
1094
+ type QueueNextSlotResponse = {
1095
+ profileId?: string;
1096
+ nextSlot?: string;
1097
+ timezone?: string;
1098
+ };
1099
+ type QueuePreviewResponse = {
1100
+ profileId?: string;
1101
+ count?: number;
1102
+ slots?: Array<(string)>;
1103
+ };
1104
+ type QueueSchedule = {
1105
+ /**
1106
+ * Unique queue identifier
1107
+ */
1108
+ _id?: string;
1109
+ /**
1110
+ * Profile ID this queue belongs to
1111
+ */
1112
+ profileId?: string;
1113
+ /**
1114
+ * Queue name (e.g., "Morning Posts", "Evening Content")
1115
+ */
1116
+ name?: string;
1117
+ /**
1118
+ * IANA timezone (e.g., America/New_York)
1119
+ */
1120
+ timezone?: string;
1121
+ slots?: Array<QueueSlot>;
1122
+ /**
1123
+ * Whether the queue is active
1124
+ */
1125
+ active?: boolean;
1126
+ /**
1127
+ * Whether this is the default queue for the profile (used when no queueId specified)
1128
+ */
1129
+ isDefault?: boolean;
1130
+ createdAt?: string;
1131
+ updatedAt?: string;
1132
+ };
1133
+ type QueueSlot = {
1134
+ /**
1135
+ * Day of week (0=Sunday, 6=Saturday)
1136
+ */
1137
+ dayOfWeek?: number;
1138
+ /**
1139
+ * Time in HH:mm format (24-hour)
1140
+ */
1141
+ time?: string;
1142
+ };
1143
+ type QueueSlotsResponse = {
1144
+ exists?: boolean;
1145
+ schedule?: QueueSchedule;
1146
+ nextSlots?: Array<(string)>;
1147
+ };
1148
+ type QueueUpdateResponse = {
1149
+ success?: boolean;
1150
+ schedule?: QueueSchedule;
1151
+ nextSlots?: Array<(string)>;
1152
+ reshuffledCount?: number;
1153
+ };
1154
+ /**
1155
+ * Snapchat Public Profile API constraints:
1156
+ *
1157
+ * **General Requirements:**
1158
+ * - Snapchat requires a Public Profile to publish content
1159
+ * - Media is required for all content types (no text-only posts)
1160
+ * - Only one media item per post is supported
1161
+ * - Media is automatically encrypted using AES-256-CBC before upload
1162
+ *
1163
+ * **Content Types:**
1164
+ * - **Story** (default): Ephemeral content visible for 24 hours. No caption/text supported.
1165
+ * - **Saved Story**: Permanent story on your Public Profile. Uses post content as title (max 45 chars).
1166
+ * - **Spotlight**: Video content for Snapchat's entertainment feed. Supports description (max 160 chars) with hashtags.
1167
+ *
1168
+ * **Media Constraints:**
1169
+ * - Images: max 20 MB, JPEG/PNG format
1170
+ * - Videos: max 500 MB, MP4 format, 5-60 seconds duration, minimum 540x960px resolution
1171
+ * - Aspect ratio: 9:16 recommended
1172
+ *
1173
+ * **Analytics:**
1174
+ * - Views, screenshots, shares, unique viewers, completion rate available
1175
+ * - Analytics are fetched per content type (story/saved_story/spotlight)
1176
+ *
1177
+ */
1178
+ type SnapchatPlatformData = {
1179
+ /**
1180
+ * Type of Snapchat content to publish:
1181
+ * - `story` - Ephemeral snap visible for 24 hours (default)
1182
+ * - `saved_story` - Permanent story saved to Public Profile
1183
+ * - `spotlight` - Video posted to Spotlight (Snapchat's TikTok-like feed)
1184
+ *
1185
+ */
1186
+ contentType?: 'story' | 'saved_story' | 'spotlight';
1187
+ };
1188
+ /**
1189
+ * Type of Snapchat content to publish:
1190
+ * - `story` - Ephemeral snap visible for 24 hours (default)
1191
+ * - `saved_story` - Permanent story saved to Public Profile
1192
+ * - `spotlight` - Video posted to Spotlight (Snapchat's TikTok-like feed)
1193
+ *
1194
+ */
1195
+ type contentType2 = 'story' | 'saved_story' | 'spotlight';
1196
+ type SocialAccount = {
1197
+ _id?: string;
1198
+ platform?: string;
1199
+ profileId?: (string | Profile);
1200
+ username?: string;
1201
+ displayName?: string;
1202
+ /**
1203
+ * Full profile URL for the connected account. Available for all platforms:
1204
+ * - Twitter/X: https://x.com/{username}
1205
+ * - Instagram: https://instagram.com/{username}
1206
+ * - TikTok: https://tiktok.com/@{username}
1207
+ * - YouTube: https://youtube.com/@{handle} or https://youtube.com/channel/{id}
1208
+ * - LinkedIn Personal: https://www.linkedin.com/in/{vanityName}/
1209
+ * - LinkedIn Organization: https://www.linkedin.com/company/{vanityName}/
1210
+ * - Threads: https://threads.net/@{username}
1211
+ * - Pinterest: https://pinterest.com/{username}
1212
+ * - Reddit: https://reddit.com/user/{username}
1213
+ * - Bluesky: https://bsky.app/profile/{handle}
1214
+ * - Facebook: https://facebook.com/{username} or https://facebook.com/{pageId}
1215
+ * - Google Business: Google Maps URL for the business location
1216
+ *
1217
+ */
1218
+ profileUrl?: string;
1219
+ isActive?: boolean;
1220
+ /**
1221
+ * Follower count (only included if user has analytics add-on)
1222
+ */
1223
+ followersCount?: number;
1224
+ /**
1225
+ * Last time follower count was updated (only included if user has analytics add-on)
1226
+ */
1227
+ followersLastUpdated?: string;
1228
+ };
1229
+ /**
1230
+ * Telegram channel/group posting settings:
1231
+ * - Supports text, images (up to 10), videos (up to 10), and mixed media albums
1232
+ * - Posts to channels display the channel name and logo as author
1233
+ * - Posts to groups display the bot name (Late) as author
1234
+ * - Message IDs are returned for analytics tracking
1235
+ * - Captions support up to 1024 characters for media posts, 4096 for text-only
1236
+ *
1237
+ * **Analytics:**
1238
+ * - **Not available via API.** The Telegram Bot API does not expose message analytics (views, forwards, reactions).
1239
+ * - View counts are only visible to channel admins directly in the Telegram app.
1240
+ * - This is a Telegram platform limitation that affects all third-party tools.
1241
+ *
1242
+ */
1243
+ type TelegramPlatformData = {
1244
+ /**
1245
+ * Text formatting mode for the message (default is HTML)
1246
+ */
1247
+ parseMode?: 'HTML' | 'Markdown' | 'MarkdownV2';
1248
+ /**
1249
+ * Disable link preview generation for URLs in the message
1250
+ */
1251
+ disableWebPagePreview?: boolean;
1252
+ /**
1253
+ * Send the message silently (users will receive notification without sound)
1254
+ */
1255
+ disableNotification?: boolean;
1256
+ /**
1257
+ * Protect message content from forwarding and saving
1258
+ */
1259
+ protectContent?: boolean;
1260
+ };
1261
+ /**
1262
+ * Text formatting mode for the message (default is HTML)
1263
+ */
1264
+ type parseMode = 'HTML' | 'Markdown' | 'MarkdownV2';
1265
+ /**
1266
+ * Constraints:
1267
+ * - Carousel posts support up to 10 images (no videos in carousels).
1268
+ * - Single posts support one image or one video.
1269
+ * - Videos must be H.264/AAC MP4 format, max 5 minutes duration.
1270
+ * - Images must be JPEG or PNG, max 8 MB each.
1271
+ * - threadItems creates a reply chain (Threads equivalent of Twitter threads).
1272
+ *
1273
+ */
1274
+ type ThreadsPlatformData = {
1275
+ /**
1276
+ * Sequence of posts in a Threads thread (root then replies in order).
1277
+ */
1278
+ threadItems?: Array<{
1279
+ content?: string;
1280
+ mediaItems?: Array<MediaItem>;
1281
+ }>;
1282
+ };
1283
+ /**
1284
+ * TikTok platform-specific settings for video/photo posting.
1285
+ *
1286
+ * **Constraints:**
1287
+ * - Photo carousels support up to 35 images.
1288
+ * - **Title length limits**:
1289
+ * - Videos: up to 2200 chars (full content used as title)
1290
+ * - Photos: content is automatically truncated to 90 chars for title (hashtags/URLs stripped). Use 'description' field for longer text (up to 4000 chars).
1291
+ * - privacyLevel must be chosen from creator_info.privacy_level_options (no defaulting).
1292
+ * - allowDuet and allowStitch required for videos; allowComment for all.
1293
+ * - contentPreviewConfirmed and expressConsentGiven must be true before posting.
1294
+ *
1295
+ * **Note:** Both camelCase and snake_case field names are accepted for backwards compatibility.
1296
+ * The nested `tiktokSettings` object format is also still supported but deprecated.
1297
+ *
1298
+ */
1299
+ type TikTokPlatformData = {
1300
+ /**
1301
+ * When true, Late sends the post to the TikTok Creator Inbox as a draft instead of publishing it immediately. When omitted or false, TikTok uses direct posting (live publish) as usual.
1302
+ *
1303
+ */
1304
+ draft?: boolean;
1305
+ /**
1306
+ * One of the values returned by the TikTok creator info API for the account
1307
+ */
1308
+ privacyLevel?: string;
1309
+ /**
1310
+ * Allow comments on the post
1311
+ */
1312
+ allowComment?: boolean;
1313
+ /**
1314
+ * Allow duets (required for video posts)
1315
+ */
1316
+ allowDuet?: boolean;
1317
+ /**
1318
+ * Allow stitches (required for video posts)
1319
+ */
1320
+ allowStitch?: boolean;
1321
+ /**
1322
+ * Type of commercial content disclosure
1323
+ */
1324
+ commercialContentType?: 'none' | 'brand_organic' | 'brand_content';
1325
+ /**
1326
+ * Whether the post promotes a brand partner
1327
+ */
1328
+ brandPartnerPromote?: boolean;
1329
+ /**
1330
+ * Whether the post is a brand organic post
1331
+ */
1332
+ isBrandOrganicPost?: boolean;
1333
+ /**
1334
+ * User has confirmed they previewed the content
1335
+ */
1336
+ contentPreviewConfirmed?: boolean;
1337
+ /**
1338
+ * User has given express consent for posting
1339
+ */
1340
+ expressConsentGiven?: boolean;
1341
+ /**
1342
+ * Optional override. Defaults based on provided media items.
1343
+ */
1344
+ mediaType?: 'video' | 'photo';
1345
+ /**
1346
+ * Optional for video posts. Timestamp in milliseconds to select which frame to use as thumbnail (defaults to 1000ms/1 second).
1347
+ */
1348
+ videoCoverTimestampMs?: number;
1349
+ /**
1350
+ * Optional for photo carousels. Index of image to use as cover, 0-based (defaults to 0/first image).
1351
+ */
1352
+ photoCoverIndex?: number;
1353
+ /**
1354
+ * When true, TikTok may add recommended music (photos only)
1355
+ */
1356
+ autoAddMusic?: boolean;
1357
+ /**
1358
+ * Set true to disclose AI-generated content
1359
+ */
1360
+ videoMadeWithAi?: boolean;
1361
+ /**
1362
+ * Optional long-form description for photo posts (max 4000 chars).
1363
+ * Recommended for photo posts when content exceeds 90 characters, as photo titles are automatically truncated to 90 chars (after stripping hashtags/URLs).
1364
+ *
1365
+ */
1366
+ description?: string;
1367
+ };
1368
+ /**
1369
+ * Type of commercial content disclosure
1370
+ */
1371
+ type commercialContentType = 'none' | 'brand_organic' | 'brand_content';
1372
+ /**
1373
+ * Optional override. Defaults based on provided media items.
1374
+ */
1375
+ type mediaType = 'video' | 'photo';
1376
+ /**
1377
+ * **DEPRECATED**: Use flat properties directly in TikTokPlatformData instead.
1378
+ * This nested format is supported for backwards compatibility only.
1379
+ *
1380
+ * @deprecated
1381
+ */
1382
+ type TikTokSettings = {
1383
+ privacyLevel?: string;
1384
+ allowComment?: boolean;
1385
+ allowDuet?: boolean;
1386
+ allowStitch?: boolean;
1387
+ commercialContentType?: string;
1388
+ brandPartnerPromote?: boolean;
1389
+ isBrandOrganicPost?: boolean;
1390
+ contentPreviewConfirmed?: boolean;
1391
+ expressConsentGiven?: boolean;
1392
+ mediaType?: string;
1393
+ videoCoverTimestampMs?: number;
1394
+ photoCoverIndex?: number;
1395
+ autoAddMusic?: boolean;
1396
+ videoMadeWithAi?: boolean;
1397
+ description?: string;
1398
+ };
1399
+ type TranscriptResponse = {
1400
+ transcript?: string;
1401
+ segments?: Array<TranscriptSegment>;
1402
+ language?: string;
1403
+ };
1404
+ type TranscriptSegment = {
1405
+ text?: string;
1406
+ start?: number;
1407
+ duration?: number;
1408
+ };
1409
+ type TwitterPlatformData = {
1410
+ /**
1411
+ * Sequence of tweets in a thread. First item is the root tweet.
1412
+ */
1413
+ threadItems?: Array<{
1414
+ content?: string;
1415
+ mediaItems?: Array<MediaItem>;
1416
+ }>;
1417
+ };
1418
+ type UploadedFile = {
1419
+ type?: 'image' | 'video' | 'document';
1420
+ url?: string;
1421
+ filename?: string;
1422
+ size?: number;
1423
+ mimeType?: string;
1424
+ };
1425
+ type type3 = 'image' | 'video' | 'document';
1426
+ type UploadTokenResponse = {
1427
+ token?: string;
1428
+ uploadUrl?: string;
1429
+ expiresAt?: string;
1430
+ status?: 'pending' | 'completed' | 'expired';
1431
+ };
1432
+ type status4 = 'pending' | 'completed' | 'expired';
1433
+ type UploadTokenStatusResponse = {
1434
+ token?: string;
1435
+ status?: 'pending' | 'completed' | 'expired';
1436
+ files?: Array<UploadedFile>;
1437
+ createdAt?: string;
1438
+ expiresAt?: string;
1439
+ completedAt?: string;
1440
+ };
1441
+ type UsageStats = {
1442
+ planName?: string;
1443
+ billingPeriod?: 'monthly' | 'yearly';
1444
+ signupDate?: string;
1445
+ limits?: {
1446
+ uploads?: number;
1447
+ profiles?: number;
1448
+ };
1449
+ usage?: {
1450
+ uploads?: number;
1451
+ profiles?: number;
1452
+ lastReset?: string;
1453
+ };
1454
+ };
1455
+ type billingPeriod = 'monthly' | 'yearly';
1456
+ type User = {
1457
+ _id?: string;
1458
+ email?: string;
1459
+ name?: string;
1460
+ role?: string;
1461
+ createdAt?: string;
1462
+ };
1463
+ type UserGetResponse = {
1464
+ user?: User;
1465
+ };
1466
+ type UsersListResponse = {
1467
+ users?: Array<User>;
1468
+ };
1469
+ /**
1470
+ * Individual webhook configuration for receiving real-time notifications
1471
+ */
1472
+ type Webhook = {
1473
+ /**
1474
+ * Unique webhook identifier
1475
+ */
1476
+ _id?: string;
1477
+ /**
1478
+ * Webhook name (for identification)
1479
+ */
1480
+ name?: string;
1481
+ /**
1482
+ * Webhook endpoint URL
1483
+ */
1484
+ url?: string;
1485
+ /**
1486
+ * Secret key for HMAC-SHA256 signature (not returned in responses for security)
1487
+ */
1488
+ secret?: string;
1489
+ /**
1490
+ * Events subscribed to
1491
+ */
1492
+ events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'account.disconnected')>;
1493
+ /**
1494
+ * Whether webhook delivery is enabled
1495
+ */
1496
+ isActive?: boolean;
1497
+ /**
1498
+ * Timestamp of last successful webhook delivery
1499
+ */
1500
+ lastFiredAt?: string;
1501
+ /**
1502
+ * Consecutive delivery failures (resets on success, webhook disabled at 10)
1503
+ */
1504
+ failureCount?: number;
1505
+ /**
1506
+ * Custom headers included in webhook requests
1507
+ */
1508
+ customHeaders?: {
1509
+ [key: string]: (string);
1510
+ };
1511
+ };
1512
+ /**
1513
+ * Webhook delivery log entry
1514
+ */
1515
+ type WebhookLog = {
1516
+ _id?: string;
1517
+ /**
1518
+ * ID of the webhook that was triggered
1519
+ */
1520
+ webhookId?: string;
1521
+ /**
1522
+ * Name of the webhook that was triggered
1523
+ */
1524
+ webhookName?: string;
1525
+ event?: 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'account.disconnected' | 'webhook.test';
1526
+ url?: string;
1527
+ status?: 'success' | 'failed';
1528
+ /**
1529
+ * HTTP status code from webhook endpoint
1530
+ */
1531
+ statusCode?: number;
1532
+ /**
1533
+ * Payload sent to webhook endpoint
1534
+ */
1535
+ requestPayload?: {
1536
+ [key: string]: unknown;
1537
+ };
1538
+ /**
1539
+ * Response body from webhook endpoint (truncated to 10KB)
1540
+ */
1541
+ responseBody?: string;
1542
+ /**
1543
+ * Error message if delivery failed
1544
+ */
1545
+ errorMessage?: string;
1546
+ /**
1547
+ * Delivery attempt number (max 3 retries)
1548
+ */
1549
+ attemptNumber?: number;
1550
+ /**
1551
+ * Response time in milliseconds
1552
+ */
1553
+ responseTime?: number;
1554
+ createdAt?: string;
1555
+ };
1556
+ type event = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'account.disconnected' | 'webhook.test';
1557
+ type status5 = 'success' | 'failed';
1558
+ /**
1559
+ * Webhook payload for account disconnected events
1560
+ */
1561
+ type WebhookPayloadAccountDisconnected = {
1562
+ event?: 'account.disconnected';
1563
+ account?: {
1564
+ /**
1565
+ * The account's unique identifier (same as used in /v1/accounts/{accountId})
1566
+ */
1567
+ accountId?: string;
1568
+ /**
1569
+ * The profile's unique identifier this account belongs to
1570
+ */
1571
+ profileId?: string;
1572
+ platform?: string;
1573
+ username?: string;
1574
+ displayName?: string;
1575
+ /**
1576
+ * Whether the disconnection was intentional (user action) or unintentional (token expired/revoked)
1577
+ */
1578
+ disconnectionType?: 'intentional' | 'unintentional';
1579
+ /**
1580
+ * Human-readable reason for the disconnection
1581
+ */
1582
+ reason?: string;
1583
+ };
1584
+ timestamp?: string;
1585
+ };
1586
+ type event2 = 'account.disconnected';
1587
+ /**
1588
+ * Whether the disconnection was intentional (user action) or unintentional (token expired/revoked)
1589
+ */
1590
+ type disconnectionType = 'intentional' | 'unintentional';
1591
+ /**
1592
+ * Webhook payload for post events
1593
+ */
1594
+ type WebhookPayloadPost = {
1595
+ event?: 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial';
1596
+ post?: {
1597
+ id?: string;
1598
+ content?: string;
1599
+ status?: string;
1600
+ scheduledFor?: string;
1601
+ publishedAt?: string;
1602
+ platforms?: Array<{
1603
+ platform?: string;
1604
+ status?: string;
1605
+ publishedUrl?: string;
1606
+ error?: string;
1607
+ }>;
1608
+ };
1609
+ timestamp?: string;
1610
+ };
1611
+ type event3 = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial';
1612
+ type YouTubeDailyViewsResponse = {
1613
+ success?: boolean;
1614
+ /**
1615
+ * The YouTube video ID
1616
+ */
1617
+ videoId?: string;
1618
+ dateRange?: {
1619
+ startDate?: string;
1620
+ endDate?: string;
1621
+ };
1622
+ /**
1623
+ * Sum of views across all days in the range
1624
+ */
1625
+ totalViews?: number;
1626
+ dailyViews?: Array<{
1627
+ date?: string;
1628
+ views?: number;
1629
+ estimatedMinutesWatched?: number;
1630
+ /**
1631
+ * Average view duration in seconds
1632
+ */
1633
+ averageViewDuration?: number;
1634
+ subscribersGained?: number;
1635
+ subscribersLost?: number;
1636
+ likes?: number;
1637
+ comments?: number;
1638
+ shares?: number;
1639
+ }>;
1640
+ /**
1641
+ * When the data was last synced from YouTube
1642
+ */
1643
+ lastSyncedAt?: (string) | null;
1644
+ scopeStatus?: {
1645
+ hasAnalyticsScope?: boolean;
1646
+ };
1647
+ };
1648
+ /**
1649
+ * YouTube video upload settings:
1650
+ * - Videos ≤ 3 minutes are automatically detected as YouTube Shorts
1651
+ * - Videos > 3 minutes become regular YouTube videos
1652
+ * - Custom thumbnails supported for regular videos (via mediaItem.thumbnail)
1653
+ * - Custom thumbnails NOT supported for Shorts via API
1654
+ * - Scheduled videos are uploaded immediately as the specified visibility and published at scheduled time
1655
+ * - Visibility defaults to "public" if not specified
1656
+ * - Set containsSyntheticMedia: true if your video contains AI-generated content
1657
+ *
1658
+ */
1659
+ type YouTubePlatformData = {
1660
+ /**
1661
+ * Video title. Defaults to first line of content or "Untitled Video". Must be ≤ 100 characters.
1662
+ */
1663
+ title?: string;
1664
+ /**
1665
+ * Video visibility setting:
1666
+ * - public: Anyone can search for and watch (default)
1667
+ * - unlisted: Only people with the link can watch
1668
+ * - private: Only you and people you specifically share with can watch
1669
+ *
1670
+ */
1671
+ visibility?: 'public' | 'private' | 'unlisted';
1672
+ /**
1673
+ * Optional first comment to post immediately after video upload. Up to 10,000 characters (YouTube's comment limit).
1674
+ */
1675
+ firstComment?: string;
1676
+ /**
1677
+ * AI-generated content disclosure flag. Set to true if your video contains AI-generated or synthetic content
1678
+ * that could be mistaken for real people, places, or events. This helps viewers understand when realistic
1679
+ * content has been created or altered using AI. YouTube may add a label to videos when this is set.
1680
+ * Added to YouTube Data API in October 2024.
1681
+ *
1682
+ */
1683
+ containsSyntheticMedia?: boolean;
1684
+ };
1685
+ type YouTubeScopeMissingResponse = {
1686
+ success?: boolean;
1687
+ error?: string;
1688
+ code?: string;
1689
+ scopeStatus?: {
1690
+ hasAnalyticsScope?: boolean;
1691
+ requiresReauthorization?: boolean;
1692
+ /**
1693
+ * URL to redirect user for reauthorization
1694
+ */
1695
+ reauthorizeUrl?: string;
1696
+ };
1697
+ };
1698
+ type GetV1ToolsYoutubeDownloadData = {
1699
+ query: {
1700
+ /**
1701
+ * Action to perform: 'download' returns download URL, 'formats' lists available formats
1702
+ */
1703
+ action?: 'download' | 'formats';
1704
+ /**
1705
+ * Desired format (when action=download)
1706
+ */
1707
+ format?: 'video' | 'audio';
1708
+ /**
1709
+ * Specific format ID from formats list
1710
+ */
1711
+ formatId?: string;
1712
+ /**
1713
+ * Desired quality (when action=download)
1714
+ */
1715
+ quality?: 'hd' | 'sd';
1716
+ /**
1717
+ * YouTube video URL or video ID
1718
+ */
1719
+ url: string;
1720
+ };
1721
+ };
1722
+ type GetV1ToolsYoutubeDownloadResponse = ({
1723
+ success?: boolean;
1724
+ title?: string;
1725
+ downloadUrl?: string;
1726
+ formats?: Array<{
1727
+ id?: string;
1728
+ label?: string;
1729
+ ext?: string;
1730
+ type?: string;
1731
+ height?: number;
1732
+ width?: number;
1733
+ }>;
1734
+ });
1735
+ type GetV1ToolsYoutubeDownloadError = ({
1736
+ error?: string;
1737
+ } | unknown);
1738
+ type GetV1ToolsYoutubeTranscriptData = {
1739
+ query: {
1740
+ /**
1741
+ * Language code for transcript
1742
+ */
1743
+ lang?: string;
1744
+ /**
1745
+ * YouTube video URL or video ID
1746
+ */
1747
+ url: string;
1748
+ };
1749
+ };
1750
+ type GetV1ToolsYoutubeTranscriptResponse = ({
1751
+ success?: boolean;
1752
+ videoId?: string;
1753
+ language?: string;
1754
+ fullText?: string;
1755
+ segments?: Array<{
1756
+ text?: string;
1757
+ start?: number;
1758
+ duration?: number;
1759
+ }>;
1760
+ });
1761
+ type GetV1ToolsYoutubeTranscriptError = (unknown);
1762
+ type GetV1ToolsInstagramDownloadData = {
1763
+ query: {
1764
+ /**
1765
+ * Instagram reel or post URL
1766
+ */
1767
+ url: string;
1768
+ };
1769
+ };
1770
+ type GetV1ToolsInstagramDownloadResponse = ({
1771
+ success?: boolean;
1772
+ title?: string;
1773
+ downloadUrl?: string;
1774
+ });
1775
+ type GetV1ToolsInstagramDownloadError = unknown;
1776
+ type PostV1ToolsInstagramHashtagCheckerData = {
1777
+ body: {
1778
+ hashtags: Array<(string)>;
1779
+ };
1780
+ };
1781
+ type PostV1ToolsInstagramHashtagCheckerResponse = ({
1782
+ success?: boolean;
1783
+ results?: Array<{
1784
+ hashtag?: string;
1785
+ status?: 'banned' | 'restricted' | 'safe' | 'unknown';
1786
+ reason?: string;
1787
+ confidence?: number;
1788
+ }>;
1789
+ summary?: {
1790
+ banned?: number;
1791
+ restricted?: number;
1792
+ safe?: number;
1793
+ };
1794
+ });
1795
+ type PostV1ToolsInstagramHashtagCheckerError = unknown;
1796
+ type GetV1ToolsTiktokDownloadData = {
1797
+ query: {
1798
+ /**
1799
+ * 'formats' to list available formats
1800
+ */
1801
+ action?: 'download' | 'formats';
1802
+ /**
1803
+ * Specific format ID (0 = no watermark, etc.)
1804
+ */
1805
+ formatId?: string;
1806
+ /**
1807
+ * TikTok video URL or ID
1808
+ */
1809
+ url: string;
1810
+ };
1811
+ };
1812
+ type GetV1ToolsTiktokDownloadResponse = ({
1813
+ success?: boolean;
1814
+ title?: string;
1815
+ downloadUrl?: string;
1816
+ formats?: Array<{
1817
+ id?: string;
1818
+ label?: string;
1819
+ ext?: string;
1820
+ }>;
1821
+ });
1822
+ type GetV1ToolsTiktokDownloadError = unknown;
1823
+ type GetV1ToolsTwitterDownloadData = {
1824
+ query: {
1825
+ action?: 'download' | 'formats';
1826
+ formatId?: string;
1827
+ /**
1828
+ * Twitter/X post URL
1829
+ */
1830
+ url: string;
1831
+ };
1832
+ };
1833
+ type GetV1ToolsTwitterDownloadResponse = ({
1834
+ success?: boolean;
1835
+ title?: string;
1836
+ downloadUrl?: string;
1837
+ });
1838
+ type GetV1ToolsTwitterDownloadError = unknown;
1839
+ type GetV1ToolsFacebookDownloadData = {
1840
+ query: {
1841
+ /**
1842
+ * Facebook video or reel URL
1843
+ */
1844
+ url: string;
1845
+ };
1846
+ };
1847
+ type GetV1ToolsFacebookDownloadResponse = ({
1848
+ success?: boolean;
1849
+ title?: string;
1850
+ downloadUrl?: string;
1851
+ thumbnail?: string;
1852
+ });
1853
+ type GetV1ToolsFacebookDownloadError = unknown;
1854
+ type GetV1ToolsLinkedinDownloadData = {
1855
+ query: {
1856
+ /**
1857
+ * LinkedIn post URL
1858
+ */
1859
+ url: string;
1860
+ };
1861
+ };
1862
+ type GetV1ToolsLinkedinDownloadResponse = ({
1863
+ success?: boolean;
1864
+ title?: string;
1865
+ downloadUrl?: string;
1866
+ });
1867
+ type GetV1ToolsLinkedinDownloadError = unknown;
1868
+ type GetV1ToolsBlueskyDownloadData = {
1869
+ query: {
1870
+ /**
1871
+ * Bluesky post URL
1872
+ */
1873
+ url: string;
1874
+ };
1875
+ };
1876
+ type GetV1ToolsBlueskyDownloadResponse = ({
1877
+ success?: boolean;
1878
+ title?: string;
1879
+ text?: string;
1880
+ downloadUrl?: string;
1881
+ thumbnail?: string;
1882
+ });
1883
+ type GetV1ToolsBlueskyDownloadError = unknown;
1884
+ type GetV1AnalyticsData = {
1885
+ query?: {
1886
+ /**
1887
+ * Inclusive lower bound
1888
+ */
1889
+ fromDate?: string;
1890
+ /**
1891
+ * Page size (default 50)
1892
+ */
1893
+ limit?: number;
1894
+ /**
1895
+ * Sort order
1896
+ */
1897
+ order?: 'asc' | 'desc';
1898
+ /**
1899
+ * Page number (default 1)
1900
+ */
1901
+ page?: number;
1902
+ /**
1903
+ * Filter by platform (default "all")
1904
+ */
1905
+ platform?: string;
1906
+ /**
1907
+ * Returns analytics for a single post. Accepts both Late Post IDs (from `POST /v1/posts`)
1908
+ * and External Post IDs (from this endpoint's list response). The API automatically
1909
+ * resolves Late Post IDs to their corresponding External Post analytics.
1910
+ *
1911
+ */
1912
+ postId?: string;
1913
+ /**
1914
+ * Filter by profile ID (default "all")
1915
+ */
1916
+ profileId?: string;
1917
+ /**
1918
+ * Sort by date or engagement
1919
+ */
1920
+ sortBy?: 'date' | 'engagement';
1921
+ /**
1922
+ * Inclusive upper bound
1923
+ */
1924
+ toDate?: string;
1925
+ };
1926
+ };
1927
+ type GetV1AnalyticsResponse = ((AnalyticsSinglePostResponse | AnalyticsListResponse));
1928
+ type GetV1AnalyticsError = ({
1929
+ error?: string;
1930
+ } | {
1931
+ error?: string;
1932
+ code?: string;
1933
+ } | ErrorResponse);
1934
+ type GetV1AnalyticsYoutubeDailyViewsData = {
1935
+ query: {
1936
+ /**
1937
+ * The Late account ID for the YouTube account
1938
+ */
1939
+ accountId: string;
1940
+ /**
1941
+ * End date (YYYY-MM-DD). Defaults to 3 days ago (YouTube data latency).
1942
+ */
1943
+ endDate?: string;
1944
+ /**
1945
+ * Start date (YYYY-MM-DD). Defaults to 30 days ago.
1946
+ */
1947
+ startDate?: string;
1948
+ /**
1949
+ * The YouTube video ID (e.g., "dQw4w9WgXcQ")
1950
+ */
1951
+ videoId: string;
1952
+ };
1953
+ };
1954
+ type GetV1AnalyticsYoutubeDailyViewsResponse = (YouTubeDailyViewsResponse);
1955
+ type GetV1AnalyticsYoutubeDailyViewsError = ({
1956
+ error?: string;
1957
+ } | {
1958
+ error?: string;
1959
+ code?: string;
1960
+ } | YouTubeScopeMissingResponse | {
1961
+ success?: boolean;
1962
+ error?: string;
1963
+ });
1964
+ type GetV1AccountGroupsResponse = ({
1965
+ groups?: Array<{
1966
+ _id?: string;
1967
+ name?: string;
1968
+ accountIds?: Array<(string)>;
1969
+ }>;
1970
+ });
1971
+ type GetV1AccountGroupsError = ({
1972
+ error?: string;
1973
+ });
1974
+ type PostV1AccountGroupsData = {
1975
+ body: {
1976
+ name: string;
1977
+ accountIds: Array<(string)>;
1978
+ };
1979
+ };
1980
+ type PostV1AccountGroupsResponse = ({
1981
+ message?: string;
1982
+ group?: {
1983
+ _id?: string;
1984
+ name?: string;
1985
+ accountIds?: Array<(string)>;
1986
+ };
1987
+ });
1988
+ type PostV1AccountGroupsError = (unknown | {
1989
+ error?: string;
1990
+ });
1991
+ type PutV1AccountGroupsByGroupIdData = {
1992
+ body: {
1993
+ name?: string;
1994
+ accountIds?: Array<(string)>;
1995
+ };
1996
+ path: {
1997
+ groupId: string;
1998
+ };
1999
+ };
2000
+ type PutV1AccountGroupsByGroupIdResponse = ({
2001
+ message?: string;
2002
+ group?: {
2003
+ [key: string]: unknown;
2004
+ };
2005
+ });
2006
+ type PutV1AccountGroupsByGroupIdError = ({
2007
+ error?: string;
2008
+ } | unknown);
2009
+ type DeleteV1AccountGroupsByGroupIdData = {
2010
+ path: {
2011
+ groupId: string;
2012
+ };
2013
+ };
2014
+ type DeleteV1AccountGroupsByGroupIdResponse = ({
2015
+ message?: string;
2016
+ });
2017
+ type DeleteV1AccountGroupsByGroupIdError = ({
2018
+ error?: string;
2019
+ });
2020
+ type PostV1MediaPresignData = {
2021
+ body: {
2022
+ /**
2023
+ * Name of the file to upload
2024
+ */
2025
+ filename: string;
2026
+ /**
2027
+ * MIME type of the file
2028
+ */
2029
+ contentType: 'image/jpeg' | 'image/jpg' | 'image/png' | 'image/webp' | 'image/gif' | 'video/mp4' | 'video/mpeg' | 'video/quicktime' | 'video/avi' | 'video/x-msvideo' | 'video/webm' | 'video/x-m4v' | 'application/pdf';
2030
+ /**
2031
+ * Optional file size in bytes for pre-validation (max 5GB)
2032
+ */
2033
+ size?: number;
2034
+ };
2035
+ };
2036
+ type PostV1MediaPresignResponse = ({
2037
+ /**
2038
+ * Presigned URL to PUT your file to (expires in 1 hour)
2039
+ */
2040
+ uploadUrl?: string;
2041
+ /**
2042
+ * Public URL where the file will be accessible after upload
2043
+ */
2044
+ publicUrl?: string;
2045
+ /**
2046
+ * Storage key/path of the file
2047
+ */
2048
+ key?: string;
2049
+ /**
2050
+ * Detected file type based on content type
2051
+ */
2052
+ type?: 'image' | 'video' | 'document';
2053
+ });
2054
+ type PostV1MediaPresignError = ({
2055
+ error?: string;
2056
+ });
2057
+ type GetV1RedditSearchData = {
2058
+ query: {
2059
+ accountId: string;
2060
+ after?: string;
2061
+ limit?: number;
2062
+ q: string;
2063
+ restrict_sr?: '0' | '1';
2064
+ sort?: 'relevance' | 'hot' | 'top' | 'new' | 'comments';
2065
+ subreddit?: string;
2066
+ };
2067
+ };
2068
+ type GetV1RedditSearchResponse = ({
2069
+ posts?: Array<{
2070
+ id?: string;
2071
+ title?: string;
2072
+ selftext?: string;
2073
+ author?: string;
2074
+ subreddit?: string;
2075
+ score?: number;
2076
+ num_comments?: number;
2077
+ created_utc?: number;
2078
+ permalink?: string;
2079
+ }>;
2080
+ after?: string;
2081
+ });
2082
+ type GetV1RedditSearchError = (unknown | {
2083
+ error?: string;
2084
+ });
2085
+ type GetV1RedditFeedData = {
2086
+ query: {
2087
+ accountId: string;
2088
+ after?: string;
2089
+ limit?: number;
2090
+ sort?: 'hot' | 'new' | 'top' | 'rising';
2091
+ subreddit?: string;
2092
+ t?: 'hour' | 'day' | 'week' | 'month' | 'year' | 'all';
2093
+ };
2094
+ };
2095
+ type GetV1RedditFeedResponse = ({
2096
+ posts?: Array<{
2097
+ [key: string]: unknown;
2098
+ }>;
2099
+ after?: string;
2100
+ });
2101
+ type GetV1RedditFeedError = (unknown | {
2102
+ error?: string;
2103
+ });
2104
+ type GetV1UsageStatsResponse = (UsageStats);
2105
+ type GetV1UsageStatsError = ({
2106
+ error?: string;
2107
+ });
2108
+ type GetV1PostsData = {
2109
+ query?: {
2110
+ createdBy?: string;
2111
+ dateFrom?: string;
2112
+ dateTo?: string;
2113
+ includeHidden?: boolean;
2114
+ /**
2115
+ * Page size
2116
+ */
2117
+ limit?: number;
2118
+ /**
2119
+ * Page number (1-based)
2120
+ */
2121
+ page?: number;
2122
+ platform?: string;
2123
+ profileId?: string;
2124
+ status?: 'draft' | 'scheduled' | 'published' | 'failed';
2125
+ };
2126
+ };
2127
+ type GetV1PostsResponse = (PostsListResponse);
2128
+ type GetV1PostsError = ({
2129
+ error?: string;
2130
+ });
2131
+ type PostV1PostsData = {
2132
+ body: {
2133
+ title?: string;
2134
+ content?: string;
2135
+ mediaItems?: Array<{
2136
+ type?: 'image' | 'video' | 'gif' | 'document';
2137
+ url?: string;
2138
+ }>;
2139
+ platforms?: Array<{
2140
+ platform?: string;
2141
+ accountId?: string;
2142
+ customContent?: string;
2143
+ customMedia?: Array<{
2144
+ type?: 'image' | 'video' | 'gif' | 'document';
2145
+ url?: string;
2146
+ }>;
2147
+ /**
2148
+ * Optional per-platform scheduled time override. When omitted, the top-level scheduledFor is used.
2149
+ */
2150
+ scheduledFor?: string;
2151
+ platformSpecificData?: (TwitterPlatformData | ThreadsPlatformData | FacebookPlatformData | InstagramPlatformData | LinkedInPlatformData | PinterestPlatformData | YouTubePlatformData | TikTokPlatformData | TelegramPlatformData | SnapchatPlatformData);
2152
+ }>;
2153
+ scheduledFor?: string;
2154
+ publishNow?: boolean;
2155
+ isDraft?: boolean;
2156
+ timezone?: string;
2157
+ /**
2158
+ * Tags/keywords for the post. YouTube-specific constraints:
2159
+ * - No count limit; duplicates are automatically removed
2160
+ * - Each tag must be ≤ 100 characters
2161
+ * - Combined total across all tags ≤ 500 characters (YouTube's limit)
2162
+ *
2163
+ */
2164
+ tags?: Array<(string)>;
2165
+ hashtags?: Array<(string)>;
2166
+ mentions?: Array<(string)>;
2167
+ crosspostingEnabled?: boolean;
2168
+ metadata?: {
2169
+ [key: string]: unknown;
2170
+ };
2171
+ /**
2172
+ * Profile ID to schedule via queue. When provided without scheduledFor,
2173
+ * the post will be automatically assigned to the next available slot
2174
+ * from the profile's default queue (or the queue specified by queueId).
2175
+ *
2176
+ */
2177
+ queuedFromProfile?: string;
2178
+ /**
2179
+ * Specific queue ID to use when scheduling via queue.
2180
+ * Only used when queuedFromProfile is also provided.
2181
+ * If omitted, uses the profile's default queue.
2182
+ *
2183
+ */
2184
+ queueId?: string;
2185
+ };
2186
+ };
2187
+ type PostV1PostsResponse = (PostCreateResponse);
2188
+ type PostV1PostsError = ({
2189
+ error?: string;
2190
+ });
2191
+ type GetV1PostsByPostIdData = {
2192
+ path: {
2193
+ postId: string;
2194
+ };
2195
+ };
2196
+ type GetV1PostsByPostIdResponse = (PostGetResponse);
2197
+ type GetV1PostsByPostIdError = ({
2198
+ error?: string;
2199
+ } | unknown);
2200
+ type PutV1PostsByPostIdData = {
2201
+ body: {
2202
+ [key: string]: unknown;
2203
+ };
2204
+ path: {
2205
+ postId: string;
2206
+ };
2207
+ };
2208
+ type PutV1PostsByPostIdResponse = (PostUpdateResponse | unknown);
2209
+ type PutV1PostsByPostIdError = (unknown | {
2210
+ error?: string;
2211
+ });
2212
+ type DeleteV1PostsByPostIdData = {
2213
+ path: {
2214
+ postId: string;
2215
+ };
2216
+ };
2217
+ type DeleteV1PostsByPostIdResponse = (PostDeleteResponse);
2218
+ type DeleteV1PostsByPostIdError = (unknown | {
2219
+ error?: string;
2220
+ });
2221
+ type PostV1PostsBulkUploadData = {
2222
+ body: {
2223
+ file?: (Blob | File);
2224
+ };
2225
+ query?: {
2226
+ dryRun?: boolean;
2227
+ };
2228
+ };
2229
+ type PostV1PostsBulkUploadResponse = ({
2230
+ success?: boolean;
2231
+ totalRows?: number;
2232
+ created?: number;
2233
+ failed?: number;
2234
+ errors?: Array<{
2235
+ row?: number;
2236
+ error?: string;
2237
+ }>;
2238
+ posts?: Array<Post>;
2239
+ } | unknown);
2240
+ type PostV1PostsBulkUploadError = (unknown | {
2241
+ error?: string;
2242
+ });
2243
+ type PostV1PostsByPostIdRetryData = {
2244
+ path: {
2245
+ postId: string;
2246
+ };
2247
+ };
2248
+ type PostV1PostsByPostIdRetryResponse = (PostRetryResponse | unknown);
2249
+ type PostV1PostsByPostIdRetryError = (unknown | {
2250
+ error?: string;
2251
+ });
2252
+ type GetV1UsersResponse = ({
2253
+ currentUserId?: string;
2254
+ users?: Array<{
2255
+ _id?: string;
2256
+ name?: string;
2257
+ email?: string;
2258
+ role?: string;
2259
+ isRoot?: boolean;
2260
+ profileAccess?: Array<(string)>;
2261
+ createdAt?: string;
2262
+ }>;
2263
+ });
2264
+ type GetV1UsersError = ({
2265
+ error?: string;
2266
+ });
2267
+ type GetV1UsersByUserIdData = {
2268
+ path: {
2269
+ userId: string;
2270
+ };
2271
+ };
2272
+ type GetV1UsersByUserIdResponse = ({
2273
+ user?: {
2274
+ _id?: string;
2275
+ name?: string;
2276
+ email?: string;
2277
+ role?: string;
2278
+ isRoot?: boolean;
2279
+ profileAccess?: Array<(string)>;
2280
+ };
2281
+ });
2282
+ type GetV1UsersByUserIdError = ({
2283
+ error?: string;
2284
+ } | unknown);
2285
+ type GetV1ProfilesData = {
2286
+ query?: {
2287
+ /**
2288
+ * When true, includes profiles that exceed the user's plan limit.
2289
+ * Over-limit profiles will have `isOverLimit: true` in the response.
2290
+ * Useful for managing/deleting profiles after a plan downgrade.
2291
+ *
2292
+ */
2293
+ includeOverLimit?: boolean;
2294
+ };
2295
+ };
2296
+ type GetV1ProfilesResponse = (ProfilesListResponse);
2297
+ type GetV1ProfilesError = ({
2298
+ error?: string;
2299
+ });
2300
+ type PostV1ProfilesData = {
2301
+ body: {
2302
+ name: string;
2303
+ description?: string;
2304
+ color?: string;
2305
+ };
2306
+ };
2307
+ type PostV1ProfilesResponse = (ProfileCreateResponse);
2308
+ type PostV1ProfilesError = (unknown | {
2309
+ error?: string;
2310
+ });
2311
+ type GetV1ProfilesByProfileIdData = {
2312
+ path: {
2313
+ profileId: string;
2314
+ };
2315
+ };
2316
+ type GetV1ProfilesByProfileIdResponse = ({
2317
+ profile?: Profile;
2318
+ });
2319
+ type GetV1ProfilesByProfileIdError = ({
2320
+ error?: string;
2321
+ });
2322
+ type PutV1ProfilesByProfileIdData = {
2323
+ body: {
2324
+ name?: string;
2325
+ description?: string;
2326
+ color?: string;
2327
+ isDefault?: boolean;
2328
+ };
2329
+ path: {
2330
+ profileId: string;
2331
+ };
2332
+ };
2333
+ type PutV1ProfilesByProfileIdResponse = ({
2334
+ message?: string;
2335
+ profile?: Profile;
2336
+ });
2337
+ type PutV1ProfilesByProfileIdError = ({
2338
+ error?: string;
2339
+ });
2340
+ type DeleteV1ProfilesByProfileIdData = {
2341
+ path: {
2342
+ profileId: string;
2343
+ };
2344
+ };
2345
+ type DeleteV1ProfilesByProfileIdResponse = ({
2346
+ message?: string;
2347
+ });
2348
+ type DeleteV1ProfilesByProfileIdError = (unknown | {
2349
+ error?: string;
2350
+ });
2351
+ type GetV1AccountsData = {
2352
+ query?: {
2353
+ /**
2354
+ * When true, includes accounts from profiles that exceed the user's plan limit.
2355
+ * Useful for disconnecting accounts from over-limit profiles so they can be deleted.
2356
+ *
2357
+ */
2358
+ includeOverLimit?: boolean;
2359
+ /**
2360
+ * Filter accounts by profile ID
2361
+ */
2362
+ profileId?: string;
2363
+ };
2364
+ };
2365
+ type GetV1AccountsResponse = ({
2366
+ accounts?: Array<SocialAccount>;
2367
+ /**
2368
+ * Whether user has analytics add-on access
2369
+ */
2370
+ hasAnalyticsAccess?: boolean;
2371
+ });
2372
+ type GetV1AccountsError = ({
2373
+ error?: string;
2374
+ });
2375
+ type GetV1AccountsFollowerStatsData = {
2376
+ query?: {
2377
+ /**
2378
+ * Comma-separated list of account IDs (optional, defaults to all user's accounts)
2379
+ */
2380
+ accountIds?: string;
2381
+ /**
2382
+ * Start date in YYYY-MM-DD format (defaults to 30 days ago)
2383
+ */
2384
+ fromDate?: string;
2385
+ /**
2386
+ * Data aggregation level
2387
+ */
2388
+ granularity?: 'daily' | 'weekly' | 'monthly';
2389
+ /**
2390
+ * Filter by profile ID
2391
+ */
2392
+ profileId?: string;
2393
+ /**
2394
+ * End date in YYYY-MM-DD format (defaults to today)
2395
+ */
2396
+ toDate?: string;
2397
+ };
2398
+ };
2399
+ type GetV1AccountsFollowerStatsResponse = ({
2400
+ accounts?: Array<AccountWithFollowerStats>;
2401
+ stats?: {
2402
+ [key: string]: Array<{
2403
+ date?: string;
2404
+ followers?: number;
2405
+ }>;
2406
+ };
2407
+ dateRange?: {
2408
+ from?: string;
2409
+ to?: string;
2410
+ };
2411
+ granularity?: string;
2412
+ });
2413
+ type GetV1AccountsFollowerStatsError = ({
2414
+ error?: string;
2415
+ } | {
2416
+ error?: string;
2417
+ message?: string;
2418
+ requiresAddon?: boolean;
2419
+ });
2420
+ type PutV1AccountsByAccountIdData = {
2421
+ body: {
2422
+ username?: string;
2423
+ displayName?: string;
2424
+ };
2425
+ path: {
2426
+ accountId: string;
2427
+ };
2428
+ };
2429
+ type PutV1AccountsByAccountIdResponse = ({
2430
+ message?: string;
2431
+ username?: string;
2432
+ displayName?: string;
2433
+ });
2434
+ type PutV1AccountsByAccountIdError = (unknown | {
2435
+ error?: string;
2436
+ });
2437
+ type DeleteV1AccountsByAccountIdData = {
2438
+ path: {
2439
+ accountId: string;
2440
+ };
2441
+ };
2442
+ type DeleteV1AccountsByAccountIdResponse = ({
2443
+ message?: string;
2444
+ });
2445
+ type DeleteV1AccountsByAccountIdError = ({
2446
+ error?: string;
2447
+ });
2448
+ type GetV1AccountsHealthData = {
2449
+ query?: {
2450
+ /**
2451
+ * Filter by platform
2452
+ */
2453
+ platform?: 'facebook' | 'instagram' | 'linkedin' | 'twitter' | 'tiktok' | 'youtube' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat';
2454
+ /**
2455
+ * Filter by profile ID
2456
+ */
2457
+ profileId?: string;
2458
+ /**
2459
+ * Filter by health status
2460
+ */
2461
+ status?: 'healthy' | 'warning' | 'error';
2462
+ };
2463
+ };
2464
+ type GetV1AccountsHealthResponse = ({
2465
+ summary?: {
2466
+ /**
2467
+ * Total number of accounts
2468
+ */
2469
+ total?: number;
2470
+ /**
2471
+ * Number of healthy accounts
2472
+ */
2473
+ healthy?: number;
2474
+ /**
2475
+ * Number of accounts with warnings
2476
+ */
2477
+ warning?: number;
2478
+ /**
2479
+ * Number of accounts with errors
2480
+ */
2481
+ error?: number;
2482
+ /**
2483
+ * Number of accounts needing reconnection
2484
+ */
2485
+ needsReconnect?: number;
2486
+ };
2487
+ accounts?: Array<{
2488
+ accountId?: string;
2489
+ platform?: string;
2490
+ username?: string;
2491
+ displayName?: string;
2492
+ profileId?: string;
2493
+ status?: 'healthy' | 'warning' | 'error';
2494
+ canPost?: boolean;
2495
+ canFetchAnalytics?: boolean;
2496
+ tokenValid?: boolean;
2497
+ tokenExpiresAt?: string;
2498
+ needsReconnect?: boolean;
2499
+ issues?: Array<(string)>;
2500
+ }>;
2501
+ });
2502
+ type GetV1AccountsHealthError = ({
2503
+ error?: string;
2504
+ });
2505
+ type GetV1AccountsByAccountIdHealthData = {
2506
+ path: {
2507
+ /**
2508
+ * The account ID to check
2509
+ */
2510
+ accountId: string;
2511
+ };
2512
+ };
2513
+ type GetV1AccountsByAccountIdHealthResponse = ({
2514
+ accountId?: string;
2515
+ platform?: string;
2516
+ username?: string;
2517
+ displayName?: string;
2518
+ /**
2519
+ * Overall health status
2520
+ */
2521
+ status?: 'healthy' | 'warning' | 'error';
2522
+ tokenStatus?: {
2523
+ /**
2524
+ * Whether the token is valid
2525
+ */
2526
+ valid?: boolean;
2527
+ expiresAt?: string;
2528
+ /**
2529
+ * Human-readable time until expiry
2530
+ */
2531
+ expiresIn?: string;
2532
+ /**
2533
+ * Whether token expires within 24 hours
2534
+ */
2535
+ needsRefresh?: boolean;
2536
+ };
2537
+ permissions?: {
2538
+ posting?: Array<{
2539
+ scope?: string;
2540
+ granted?: boolean;
2541
+ required?: boolean;
2542
+ }>;
2543
+ analytics?: Array<{
2544
+ scope?: string;
2545
+ granted?: boolean;
2546
+ required?: boolean;
2547
+ }>;
2548
+ optional?: Array<{
2549
+ scope?: string;
2550
+ granted?: boolean;
2551
+ required?: boolean;
2552
+ }>;
2553
+ canPost?: boolean;
2554
+ canFetchAnalytics?: boolean;
2555
+ missingRequired?: Array<(string)>;
2556
+ };
2557
+ /**
2558
+ * List of issues found
2559
+ */
2560
+ issues?: Array<(string)>;
2561
+ /**
2562
+ * Actionable recommendations to fix issues
2563
+ */
2564
+ recommendations?: Array<(string)>;
2565
+ });
2566
+ type GetV1AccountsByAccountIdHealthError = ({
2567
+ error?: string;
2568
+ });
2569
+ type GetV1ApiKeysResponse = ({
2570
+ apiKeys?: Array<ApiKey>;
2571
+ });
2572
+ type GetV1ApiKeysError = ({
2573
+ error?: string;
2574
+ });
2575
+ type PostV1ApiKeysData = {
2576
+ body: {
2577
+ name: string;
2578
+ /**
2579
+ * Days until expiry
2580
+ */
2581
+ expiresIn?: number;
2582
+ };
2583
+ };
2584
+ type PostV1ApiKeysResponse = ({
2585
+ message?: string;
2586
+ apiKey?: ApiKey;
2587
+ });
2588
+ type PostV1ApiKeysError = (unknown | {
2589
+ error?: string;
2590
+ });
2591
+ type DeleteV1ApiKeysByKeyIdData = {
2592
+ path: {
2593
+ keyId: string;
2594
+ };
2595
+ };
2596
+ type DeleteV1ApiKeysByKeyIdResponse = ({
2597
+ message?: string;
2598
+ });
2599
+ type DeleteV1ApiKeysByKeyIdError = ({
2600
+ error?: string;
2601
+ });
2602
+ type PostV1InviteTokensData = {
2603
+ body: {
2604
+ /**
2605
+ * 'all' grants access to all profiles, 'profiles' restricts to specific profiles
2606
+ */
2607
+ scope: 'all' | 'profiles';
2608
+ /**
2609
+ * Required if scope is 'profiles'. Array of profile IDs to grant access to.
2610
+ */
2611
+ profileIds?: Array<(string)>;
2612
+ };
2613
+ };
2614
+ type PostV1InviteTokensResponse = ({
2615
+ token?: string;
2616
+ scope?: string;
2617
+ invitedProfileIds?: Array<(string)>;
2618
+ expiresAt?: string;
2619
+ inviteUrl?: string;
2620
+ });
2621
+ type PostV1InviteTokensError = (unknown | {
2622
+ error?: string;
2623
+ });
2624
+ type GetV1PlatformInvitesData = {
2625
+ query?: {
2626
+ /**
2627
+ * Optional. Filter invites by profile ID
2628
+ */
2629
+ profileId?: string;
2630
+ };
2631
+ };
2632
+ type GetV1PlatformInvitesResponse = ({
2633
+ invites?: Array<{
2634
+ _id?: string;
2635
+ token?: string;
2636
+ userId?: string;
2637
+ /**
2638
+ * Populated profile object (not a string ID)
2639
+ */
2640
+ profileId?: {
2641
+ _id?: string;
2642
+ name?: string;
2643
+ };
2644
+ platform?: string;
2645
+ inviterName?: string;
2646
+ inviterEmail?: string;
2647
+ expiresAt?: string;
2648
+ isUsed?: boolean;
2649
+ createdAt?: string;
2650
+ }>;
2651
+ });
2652
+ type GetV1PlatformInvitesError = ({
2653
+ error?: string;
2654
+ });
2655
+ type PostV1PlatformInvitesData = {
2656
+ body: {
2657
+ /**
2658
+ * Profile ID to connect the account to
2659
+ */
2660
+ profileId: string;
2661
+ /**
2662
+ * Platform to connect
2663
+ */
2664
+ platform: 'facebook' | 'instagram' | 'linkedin' | 'twitter' | 'threads' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat';
2665
+ };
2666
+ };
2667
+ type PostV1PlatformInvitesResponse = ({
2668
+ invite?: {
2669
+ _id?: string;
2670
+ token?: string;
2671
+ userId?: string;
2672
+ /**
2673
+ * Populated profile object (not a string ID)
2674
+ */
2675
+ profileId?: {
2676
+ _id?: string;
2677
+ name?: string;
2678
+ };
2679
+ platform?: string;
2680
+ inviterName?: string;
2681
+ inviterEmail?: string;
2682
+ expiresAt?: string;
2683
+ isUsed?: boolean;
2684
+ createdAt?: string;
2685
+ inviteUrl?: string;
2686
+ };
2687
+ });
2688
+ type PostV1PlatformInvitesError = (unknown | {
2689
+ error?: string;
2690
+ });
2691
+ type DeleteV1PlatformInvitesData = {
2692
+ query: {
2693
+ /**
2694
+ * Invite ID to revoke
2695
+ */
2696
+ id: string;
2697
+ };
2698
+ };
2699
+ type DeleteV1PlatformInvitesResponse = ({
2700
+ message?: string;
2701
+ });
2702
+ type DeleteV1PlatformInvitesError = (unknown | {
2703
+ error?: string;
2704
+ });
2705
+ type GetV1ConnectByPlatformData = {
2706
+ path: {
2707
+ /**
2708
+ * Social media platform to connect
2709
+ */
2710
+ platform: 'facebook' | 'instagram' | 'linkedin' | 'twitter' | 'tiktok' | 'youtube' | 'threads' | 'reddit' | 'pinterest' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat';
2711
+ };
2712
+ query: {
2713
+ /**
2714
+ * Your Late profile ID (get from /v1/profiles)
2715
+ */
2716
+ profileId: string;
2717
+ /**
2718
+ * Optional: Your custom redirect URL after connection completes.
2719
+ *
2720
+ * **Standard Mode:** Omit `headless=true` to use our hosted page selection UI.
2721
+ * After the user selects a Facebook Page, Late redirects here with:
2722
+ * `?connected=facebook&profileId=X&username=Y`
2723
+ *
2724
+ * **Headless Mode (Facebook, LinkedIn, Pinterest, Google Business Profile & Snapchat):**
2725
+ * Pass `headless=true` as a query parameter on this endpoint (not inside `redirect_url`), e.g.:
2726
+ * `GET /v1/connect/facebook?profileId=PROFILE_ID&redirect_url=https://yourapp.com/callback&headless=true`
2727
+ * `GET /v1/connect/linkedin?profileId=PROFILE_ID&redirect_url=https://yourapp.com/callback&headless=true`
2728
+ * `GET /v1/connect/pinterest?profileId=PROFILE_ID&redirect_url=https://yourapp.com/callback&headless=true`
2729
+ * `GET /v1/connect/googlebusiness?profileId=PROFILE_ID&redirect_url=https://yourapp.com/callback&headless=true`
2730
+ * `GET /v1/connect/snapchat?profileId=PROFILE_ID&redirect_url=https://yourapp.com/callback&headless=true`
2731
+ *
2732
+ * After OAuth, the user is redirected directly to your `redirect_url` with OAuth data:
2733
+ * - **Facebook:** `?profileId=X&tempToken=Y&userProfile=Z&connect_token=CT&platform=facebook&step=select_page`
2734
+ * - **LinkedIn:** `?profileId=X&tempToken=Y&userProfile=Z&organizations=ORGS&connect_token=CT&platform=linkedin&step=select_organization`
2735
+ * (organizations contains `id`, `urn`, `name` only - use `/v1/connect/linkedin/organizations` to fetch full details)
2736
+ * - **Pinterest:** `?profileId=X&tempToken=Y&userProfile=Z&connect_token=CT&platform=pinterest&step=select_board`
2737
+ * - **Google Business:** `?profileId=X&tempToken=Y&userProfile=Z&connect_token=CT&platform=googlebusiness&step=select_location`
2738
+ * - **Snapchat:** `?profileId=X&tempToken=Y&userProfile=Z&publicProfiles=PROFILES&connect_token=CT&platform=snapchat&step=select_public_profile`
2739
+ * (publicProfiles contains `id`, `display_name`, `username`, `profile_image_url`, `subscriber_count`)
2740
+ *
2741
+ * Then use the respective endpoints to build your custom UI:
2742
+ * - Facebook: `/v1/connect/facebook/select-page` (GET to fetch, POST to save)
2743
+ * - LinkedIn: `/v1/connect/linkedin/organizations` (GET to fetch logos), `/v1/connect/linkedin/select-organization` (POST to save)
2744
+ * - Pinterest: `/v1/connect/pinterest/select-board` (GET to fetch, POST to save)
2745
+ * - Google Business: `/v1/connect/googlebusiness/locations` (GET) and `/v1/connect/googlebusiness/select-location` (POST)
2746
+ * - Snapchat: `/v1/connect/snapchat/select-profile` (POST to save selected public profile)
2747
+ *
2748
+ * Example: `https://yourdomain.com/integrations/callback`
2749
+ *
2750
+ */
2751
+ redirect_url?: string;
2752
+ };
2753
+ };
2754
+ type GetV1ConnectByPlatformResponse = ({
2755
+ /**
2756
+ * URL to redirect your user to for OAuth authorization
2757
+ */
2758
+ authUrl?: string;
2759
+ /**
2760
+ * State parameter for security (handled automatically)
2761
+ */
2762
+ state?: string;
2763
+ });
2764
+ type GetV1ConnectByPlatformError = (unknown | {
2765
+ error?: string;
2766
+ });
2767
+ type PostV1ConnectByPlatformData = {
2768
+ body: {
2769
+ code: string;
2770
+ state: string;
2771
+ profileId: string;
2772
+ };
2773
+ path: {
2774
+ platform: string;
2775
+ };
2776
+ };
2777
+ type PostV1ConnectByPlatformResponse = (unknown);
2778
+ type PostV1ConnectByPlatformError = (unknown | {
2779
+ error?: string;
2780
+ });
2781
+ type GetV1ConnectFacebookSelectPageData = {
2782
+ query: {
2783
+ /**
2784
+ * Profile ID from your connection flow
2785
+ */
2786
+ profileId: string;
2787
+ /**
2788
+ * Temporary Facebook access token from the OAuth callback redirect
2789
+ */
2790
+ tempToken: string;
2791
+ };
2792
+ };
2793
+ type GetV1ConnectFacebookSelectPageResponse = ({
2794
+ pages?: Array<{
2795
+ /**
2796
+ * Facebook Page ID
2797
+ */
2798
+ id?: string;
2799
+ /**
2800
+ * Page name
2801
+ */
2802
+ name?: string;
2803
+ /**
2804
+ * Page username/handle (may be null)
2805
+ */
2806
+ username?: string;
2807
+ /**
2808
+ * Page-specific access token
2809
+ */
2810
+ access_token?: string;
2811
+ /**
2812
+ * Page category
2813
+ */
2814
+ category?: string;
2815
+ /**
2816
+ * User permissions for this page
2817
+ */
2818
+ tasks?: Array<(string)>;
2819
+ }>;
2820
+ });
2821
+ type GetV1ConnectFacebookSelectPageError = (unknown | {
2822
+ error?: string;
2823
+ });
2824
+ type PostV1ConnectFacebookSelectPageData = {
2825
+ body: {
2826
+ /**
2827
+ * Profile ID from your connection flow
2828
+ */
2829
+ profileId: string;
2830
+ /**
2831
+ * The Facebook Page ID selected by the user
2832
+ */
2833
+ pageId: string;
2834
+ /**
2835
+ * Temporary Facebook access token from OAuth
2836
+ */
2837
+ tempToken: string;
2838
+ /**
2839
+ * Decoded user profile object from the OAuth callback
2840
+ */
2841
+ userProfile?: {
2842
+ id?: string;
2843
+ name?: string;
2844
+ profilePicture?: string;
2845
+ };
2846
+ /**
2847
+ * Optional custom redirect URL to return to after selection
2848
+ */
2849
+ redirect_url?: string;
2850
+ };
2851
+ };
2852
+ type PostV1ConnectFacebookSelectPageResponse = ({
2853
+ message?: string;
2854
+ /**
2855
+ * Redirect URL if custom redirect_url was provided
2856
+ */
2857
+ redirect_url?: string;
2858
+ account?: {
2859
+ platform?: 'facebook';
2860
+ username?: string;
2861
+ displayName?: string;
2862
+ profilePicture?: string;
2863
+ isActive?: boolean;
2864
+ selectedPageName?: string;
2865
+ };
2866
+ });
2867
+ type PostV1ConnectFacebookSelectPageError = (unknown | {
2868
+ error?: string;
2869
+ });
2870
+ type GetV1ConnectGooglebusinessLocationsData = {
2871
+ query: {
2872
+ /**
2873
+ * Profile ID from your connection flow
2874
+ */
2875
+ profileId: string;
2876
+ /**
2877
+ * Temporary Google access token from the OAuth callback redirect
2878
+ */
2879
+ tempToken: string;
2880
+ };
2881
+ };
2882
+ type GetV1ConnectGooglebusinessLocationsResponse = ({
2883
+ locations?: Array<{
2884
+ /**
2885
+ * Location ID
2886
+ */
2887
+ id?: string;
2888
+ /**
2889
+ * Business name
2890
+ */
2891
+ name?: string;
2892
+ /**
2893
+ * Google Business Account ID
2894
+ */
2895
+ accountId?: string;
2896
+ /**
2897
+ * Account name
2898
+ */
2899
+ accountName?: string;
2900
+ /**
2901
+ * Business address
2902
+ */
2903
+ address?: string;
2904
+ /**
2905
+ * Business category
2906
+ */
2907
+ category?: string;
2908
+ }>;
2909
+ });
2910
+ type GetV1ConnectGooglebusinessLocationsError = (unknown | {
2911
+ error?: string;
2912
+ });
2913
+ type PostV1ConnectGooglebusinessSelectLocationData = {
2914
+ body: {
2915
+ /**
2916
+ * Profile ID from your connection flow
2917
+ */
2918
+ profileId: string;
2919
+ /**
2920
+ * The Google Business location ID selected by the user
2921
+ */
2922
+ locationId: string;
2923
+ /**
2924
+ * Temporary Google access token from OAuth
2925
+ */
2926
+ tempToken: string;
2927
+ /**
2928
+ * Decoded user profile object from the OAuth callback. **Important:** This contains
2929
+ * the refresh token needed for token refresh. Always include this field.
2930
+ *
2931
+ */
2932
+ userProfile?: {
2933
+ id?: string;
2934
+ name?: string;
2935
+ /**
2936
+ * Google refresh token for long-lived access
2937
+ */
2938
+ refreshToken?: string;
2939
+ /**
2940
+ * Token expiration time in seconds
2941
+ */
2942
+ tokenExpiresIn?: number;
2943
+ /**
2944
+ * Granted OAuth scopes
2945
+ */
2946
+ scope?: string;
2947
+ };
2948
+ /**
2949
+ * Optional custom redirect URL to return to after selection
2950
+ */
2951
+ redirect_url?: string;
2952
+ };
2953
+ };
2954
+ type PostV1ConnectGooglebusinessSelectLocationResponse = ({
2955
+ message?: string;
2956
+ /**
2957
+ * Redirect URL if custom redirect_url was provided
2958
+ */
2959
+ redirect_url?: string;
2960
+ account?: {
2961
+ platform?: 'googlebusiness';
2962
+ username?: string;
2963
+ displayName?: string;
2964
+ isActive?: boolean;
2965
+ selectedLocationName?: string;
2966
+ selectedLocationId?: string;
2967
+ };
2968
+ });
2969
+ type PostV1ConnectGooglebusinessSelectLocationError = (unknown | {
2970
+ error?: string;
2971
+ });
2972
+ type GetV1AccountsByAccountIdGmbReviewsData = {
2973
+ path: {
2974
+ /**
2975
+ * The Late account ID (from /v1/accounts)
2976
+ */
2977
+ accountId: string;
2978
+ };
2979
+ query?: {
2980
+ /**
2981
+ * Number of reviews to fetch per page (max 50)
2982
+ */
2983
+ pageSize?: number;
2984
+ /**
2985
+ * Pagination token from previous response
2986
+ */
2987
+ pageToken?: string;
2988
+ };
2989
+ };
2990
+ type GetV1AccountsByAccountIdGmbReviewsResponse = ({
2991
+ success?: boolean;
2992
+ accountId?: string;
2993
+ locationId?: string;
2994
+ reviews?: Array<{
2995
+ /**
2996
+ * Review ID
2997
+ */
2998
+ id?: string;
2999
+ /**
3000
+ * Full resource name
3001
+ */
3002
+ name?: string;
3003
+ reviewer?: {
3004
+ displayName?: string;
3005
+ profilePhotoUrl?: (string) | null;
3006
+ isAnonymous?: boolean;
3007
+ };
3008
+ /**
3009
+ * Numeric star rating
3010
+ */
3011
+ rating?: number;
3012
+ /**
3013
+ * Google's string rating
3014
+ */
3015
+ starRating?: 'ONE' | 'TWO' | 'THREE' | 'FOUR' | 'FIVE';
3016
+ /**
3017
+ * Review text
3018
+ */
3019
+ comment?: string;
3020
+ createTime?: string;
3021
+ updateTime?: string;
3022
+ reviewReply?: {
3023
+ /**
3024
+ * Business owner reply
3025
+ */
3026
+ comment?: string;
3027
+ updateTime?: string;
3028
+ } | null;
3029
+ }>;
3030
+ /**
3031
+ * Overall average rating
3032
+ */
3033
+ averageRating?: number;
3034
+ /**
3035
+ * Total number of reviews
3036
+ */
3037
+ totalReviewCount?: number;
3038
+ /**
3039
+ * Token for next page
3040
+ */
3041
+ nextPageToken?: (string) | null;
3042
+ });
3043
+ type GetV1AccountsByAccountIdGmbReviewsError = (ErrorResponse | {
3044
+ error?: string;
3045
+ });
3046
+ type GetV1ConnectLinkedinOrganizationsData = {
3047
+ query: {
3048
+ /**
3049
+ * Comma-separated list of organization IDs to fetch details for (max 100)
3050
+ */
3051
+ orgIds: string;
3052
+ /**
3053
+ * The temporary LinkedIn access token from the OAuth redirect
3054
+ */
3055
+ tempToken: string;
3056
+ };
3057
+ };
3058
+ type GetV1ConnectLinkedinOrganizationsResponse = ({
3059
+ organizations?: Array<{
3060
+ /**
3061
+ * Organization ID
3062
+ */
3063
+ id?: string;
3064
+ /**
3065
+ * Logo URL (may be absent if no logo)
3066
+ */
3067
+ logoUrl?: string;
3068
+ /**
3069
+ * Organization's vanity name/slug
3070
+ */
3071
+ vanityName?: string;
3072
+ /**
3073
+ * Organization's website URL
3074
+ */
3075
+ website?: string;
3076
+ /**
3077
+ * Organization's primary industry
3078
+ */
3079
+ industry?: string;
3080
+ /**
3081
+ * Organization's description
3082
+ */
3083
+ description?: string;
3084
+ }>;
3085
+ });
3086
+ type GetV1ConnectLinkedinOrganizationsError = ({
3087
+ error?: string;
3088
+ } | unknown);
3089
+ type PostV1ConnectLinkedinSelectOrganizationData = {
3090
+ body: {
3091
+ profileId: string;
3092
+ tempToken: string;
3093
+ userProfile: {
3094
+ [key: string]: unknown;
3095
+ };
3096
+ accountType: 'personal' | 'organization';
3097
+ selectedOrganization?: {
3098
+ [key: string]: unknown;
3099
+ };
3100
+ redirect_url?: string;
3101
+ };
3102
+ };
3103
+ type PostV1ConnectLinkedinSelectOrganizationResponse = ({
3104
+ message?: string;
3105
+ account?: SocialAccount;
3106
+ });
3107
+ type PostV1ConnectLinkedinSelectOrganizationError = (unknown | {
3108
+ error?: string;
3109
+ });
3110
+ type GetV1ConnectPinterestSelectBoardData = {
3111
+ headers: {
3112
+ /**
3113
+ * Short-lived connect token from the OAuth redirect
3114
+ */
3115
+ 'X-Connect-Token': string;
3116
+ };
3117
+ query: {
3118
+ /**
3119
+ * Your Late profile ID
3120
+ */
3121
+ profileId: string;
3122
+ /**
3123
+ * Temporary Pinterest access token from the OAuth callback redirect
3124
+ */
3125
+ tempToken: string;
3126
+ };
3127
+ };
3128
+ type GetV1ConnectPinterestSelectBoardResponse = ({
3129
+ boards?: Array<{
3130
+ /**
3131
+ * Pinterest Board ID
3132
+ */
3133
+ id?: string;
3134
+ /**
3135
+ * Board name
3136
+ */
3137
+ name?: string;
3138
+ /**
3139
+ * Board description
3140
+ */
3141
+ description?: string;
3142
+ /**
3143
+ * Board privacy setting
3144
+ */
3145
+ privacy?: string;
3146
+ }>;
3147
+ });
3148
+ type GetV1ConnectPinterestSelectBoardError = (unknown | {
3149
+ error?: string;
3150
+ });
3151
+ type PostV1ConnectPinterestSelectBoardData = {
3152
+ body: {
3153
+ /**
3154
+ * Your Late profile ID
3155
+ */
3156
+ profileId: string;
3157
+ /**
3158
+ * The Pinterest Board ID selected by the user
3159
+ */
3160
+ boardId: string;
3161
+ /**
3162
+ * The board name (for display purposes)
3163
+ */
3164
+ boardName?: string;
3165
+ /**
3166
+ * Temporary Pinterest access token from OAuth
3167
+ */
3168
+ tempToken: string;
3169
+ /**
3170
+ * User profile data from OAuth redirect
3171
+ */
3172
+ userProfile?: {
3173
+ [key: string]: unknown;
3174
+ };
3175
+ /**
3176
+ * Pinterest refresh token (if available)
3177
+ */
3178
+ refreshToken?: string;
3179
+ /**
3180
+ * Token expiration time in seconds
3181
+ */
3182
+ expiresIn?: number;
3183
+ /**
3184
+ * Custom redirect URL after connection completes
3185
+ */
3186
+ redirect_url?: string;
3187
+ };
3188
+ };
3189
+ type PostV1ConnectPinterestSelectBoardResponse = ({
3190
+ message?: string;
3191
+ /**
3192
+ * Redirect URL with connection params (if provided)
3193
+ */
3194
+ redirect_url?: string;
3195
+ account?: {
3196
+ platform?: 'pinterest';
3197
+ username?: string;
3198
+ displayName?: string;
3199
+ profilePicture?: string;
3200
+ isActive?: boolean;
3201
+ defaultBoardName?: string;
3202
+ };
3203
+ });
3204
+ type PostV1ConnectPinterestSelectBoardError = (unknown | {
3205
+ error?: string;
3206
+ });
3207
+ type GetV1ConnectSnapchatSelectProfileData = {
3208
+ headers: {
3209
+ /**
3210
+ * Short-lived connect token from the OAuth redirect
3211
+ */
3212
+ 'X-Connect-Token': string;
3213
+ };
3214
+ query: {
3215
+ /**
3216
+ * Your Late profile ID
3217
+ */
3218
+ profileId: string;
3219
+ /**
3220
+ * Temporary Snapchat access token from the OAuth callback redirect
3221
+ */
3222
+ tempToken: string;
3223
+ };
3224
+ };
3225
+ type GetV1ConnectSnapchatSelectProfileResponse = ({
3226
+ publicProfiles?: Array<{
3227
+ /**
3228
+ * Snapchat Public Profile ID
3229
+ */
3230
+ id?: string;
3231
+ /**
3232
+ * Public profile display name
3233
+ */
3234
+ display_name?: string;
3235
+ /**
3236
+ * Public profile username/handle
3237
+ */
3238
+ username?: string;
3239
+ /**
3240
+ * Profile image URL
3241
+ */
3242
+ profile_image_url?: string;
3243
+ /**
3244
+ * Number of subscribers
3245
+ */
3246
+ subscriber_count?: number;
3247
+ }>;
3248
+ });
3249
+ type GetV1ConnectSnapchatSelectProfileError = (unknown | {
3250
+ error?: string;
3251
+ });
3252
+ type PostV1ConnectSnapchatSelectProfileData = {
3253
+ body: {
3254
+ /**
3255
+ * Your Late profile ID
3256
+ */
3257
+ profileId: string;
3258
+ /**
3259
+ * The selected Snapchat Public Profile
3260
+ */
3261
+ selectedPublicProfile: {
3262
+ /**
3263
+ * Snapchat Public Profile ID
3264
+ */
3265
+ id: string;
3266
+ /**
3267
+ * Display name of the public profile
3268
+ */
3269
+ display_name: string;
3270
+ /**
3271
+ * Username/handle
3272
+ */
3273
+ username?: string;
3274
+ /**
3275
+ * Profile image URL
3276
+ */
3277
+ profile_image_url?: string;
3278
+ /**
3279
+ * Number of subscribers
3280
+ */
3281
+ subscriber_count?: number;
3282
+ };
3283
+ /**
3284
+ * Temporary Snapchat access token from OAuth
3285
+ */
3286
+ tempToken: string;
3287
+ /**
3288
+ * User profile data from OAuth redirect
3289
+ */
3290
+ userProfile: {
3291
+ [key: string]: unknown;
3292
+ };
3293
+ /**
3294
+ * Snapchat refresh token (if available)
3295
+ */
3296
+ refreshToken?: string;
3297
+ /**
3298
+ * Token expiration time in seconds
3299
+ */
3300
+ expiresIn?: number;
3301
+ /**
3302
+ * Custom redirect URL after connection completes
3303
+ */
3304
+ redirect_url?: string;
3305
+ };
3306
+ headers?: {
3307
+ /**
3308
+ * Short-lived connect token from the OAuth redirect (for API users)
3309
+ */
3310
+ 'X-Connect-Token'?: string;
3311
+ };
3312
+ };
3313
+ type PostV1ConnectSnapchatSelectProfileResponse = ({
3314
+ message?: string;
3315
+ /**
3316
+ * Redirect URL with connection params (if provided in request)
3317
+ */
3318
+ redirect_url?: string;
3319
+ account?: {
3320
+ platform?: 'snapchat';
3321
+ username?: string;
3322
+ displayName?: string;
3323
+ profilePicture?: string;
3324
+ isActive?: boolean;
3325
+ publicProfileName?: string;
3326
+ };
3327
+ });
3328
+ type PostV1ConnectSnapchatSelectProfileError = (unknown | {
3329
+ error?: string;
3330
+ });
3331
+ type PostV1ConnectBlueskyCredentialsData = {
3332
+ body: {
3333
+ /**
3334
+ * Your Bluesky handle (e.g. user.bsky.social) or email address
3335
+ */
3336
+ identifier: string;
3337
+ /**
3338
+ * App password generated from Bluesky Settings > App Passwords
3339
+ */
3340
+ appPassword: string;
3341
+ /**
3342
+ * Required state parameter formatted as `{userId}-{profileId}`.
3343
+ * - `userId`: Your Late user ID (get from `GET /v1/users` → `currentUserId`)
3344
+ * - `profileId`: The profile ID to connect the account to (get from `GET /v1/profiles`)
3345
+ *
3346
+ */
3347
+ state: string;
3348
+ /**
3349
+ * Optional URL to redirect to after successful connection
3350
+ */
3351
+ redirectUri?: string;
3352
+ };
3353
+ };
3354
+ type PostV1ConnectBlueskyCredentialsResponse = ({
3355
+ message?: string;
3356
+ account?: SocialAccount;
3357
+ });
3358
+ type PostV1ConnectBlueskyCredentialsError = (unknown | {
3359
+ error?: string;
3360
+ });
3361
+ type GetV1ConnectTelegramData = {
3362
+ query: {
3363
+ /**
3364
+ * The profile ID to connect the Telegram account to
3365
+ */
3366
+ profileId: string;
3367
+ };
3368
+ };
3369
+ type GetV1ConnectTelegramResponse = ({
3370
+ /**
3371
+ * The access code to send to the Telegram bot
3372
+ */
3373
+ code?: string;
3374
+ /**
3375
+ * When the code expires
3376
+ */
3377
+ expiresAt?: string;
3378
+ /**
3379
+ * Seconds until expiration
3380
+ */
3381
+ expiresIn?: number;
3382
+ /**
3383
+ * The Telegram bot username to message
3384
+ */
3385
+ botUsername?: string;
3386
+ /**
3387
+ * Step-by-step connection instructions
3388
+ */
3389
+ instructions?: Array<(string)>;
3390
+ });
3391
+ type GetV1ConnectTelegramError = (unknown | {
3392
+ error?: string;
3393
+ });
3394
+ type PostV1ConnectTelegramData = {
3395
+ body: {
3396
+ /**
3397
+ * The Telegram chat ID. Can be:
3398
+ * - Numeric ID (e.g., "-1001234567890")
3399
+ * - Username with @ prefix (e.g., "@mychannel")
3400
+ *
3401
+ */
3402
+ chatId: string;
3403
+ /**
3404
+ * The profile ID to connect the account to
3405
+ */
3406
+ profileId: string;
3407
+ };
3408
+ };
3409
+ type PostV1ConnectTelegramResponse = ({
3410
+ message?: string;
3411
+ account?: {
3412
+ _id?: string;
3413
+ platform?: 'telegram';
3414
+ username?: string;
3415
+ displayName?: string;
3416
+ isActive?: boolean;
3417
+ chatType?: 'channel' | 'group' | 'supergroup' | 'private';
3418
+ };
3419
+ });
3420
+ type PostV1ConnectTelegramError = (unknown | {
3421
+ error?: string;
3422
+ });
3423
+ type PatchV1ConnectTelegramData = {
3424
+ query: {
3425
+ /**
3426
+ * The access code to check status for
3427
+ */
3428
+ code: string;
3429
+ };
3430
+ };
3431
+ type PatchV1ConnectTelegramResponse = (({
3432
+ status?: 'pending';
3433
+ expiresAt?: string;
3434
+ /**
3435
+ * Seconds until expiration
3436
+ */
3437
+ expiresIn?: number;
3438
+ } | {
3439
+ status?: 'connected';
3440
+ chatId?: string;
3441
+ chatTitle?: string;
3442
+ chatType?: 'channel' | 'group' | 'supergroup';
3443
+ account?: {
3444
+ _id?: string;
3445
+ platform?: string;
3446
+ username?: string;
3447
+ displayName?: string;
3448
+ };
3449
+ } | {
3450
+ status?: 'expired';
3451
+ message?: string;
3452
+ }));
3453
+ type PatchV1ConnectTelegramError = ({
3454
+ error?: string;
3455
+ } | unknown);
3456
+ type PutV1AccountsByAccountIdFacebookPageData = {
3457
+ body: {
3458
+ selectedPageId: string;
3459
+ };
3460
+ path: {
3461
+ accountId: string;
3462
+ };
3463
+ };
3464
+ type PutV1AccountsByAccountIdFacebookPageResponse = ({
3465
+ message?: string;
3466
+ account?: SocialAccount;
3467
+ });
3468
+ type PutV1AccountsByAccountIdFacebookPageError = (unknown | {
3469
+ error?: string;
3470
+ });
3471
+ type GetV1AccountsByAccountIdLinkedinOrganizationsData = {
3472
+ path: {
3473
+ accountId: string;
3474
+ };
3475
+ };
3476
+ type GetV1AccountsByAccountIdLinkedinOrganizationsResponse = ({
3477
+ organizations?: Array<{
3478
+ id?: string;
3479
+ name?: string;
3480
+ vanityName?: string;
3481
+ localizedName?: string;
3482
+ }>;
3483
+ });
3484
+ type GetV1AccountsByAccountIdLinkedinOrganizationsError = ({
3485
+ error?: string;
3486
+ } | unknown);
3487
+ type GetV1AccountsByAccountIdLinkedinAggregateAnalyticsData = {
3488
+ path: {
3489
+ /**
3490
+ * The ID of the LinkedIn personal account
3491
+ */
3492
+ accountId: string;
3493
+ };
3494
+ query?: {
3495
+ /**
3496
+ * Type of aggregation for the analytics data.
3497
+ * - `TOTAL` (default): Returns single totals for each metric
3498
+ * - `DAILY`: Returns daily breakdown of metrics
3499
+ *
3500
+ * Note: `MEMBERS_REACHED` metric is not available with `DAILY` aggregation.
3501
+ *
3502
+ */
3503
+ aggregation?: 'TOTAL' | 'DAILY';
3504
+ /**
3505
+ * End date for analytics data in YYYY-MM-DD format (exclusive).
3506
+ * If provided without startDate, startDate defaults to 30 days before endDate.
3507
+ *
3508
+ */
3509
+ endDate?: string;
3510
+ /**
3511
+ * Comma-separated list of metrics to fetch. If omitted, fetches all available metrics.
3512
+ * Valid values: IMPRESSION, MEMBERS_REACHED, REACTION, COMMENT, RESHARE
3513
+ *
3514
+ */
3515
+ metrics?: string;
3516
+ /**
3517
+ * Start date for analytics data in YYYY-MM-DD format.
3518
+ * If provided without endDate, endDate defaults to today.
3519
+ * If omitted entirely, returns lifetime analytics.
3520
+ *
3521
+ */
3522
+ startDate?: string;
3523
+ };
3524
+ };
3525
+ type GetV1AccountsByAccountIdLinkedinAggregateAnalyticsResponse = ((LinkedInAggregateAnalyticsTotalResponse | LinkedInAggregateAnalyticsDailyResponse));
3526
+ type GetV1AccountsByAccountIdLinkedinAggregateAnalyticsError = ({
3527
+ error?: string;
3528
+ code?: string;
3529
+ validOptions?: Array<(string)>;
3530
+ } | {
3531
+ error?: string;
3532
+ } | {
3533
+ error?: string;
3534
+ code?: string;
3535
+ } | {
3536
+ error?: string;
3537
+ code?: string;
3538
+ requiredScope?: string;
3539
+ action?: string;
3540
+ } | unknown);
3541
+ type GetV1AccountsByAccountIdLinkedinPostAnalyticsData = {
3542
+ path: {
3543
+ /**
3544
+ * The ID of the LinkedIn account
3545
+ */
3546
+ accountId: string;
3547
+ };
3548
+ query: {
3549
+ /**
3550
+ * The LinkedIn post URN
3551
+ */
3552
+ urn: string;
3553
+ };
3554
+ };
3555
+ type GetV1AccountsByAccountIdLinkedinPostAnalyticsResponse = ({
3556
+ accountId?: string;
3557
+ platform?: string;
3558
+ accountType?: 'personal' | 'organization';
3559
+ username?: string;
3560
+ postUrn?: string;
3561
+ analytics?: {
3562
+ /**
3563
+ * Times the post was shown
3564
+ */
3565
+ impressions?: number;
3566
+ /**
3567
+ * Unique members who saw the post
3568
+ */
3569
+ reach?: number;
3570
+ /**
3571
+ * Reactions on the post
3572
+ */
3573
+ likes?: number;
3574
+ /**
3575
+ * Comments on the post
3576
+ */
3577
+ comments?: number;
3578
+ /**
3579
+ * Reshares of the post
3580
+ */
3581
+ shares?: number;
3582
+ /**
3583
+ * Clicks on the post (organization accounts only)
3584
+ */
3585
+ clicks?: number;
3586
+ /**
3587
+ * Video views (video posts only)
3588
+ */
3589
+ views?: number;
3590
+ /**
3591
+ * Engagement rate as percentage
3592
+ */
3593
+ engagementRate?: number;
3594
+ };
3595
+ lastUpdated?: string;
3596
+ });
3597
+ type GetV1AccountsByAccountIdLinkedinPostAnalyticsError = ({
3598
+ error?: string;
3599
+ code?: 'missing_urn' | 'invalid_urn' | 'invalid_platform';
3600
+ } | {
3601
+ error?: string;
3602
+ } | unknown | {
3603
+ error?: string;
3604
+ code?: string;
3605
+ requiredScope?: string;
3606
+ action?: string;
3607
+ } | {
3608
+ error?: string;
3609
+ code?: string;
3610
+ });
3611
+ type PutV1AccountsByAccountIdLinkedinOrganizationData = {
3612
+ body: {
3613
+ accountType: 'personal' | 'organization';
3614
+ selectedOrganization?: {
3615
+ [key: string]: unknown;
3616
+ };
3617
+ };
3618
+ path: {
3619
+ accountId: string;
3620
+ };
3621
+ };
3622
+ type PutV1AccountsByAccountIdLinkedinOrganizationResponse = ({
3623
+ message?: string;
3624
+ account?: SocialAccount;
3625
+ });
3626
+ type PutV1AccountsByAccountIdLinkedinOrganizationError = (unknown | {
3627
+ error?: string;
3628
+ });
3629
+ type GetV1AccountsByAccountIdLinkedinMentionsData = {
3630
+ path: {
3631
+ /**
3632
+ * The LinkedIn account ID
3633
+ */
3634
+ accountId: string;
3635
+ };
3636
+ query: {
3637
+ /**
3638
+ * The exact display name as shown on LinkedIn.
3639
+ * - **Person mentions:** Required for clickable mentions. If not provided, a name is derived from the vanity URL which may not match exactly.
3640
+ * - **Organization mentions:** Optional. If not provided, the company name is automatically retrieved from LinkedIn.
3641
+ *
3642
+ */
3643
+ displayName?: string;
3644
+ /**
3645
+ * LinkedIn profile URL, company URL, or vanity name.
3646
+ * - Person: `miquelpalet`, `linkedin.com/in/miquelpalet`
3647
+ * - Organization: `company/microsoft`, `linkedin.com/company/microsoft`
3648
+ *
3649
+ */
3650
+ url: string;
3651
+ };
3652
+ };
3653
+ type GetV1AccountsByAccountIdLinkedinMentionsResponse = ({
3654
+ /**
3655
+ * The LinkedIn URN (person or organization)
3656
+ */
3657
+ urn?: string;
3658
+ /**
3659
+ * The type of entity (person or organization)
3660
+ */
3661
+ type?: 'person' | 'organization';
3662
+ /**
3663
+ * Display name (provided, from API, or derived from vanity URL)
3664
+ */
3665
+ displayName?: string;
3666
+ /**
3667
+ * Ready-to-use mention format for post content
3668
+ */
3669
+ mentionFormat?: string;
3670
+ /**
3671
+ * The vanity name/slug (only for organization mentions)
3672
+ */
3673
+ vanityName?: string;
3674
+ /**
3675
+ * Warning about clickable mentions (only present for person mentions if displayName was not provided)
3676
+ */
3677
+ warning?: string;
3678
+ });
3679
+ type GetV1AccountsByAccountIdLinkedinMentionsError = ({
3680
+ error?: string;
3681
+ });
3682
+ type GetV1AccountsByAccountIdPinterestBoardsData = {
3683
+ path: {
3684
+ accountId: string;
3685
+ };
3686
+ };
3687
+ type GetV1AccountsByAccountIdPinterestBoardsResponse = ({
3688
+ boards?: Array<{
3689
+ id?: string;
3690
+ name?: string;
3691
+ description?: string;
3692
+ privacy?: string;
3693
+ }>;
3694
+ });
3695
+ type GetV1AccountsByAccountIdPinterestBoardsError = (unknown | {
3696
+ error?: string;
3697
+ });
3698
+ type PutV1AccountsByAccountIdPinterestBoardsData = {
3699
+ body: {
3700
+ defaultBoardId: string;
3701
+ defaultBoardName?: string;
3702
+ };
3703
+ path: {
3704
+ accountId: string;
3705
+ };
3706
+ };
3707
+ type PutV1AccountsByAccountIdPinterestBoardsResponse = ({
3708
+ message?: string;
3709
+ account?: SocialAccount;
3710
+ });
3711
+ type PutV1AccountsByAccountIdPinterestBoardsError = (unknown | {
3712
+ error?: string;
3713
+ });
3714
+ type GetV1AccountsByAccountIdRedditSubredditsData = {
3715
+ path: {
3716
+ accountId: string;
3717
+ };
3718
+ };
3719
+ type GetV1AccountsByAccountIdRedditSubredditsResponse = ({
3720
+ subreddits?: Array<{
3721
+ name?: string;
3722
+ displayName?: string;
3723
+ subscribers?: number;
3724
+ public_description?: string;
3725
+ }>;
3726
+ });
3727
+ type GetV1AccountsByAccountIdRedditSubredditsError = (unknown | {
3728
+ error?: string;
3729
+ });
3730
+ type PutV1AccountsByAccountIdRedditSubredditsData = {
3731
+ body: {
3732
+ defaultSubreddit: string;
3733
+ };
3734
+ path: {
3735
+ accountId: string;
3736
+ };
3737
+ };
3738
+ type PutV1AccountsByAccountIdRedditSubredditsResponse = ({
3739
+ message?: string;
3740
+ account?: SocialAccount;
3741
+ });
3742
+ type PutV1AccountsByAccountIdRedditSubredditsError = (unknown | {
3743
+ error?: string;
3744
+ });
3745
+ type GetV1QueueSlotsData = {
3746
+ query: {
3747
+ /**
3748
+ * Set to 'true' to list all queues for the profile
3749
+ */
3750
+ all?: 'true';
3751
+ /**
3752
+ * Profile ID to get queues for
3753
+ */
3754
+ profileId: string;
3755
+ /**
3756
+ * Specific queue ID to retrieve (optional)
3757
+ */
3758
+ queueId?: string;
3759
+ };
3760
+ };
3761
+ type GetV1QueueSlotsResponse = (({
3762
+ exists?: boolean;
3763
+ schedule?: QueueSchedule;
3764
+ nextSlots?: Array<(string)>;
3765
+ } | {
3766
+ queues?: Array<QueueSchedule>;
3767
+ count?: number;
3768
+ }));
3769
+ type GetV1QueueSlotsError = (unknown | {
3770
+ error?: string;
3771
+ });
3772
+ type PostV1QueueSlotsData = {
3773
+ body: {
3774
+ /**
3775
+ * Profile ID
3776
+ */
3777
+ profileId: string;
3778
+ /**
3779
+ * Queue name (e.g., Evening Posts)
3780
+ */
3781
+ name: string;
3782
+ /**
3783
+ * IANA timezone
3784
+ */
3785
+ timezone: string;
3786
+ slots: Array<QueueSlot>;
3787
+ active?: boolean;
3788
+ };
3789
+ };
3790
+ type PostV1QueueSlotsResponse = ({
3791
+ success?: boolean;
3792
+ schedule?: QueueSchedule;
3793
+ nextSlots?: Array<(string)>;
3794
+ });
3795
+ type PostV1QueueSlotsError = (unknown | {
3796
+ error?: string;
3797
+ });
3798
+ type PutV1QueueSlotsData = {
3799
+ body: {
3800
+ profileId: string;
3801
+ /**
3802
+ * Queue ID to update (optional)
3803
+ */
3804
+ queueId?: string;
3805
+ /**
3806
+ * Queue name
3807
+ */
3808
+ name?: string;
3809
+ timezone: string;
3810
+ slots: Array<QueueSlot>;
3811
+ active?: boolean;
3812
+ /**
3813
+ * Make this queue the default
3814
+ */
3815
+ setAsDefault?: boolean;
3816
+ /**
3817
+ * Whether to reschedule existing queued posts to match new slots
3818
+ */
3819
+ reshuffleExisting?: boolean;
3820
+ };
3821
+ };
3822
+ type PutV1QueueSlotsResponse = ({
3823
+ success?: boolean;
3824
+ schedule?: QueueSchedule;
3825
+ nextSlots?: Array<(string)>;
3826
+ reshuffledCount?: number;
3827
+ });
3828
+ type PutV1QueueSlotsError = (unknown | {
3829
+ error?: string;
3830
+ });
3831
+ type DeleteV1QueueSlotsData = {
3832
+ query: {
3833
+ profileId: string;
3834
+ /**
3835
+ * Queue ID to delete
3836
+ */
3837
+ queueId: string;
3838
+ };
3839
+ };
3840
+ type DeleteV1QueueSlotsResponse = ({
3841
+ success?: boolean;
3842
+ deleted?: boolean;
3843
+ });
3844
+ type DeleteV1QueueSlotsError = (unknown | {
3845
+ error?: string;
3846
+ });
3847
+ type GetV1QueuePreviewData = {
3848
+ query: {
3849
+ count?: number;
3850
+ profileId: string;
3851
+ };
3852
+ };
3853
+ type GetV1QueuePreviewResponse = ({
3854
+ profileId?: string;
3855
+ count?: number;
3856
+ slots?: Array<(string)>;
3857
+ });
3858
+ type GetV1QueuePreviewError = (unknown | {
3859
+ error?: string;
3860
+ });
3861
+ type GetV1QueueNextSlotData = {
3862
+ query: {
3863
+ profileId: string;
3864
+ /**
3865
+ * Specific queue ID (optional, defaults to profile's default queue)
3866
+ */
3867
+ queueId?: string;
3868
+ };
3869
+ };
3870
+ type GetV1QueueNextSlotResponse = ({
3871
+ profileId?: string;
3872
+ nextSlot?: string;
3873
+ timezone?: string;
3874
+ /**
3875
+ * Queue ID this slot belongs to
3876
+ */
3877
+ queueId?: string;
3878
+ /**
3879
+ * Queue name
3880
+ */
3881
+ queueName?: string;
3882
+ });
3883
+ type GetV1QueueNextSlotError = (unknown | {
3884
+ error?: string;
3885
+ });
3886
+ type GetV1WebhooksSettingsResponse = ({
3887
+ webhooks?: Array<Webhook>;
3888
+ });
3889
+ type GetV1WebhooksSettingsError = ({
3890
+ error?: string;
3891
+ });
3892
+ type PostV1WebhooksSettingsData = {
3893
+ body: {
3894
+ /**
3895
+ * Webhook name (max 50 characters)
3896
+ */
3897
+ name?: string;
3898
+ /**
3899
+ * Webhook endpoint URL (must be HTTPS in production)
3900
+ */
3901
+ url?: string;
3902
+ /**
3903
+ * Secret key for HMAC-SHA256 signature verification
3904
+ */
3905
+ secret?: string;
3906
+ /**
3907
+ * Events to subscribe to
3908
+ */
3909
+ events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'account.disconnected')>;
3910
+ /**
3911
+ * Enable or disable webhook delivery
3912
+ */
3913
+ isActive?: boolean;
3914
+ /**
3915
+ * Custom headers to include in webhook requests
3916
+ */
3917
+ customHeaders?: {
3918
+ [key: string]: (string);
3919
+ };
3920
+ };
3921
+ };
3922
+ type PostV1WebhooksSettingsResponse = ({
3923
+ success?: boolean;
3924
+ webhook?: Webhook;
3925
+ });
3926
+ type PostV1WebhooksSettingsError = (unknown | {
3927
+ error?: string;
3928
+ });
3929
+ type PutV1WebhooksSettingsData = {
3930
+ body: {
3931
+ /**
3932
+ * Webhook ID to update (required)
3933
+ */
3934
+ _id: string;
3935
+ /**
3936
+ * Webhook name (max 50 characters)
3937
+ */
3938
+ name?: string;
3939
+ /**
3940
+ * Webhook endpoint URL (must be HTTPS in production)
3941
+ */
3942
+ url?: string;
3943
+ /**
3944
+ * Secret key for HMAC-SHA256 signature verification
3945
+ */
3946
+ secret?: string;
3947
+ /**
3948
+ * Events to subscribe to
3949
+ */
3950
+ events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'account.disconnected')>;
3951
+ /**
3952
+ * Enable or disable webhook delivery
3953
+ */
3954
+ isActive?: boolean;
3955
+ /**
3956
+ * Custom headers to include in webhook requests
3957
+ */
3958
+ customHeaders?: {
3959
+ [key: string]: (string);
3960
+ };
3961
+ };
3962
+ };
3963
+ type PutV1WebhooksSettingsResponse = ({
3964
+ success?: boolean;
3965
+ webhook?: Webhook;
3966
+ });
3967
+ type PutV1WebhooksSettingsError = (unknown | {
3968
+ error?: string;
3969
+ });
3970
+ type DeleteV1WebhooksSettingsData = {
3971
+ query: {
3972
+ /**
3973
+ * Webhook ID to delete
3974
+ */
3975
+ id: string;
3976
+ };
3977
+ };
3978
+ type DeleteV1WebhooksSettingsResponse = ({
3979
+ success?: boolean;
3980
+ });
3981
+ type DeleteV1WebhooksSettingsError = (unknown | {
3982
+ error?: string;
3983
+ });
3984
+ type PostV1WebhooksTestData = {
3985
+ body: {
3986
+ /**
3987
+ * ID of the webhook to test
3988
+ */
3989
+ webhookId: string;
3990
+ };
3991
+ };
3992
+ type PostV1WebhooksTestResponse = ({
3993
+ success?: boolean;
3994
+ message?: string;
3995
+ });
3996
+ type PostV1WebhooksTestError = (unknown | {
3997
+ error?: string;
3998
+ } | {
3999
+ success?: boolean;
4000
+ message?: string;
4001
+ });
4002
+ type GetV1WebhooksLogsData = {
4003
+ query?: {
4004
+ /**
4005
+ * Filter by event type
4006
+ */
4007
+ event?: 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'account.disconnected' | 'webhook.test';
4008
+ /**
4009
+ * Maximum number of logs to return (max 100)
4010
+ */
4011
+ limit?: number;
4012
+ /**
4013
+ * Filter by delivery status
4014
+ */
4015
+ status?: 'success' | 'failed';
4016
+ /**
4017
+ * Filter by webhook ID
4018
+ */
4019
+ webhookId?: string;
4020
+ };
4021
+ };
4022
+ type GetV1WebhooksLogsResponse = ({
4023
+ logs?: Array<WebhookLog>;
4024
+ });
4025
+ type GetV1WebhooksLogsError = ({
4026
+ error?: string;
4027
+ });
4028
+ type GetV1LogsData = {
4029
+ query?: {
4030
+ /**
4031
+ * Filter by action type
4032
+ */
4033
+ action?: 'publish' | 'retry' | 'media_upload' | 'rate_limit_pause' | 'token_refresh' | 'cancelled' | 'all';
4034
+ /**
4035
+ * Number of days to look back (max 7)
4036
+ */
4037
+ days?: number;
4038
+ /**
4039
+ * Maximum number of logs to return (max 100)
4040
+ */
4041
+ limit?: number;
4042
+ /**
4043
+ * Filter by platform
4044
+ */
4045
+ platform?: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'all';
4046
+ /**
4047
+ * Number of logs to skip (for pagination)
4048
+ */
4049
+ skip?: number;
4050
+ /**
4051
+ * Filter by log status
4052
+ */
4053
+ status?: 'success' | 'failed' | 'pending' | 'skipped' | 'all';
4054
+ };
4055
+ };
4056
+ type GetV1LogsResponse = ({
4057
+ logs?: Array<PostLog>;
4058
+ pagination?: {
4059
+ /**
4060
+ * Total number of logs matching the query
4061
+ */
4062
+ total?: number;
4063
+ limit?: number;
4064
+ skip?: number;
4065
+ /**
4066
+ * Total number of pages
4067
+ */
4068
+ pages?: number;
4069
+ hasMore?: boolean;
4070
+ };
4071
+ });
4072
+ type GetV1LogsError = ({
4073
+ error?: string;
4074
+ });
4075
+ type GetV1LogsByLogIdData = {
4076
+ path: {
4077
+ /**
4078
+ * The log entry ID
4079
+ */
4080
+ logId: string;
4081
+ };
4082
+ };
4083
+ type GetV1LogsByLogIdResponse = ({
4084
+ log?: PostLogDetail;
4085
+ });
4086
+ type GetV1LogsByLogIdError = ({
4087
+ error?: string;
4088
+ } | unknown);
4089
+ type GetV1PostsByPostIdLogsData = {
4090
+ path: {
4091
+ /**
4092
+ * The post ID
4093
+ */
4094
+ postId: string;
4095
+ };
4096
+ query?: {
4097
+ /**
4098
+ * Maximum number of logs to return (max 100)
4099
+ */
4100
+ limit?: number;
4101
+ };
4102
+ };
4103
+ type GetV1PostsByPostIdLogsResponse = ({
4104
+ logs?: Array<PostLog>;
4105
+ /**
4106
+ * Number of logs returned
4107
+ */
4108
+ count?: number;
4109
+ postId?: string;
4110
+ });
4111
+ type GetV1PostsByPostIdLogsError = ({
4112
+ error?: string;
4113
+ } | unknown);
4114
+
4115
+ export { type AccountGetResponse, type AccountWithFollowerStats, type AccountsListResponse, type AnalyticsListResponse, type AnalyticsOverview, type AnalyticsSinglePostResponse, type ApiKey, type CaptionResponse, type ClientOptions, type DeleteV1AccountGroupsByGroupIdData, type DeleteV1AccountGroupsByGroupIdError, type DeleteV1AccountGroupsByGroupIdResponse, type DeleteV1AccountsByAccountIdData, type DeleteV1AccountsByAccountIdError, type DeleteV1AccountsByAccountIdResponse, type DeleteV1ApiKeysByKeyIdData, type DeleteV1ApiKeysByKeyIdError, type DeleteV1ApiKeysByKeyIdResponse, type DeleteV1PlatformInvitesData, type DeleteV1PlatformInvitesError, type DeleteV1PlatformInvitesResponse, type DeleteV1PostsByPostIdData, type DeleteV1PostsByPostIdError, type DeleteV1PostsByPostIdResponse, type DeleteV1ProfilesByProfileIdData, type DeleteV1ProfilesByProfileIdError, type DeleteV1ProfilesByProfileIdResponse, type DeleteV1QueueSlotsData, type DeleteV1QueueSlotsError, type DeleteV1QueueSlotsResponse, type DeleteV1WebhooksSettingsData, type DeleteV1WebhooksSettingsError, type DeleteV1WebhooksSettingsResponse, type DownloadFormat, type DownloadResponse, type ErrorResponse, type FacebookPlatformData, type FollowerStatsResponse, type GetV1AccountGroupsError, type GetV1AccountGroupsResponse, type GetV1AccountsByAccountIdGmbReviewsData, type GetV1AccountsByAccountIdGmbReviewsError, type GetV1AccountsByAccountIdGmbReviewsResponse, type GetV1AccountsByAccountIdHealthData, type GetV1AccountsByAccountIdHealthError, type GetV1AccountsByAccountIdHealthResponse, type GetV1AccountsByAccountIdLinkedinAggregateAnalyticsData, type GetV1AccountsByAccountIdLinkedinAggregateAnalyticsError, type GetV1AccountsByAccountIdLinkedinAggregateAnalyticsResponse, type GetV1AccountsByAccountIdLinkedinMentionsData, type GetV1AccountsByAccountIdLinkedinMentionsError, type GetV1AccountsByAccountIdLinkedinMentionsResponse, type GetV1AccountsByAccountIdLinkedinOrganizationsData, type GetV1AccountsByAccountIdLinkedinOrganizationsError, type GetV1AccountsByAccountIdLinkedinOrganizationsResponse, type GetV1AccountsByAccountIdLinkedinPostAnalyticsData, type GetV1AccountsByAccountIdLinkedinPostAnalyticsError, type GetV1AccountsByAccountIdLinkedinPostAnalyticsResponse, type GetV1AccountsByAccountIdPinterestBoardsData, type GetV1AccountsByAccountIdPinterestBoardsError, type GetV1AccountsByAccountIdPinterestBoardsResponse, type GetV1AccountsByAccountIdRedditSubredditsData, type GetV1AccountsByAccountIdRedditSubredditsError, type GetV1AccountsByAccountIdRedditSubredditsResponse, type GetV1AccountsData, type GetV1AccountsError, type GetV1AccountsFollowerStatsData, type GetV1AccountsFollowerStatsError, type GetV1AccountsFollowerStatsResponse, type GetV1AccountsHealthData, type GetV1AccountsHealthError, type GetV1AccountsHealthResponse, type GetV1AccountsResponse, type GetV1AnalyticsData, type GetV1AnalyticsError, type GetV1AnalyticsResponse, type GetV1AnalyticsYoutubeDailyViewsData, type GetV1AnalyticsYoutubeDailyViewsError, type GetV1AnalyticsYoutubeDailyViewsResponse, type GetV1ApiKeysError, type GetV1ApiKeysResponse, type GetV1ConnectByPlatformData, type GetV1ConnectByPlatformError, type GetV1ConnectByPlatformResponse, type GetV1ConnectFacebookSelectPageData, type GetV1ConnectFacebookSelectPageError, type GetV1ConnectFacebookSelectPageResponse, type GetV1ConnectGooglebusinessLocationsData, type GetV1ConnectGooglebusinessLocationsError, type GetV1ConnectGooglebusinessLocationsResponse, type GetV1ConnectLinkedinOrganizationsData, type GetV1ConnectLinkedinOrganizationsError, type GetV1ConnectLinkedinOrganizationsResponse, type GetV1ConnectPinterestSelectBoardData, type GetV1ConnectPinterestSelectBoardError, type GetV1ConnectPinterestSelectBoardResponse, type GetV1ConnectSnapchatSelectProfileData, type GetV1ConnectSnapchatSelectProfileError, type GetV1ConnectSnapchatSelectProfileResponse, type GetV1ConnectTelegramData, type GetV1ConnectTelegramError, type GetV1ConnectTelegramResponse, type GetV1LogsByLogIdData, type GetV1LogsByLogIdError, type GetV1LogsByLogIdResponse, type GetV1LogsData, type GetV1LogsError, type GetV1LogsResponse, type GetV1PlatformInvitesData, type GetV1PlatformInvitesError, type GetV1PlatformInvitesResponse, type GetV1PostsByPostIdData, type GetV1PostsByPostIdError, type GetV1PostsByPostIdLogsData, type GetV1PostsByPostIdLogsError, type GetV1PostsByPostIdLogsResponse, type GetV1PostsByPostIdResponse, type GetV1PostsData, type GetV1PostsError, type GetV1PostsResponse, type GetV1ProfilesByProfileIdData, type GetV1ProfilesByProfileIdError, type GetV1ProfilesByProfileIdResponse, type GetV1ProfilesData, type GetV1ProfilesError, type GetV1ProfilesResponse, type GetV1QueueNextSlotData, type GetV1QueueNextSlotError, type GetV1QueueNextSlotResponse, type GetV1QueuePreviewData, type GetV1QueuePreviewError, type GetV1QueuePreviewResponse, type GetV1QueueSlotsData, type GetV1QueueSlotsError, type GetV1QueueSlotsResponse, type GetV1RedditFeedData, type GetV1RedditFeedError, type GetV1RedditFeedResponse, type GetV1RedditSearchData, type GetV1RedditSearchError, type GetV1RedditSearchResponse, type GetV1ToolsBlueskyDownloadData, type GetV1ToolsBlueskyDownloadError, type GetV1ToolsBlueskyDownloadResponse, type GetV1ToolsFacebookDownloadData, type GetV1ToolsFacebookDownloadError, type GetV1ToolsFacebookDownloadResponse, type GetV1ToolsInstagramDownloadData, type GetV1ToolsInstagramDownloadError, type GetV1ToolsInstagramDownloadResponse, type GetV1ToolsLinkedinDownloadData, type GetV1ToolsLinkedinDownloadError, type GetV1ToolsLinkedinDownloadResponse, type GetV1ToolsTiktokDownloadData, type GetV1ToolsTiktokDownloadError, type GetV1ToolsTiktokDownloadResponse, type GetV1ToolsTwitterDownloadData, type GetV1ToolsTwitterDownloadError, type GetV1ToolsTwitterDownloadResponse, type GetV1ToolsYoutubeDownloadData, type GetV1ToolsYoutubeDownloadError, type GetV1ToolsYoutubeDownloadResponse, type GetV1ToolsYoutubeTranscriptData, type GetV1ToolsYoutubeTranscriptError, type GetV1ToolsYoutubeTranscriptResponse, type GetV1UsageStatsError, type GetV1UsageStatsResponse, type GetV1UsersByUserIdData, type GetV1UsersByUserIdError, type GetV1UsersByUserIdResponse, type GetV1UsersError, type GetV1UsersResponse, type GetV1WebhooksLogsData, type GetV1WebhooksLogsError, type GetV1WebhooksLogsResponse, type GetV1WebhooksSettingsError, type GetV1WebhooksSettingsResponse, type GoogleBusinessPlatformData, type HashtagCheckResponse, type HashtagInfo, type InstagramPlatformData, Late, LateApiError, type LinkedInAggregateAnalyticsDailyResponse, type LinkedInAggregateAnalyticsTotalResponse, type LinkedInPlatformData, type MediaItem, type MediaUploadResponse, type Pagination, type ParameterLimitParam, type ParameterPageParam, type PatchV1ConnectTelegramData, type PatchV1ConnectTelegramError, type PatchV1ConnectTelegramResponse, type PinterestPlatformData, type PlatformAnalytics, type PlatformTarget, type Post, type PostAnalytics, type PostCreateResponse, type PostDeleteResponse, type PostGetResponse, type PostLog, type PostLogDetail, type PostRetryResponse, type PostUpdateResponse, type PostV1AccountGroupsData, type PostV1AccountGroupsError, type PostV1AccountGroupsResponse, type PostV1ApiKeysData, type PostV1ApiKeysError, type PostV1ApiKeysResponse, type PostV1ConnectBlueskyCredentialsData, type PostV1ConnectBlueskyCredentialsError, type PostV1ConnectBlueskyCredentialsResponse, type PostV1ConnectByPlatformData, type PostV1ConnectByPlatformError, type PostV1ConnectByPlatformResponse, type PostV1ConnectFacebookSelectPageData, type PostV1ConnectFacebookSelectPageError, type PostV1ConnectFacebookSelectPageResponse, type PostV1ConnectGooglebusinessSelectLocationData, type PostV1ConnectGooglebusinessSelectLocationError, type PostV1ConnectGooglebusinessSelectLocationResponse, type PostV1ConnectLinkedinSelectOrganizationData, type PostV1ConnectLinkedinSelectOrganizationError, type PostV1ConnectLinkedinSelectOrganizationResponse, type PostV1ConnectPinterestSelectBoardData, type PostV1ConnectPinterestSelectBoardError, type PostV1ConnectPinterestSelectBoardResponse, type PostV1ConnectSnapchatSelectProfileData, type PostV1ConnectSnapchatSelectProfileError, type PostV1ConnectSnapchatSelectProfileResponse, type PostV1ConnectTelegramData, type PostV1ConnectTelegramError, type PostV1ConnectTelegramResponse, type PostV1InviteTokensData, type PostV1InviteTokensError, type PostV1InviteTokensResponse, type PostV1MediaPresignData, type PostV1MediaPresignError, type PostV1MediaPresignResponse, type PostV1PlatformInvitesData, type PostV1PlatformInvitesError, type PostV1PlatformInvitesResponse, type PostV1PostsBulkUploadData, type PostV1PostsBulkUploadError, type PostV1PostsBulkUploadResponse, type PostV1PostsByPostIdRetryData, type PostV1PostsByPostIdRetryError, type PostV1PostsByPostIdRetryResponse, type PostV1PostsData, type PostV1PostsError, type PostV1PostsResponse, type PostV1ProfilesData, type PostV1ProfilesError, type PostV1ProfilesResponse, type PostV1QueueSlotsData, type PostV1QueueSlotsError, type PostV1QueueSlotsResponse, type PostV1ToolsInstagramHashtagCheckerData, type PostV1ToolsInstagramHashtagCheckerError, type PostV1ToolsInstagramHashtagCheckerResponse, type PostV1WebhooksSettingsData, type PostV1WebhooksSettingsError, type PostV1WebhooksSettingsResponse, type PostV1WebhooksTestData, type PostV1WebhooksTestError, type PostV1WebhooksTestResponse, type PostsListResponse, type Profile, type ProfileCreateResponse, type ProfileDeleteResponse, type ProfileGetResponse, type ProfileUpdateResponse, type ProfilesListResponse, type PutV1AccountGroupsByGroupIdData, type PutV1AccountGroupsByGroupIdError, type PutV1AccountGroupsByGroupIdResponse, type PutV1AccountsByAccountIdData, type PutV1AccountsByAccountIdError, type PutV1AccountsByAccountIdFacebookPageData, type PutV1AccountsByAccountIdFacebookPageError, type PutV1AccountsByAccountIdFacebookPageResponse, type PutV1AccountsByAccountIdLinkedinOrganizationData, type PutV1AccountsByAccountIdLinkedinOrganizationError, type PutV1AccountsByAccountIdLinkedinOrganizationResponse, type PutV1AccountsByAccountIdPinterestBoardsData, type PutV1AccountsByAccountIdPinterestBoardsError, type PutV1AccountsByAccountIdPinterestBoardsResponse, type PutV1AccountsByAccountIdRedditSubredditsData, type PutV1AccountsByAccountIdRedditSubredditsError, type PutV1AccountsByAccountIdRedditSubredditsResponse, type PutV1AccountsByAccountIdResponse, type PutV1PostsByPostIdData, type PutV1PostsByPostIdError, type PutV1PostsByPostIdResponse, type PutV1ProfilesByProfileIdData, type PutV1ProfilesByProfileIdError, type PutV1ProfilesByProfileIdResponse, type PutV1QueueSlotsData, type PutV1QueueSlotsError, type PutV1QueueSlotsResponse, type PutV1WebhooksSettingsData, type PutV1WebhooksSettingsError, type PutV1WebhooksSettingsResponse, type QueueDeleteResponse, type QueueNextSlotResponse, type QueuePreviewResponse, type QueueSchedule, type QueueSlot, type QueueSlotsResponse, type QueueUpdateResponse, RateLimitError, type SnapchatPlatformData, type SocialAccount, type TelegramPlatformData, type ThreadsPlatformData, type TikTokPlatformData, type TikTokSettings, type TranscriptResponse, type TranscriptSegment, type TwitterPlatformData, type UploadTokenResponse, type UploadTokenStatusResponse, type UploadedFile, type UsageStats, type User, type UserGetResponse, type UsersListResponse, ValidationError, type Webhook, type WebhookLog, type WebhookPayloadAccountDisconnected, type WebhookPayloadPost, type YouTubeDailyViewsResponse, type YouTubePlatformData, type YouTubeScopeMissingResponse, type action, type aggregation, type aggregation2, type aggregation3, type billingPeriod, type commercialContentType, type contentType, type contentType2, Late as default, type disconnectionType, type event, type event2, type event3, type graduationStrategy, type mediaType, parseApiError, type parseMode, type platform, type status, type status2, type status3, type status4, type status5, type type, type type2, type type3, type visibility };