import * as _hey_api_client_fetch from '@hey-api/client-fetch'; interface ClientOptions { /** * API key for authentication. Defaults to process.env['ZERNIO_API_KEY'] (falls back to LATE_API_KEY). */ apiKey?: string | undefined; /** * Override the default base URL for the API. * @default "https://zernio.com/api" */ baseURL?: string | null | undefined; /** * The maximum amount of time (in milliseconds) that the client should wait for a response. * @default 60000 */ timeout?: number; /** * Default headers to include with every request. */ defaultHeaders?: Record; } /** * API Client for the Zernio API. * * @example * ```typescript * import Zernio from '@zernio/node'; * * const zernio = new Zernio({ * apiKey: process.env['ZERNIO_API_KEY'], // This is the default and can be omitted * }); * * async function main() { * const post = await zernio.posts.create({ * body: { * content: 'Hello from the Zernio SDK!', * platforms: [{ platform: 'twitter', accountId: 'acc_123' }], * publishNow: true, * }, * }); * console.log(post.data); * } * * main(); * ``` */ declare class Zernio { private _options; /** * HTTP client owned by this instance. Every namespace method below is bound * to it, so two Zernio instances in the same process never see each other's * credentials. */ private _client; /** * Wrapper around `_client` that `_bind` injects into operations. Identical * to `_client` except that its HTTP methods strip the `client` selector from * request options before dispatch (see `_stripClientSelector`). */ private _dispatchClient; /** * API key used for authentication. */ apiKey: string; /** * Base URL for API requests. */ baseURL: string; /** * Routes a generated operation through this instance's client, preserving the * operation's own signature. Reads `_client` when the method is called, not * when it is bound, because class fields initialize before the constructor * body runs. */ private _bind; /** * TODO: remove once hey-api ships a fix for * https://github.com/hey-api/hey-api/issues/4177 and we can upgrade. * * `_bind` injects the per-instance client into each operation's options * under the `client` key, and the generated operations forward that whole * options object to @hey-api/client-fetch, which spreads it into the fetch * `RequestInit`. Node's undici ignores unknown init fields, but Deno defines * its own `client` init option (a `Deno.HttpClient`) and validates it, so * `new Request(...)` throws and every SDK call fails on Deno, Deno Deploy, * and Supabase Edge Functions. The selector has already done its job by the * time an HTTP method runs, so this wrapper strips it before hey-api builds * the request. The real client is left untouched — config and interceptors * still live on it, and the wrapper delegates everything else to it. */ private static _stripClientSelector; /** * validate API */ validate: { validatePostLength: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; validatePost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; validateMedia: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; validateSubreddit: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Analytics API - Get performance metrics */ analytics: { getAnalytics: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getYouTubeChannelInsights: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getLinkedInOrgAggregateAnalytics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getTikTokAccountInsights: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getYouTubeDailyViews: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getYouTubeVideoRetention: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getFacebookPageInsights: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getFacebookPostEarnings: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInstagramAccountInsights: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInstagramFollowerHistory: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInstagramDemographics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getYouTubeDemographics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getDailyMetrics: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getBestTimeToPost: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getContentDecay: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getPostingFrequency: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getPostTimeline: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getGoogleBusinessPerformance: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getGoogleBusinessSearchKeywords: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; syncExternalPosts: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getLinkedInAggregateAnalytics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getLinkedInPostAnalytics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getLinkedInPostReactions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getFacebookPostReactions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * inboxanalytics API */ inboxanalytics: { getInboxVolume: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInboxHeatmap: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInboxSourceBreakdown: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInboxResponseTime: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInboxTopAccounts: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listInboxConversationAnalytics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInboxConversationAnalytics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Account Groups API - Organize accounts into groups */ accountGroups: { listAccountGroups: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createAccountGroup: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateAccountGroup: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteAccountGroup: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Media API - Upload and manage media files */ media: { getMediaPresignedUrl: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Reddit API - Search and feed */ reddit: { searchReddit: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getRedditFeed: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Usage API - Get usage statistics */ usage: { getBilling: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getXApiPricing: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getUsage: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getUsageStats: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getCallsUsage: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getSmsUsage: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Posts API - Create, schedule, and manage social media posts */ posts: { listPosts: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createPost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getPost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updatePost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deletePost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; bulkUploadPosts: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; retryPost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; unpublishPost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; editPost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updatePostMetadata: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Users API - User management */ users: { listUsers: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getUser: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Profiles API - Manage workspace profiles */ profiles: { listProfiles: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createProfile: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getProfile: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateProfile: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteProfile: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Accounts API - Manage connected social media accounts */ accounts: { listAccounts: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getFollowerStats: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateAccount: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; moveAccountToProfile: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteAccount: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getAllAccountsHealth: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getAccountHealth: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInstagramFollowStatus: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getTikTokCreatorInfo: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getGoogleBusinessReviews: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; batchGetGoogleBusinessReviews: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; replyToGoogleBusinessReview: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteGoogleBusinessReviewReply: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getLinkedInMentions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getSlackSettings: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateSlackSettings: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getBlueskySettings: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateBlueskySettings: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * whatsapp API */ whatsapp: { registerWhatsAppNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppMedia: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppTemplates: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createWhatsAppTemplate: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppTemplate: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateWhatsAppTemplate: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteWhatsAppTemplate: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppBusinessProfile: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateWhatsAppBusinessProfile: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; uploadWhatsAppProfilePhoto: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppDisplayName: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateWhatsAppDisplayName: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsappBusinessUsername: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; setWhatsappBusinessUsername: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteWhatsappBusinessUsername: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsappBusinessUsernameSuggestions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppBlockStatus: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppBlockedUsers: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; blockWhatsAppUsers: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; unblockWhatsAppUsers: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listWhatsAppAccountEvents: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppDataset: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createWhatsAppDataset: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listWhatsAppGroupChats: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createWhatsAppGroupChat: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppGroupChat: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateWhatsAppGroupChat: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteWhatsAppGroupChat: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; addWhatsAppGroupParticipants: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; removeWhatsAppGroupParticipants: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createWhatsAppGroupInviteLink: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listWhatsAppGroupJoinRequests: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; approveWhatsAppGroupJoinRequests: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; rejectWhatsAppGroupJoinRequests: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listWhatsAppConversions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; sendWhatsAppConversion: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * API Keys API - Manage API keys */ apiKeys: { verifyCredential: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listApiKeys: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createApiKey: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteApiKey: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * connectedapps API */ connectedapps: { listConnectedApps: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; revokeConnectedApp: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Invites API - Team invitations */ invites: { createInviteToken: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Connect API - OAuth connection flows */ connect: { getConnectUrl: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; handleOAuthCallback: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; connectAds: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getShopifyConnectUrl: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; connectShopifyWithToken: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; configureTikTokAdsBrandIdentity: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listInstagramPages: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; selectInstagramAccount: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getPendingOAuthData: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; connectOpenAIAdsCredentials: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; connectWhatsAppCredentials: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listWhatsAppPhoneNumbers: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; completeWhatsAppPhoneSelection: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getFacebookPages: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateFacebookPage: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getLinkedInOrganizations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateLinkedInOrganization: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getPinterestBoards: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updatePinterestBoards: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createPinterestBoard: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getYoutubePlaylists: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateYoutubeDefaultPlaylist: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getGmbLocations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateGmbLocation: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; assignGoogleBusinessLocation: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getRedditSubreddits: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateRedditSubreddits: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getSubredditRules: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; voteRedditThing: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getRedditFlairs: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; setRedditPostFlair: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; facebook: { listFacebookPages: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; selectFacebookPage: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; googleBusiness: { listGoogleBusinessLocations: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; selectGoogleBusinessLocation: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; linkedin: { listLinkedInOrganizations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; selectLinkedInOrganization: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; pinterest: { listPinterestBoardsForSelection: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; selectPinterestBoard: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; snapchat: { listSnapchatProfiles: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; selectSnapchatProfile: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; bluesky: { connectBlueskyCredentials: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; telegram: { getTelegramConnectStatus: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; initiateTelegramConnect: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; completeTelegramConnect: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; }; /** * gmbverifications API */ gmbverifications: { getGoogleBusinessVerifications: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; startGoogleBusinessVerification: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; fetchGoogleBusinessVerificationOptions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; completeGoogleBusinessVerification: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * gmbfoodmenus API */ gmbfoodmenus: { getGoogleBusinessFoodMenus: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateGoogleBusinessFoodMenus: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * gmblocationdetails API */ gmblocationdetails: { getGoogleBusinessLocationDetails: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateGoogleBusinessLocationDetails: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * gmbmedia API */ gmbmedia: { listGoogleBusinessMedia: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createGoogleBusinessMedia: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteGoogleBusinessMedia: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * gmbattributes API */ gmbattributes: { getGmbAttributeMetadata: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getGoogleBusinessAttributes: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateGoogleBusinessAttributes: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * gmbplaceactions API */ gmbplaceactions: { listGoogleBusinessPlaceActions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createGoogleBusinessPlaceAction: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteGoogleBusinessPlaceAction: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateGoogleBusinessPlaceAction: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * gmbservices API */ gmbservices: { getGoogleBusinessServices: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateGoogleBusinessServices: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * instagram API */ instagram: { listInstagramStories: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInstagramPublishingLimit: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; searchInstagramAudio: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInstagramAudio: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInstagramStoryInsights: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * discord API */ discord: { getDiscordSettings: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateDiscordSettings: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getDiscordChannels: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; sendDiscordDirectMessage: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listDiscordGuildRoles: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createDiscordGuildRole: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; editDiscordGuildRole: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteDiscordGuildRole: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listDiscordGuildMembers: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; searchDiscordGuildMembers: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getDiscordGuildMember: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; addDiscordMemberRole: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; removeDiscordMemberRole: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteDiscordMessage: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; crosspostDiscordMessage: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createDiscordThread: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listDiscordPinnedMessages: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; pinDiscordMessage: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; unpinDiscordMessage: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listDiscordScheduledEvents: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createDiscordScheduledEvent: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getDiscordScheduledEvent: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateDiscordScheduledEvent: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteDiscordScheduledEvent: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * slack API */ slack: { listSlackMembers: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Queue API - Manage posting queue */ queue: { listQueueSlots: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createQueueSlot: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateQueueSlot: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteQueueSlot: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; previewQueue: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getNextQueueSlot: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Webhooks API - Configure event webhooks */ webhooks: { getWebhookSettings: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createWebhookSettings: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateWebhookSettings: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteWebhookSettings: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWebhookLogs: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; testWebhook: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Logs API - Publishing logs */ logs: { listLogs: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * messages API */ messages: { listInboxConversations: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createInboxConversation: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; searchInboxConversations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInboxConversation: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateInboxConversation: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInboxConversationMessages: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; sendInboxMessage: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; editInboxMessage: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteInboxMessage: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; sendTypingIndicator: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; markConversationRead: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; addMessageReaction: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; removeMessageReaction: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; uploadMediaDirect: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getMessageAttachment: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * accountsettings API */ accountsettings: { getMessengerMenu: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; setMessengerMenu: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteMessengerMenu: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInstagramIceBreakers: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; setInstagramIceBreakers: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteInstagramIceBreakers: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getTelegramCommands: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; setTelegramCommands: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteTelegramCommands: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * comments API */ comments: { listInboxComments: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getInboxPostComments: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; replyToInboxPost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteInboxComment: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; editInboxComment: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; setCommentModeration: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; hideInboxComment: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; unhideInboxComment: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; likeInboxComment: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; unlikeInboxComment: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; likePost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; unlikePost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; sendPrivateReplyToComment: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * twitterengagement API */ twitterengagement: { retweetPost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; undoRetweet: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; bookmarkPost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; removeBookmark: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; followUser: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; unfollowUser: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; searchTweets: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getTweet: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * mentions API */ mentions: { listInboxMentions: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; replyToMention: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * reviews API */ reviews: { listInboxReviews: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; replyToInboxReview: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteInboxReviewReply: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * whatsappcalling API */ whatsappcalling: { getWhatsAppCallingConfig: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; enableWhatsAppCallingLegacy: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateWhatsAppCallingLegacy: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; disableWhatsAppCallingLegacy: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppCallPermissions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; initiateWhatsAppCall: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listWhatsAppCalls: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppCall: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppCallRecording: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppCallEstimate: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppCalling: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; enableWhatsAppCalling: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateWhatsAppCalling: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; disableWhatsAppCalling: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; startWhatsAppCallerIdVerification: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; verifyWhatsAppCallerId: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * calls API */ calls: { listCalls: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getCall: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getCallRecording: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * voice API */ voice: { createVoiceCall: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listVoiceCalls: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getVoiceCall: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; endVoiceCall: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getVoiceCallRecording: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; transferVoiceCall: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getVoiceCallEstimate: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createVoiceWebSession: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; dialVoiceWebCall: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; enableVoiceOnNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; disableVoiceOnNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * sms API */ sms: { sendSms: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; lookupSmsNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listSmsOptOuts: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createSmsSenderId: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listSmsSenderIds: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; requestSmsSenderIdLimitIncrease: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteSmsSenderId: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; startSmsRegistration: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listSmsRegistrations: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; preflightSmsRegistration: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deactivateSmsRegistration: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getSmsRegistration: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; verifySmsRegistrationOtp: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; resendSmsRegistrationOtp: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; appealSmsRegistration: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; respondToSmsRegistrationReview: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; uploadSmsOptInProofFile: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; uploadSmsOptInProof: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; shareSmsRegistration: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; enableSmsOnNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; disableSmsOnNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; reuseSmsRegistrationForNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * whatsapptemplates API */ whatsapptemplates: { getWhatsAppLibraryTemplate: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * whatsappphonenumbers API */ whatsappphonenumbers: { getWhatsAppNumberInfo: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppPhoneNumbers: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; purchaseWhatsAppPhoneNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listWhatsAppNumberCountries: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; searchAvailableWhatsAppNumbers: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; checkWhatsAppNumberAvailability: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppNumberKycForm: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; submitWhatsAppNumberKyc: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; uploadWhatsAppNumberKycDocument: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; validateWhatsAppNumberKycAddress: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createWhatsAppNumberKycLink: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; moveWhatsAppNumberToProfile: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppNumberRemediation: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; remediateWhatsAppNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppPhoneNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; releaseWhatsAppPhoneNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * phonenumbers API */ phonenumbers: { listPhoneNumbers: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getPhoneNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; releasePhoneNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; purchasePhoneNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listPhoneNumberCountries: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; searchAvailablePhoneNumbers: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; checkPhoneNumberAvailability: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getPhoneNumberKycForm: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; submitPhoneNumberKyc: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; viewPhoneNumberKycDocument: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; uploadPhoneNumberKycDocument: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; validatePhoneNumberKycAddress: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createPhoneNumberKycLink: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createPhoneNumberPortIn: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listPhoneNumberPortIns: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; checkPhoneNumberPortability: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; uploadPhoneNumberPortInDocument: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getPhoneNumberPortInRequirements: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getPhoneNumberPortInOrderRequirements: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; cancelPhoneNumberPortIn: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; reviewPhoneNumberKycPacket: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getPhoneNumberRemediation: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; remediatePhoneNumber: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; replyToPhoneNumberReviewer: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; respondToPhoneNumberReviewer: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * whatsappsandbox API */ whatsappsandbox: { listWhatsAppSandboxSessions: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createWhatsAppSandboxSession: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteWhatsAppSandboxSession: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * whatsappflows API */ whatsappflows: { listWhatsAppFlows: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createWhatsAppFlow: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppFlow: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateWhatsAppFlow: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteWhatsAppFlow: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppFlowJson: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; uploadWhatsAppFlowJson: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWhatsAppFlowPreview: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listWhatsAppFlowVersions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; publishWhatsAppFlow: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deprecateWhatsAppFlow: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; sendWhatsAppFlowMessage: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listWhatsAppFlowResponses: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * contacts API */ contacts: { listContacts: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createContact: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getContact: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateContact: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteContact: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getContactChannels: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; bulkCreateContacts: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * customfields API */ customfields: { setContactFieldValue: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; clearContactFieldValue: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listCustomFields: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createCustomField: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateCustomField: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteCustomField: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * broadcasts API */ broadcasts: { listBroadcasts: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createBroadcast: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getBroadcast: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateBroadcast: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteBroadcast: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; sendBroadcast: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; scheduleBroadcast: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; cancelBroadcast: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listBroadcastRecipients: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; addBroadcastRecipients: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * workflows API */ workflows: { listWorkflows: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createWorkflow: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWorkflow: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateWorkflow: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteWorkflow: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; activateWorkflow: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; pauseWorkflow: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listWorkflowExecutions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; triggerWorkflow: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listWorkflowExecutionEvents: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; duplicateWorkflow: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listWorkflowVersions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getWorkflowVersion: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; restoreWorkflowVersion: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * sequences API */ sequences: { listSequences: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createSequence: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getSequence: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateSequence: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteSequence: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; activateSequence: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; pauseSequence: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; enrollContacts: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; unenrollContact: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listSequenceEnrollments: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * commentautomations API */ commentautomations: { listCommentAutomations: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createCommentAutomation: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getCommentAutomation: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateCommentAutomation: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteCommentAutomation: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listCommentAutomationLogs: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * adcampaigns API */ adcampaigns: { listAds: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listAdKeywords: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listAdCampaigns: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createAdCampaign: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateAdCampaignStatus: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateAdCampaign: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteAdCampaign: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; bulkUpdateAdCampaignStatus: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; duplicateAdCampaign: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; duplicateAdSet: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; duplicateAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getAdSetDetails: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateAdSet: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateAdSetStatus: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getAdTree: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getAdsTimeline: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateAdStatus: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; boostPost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createStandaloneAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * adinsights API */ adinsights: { getAdsSearchTerms: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listLocalServicesLeads: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listLocalServicesLeadConversations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getCampaignAnalytics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; generateKeywordIdeas: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; generateKeywordHistoricalMetrics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; queryAdInsights: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createAdInsightsReport: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getAdInsightsReport: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getAdAnalytics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * adcreatives API */ adcreatives: { generateAdPreviews: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getAdPreviews: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listAdCreatives: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createAdCreative: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getAdCreative: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateAdCreative: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteAdCreative: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; uploadAdImage: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listAdImages: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listAdVideos: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listAdCatalogs: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listAdCatalogProductSets: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * trackingtags API */ trackingtags: { getAdTrackingTags: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateAdTrackingTags: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listTrackingTags: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createTrackingTag: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getTrackingTag: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateTrackingTag: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listTrackingTagSharedAccounts: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; addTrackingTagSharedAccount: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; removeTrackingTagSharedAccount: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getTrackingTagStats: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * adaccounts API */ adaccounts: { getAdComments: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listAdsBusinessCenters: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getAdsActivityLog: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listAdStudies: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listMetaBusinesses: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listAdLabels: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listHighDemandPeriods: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createHighDemandPeriod: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listValueRuleSets: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createValueRuleSet: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getValueRuleSet: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateValueRuleSet: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteValueRuleSet: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getAdAccountFinance: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listAdAccounts: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateAdAccount: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getDsaDefaults: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getDsaRecommendations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listCustomConversions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createCustomConversion: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * reachandfrequency API */ reachandfrequency: { createRfPrediction: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getRfPrediction: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; cancelRfReservation: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; reserveRfPrediction: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * leadgen API */ leadgen: { listLeads: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listLeadForms: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createLeadForm: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getLeadForm: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; archiveLeadForm: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listFormLeads: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createTestLead: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * adtargeting API */ adtargeting: { searchAdInterests: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; searchAdTargeting: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; estimateAdReach: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getLinkedInBidPricing: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getLinkedInSupplyForecast: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * adaudiences API */ adaudiences: { listAdAudiences: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createAdAudience: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getAdAudience: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateAdAudience: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteAdAudience: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; addUsersToAdAudience: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; replaceAdAudienceCompanies: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * conversions API */ conversions: { getConversionsQuality: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; sendConversions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; adjustConversions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listConversionDestinations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createConversionDestination: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getConversionDestination: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateConversionDestination: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteConversionDestination: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listConversionAssociations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; addConversionAssociations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; removeConversionAssociations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getConversionMetrics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * messagingads API */ messagingads: { createMessagingAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createCallAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createCtwaAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * blogs API */ blogs: { listBlogs: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createBlog: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getBlog: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateBlog: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteBlog: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; listBlogArticles: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; createBlogArticle: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getBlogArticle: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; updateBlogArticle: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; deleteBlogArticle: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * verify API */ verify: { createVerification: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; getVerification: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; checkVerification: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * @deprecated The `ads` namespace has been split. Use one of these instead: * zernio.adcampaigns, zernio.adaccounts, zernio.adcreatives, zernio.adaudiences, zernio.adtargeting, zernio.adinsights, zernio.conversions, zernio.messagingads, zernio.reachandfrequency, zernio.leadgen, zernio.trackingtags. * This backward-compatibility alias will be removed in a future major version. */ ads: { /** @deprecated Use `zernio.adcampaigns.listAds` instead. */ listAds: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.listAdKeywords` instead. */ listAdKeywords: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.listAdCampaigns` instead. */ listAdCampaigns: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.createAdCampaign` instead. */ createAdCampaign: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.updateAdCampaignStatus` instead. */ updateAdCampaignStatus: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.updateAdCampaign` instead. */ updateAdCampaign: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.deleteAdCampaign` instead. */ deleteAdCampaign: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.bulkUpdateAdCampaignStatus` instead. */ bulkUpdateAdCampaignStatus: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.duplicateAdCampaign` instead. */ duplicateAdCampaign: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.duplicateAdSet` instead. */ duplicateAdSet: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.duplicateAd` instead. */ duplicateAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.getAdSetDetails` instead. */ getAdSetDetails: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.updateAdSet` instead. */ updateAdSet: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.updateAdSetStatus` instead. */ updateAdSetStatus: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.getAdTree` instead. */ getAdTree: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.getAdsTimeline` instead. */ getAdsTimeline: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.getAd` instead. */ getAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.updateAd` instead. */ updateAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.deleteAd` instead. */ deleteAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.updateAdStatus` instead. */ updateAdStatus: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.boostPost` instead. */ boostPost: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcampaigns.createStandaloneAd` instead. */ createStandaloneAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.getAdComments` instead. */ getAdComments: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.listAdsBusinessCenters` instead. */ listAdsBusinessCenters: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.getAdsActivityLog` instead. */ getAdsActivityLog: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.listAdStudies` instead. */ listAdStudies: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.listMetaBusinesses` instead. */ listMetaBusinesses: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.listAdLabels` instead. */ listAdLabels: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.listHighDemandPeriods` instead. */ listHighDemandPeriods: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.createHighDemandPeriod` instead. */ createHighDemandPeriod: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.listValueRuleSets` instead. */ listValueRuleSets: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.createValueRuleSet` instead. */ createValueRuleSet: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.getValueRuleSet` instead. */ getValueRuleSet: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.updateValueRuleSet` instead. */ updateValueRuleSet: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.deleteValueRuleSet` instead. */ deleteValueRuleSet: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.getAdAccountFinance` instead. */ getAdAccountFinance: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.listAdAccounts` instead. */ listAdAccounts: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.updateAdAccount` instead. */ updateAdAccount: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.getDsaDefaults` instead. */ getDsaDefaults: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.getDsaRecommendations` instead. */ getDsaRecommendations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.listCustomConversions` instead. */ listCustomConversions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaccounts.createCustomConversion` instead. */ createCustomConversion: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcreatives.generateAdPreviews` instead. */ generateAdPreviews: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcreatives.getAdPreviews` instead. */ getAdPreviews: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcreatives.listAdCreatives` instead. */ listAdCreatives: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcreatives.createAdCreative` instead. */ createAdCreative: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcreatives.getAdCreative` instead. */ getAdCreative: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcreatives.updateAdCreative` instead. */ updateAdCreative: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcreatives.deleteAdCreative` instead. */ deleteAdCreative: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcreatives.uploadAdImage` instead. */ uploadAdImage: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcreatives.listAdImages` instead. */ listAdImages: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcreatives.listAdVideos` instead. */ listAdVideos: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcreatives.listAdCatalogs` instead. */ listAdCatalogs: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adcreatives.listAdCatalogProductSets` instead. */ listAdCatalogProductSets: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaudiences.listAdAudiences` instead. */ listAdAudiences: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaudiences.createAdAudience` instead. */ createAdAudience: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaudiences.getAdAudience` instead. */ getAdAudience: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaudiences.updateAdAudience` instead. */ updateAdAudience: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaudiences.deleteAdAudience` instead. */ deleteAdAudience: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaudiences.addUsersToAdAudience` instead. */ addUsersToAdAudience: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adaudiences.replaceAdAudienceCompanies` instead. */ replaceAdAudienceCompanies: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adtargeting.searchAdInterests` instead. */ searchAdInterests: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adtargeting.searchAdTargeting` instead. */ searchAdTargeting: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adtargeting.estimateAdReach` instead. */ estimateAdReach: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adtargeting.getLinkedInBidPricing` instead. */ getLinkedInBidPricing: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adtargeting.getLinkedInSupplyForecast` instead. */ getLinkedInSupplyForecast: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adinsights.getAdsSearchTerms` instead. */ getAdsSearchTerms: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adinsights.listLocalServicesLeads` instead. */ listLocalServicesLeads: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adinsights.listLocalServicesLeadConversations` instead. */ listLocalServicesLeadConversations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adinsights.getCampaignAnalytics` instead. */ getCampaignAnalytics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adinsights.generateKeywordIdeas` instead. */ generateKeywordIdeas: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adinsights.generateKeywordHistoricalMetrics` instead. */ generateKeywordHistoricalMetrics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adinsights.queryAdInsights` instead. */ queryAdInsights: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adinsights.createAdInsightsReport` instead. */ createAdInsightsReport: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adinsights.getAdInsightsReport` instead. */ getAdInsightsReport: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.adinsights.getAdAnalytics` instead. */ getAdAnalytics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.conversions.getConversionsQuality` instead. */ getConversionsQuality: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.conversions.sendConversions` instead. */ sendConversions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.conversions.adjustConversions` instead. */ adjustConversions: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.conversions.listConversionDestinations` instead. */ listConversionDestinations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.conversions.createConversionDestination` instead. */ createConversionDestination: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.conversions.getConversionDestination` instead. */ getConversionDestination: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.conversions.updateConversionDestination` instead. */ updateConversionDestination: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.conversions.deleteConversionDestination` instead. */ deleteConversionDestination: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.conversions.listConversionAssociations` instead. */ listConversionAssociations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.conversions.addConversionAssociations` instead. */ addConversionAssociations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.conversions.removeConversionAssociations` instead. */ removeConversionAssociations: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.conversions.getConversionMetrics` instead. */ getConversionMetrics: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.messagingads.createMessagingAd` instead. */ createMessagingAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.messagingads.createCallAd` instead. */ createCallAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.messagingads.createCtwaAd` instead. */ createCtwaAd: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.reachandfrequency.createRfPrediction` instead. */ createRfPrediction: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.reachandfrequency.getRfPrediction` instead. */ getRfPrediction: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.reachandfrequency.cancelRfReservation` instead. */ cancelRfReservation: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.reachandfrequency.reserveRfPrediction` instead. */ reserveRfPrediction: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.leadgen.listLeads` instead. */ listLeads: (options?: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.leadgen.listLeadForms` instead. */ listLeadForms: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.leadgen.createLeadForm` instead. */ createLeadForm: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.leadgen.getLeadForm` instead. */ getLeadForm: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.leadgen.archiveLeadForm` instead. */ archiveLeadForm: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.leadgen.listFormLeads` instead. */ listFormLeads: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.leadgen.createTestLead` instead. */ createTestLead: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.trackingtags.getAdTrackingTags` instead. */ getAdTrackingTags: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.trackingtags.updateAdTrackingTags` instead. */ updateAdTrackingTags: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.trackingtags.listTrackingTags` instead. */ listTrackingTags: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.trackingtags.createTrackingTag` instead. */ createTrackingTag: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.trackingtags.getTrackingTag` instead. */ getTrackingTag: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.trackingtags.updateTrackingTag` instead. */ updateTrackingTag: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.trackingtags.listTrackingTagSharedAccounts` instead. */ listTrackingTagSharedAccounts: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.trackingtags.addTrackingTagSharedAccount` instead. */ addTrackingTagSharedAccount: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.trackingtags.removeTrackingTagSharedAccount` instead. */ removeTrackingTagSharedAccount: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; /** @deprecated Use `zernio.trackingtags.getTrackingTagStats` instead. */ getTrackingTagStats: (options: _hey_api_client_fetch.OptionsLegacyParser) => _hey_api_client_fetch.RequestResult; }; /** * Create a new Zernio API client. * * @param options - Configuration options for the client */ constructor(options?: ClientOptions); } /** @deprecated Use Zernio instead */ declare const Late: typeof Zernio; /** * Base error class for Zernio API errors */ declare class ZernioApiError extends Error { readonly statusCode: number; readonly code?: string; readonly details?: Record; constructor(message: string, statusCode: number, code?: string, details?: Record); /** * Check if this is a rate limit error */ isRateLimited(): boolean; /** * Check if this is an authentication error */ isAuthError(): boolean; /** * Check if this is a permission/access error */ isForbidden(): boolean; /** * Check if this is a not found error */ isNotFound(): boolean; /** * Check if this is a validation error */ isValidationError(): boolean; /** * Check if this is a payment required error */ isPaymentRequired(): boolean; } /** @deprecated Use ZernioApiError instead */ declare const LateApiError: typeof ZernioApiError; /** * Rate limit error with additional rate limit info */ declare class RateLimitError extends ZernioApiError { readonly limit?: number; readonly remaining?: number; readonly resetAt?: Date; constructor(message: string, limit?: number, remaining?: number, resetAt?: Date); /** * Get seconds until rate limit resets */ getSecondsUntilReset(): number | undefined; } /** * Validation error with field-specific details */ declare class ValidationError extends ZernioApiError { readonly fields?: Record; constructor(message: string, fields?: Record); } /** * Parse an error response from the API */ declare function parseApiError(response: Response, body?: { error?: string; message?: string; code?: string; details?: Record; }): ZernioApiError; type AccountsListResponse = { accounts: Array; /** * Whether user has analytics add-on access */ hasAnalyticsAccess: boolean; /** * Only present when page/limit params are provided */ pagination?: Pagination; }; type AccountWithFollowerStats = SocialAccount & { /** * Current follower count */ currentFollowers?: number; lastUpdated?: string; /** * Follower change over period */ growth?: number; /** * Percentage growth */ growthPercentage?: number; /** * Number of historical snapshots */ dataPoints?: number; /** * Platform-specific account stats from the latest daily snapshot. * Fields vary by platform. Only present if metadata has been captured. * */ accountStats?: { /** * Number of accounts being followed */ followingCount?: number; /** * Total media posts (Instagram) */ mediaCount?: number; /** * Total videos (YouTube, TikTok) */ videoCount?: number; /** * Total tweets (X/Twitter) */ tweetCount?: number; /** * Total posts (Bluesky) */ postsCount?: number; /** * Total pins (Pinterest) */ pinCount?: number; /** * Total channel views (YouTube) */ totalViews?: number; /** * Total likes received (TikTok) */ likesCount?: number; /** * Monthly profile views (Pinterest) */ monthlyViews?: number; /** * Lists the user appears on (X/Twitter) */ listedCount?: number; /** * Total boards (Pinterest) */ boardCount?: number; }; }; type Ad = { _id?: string; name?: string; platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter' | 'openai'; /** * Delivery status. Derived from the platform `effective_status`, so it inherits ancestor pauses (an ACTIVE ad under a PAUSED campaign reads `paused`). For the ad's own on/off toggle use `configuredStatus`; for the review state use `reviewStatus`. */ status?: (AdStatus); /** * The ad's own on/off toggle as configured on the platform (Meta `configured_status`: ACTIVE / PAUSED), unaffected by ancestor (ad set / campaign) pauses. Distinct from `status`, which is the ancestor-cascaded delivery status. Only present for Meta ads synced after this field was added. */ configuredStatus?: (string) | null; /** * Platform review state of this ad, independent of delivery `status` / `configuredStatus`. Absent when the platform reports no review signal. */ reviewStatus?: (AdReviewStatus); adType?: 'boost' | 'standalone'; /** * Creative format, classified from the media the creative carries. `null` when the creative carries no media to classify — an unsynced creative and a genuine text-only ad are indistinguishable, so neither is guessed at. Returned by `GET /v1/ads`, `GET /v1/ads/{adId}` and the ad nodes of `GET /v1/ads/tree`. */ creativeType?: ('carousel' | 'video' | 'document' | 'image') | null; /** * Available goals vary by platform. Meta (Facebook/Instagram) supports all 9 (incl. `lead_conversion` = website pixel lead optimization and `catalog_sales` = Advantage+ catalog ads). TikTok supports the 7 non-`lead_conversion` goals. LinkedIn supports all except app_promotion / lead_conversion. Twitter/X supports engagement, traffic, awareness, video_views, app_promotion. Pinterest and Google Ads support only engagement, traffic, awareness, video_views. */ goal?: 'engagement' | 'traffic' | 'awareness' | 'video_views' | 'lead_generation' | 'lead_conversion' | 'conversions' | 'app_promotion' | 'catalog_sales' | 'job_applicants'; /** * True for ads synced from platform ad managers */ isExternal?: boolean; budget?: { amount?: number; type?: 'daily' | 'lifetime'; } | null; metrics?: (AdMetrics | null); platformAdId?: string; platformAdAccountId?: string; platformCampaignId?: string; platformAdSetId?: string; campaignName?: string; adSetName?: string; /** * Raw Meta campaign objective (e.g. OUTCOME_SALES, OUTCOME_LEADS, OUTCOME_TRAFFIC). Only present for Meta ads. */ platformObjective?: (string) | null; /** * What the delivery system optimizes for, at ad-set level. The value space depends on `platform`: * * - Meta: ad set `optimization_goal` (e.g. OFFSITE_CONVERSIONS, VALUE, LEAD_GENERATION, LINK_CLICKS). * - LinkedIn: the campaign's EFFECTIVE `optimizationTargetType`, refreshed from LinkedIn on every * sync rather than echoing what was passed on create. `NONE` means manual bidding, and it is a * real value, not missing data. Auto-bid values are MAX_IMPRESSION / MAX_CLICK / MAX_CONVERSION / * MAX_VIDEO_VIEW / MAX_LEAD / MAX_REACH; target-cost values are TARGET_COST_PER_CLICK / * TARGET_COST_PER_IMPRESSION / TARGET_COST_PER_VIDEO_VIEW; cost-cap values are the * CAP_COST_AND_MAXIMIZE_* family. * */ optimizationGoal?: (string) | null; /** * LinkedIn only. The campaign's EFFECTIVE cost model (billing event) as applied by LinkedIn, * refreshed on every sync rather than echoing what was passed on create. One of `CPM` (cost per * thousand impressions), `CPC` (cost per click) or `CPV` (cost per video view). On LinkedIn this is * the axis that pairs with `bidAmount`; there is no `bidStrategy`. For campaign type * SPONSORED_INMAILS, `CPM` bills as cost-per-send x 1000. `null` for non-LinkedIn ads. * */ costType?: (string) | null; /** * LinkedIn only. Why the parent campaign is (or is not) delivering, verbatim from LinkedIn. * A campaign can report `status: ACTIVE` and still serve nothing; this array is what says so. * * - `[]` means no serving data: a non-LinkedIn ad, or a LinkedIn ad not yet re-synced. * - `["RUNNABLE"]` means the campaign is eligible to serve. * - Anything else is a hold. Known values include ACCOUNT_SERVING_HOLD, ACCOUNT_TOTAL_BUDGET_HOLD, * ACCOUNT_END_DATE_HOLD, CAMPAIGN_START_DATE_HOLD, CAMPAIGN_END_DATE_HOLD, * CAMPAIGN_TOTAL_BUDGET_HOLD, CAMPAIGN_AUDIENCE_COUNT_HOLD, CAMPAIGN_GROUP_START_DATE_HOLD, * CAMPAIGN_GROUP_END_DATE_HOLD, CAMPAIGN_GROUP_TOTAL_BUDGET_HOLD, CAMPAIGN_GROUP_STATUS_HOLD and * STOPPED. The list is open on purpose, so treat unrecognized values as holds rather than errors. * * The end-date and total-budget holds are terminal and surface as `status: completed`; the rest * surface as `status: paused`. Note that a hold is not the only cause of zero delivery: with * manual, target-cost or cost-cap bidding, a `bidAmount` of 0 stops delivery while * `servingStatuses` still reads `["RUNNABLE"]`. Check `costType` / `bidAmount` / * `optimizationGoal` as well. * */ servingStatuses?: Array<(string)>; /** * Human-readable advertiser/account name (Meta `AdAccount.name`, TikTok * `advertiser_name`, LinkedIn / X / Pinterest equivalents). Refreshed every * sync so platform-side renames propagate within one cycle. `null` when the * platform doesn't return a name or the sync hasn't run yet. * */ platformAdAccountName?: (string) | null; /** * Platform-reported creation timestamp (Meta `created_time`, TikTok `create_time`). * Distinct from `createdAt` which reflects when Zernio first synced the doc — for * sort/filter by "when the ad was actually created on the platform", read this field. * `null` for legacy ads synced before this field was added; aggregations fall back * to `createdAt` in that case. * */ platformCreatedAt?: (string) | null; /** * Ad-set bid strategy (overrides campaign level on Meta). Populated for Meta and * TikTok. TikTok's native `bid_type` is normalized to the cross-platform Meta enum: * `BID_TYPE_NO_BID` -> `LOWEST_COST_WITHOUT_CAP`, `BID_TYPE_CUSTOM` -> * `LOWEST_COST_WITH_BID_CAP`, deep_bid_type=MIN_ROAS or roas_bid>0 -> * `LOWEST_COST_WITH_MIN_ROAS`, `BID_TYPE_MAX_CONVERSION` -> `LOWEST_COST_WITHOUT_CAP`. * */ bidStrategy?: (BidStrategy | null); /** * Bid amount in WHOLE currency units of the ad account (USD: 5 = $5.00; JPY: 100 = ¥100). * * - Meta source: `bid_amount` on the ad set (smallest-denomination int, decoded here). Populated * when bidStrategy is `LOWEST_COST_WITH_BID_CAP` or `COST_CAP`; `null` for auto-bid * (`LOWEST_COST_WITHOUT_CAP`). * - TikTok source: priority order `bid_price` -> `conversion_bid_price` -> `deep_cpa_bid` * (whichever is set on the ad group). TikTok stores all three in whole currency units. * - LinkedIn source: the campaign's EFFECTIVE `unitCost`, refreshed on every sync rather than * echoing what was passed on create. Its meaning depends on the bidding mode implied by * `optimizationGoal`: bid amount (manual), target cost, or cost cap. It pairs with `costType`, * NOT with `bidStrategy`, which LinkedIn does not have. A value of `0` is a real, delivery- * stopping configuration and not "unset", so do not gate this field on `bidStrategy` for * LinkedIn ads. * * Source: facebook-business-sdk-codegen api_specs/specs/AdSet.json (`bid_amount`). * */ bidAmount?: (number) | null; /** * Minimum ROAS as a decimal multiplier (2.0 = 2.0x ROAS). Populated when bidStrategy * is `LOWEST_COST_WITH_MIN_ROAS`. * * - Meta source: decoded from `bid_constraints.roas_average_floor` (Meta stores as * fixed-point int × 10000; we return the decimal). * - TikTok source: `roas_bid` on the ad group (already a decimal). * * Source: facebook-business-sdk-codegen api_specs/specs/AdCampaignBidConstraint.json. * */ roasAverageFloor?: (number) | null; /** * Meta promoted object containing conversion event details. Structure varies by objective. Only present for Meta ads. */ promotedObject?: { /** * Conversion event type (e.g. PURCHASE, LEAD, COMPLETE_REGISTRATION, ADD_TO_CART) */ custom_event_type?: string; /** * Meta pixel ID */ pixel_id?: string; /** * Facebook page ID */ page_id?: string; /** * Facebook app ID */ application_id?: string; /** * Product catalog set ID */ product_set_id?: string; } | null; /** * Platform-specific creative data. Fields vary by platform. */ creative?: { /** * Primary thumbnail/image URL */ thumbnailUrl?: (string) | null; /** * Alternative image URL */ imageUrl?: string; /** * Meta video ID for VIDEO-type ads. Null for non-video ads. Callers that need an embeddable MP4 can call GET /{videoId}?fields=source with the page access token. */ videoId?: (string) | null; /** * Public Facebook watch URL for VIDEO-type ads (https://www.facebook.com/watch/?v={videoId}). Null for non-video ads. */ videoUrl?: (string) | null; /** * Meta ad creative id backing this ad. Reusable via existingCreativeId on POST /v1/ads/create. */ creativeId?: (string) | null; /** * Meta creative object_type (e.g. SHARE, VIDEO, PRIVACY_CHECK_FAIL, POST_DELETED). Use this to render state-aware previews — when Meta moderation strips image/video fields, only thumbnailUrl at 64x64 is available. */ objectType?: string; /** * Meta creative `object_story_id` (the SHARE reference). Frequently absent — Meta omits it for SHARE creatives. Use effectiveObjectStoryId instead. */ objectStoryId?: (string) | null; /** * Meta `effective_object_story_id` — `{pageId}_{postId}` of the Facebook post the ad's engagement (comments) lives on. Pass to GET /v1/ads?effectiveObjectStoryId= to map a Business-Manager-visible post back to this ad; GET /v1/ads/{adId}/comments resolves comments against it. */ effectiveObjectStoryId?: (string) | null; /** * Facebook Page backing the creative (Meta only). What the `pageId` filter on /v1/ads, /v1/ads/campaigns and /v1/ads/tree matches against. Absent for non-Meta ads and rare Meta creatives with no page signal. */ pageId?: (string) | null; /** * Meta `effective_instagram_media_id` — the Instagram media ID of the boosted post the ad's engagement lives on. Pass to GET /v1/ads?effectiveInstagramMediaId= to map a Business-Manager-visible IG post back to this ad. */ effectiveInstagramMediaId?: (string) | null; /** * Meta `instagram_user_id` — the Instagram-scoped business ID that owns the boosted media. */ instagramUserId?: (string) | null; /** * Meta `instagram_permalink_url` — public Instagram post URL of the boosted media. */ instagramPermalinkUrl?: (string) | null; /** * All media URLs for this ad (carousel images, multiple assets). Populated for Meta (carousel child_attachments), Google Ads (responsive display marketing_images), and LinkedIn (multi-image posts). */ mediaUrls?: Array<(string)>; /** * LinkedIn only. Whether LinkedIn is currently serving this specific creative. Complements the ad-level `servingStatuses`, which describes the parent campaign. */ isServing?: (boolean) | null; /** * LinkedIn only. Why this specific creative is not being served. Empty when it is serving. * A superset of the ad-level `servingStatuses`: it repeats the inherited campaign, campaign * group and account holds AND adds creative-only causes such as UNDER_REVIEW, REJECTED, * PROCESSING, PROCESSING_FAILED, FORM_HOLD (lead-gen-form creatives), * REFERRED_CONTENT_QUALITY_HOLD, JOB_POSTING_ON_HOLD and JOB_POSTING_INVALID (job ads). * Some values are format-specific and will never appear on other ad formats. The list is * open, so treat unrecognized values as holds rather than errors. * */ servingHoldReasons?: Array<(string)>; /** * Ad copy/text */ body?: string; /** * Google Ads headline */ googleHeadline?: string; /** * Google Ads description */ googleDescription?: string; /** * Destination URL */ linkUrl?: string; pinterestImageUrl?: string; pinterestTitle?: string; pinterestDescription?: string; } | null; /** * The ad set's targeting (age, gender, geo, interests, placements, audience inclusions/exclusions). * For ads created through Zernio this is the spec you supplied. For external ads (synced from * Meta Ads Manager, `isExternal: true`) targeting lives at the ad set and isn't stored at ingest, * so on the first `GET /v1/ads/{adId}` Zernio resolves it live from Meta and caches it on the ad; * the value is then Meta's raw `targeting` shape (snake_case, e.g. `geo_locations`, `age_min`), * the same object Ads Manager shows. May be absent if the ad set exposes no targeting or the lookup fails. * */ targeting?: { [key: string]: unknown; }; schedule?: { startDate?: string; endDate?: string; } | null; rejectionReason?: string; createdAt?: string; updatedAt?: string; }; type platform = 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter' | 'openai'; type adType = 'boost' | 'standalone'; /** * Creative format, classified from the media the creative carries. `null` when the creative carries no media to classify — an unsynced creative and a genuine text-only ad are indistinguishable, so neither is guessed at. Returned by `GET /v1/ads`, `GET /v1/ads/{adId}` and the ad nodes of `GET /v1/ads/tree`. */ type creativeType = 'carousel' | 'video' | 'document' | 'image'; /** * Available goals vary by platform. Meta (Facebook/Instagram) supports all 9 (incl. `lead_conversion` = website pixel lead optimization and `catalog_sales` = Advantage+ catalog ads). TikTok supports the 7 non-`lead_conversion` goals. LinkedIn supports all except app_promotion / lead_conversion. Twitter/X supports engagement, traffic, awareness, video_views, app_promotion. Pinterest and Google Ads support only engagement, traffic, awareness, video_views. */ type goal = 'engagement' | 'traffic' | 'awareness' | 'video_views' | 'lead_generation' | 'lead_conversion' | 'conversions' | 'app_promotion' | 'catalog_sales' | 'job_applicants'; type type = 'daily' | 'lifetime'; type AdAnalyticsResponse = { /** * Present and true while historical data is being backfilled. */ backfillPending?: boolean; ad?: { id?: string; name?: string; platform?: string; status?: string; /** * ISO 4217 code of the ad account that owns this ad (e.g. USD, THB, INR). All money values in `summary` and `daily` are in this currency. Null only on legacy ads synced before currency was persisted. */ currency?: (string) | null; }; analytics?: { summary?: AdMetrics; daily?: Array<(AdMetrics & { date?: string; })>; breakdowns?: { [key: string]: Array<{ [key: string]: unknown; }>; }; }; }; /** * Budget amount in the ad account's native currency (see the campaign's `currency` field for the code). */ type AdBudget = { amount: number; type: 'daily' | 'lifetime'; }; type AdCampaign = { platformCampaignId?: string; platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter' | 'openai'; campaignName?: string; /** * Delivery status derived from child ad statuses. Distinct from `reviewStatus`. */ status?: (AdStatus); /** * Platform-side review state of the campaign. See AdTreeCampaign.reviewStatus for the full description. */ reviewStatus?: (AdReviewStatus | null); /** * Raw platform-level campaign status (Meta `effective_status`). */ platformCampaignStatus?: (string) | null; /** * Platform-reported campaign issues (Meta `issues_info[]`). */ campaignIssuesInfo?: Array<{ [key: string]: unknown; }> | null; adCount?: number; /** * Effective budget (back-compat). Use `budgetLevel` to disambiguate CBO vs ABO. */ budget?: { amount?: number; type?: 'daily' | 'lifetime'; } | null; /** * Campaign-level budget (CBO). Null for ABO campaigns. */ campaignBudget?: { amount?: number; type?: 'daily' | 'lifetime'; } | null; /** * Canonical CBO/ABO indicator. See AdTreeCampaign.budgetLevel. */ budgetLevel?: ('campaign' | 'adset') | null; /** * Meta-only. Mirrors Campaign.is_budget_schedule_enabled. */ isBudgetScheduleEnabled?: boolean; /** * ISO 4217 currency code for all budget amounts. Budgets are NOT normalized to USD. */ currency?: (string) | null; metrics?: AdMetrics; platformAdAccountId?: string; /** * Human-readable advertiser/account name from the platform. Refreshed on every sync. */ platformAdAccountName?: (string) | null; accountId?: string; profileId?: string; /** * Google-only. Raw campaign.advertising_channel_type. See AdTreeCampaign.advertisingChannelType. */ advertisingChannelType?: (string) | null; /** * Raw Meta campaign objective (e.g. OUTCOME_SALES, OUTCOME_LEADS, OUTCOME_TRAFFIC) */ platformObjective?: (string) | null; /** * Optimization goal shared across ad sets, or comma-separated values when ad sets differ. Meta: e.g. OFFSITE_CONVERSIONS, VALUE, LEAD_GENERATION. LinkedIn: the campaign optimizationTargetType (e.g. MAX_CLICK, MAX_IMPRESSION, NONE); `NONE` with a manual costType is a campaign LinkedIn will not deliver. */ optimizationGoal?: (string) | null; /** * Campaign-level bid strategy. Ad sets inherit this unless they override. */ bidStrategy?: (BidStrategy | null); /** * Representative bid from the top-spending ad set (whole currency units). Meta: populated when bidStrategy is LOWEST_COST_WITH_BID_CAP or COST_CAP. LinkedIn: the campaign unitCost, ungated, where 0 is a real delivery-stopping value. */ bidAmount?: (number) | null; /** * Representative ROAS floor from the top-spending ad set. Decimal multiplier (2.0 = 2.0x). */ roasAverageFloor?: (number) | null; /** * Meta promoted object at campaign level (conversion event details) */ promotedObject?: { custom_event_type?: string; pixel_id?: string; page_id?: string; } | null; earliestAd?: string; latestAd?: string; }; /** * Canonical CBO/ABO indicator. See AdTreeCampaign.budgetLevel. */ type budgetLevel = 'campaign' | 'adset'; /** * One day of metrics. Same fields as `AdMetrics` plus the `date` they * apply to. Returned inside a node's `daily[]` when `GET /v1/ads/tree` is * called with `timeIncrement=1`. Rate metrics (ctr/cpc/cpm/costPerConversion/ * roas/videoAvgTimeWatchedActions) are recomputed per day from that day's * sums, so summing the additive fields across a node's `daily[]` reproduces * its aggregated `metrics` total. `reach` is the exception: on Meta and * TikTok the aggregated total is de-duplicated across the range, so daily * reach does not sum to it. Do NOT sum or plain-average * `videoAvgTimeWatchedActions` across days: the range value is the * play-weighted average of the daily values. * */ type AdDailyMetrics = AdMetrics & { /** * Calendar day (YYYY-MM-DD) these metrics apply to. */ date?: string; }; /** * The single `engagement` total split into the interactions behind it. * * Note that `engagement` is not the sum of these: Meta's own * `post_engagement` and `page_engagement` totals already contain the * individual interactions, and all of them are counted into `engagement`. * Use these fields when you need a specific interaction, and `engagement` * only as the coarse total it has always been. * * Populated for Meta and, since 2026-08, TikTok (`reactions` = paid * likes, `comments`, `shares`; TikTok's `follow` count lives in * `actions.follow`, not here). Other platforms leave these at 0. * TikTok history note: paused TikTok ads are not re-synced, so * campaigns that ended before the rollout keep 0s here. * */ type AdEngagementCounts = { /** * Meta's own post-engagement total (`post_engagement`). Meta-only. */ postEngagement?: number; /** * Meta's own page-engagement total (`page_engagement`). Meta-only. */ pageEngagement?: number; /** * Reactions on the ad's post (`post_reaction`). For TikTok these are its paid likes. */ reactions?: number; /** * Comments on the ad's post. */ comments?: number; /** * Shares of the ad's post. Meta reports these under the action type literally named `post`; TikTok under `share`. */ shares?: number; /** * Saves of the ad's post (`onsite_conversion.post_save`). */ saves?: number; /** * New Page likes attributed to the ad (`like`). */ pageLikes?: number; /** * 3-second video views (`video_view`). For completion-based counts use `videoThruplayWatchedActions`. */ videoViews?: number; /** * Attributed link clicks (`link_click`). This is the attribution-window count, which differs from the in-session count in the sibling `inlineLinkClicks` field. */ linkClicks?: number; }; /** * Named conversion-funnel steps, resolved from the same data as `actions` * so you never have to parse action-type strings yourself. * * Meta reports one event under several action types at once * (`offsite_conversion.fb_pixel_purchase`, `omni_purchase`, `purchase`, …). * Each field below takes the FIRST family member present rather than * summing them, which is what makes these counts safe to add up — summing * the raw `actions` keys yourself double or triple counts. The same * priority order backs `conversions`, so a purchase-optimised campaign * reports the identical number in `conversions` and `funnel.purchases`. * * Every field is 0 when that step never fired. Populated for Meta ads; * other platforms report a different action taxonomy and generally leave * these at 0 (read `actions` for those). At ad-set and campaign level each * step is summed from its per-ad values. * */ type AdFunnelCounts = { /** * Landing page views — the visitor actually loaded the destination, unlike a link click. Meta `landing_page_view`. */ landingPageViews?: number; /** * Content views (Meta `ViewContent` pixel event). */ contentViews?: number; /** * On-site searches (Meta `Search` pixel event). */ searches?: number; /** * Adds to wishlist (Meta `AddToWishlist` pixel event). */ wishlistAdds?: number; /** * Adds to cart (Meta `AddToCart` pixel event). */ cartAdds?: number; /** * Checkouts started (Meta `InitiateCheckout` pixel event). */ checkoutsInitiated?: number; /** * Payment details added at checkout (Meta `AddPaymentInfo` pixel event). */ paymentInfoAdds?: number; /** * Purchases (Meta `Purchase` pixel event). Pair with `purchaseValue` for revenue. */ purchases?: number; /** * Leads, from either the website pixel or an instant form — whichever the ad uses. */ leads?: number; /** * Completed registrations (Meta `CompleteRegistration` pixel event). */ registrationsCompleted?: number; /** * Mobile app installs attributed to the ad. */ appInstalls?: number; /** * Messaging conversations started within 7 days — the headline metric for click-to-WhatsApp and click-to-Messenger ads. */ messagingConversationsStarted?: number; /** * Messaging threads where the person sent a first reply. */ messagingFirstReplies?: number; }; type AdMetrics = { spend?: number; impressions?: number; /** * Unique people reached in the requested date range. Meta (facebook/instagram) and TikTok: the platform's own de-duplicated reach for the exact range, fetched live and cached up to ~1 hour (may lag recent delivery; on a transient platform error the value temporarily falls back to a sum of per-day reach, which overcounts people reached on multiple days or by multiple child ads). Because it is de-duplicated, reach is NOT additive on these platforms: neither daily values nor child nodes sum to the range total. Google, LinkedIn, X, Pinterest and OpenAI report 0 (reach not synced). Frequency (impressions / reach) is only meaningful for Meta and TikTok. */ reach?: number; clicks?: number; /** * Click-through rate (%) */ ctr?: number; /** * Cost per click */ cpc?: number; /** * Cost per 1000 impressions */ cpm?: number; engagement?: number; /** * Count of conversion events over the requested date range. FRACTIONAL: attribution splits one conversion across touchpoints and Google additionally reports modeled conversions, so values like 0.347 are normal. Meta: events matching the campaign's promoted_object.custom_event_type (PURCHASE, LEAD, etc.). Google: the account's tracked conversions. X and LinkedIn: their reported website/lead conversions (added 2026-07). 0 for non-conversion campaigns or when no events have fired. */ conversions?: number; /** * Derived spend / conversions in the same currency as spend. 0 when conversions is 0. */ costPerConversion?: number; /** * Per-action-type counts summed over the date range, keyed by the platform's action-type names. Meta: raw Insights action_type keys (link_click, offsite_conversion.fb_pixel_purchase, onsite_conversion.lead_grouped, ...) — both engagement and conversion events. TikTok: pixel conversions (purchase, add_to_cart, initiate_checkout, view_content, complete_payment, lead) plus the paid-engagement family (follow, post_reaction for paid likes, comment, share) — follow is how FOLLOWERS-goal campaigns report their result. X: conversion types (purchase, sign_up, site_visit, download, custom). LinkedIn: conversion types (post_click, post_view, lead_gen). Google returns {} (its per-action names aren't synced per ad). Empty object when no actions are reported. NOTE: keys differ by platform, so branch on the ad's platform when interpreting them. */ actions?: { [key: string]: (number); }; /** * Monetary mirror of `actions`, from Meta's Insights `action_values[]` array. Same keying — values are the revenue attributed to each action_type, in ad-account native currency (same unit as `spend`; see the campaign node's `currency` field). Use this to compute revenue-per-event (e.g. avg purchase value). Meta-only; other platforms return {}. */ actionValues?: { [key: string]: (number); }; /** * Convenience sum of purchase-type action values — picked from `actionValues` via the same priority list as `conversions` so both fields describe the same events. In ad-account native currency. 0 when the campaign has no purchase event configured. Meta-only. */ purchaseValue?: number; /** * Return on ad spend — derived as `purchaseValue / spend`. 0 when `spend` is 0. Equivalent to Meta's `purchase_roas` under default attribution. At ad-set and campaign levels this is recomputed from summed purchaseValue + spend (NOT averaged across children) so it's mathematically correct at every rollup level. */ roas?: number; /** * Derived `spend / actions[type]` for every action type with a non-zero count, in ad-account native currency. Same keys as `actions`. Rounded to 4 decimals because cheap actions cost well under a cent. Recomputed from summed spend + counts at every rollup level. Empty object when spend is 0 or no actions are reported. */ costPerAction?: { [key: string]: (number); }; /** * Clicks leading off Meta's surfaces to the advertiser's destination. Meta-only; other platforms report 0. */ outboundClicks?: number; /** * Derived `outboundClicks / impressions * 100`, recomputed from sums at every rollup level. */ outboundClicksCtr?: number; /** * In-session link clicks. Differs from the attributed `link_click` count in `actions`/`engagementBreakdown.linkClicks`, which uses the attribution window. Meta-only. */ inlineLinkClicks?: number; /** * Derived `inlineLinkClicks / impressions * 100`, recomputed from sums at every rollup level. */ inlineLinkClickCtr?: number; /** * People who clicked at least once. NOT additive: summed across days/children it overcounts people who clicked on multiple days or ads, so treat rollups as an upper bound (same caveat as `reach`). Meta-only. */ uniqueClicks?: number; /** * Derived `uniqueClicks / impressions * 100` (NOT Meta's reach-based unique_ctr). Inherits the non-additivity caveat of `uniqueClicks`. */ uniqueCtr?: number; /** * Number of times the video started playing, summed over the date range and across children at ad-set/campaign level. 0 for non-video ads. Sources: Meta `video_play_actions`, TikTok `video_play_actions`. */ videoPlayActions?: number; /** * Views of at least 30 seconds (or to the end, for shorter videos). Sources: Meta `video_30_sec_watched_actions` (Meta only). */ video30SecWatchedActions?: number; /** * ThruPlays (watched to completion, or at least 15 seconds). Sources: Meta `video_thruplay_watched_actions` (Meta only). */ videoThruplayWatchedActions?: number; /** * Views reaching 25% of the video's length. With the other percentile fields, powers hook/hold/drop-off analysis (e.g. hook rate = videoP25WatchedActions / videoPlayActions). Sources: Meta `video_p25_watched_actions`, TikTok `video_views_p25`. */ videoP25WatchedActions?: number; /** * Views reaching 50% of the video's length. Sources: Meta `video_p50_watched_actions`, TikTok `video_views_p50`. */ videoP50WatchedActions?: number; /** * Views reaching 75% of the video's length. Sources: Meta `video_p75_watched_actions`, TikTok `video_views_p75`. */ videoP75WatchedActions?: number; /** * Views reaching 95% of the video's length. Sources: Meta `video_p95_watched_actions` (Meta only). */ videoP95WatchedActions?: number; /** * Views reaching 100% of the video's length. Sources: Meta `video_p100_watched_actions`, TikTok `video_views_p100`. */ videoP100WatchedActions?: number; /** * Average seconds watched per play. Aggregated over date ranges and across children as a play-weighted average (total watch time / total plays), never a plain average of averages. Sources: Meta `video_avg_time_watched_actions`, TikTok `average_video_play`. */ videoAvgTimeWatchedActions?: number; /** * Derived `spend / videoThruplayWatchedActions`, in ad-account native currency. Rounded to 4 decimals rather than the usual 2 because a ThruPlay routinely costs well under a cent. 0 when the ad has no ThruPlays (ThruPlay is Meta-only). */ costPerThruplay?: number; funnel?: AdFunnelCounts; engagementBreakdown?: AdEngagementCounts; /** * Present on individual ads only, not on campaign aggregations */ lastSyncedAt?: string; }; /** * Platform-side review state, independent of the delivery `status` and the `configuredStatus` on/off toggle. `in_review` means the platform is still reviewing. Absent when the platform reports no review signal (e.g. a paused ad whose review state is masked behind the pause). */ type AdReviewStatus = 'in_review' | 'approved' | 'rejected' | 'with_issues'; type AdsListResponse = { ads?: Array; pagination?: Pagination; /** * Present and true while historical data is being backfilled. */ backfillPending?: boolean; }; type AdStatus = 'active' | 'paused' | 'pending_review' | 'rejected' | 'completed' | 'cancelled' | 'error'; type AdsTimelineResponse = { /** * Present and true while historical data is being backfilled. */ backfillPending?: boolean; rows?: Array<{ date?: string; /** * Native currency units (matches /ads/tree convention). */ spend?: number; impressions?: number; /** * Reach summed across the account's ads for this single day. A person seen by two ads the same day counts twice, and reach is de-duplicated per day only: do NOT sum it across days (people reached on multiple days would be double-counted). */ reach?: number; clicks?: number; engagement?: number; /** * Click-through rate as a percentage (0–100). */ ctr?: number; /** * Cost per click in native currency. */ cpc?: number; /** * Cost per 1000 impressions in native currency. */ cpm?: number; /** * Sum of conversion events over the range. Fractional values are normal (attribution splitting + Google modeled conversions). Meta: events matching the campaign optimization goal. Google: tracked conversions. X / LinkedIn: reported website/lead conversions (added 2026-07). */ conversions?: number; costPerConversion?: number; /** * Per-action-type counts merged across all ads on this day. Keys are platform-native action types. */ actions?: { [key: string]: (number); }; /** * Monetary mirror of `actions` in native currency. */ actionValues?: { [key: string]: (number); }; /** * Sum of purchase-type action values on this day, native currency. */ purchaseValue?: number; /** * Derived purchaseValue / spend. */ roas?: number; }>; }; /** * Ad set (or ad group/line item depending on platform) with rolled-up metrics and child ads */ type AdTreeAdSet = { platformAdSetId?: string; adSetName?: string; /** * Derived from child ad statuses */ status?: (AdStatus); adCount?: number; /** * Effective budget at this level (back-compat). For CBO campaigns this mirrors the parent campaign's budget; for ABO this is the ad-set-specific budget. Use `adSetBudget` / parent `campaignBudget` + `budgetLevel` to disambiguate. */ budget?: { amount?: number; type?: 'daily' | 'lifetime'; } | null; /** * Ad-set-level budget (ABO). Null for CBO campaigns where the budget is set on the campaign. */ adSetBudget?: { amount?: number; type?: 'daily' | 'lifetime'; } | null; metrics?: AdMetrics; /** * What the delivery system optimizes for. Meta ad set optimization goal (e.g. OFFSITE_CONVERSIONS, VALUE, LEAD_GENERATION), or on LinkedIn the campaign's effective optimizationTargetType (NONE means manual bidding). See the `optimizationGoal` field on `Ad` for the full value spaces. */ optimizationGoal?: (string) | null; /** * Bid strategy for this ad set (overrides campaign level when set). Meta and TikTok only; LinkedIn uses `costType` instead. */ bidStrategy?: (BidStrategy | null); /** * Bid amount in whole currency units. On Meta/TikTok populated when bidStrategy is LOWEST_COST_WITH_BID_CAP or COST_CAP; on LinkedIn it is the campaign's effective unitCost and pairs with `costType`, where 0 is a real, delivery-stopping value. */ bidAmount?: (number) | null; /** * Minimum ROAS as a decimal multiplier (2.0 = 2.0x). Populated when bidStrategy is LOWEST_COST_WITH_MIN_ROAS. */ roasAverageFloor?: (number) | null; /** * LinkedIn only. Effective cost model (billing event) of the LinkedIn campaign backing this ad set: CPM, CPC or CPV. Null for non-LinkedIn ad sets. */ costType?: (string) | null; /** * LinkedIn only. Why the LinkedIn campaign backing this ad set is (or is not) delivering. A LinkedIn Campaign maps to this ad-set node, so this is the level where LinkedIn's holds actually apply. Empty means no serving data, ["RUNNABLE"] means eligible to serve, anything else is a hold. See the `servingStatuses` field on `Ad` for the known values. */ servingStatuses?: Array<(string)>; /** * Meta promoted object for this ad set (conversion event details) */ promotedObject?: { custom_event_type?: string; pixel_id?: string; page_id?: string; } | null; /** * Individual ads within this ad set (capped at 100). Returns a subset of Ad fields from the aggregation: `_id`, `name`, `platform`, `status`, `configuredStatus`, `reviewStatus`, `budget`, `metrics`, `creative`, `goal` and the `platform*` ids are always included; `targeting` and `schedule` may be absent. `configuredStatus` (the ad's own on/off toggle) and `reviewStatus` (the platform's review verdict) are part of this contract, not incidental: a rejected ad is only distinguishable from a healthy one through `reviewStatus`. When `timeIncrement=1&dailyLevel=ad`, each entry also carries a `daily[]` array of `AdDailyMetrics`. */ ads?: Array; /** * Per-day metric series for this ad set. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` and `dailyLevel` is `adset` or `ad`. */ daily?: Array; }; /** * Campaign with nested ad sets and rolled-up metrics */ type AdTreeCampaign = { platformCampaignId?: string; platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter' | 'openai'; campaignName?: string; /** * Delivery status derived from child ad statuses. Distinct from `reviewStatus`, which reflects the platform-side review state. */ status?: (AdStatus); /** * Platform-side review state of the campaign. Independent of the * children-derived delivery `status`: a campaign can have ads * already active (status=active) while the campaign itself is * still being reviewed by the platform (reviewStatus=in_review). * For Meta, derived from `effective_status` + `issues_info` on * the Campaign, plus ad-level PENDING_REVIEW rollup. * */ reviewStatus?: (AdReviewStatus | null); /** * Raw platform-level campaign status (Meta `effective_status`: ACTIVE, PAUSED, DELETED, ARCHIVED, IN_PROCESS, WITH_ISSUES). Distinct from per-ad `platformStatus`. */ platformCampaignStatus?: (string) | null; /** * Platform-reported campaign issues (Meta `issues_info[]`). Populated only when the platform has delivery issues to report; contains the specific error codes and messages. */ campaignIssuesInfo?: Array<{ [key: string]: unknown; }> | null; /** * Total ads across all ad sets */ adCount?: number; adSetCount?: number; /** * Effective budget (back-compat). For CBO this mirrors `campaignBudget`, for ABO this mirrors the child ad-set budget. Use `budgetLevel` to disambiguate. */ budget?: { amount?: number; type?: 'daily' | 'lifetime'; } | null; /** * Campaign-level budget (Campaign Budget Optimization / CBO). Populated only when the platform set the budget at the campaign level. For ABO campaigns this is null and the budget lives on the child ad set. */ campaignBudget?: { amount?: number; type?: 'daily' | 'lifetime'; } | null; /** * Canonical CBO/ABO indicator. `campaign` = CBO (Advantage Campaign Budget, budget lives on the campaign). `adset` = ABO (budget lives on each ad set). Route budget updates to the matching Meta entity. */ budgetLevel?: ('campaign' | 'adset') | null; /** * Meta-only. Mirrors Campaign.is_budget_schedule_enabled — true when the campaign uses budget scheduling (time-based budget changes). Independent of CBO/ABO. */ isBudgetScheduleEnabled?: boolean; /** * ISO 4217 currency code (e.g. USD, EUR, CLP, JPY) for all budget amounts in this campaign node. Budgets are NOT normalized to USD. */ currency?: (string) | null; metrics?: AdMetrics; platformAdAccountId?: string; /** * Human-readable advertiser/account name from the platform. Refreshed on every sync. */ platformAdAccountName?: (string) | null; accountId?: string; profileId?: string; /** * Google-only. Raw campaign.advertising_channel_type (SEARCH, PERFORMANCE_MAX, LOCAL_SERVICES, VIDEO, DEMAND_GEN, DISPLAY, SHOPPING, ...). Serving surface, distinct from platformObjective (advertiser intent). Null/absent for non-Google platforms. */ advertisingChannelType?: (string) | null; /** * Raw Meta campaign objective (e.g. OUTCOME_SALES, OUTCOME_LEADS, OUTCOME_TRAFFIC) */ platformObjective?: (string) | null; /** * Optimization goal shared across ad sets, or comma-separated values when ad sets differ. Meta: e.g. OFFSITE_CONVERSIONS, VALUE, LEAD_GENERATION. LinkedIn: the campaign optimizationTargetType (e.g. MAX_CLICK, MAX_IMPRESSION, NONE); `NONE` with a manual costType is a campaign LinkedIn will not deliver. */ optimizationGoal?: (string) | null; /** * Campaign-level bid strategy. Ad sets inherit this unless they override. */ bidStrategy?: (BidStrategy | null); /** * Representative bid for the campaign, bubbled up from the top-spending ad set (whole currency units). Meta: populated when the ad-set bidStrategy is LOWEST_COST_WITH_BID_CAP or COST_CAP. LinkedIn: the campaign unitCost, which has no bidStrategy gate and where 0 is a real, delivery-stopping value rather than unset. */ bidAmount?: (number) | null; /** * Representative ROAS floor for the campaign — bubbled up from the top-spending ad set. Decimal multiplier (2.0 = 2.0x). */ roasAverageFloor?: (number) | null; /** * Meta promoted object at campaign level (conversion event details) */ promotedObject?: { custom_event_type?: string; pixel_id?: string; page_id?: string; } | null; adSets?: Array; /** * Per-day metric series for this campaign. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` (any `dailyLevel`). This is the per-campaign daily trend — summing its additive fields reproduces the campaign `metrics` total, except `reach`: on Meta the range total is de-duplicated, so daily reach does not sum to it. */ daily?: Array; }; type AdTreeResponse = { campaigns?: Array; pagination?: Pagination; /** * Present and true while historical data is being backfilled. */ backfillPending?: boolean; }; type AnalyticsListResponse = { overview?: AnalyticsOverview; posts?: Array<{ _id?: string; /** * Original Zernio post ID if scheduled via Zernio */ latePostId?: (string) | null; content?: string; scheduledFor?: string; publishedAt?: string; status?: string; analytics?: PostAnalytics; platforms?: Array; platform?: string; platformPostUrl?: string; isExternal?: boolean; profileId?: (string) | null; thumbnailUrl?: string; mediaType?: 'image' | 'video' | 'gif' | 'document' | 'carousel' | 'text'; /** * All media items for this post. Carousel posts contain one entry per slide. */ mediaItems?: Array<{ type?: 'image' | 'video'; /** * Direct URL to the media */ url?: string; /** * Thumbnail URL (same as url for images) */ thumbnail?: string; /** * Accessibility alt text set on the media, when present. */ altText?: string; }>; /** * Instagram only: the platform media product type (e.g. FEED, REELS, STORY, AD). Absent when the platform did not report it. */ mediaProductType?: string; /** * Instagram only: whether Instagram labeled the media as AI-generated. Absent when the platform did not report it. */ isAiGenerated?: boolean; /** * Instagram reels only: whether the reel is also shared to the main feed. Absent when the platform did not report it. */ isSharedToFeed?: boolean; /** * Instagram only: audio type of the media (MUSIC or ORIGINAL_SOUND). Absent when the platform did not report it. */ mediaAudioType?: string; }>; pagination?: Pagination; /** * Connected social accounts (followerCount and followersLastUpdated only included if user has analytics add-on) */ accounts?: Array; /** * Whether user has analytics add-on access */ hasAnalyticsAccess?: boolean; }; type AnalyticsOverview = { totalPosts?: number; publishedPosts?: number; scheduledPosts?: number; lastSync?: (string) | null; dataStaleness?: { /** * Number of accounts with stale analytics data */ staleAccountCount?: number; /** * Whether a background sync was triggered for stale accounts */ syncTriggered?: boolean; }; }; type AnalyticsSinglePostResponse = { postId?: string; /** * Original Zernio post ID if scheduled via Zernio */ latePostId?: (string) | null; /** * Overall post status. "partial" when some platforms published and others failed. */ status?: 'published' | 'failed' | 'partial'; content?: string; scheduledFor?: string; publishedAt?: (string) | null; analytics?: PostAnalytics; platformAnalytics?: Array; platform?: string; platformPostUrl?: (string) | null; isExternal?: boolean; /** * Overall sync state across all platforms */ syncStatus?: 'synced' | 'pending' | 'partial' | 'unavailable'; /** * Human-readable status message for pending, partial, or failed states */ message?: (string) | null; thumbnailUrl?: (string) | null; mediaType?: ('image' | 'video' | 'carousel' | 'text') | null; /** * All media items for this post. Carousel posts contain one entry per slide. */ mediaItems?: Array<{ type?: 'image' | 'video'; /** * 'Direct URL to the media file. Null when the platform withholds it: check mediaStatus before downloading. Instagram omits the video file for Reels it flags as containing copyrighted material (its docs name audio as the usual cause), so type stays "video" while the file is permanently unreachable.' */ url?: (string) | null; /** * Thumbnail URL (same as url for images). Still present when url is null. */ thumbnail?: (string) | null; /** * Accessibility alt text set on the media, when present. */ altText?: string; /** * unavailable means the media file could not be retrieved (url is null or, for LinkedIn videos, a cover image standing in for the file). available or absent means the file is available at url (older synced items omit the field). */ mediaStatus?: 'available' | 'unavailable'; /** * Why the file is missing. platform_withheld means the platform declined to return it and retrying will not help. */ unavailableReason?: 'platform_withheld'; }>; /** * Instagram only: the platform media product type (e.g. FEED, REELS, STORY, AD). Absent when the platform did not report it. */ mediaProductType?: string; /** * Instagram only: whether Instagram labeled the media as AI-generated. Absent when the platform did not report it. */ isAiGenerated?: boolean; /** * Instagram reels only: whether the reel is also shared to the main feed. Absent when the platform did not report it. */ isSharedToFeed?: boolean; /** * Instagram only: audio type of the media (MUSIC or ORIGINAL_SOUND). Absent when the platform did not report it. */ mediaAudioType?: string; }; /** * Overall post status. "partial" when some platforms published and others failed. */ type status = 'published' | 'failed' | 'partial'; /** * Overall sync state across all platforms */ type syncStatus = 'synced' | 'pending' | 'partial' | 'unavailable'; type mediaType = 'image' | 'video' | 'carousel' | 'text'; type ApiKey = { id?: string; name?: string; keyPreview?: string; expiresAt?: string; createdAt?: string; /** * Returned only once, on creation */ key?: string; /** * 'full' grants access to all profiles, 'profiles' restricts to specific profiles */ scope?: 'full' | 'profiles'; /** * Profiles this key can access (populated with name and color). Only present when scope is 'profiles'. */ profileIds?: Array<{ _id?: string; name?: string; color?: string; }>; /** * 'read-write' allows all operations, 'read' restricts to GET requests only */ permission?: 'read-write' | 'read'; /** * Resource groups this key can NOT access (opt-out denylist). Absent or empty means legacy full access. A key with any group disabled is a restricted key (zrk_ prefix) and can never manage API keys, invites, or member identity. Each operation's group is published as x-resource-group. With 'messages' disabled, the key cannot read or send private messages through any API surface, and it cannot create or edit a webhook subscription broader than itself: it cannot subscribe to, test-fire, redeliver, or read delivery logs for message events. Subscriptions created earlier, from the dashboard, or with a full-access key keep delivering whatever their own `disabledResourceGroups` allows, so restricting an existing integration end to end means restricting the subscription too. OAuth connector tokens (AI assistants and MCP clients) resolve against the same registry, but their groups are not settable yet: treat an authorized connector as full access. */ disabledResourceGroups?: Array<('publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks')>; }; /** * 'full' grants access to all profiles, 'profiles' restricts to specific profiles */ type scope = 'full' | 'profiles'; /** * 'read-write' allows all operations, 'read' restricts to GET requests only */ type permission = 'read-write' | 'read'; /** * Meta bid strategy. Same enum applies at campaign and ad-set level; ad-set value (when set) * overrides campaign-level. Cross-field rules: * - `LOWEST_COST_WITHOUT_CAP` (default): auto-bid, forbids `bidAmount` and `roasAverageFloor`. * - `LOWEST_COST_WITH_BID_CAP` / `COST_CAP`: require `bidAmount` (whole currency units). * - `LOWEST_COST_WITH_MIN_ROAS`: requires `roasAverageFloor` (decimal multiplier, 2.0 = 2.0x). * Source: facebook-business-sdk-codegen api_specs/specs/enum_types.json (`AdSet_bid_strategy`, * `Campaign_bid_strategy`). * */ type BidStrategy = 'LOWEST_COST_WITHOUT_CAP' | 'LOWEST_COST_WITH_BID_CAP' | 'COST_CAP' | 'LOWEST_COST_WITH_MIN_ROAS'; /** * Account billing state — plan, cycle, balance, spend caps, and payment / * access status. Returned by `GET /v1/billing`. * */ type BillingSnapshot = { billingSystem?: 'metronome' | 'stripe' | 'shopify'; plan?: { name?: string; isUsageBased?: boolean; /** * True when the key belongs to an account with an active paid billing relationship (Stripe subscription, Metronome enrollment, or Shopify-managed billing). */ isPaid?: boolean; }; /** * myshopify.com domain owning the subscription; present only when billingSystem is shopify. */ shopifyShopDomain?: (string) | null; /** * Current billing cycle. `start`/`end` are resolved for usage-based accounts only. */ period?: { start?: (string) | null; end?: (string) | null; /** * Day-of-month the cycle resets. */ anchorDay?: number; }; /** * Accrued spend + remaining credits this cycle. `null` for fixed-subscription (Stripe) plans. */ balance?: { accruedThisPeriodCents?: number; creditsRemainingCents?: number; } | null; caps?: { xSpendUsedCents?: number; /** * Monthly X-API spend cap; null = unlimited. */ xSpendLimitCents?: (number) | null; }; status?: { hasAccess?: boolean; suspended?: boolean; suspendedAt?: (string) | null; suspensionReason?: (string) | null; /** * Hosted invoice URL for dunning (Stripe). */ openInvoiceUrl?: (string) | null; declineReason?: (string) | null; autoUpgradeEnabled?: boolean; }; /** * Deprecated plan entitlements (Stripe only); absent for usage-based accounts. */ legacy?: { limits?: { uploads?: number; profiles?: number; }; }; }; type billingSystem = 'metronome' | 'stripe' | 'shopify'; /** * A blog container on the connected platform. All content lives on the platform; Zernio proxies it and stores nothing. */ type Blog = { /** * Platform-native blog id (numeric string for Shopify). */ id?: string; platform?: 'shopify'; title?: string; /** * URL slug of the blog. */ handle?: string; }; type platform2 = 'shopify'; /** * An article inside a blog on the connected platform. */ type BlogArticle = { /** * Platform-native article id (numeric string for Shopify). */ id?: string; /** * Platform-native id of the blog the article belongs to. */ blogId?: string; platform?: 'shopify'; title?: string; /** * Article body as HTML. */ bodyHtml?: (string) | null; /** * URL slug of the article. */ handle?: string; tags?: Array<(string)>; /** * Display name of the article author. */ author?: (string) | null; /** * Short summary shown in blog listings. */ excerpt?: (string) | null; /** * Featured image. */ image?: { url?: string; altText?: (string) | null; } | null; /** * False while the article is a draft or its publish date is still in the future. */ isPublished?: boolean; /** * When the article was (or is scheduled to be) published; null for drafts. */ publishedAt?: (string) | null; createdAt?: (string) | null; updatedAt?: (string) | null; }; /** * Bluesky post settings. Supports text posts with up to 4 images or a single video. threadItems creates a reply chain (Bluesky thread). Images exceeding 1MB are automatically compressed. Alt text supported via mediaItem properties. Use langs to tag post language for feed-generator filtering. * */ type BlueskyPlatformData = { /** * Language(s) of the post text as 1-3 BCP-47 codes (e.g. "pt", "en-US"), written to the post record's langs field. Bluesky feed generators filter on this field, so posts without it never appear in language-scoped feeds. Can only be set at creation (Bluesky has no post editing). When threadItems is used, every item in the thread carries the same langs. When omitted, the account's default (set via PATCH /v1/accounts/{accountId}/bluesky-settings) applies; with no default either, the field is absent from the record. * */ langs?: Array<(string)>; /** * Complete sequence of posts in a Bluesky thread. The first item becomes the root post, subsequent items are chained as replies. When threadItems is provided, the top-level content field is used only for display and search purposes, it is NOT published. You must include your first post as threadItems[0]. * */ threadItems?: Array<{ content?: string; mediaItems?: Array; }>; }; /** * Result of a CSV bulk upload. The same shape is returned for `200` (all rows * succeeded or all failed) and `207` (mixed). Per-row outcomes live in `results`; * the row's success is `ok`, and failures carry machine-readable codes in `errors`. * */ type BulkUploadResult = { /** * Number of data rows processed from the CSV */ total?: number; /** * Count of rows that succeeded (results[].ok === true) */ valid?: number; /** * Count of rows that failed (total - valid) */ invalid?: number; /** * One entry per CSV data row, in row order. */ results?: Array<{ /** * 1-based index of the CSV data row (header excluded) */ rowIndex?: number; /** * Whether the row was created successfully */ ok?: boolean; /** * ID of the created post. Present only when `ok` is true and not a dry run. */ createdPostId?: string; /** * Machine-readable failure codes for this row. Present only when `ok` is false. * Examples: `unknown_profile:`, `no_account_for_platform:`, * `schedule_time_missing`, `rate_limited::@:`. * */ errors?: Array<(string)>; }>; /** * Top-level advisory warnings (e.g. `rows_exceed_advisory_limit:500`). Empty when none. */ warnings?: Array<(string)>; /** * Present only when one or more rows targeted an account currently in cooldown. * Lets callers map `rate_limited:*` row errors back to structured metadata without * parsing the error strings. * */ rateLimitedAccounts?: Array<{ accountId?: string; platform?: string; username?: string; rateLimitedUntil?: string; }>; }; /** * TikTok Business Center entity. Returned by `GET /v1/ads/business-centers`. BCs are * TikTok's agency container — one BC owns N advertisers (ad accounts). Most solo * advertisers don't have one; the agency token uses BCs to roll up multi-client access. * */ type BusinessCenter = { /** * Business Center ID */ bcId?: string; /** * Display name set by the BC owner */ name?: string; /** * Number of advertisers reachable under this BC for the calling token. * `null` when the BC asset walk returned empty or failed (typical for * agency apps without full BC asset read scope) — distinct from `0`, * which would imply the BC genuinely has no advertisers. * */ advertiserCount?: (number) | null; }; /** * One call on a number you own, either channel. `channel` tells you which * lane it took: `whatsapp` (WhatsApp Business Calling) or `pstn` (a regular * phone call). List endpoints omit `transcript`; use `lastTranscriptSnippet` * for a preview and the detail endpoint for the full transcript. * */ type CallRecord = { _id?: string; /** * Owning social account. The unified /v1/calls/{id} detail + recording endpoints work for any channel; the channel-specific endpoints remain for account-scoped access. */ accountId?: string; /** * Inbox conversation with the counterparty, when one exists. */ conversationId?: (string) | null; /** * CRM Contact for the counterparty, when resolved. */ contactId?: (string) | null; channel?: 'whatsapp' | 'pstn'; direction?: 'inbound' | 'outbound'; /** * Caller number (E.164). */ from?: string; /** * Callee number (E.164). */ to?: string; /** * Destination the call was routed to (tel:/sip:/wss:), snapshotted at routing time. */ forwardTo?: (string) | null; /** * Outbound PSTN only. Message spoken to the callee on answer, before the bridge. */ greeting?: (string) | null; status?: 'ringing' | 'answered' | 'ended' | 'failed'; /** * True when an inbound call went to voicemail. */ isVoicemail?: boolean; /** * Outbound answering-machine detection was requested for this call. */ amd?: boolean; /** * With `amd`, whether a machine (vs a human) answered. */ answeredMachine?: (boolean) | null; /** * Caller ID presented on the forwarded leg. */ forwardCallerId?: 'business' | 'caller'; /** * Effective flag for THIS call (number default + per-call override, resolved at create time). */ recordingEnabled?: boolean; transcriptionEnabled?: boolean; transcriptionLanguage?: 'auto' | 'en' | 'es'; startedAt?: string; answeredAt?: (string) | null; endedAt?: (string) | null; /** * When the call was blind-transferred (POST /v1/voice/calls/{id}/transfer). */ transferredAt?: (string) | null; durationSeconds?: number; endReason?: 'hangup' | 'no_answer' | 'rejected' | 'error'; /** * Raw carrier hangup cause behind endReason (e.g. normal_clearing, not_found, time_limit) — the actual motive when endReason is a coarse bucket. */ hangupCause?: (string) | null; /** * SIP response code that ended the call, when SIP-signalled (e.g. '403', '488'). The real failure reason for SIP legs. */ sipHangupCause?: (string) | null; /** * Per-call failure log (dial failed, bridge failed, recording error). */ callErrors?: Array<{ code?: number; message?: string; }>; /** * May be expired. Resolve a fresh playable URL via GET /v1/calls/{id}/recording (any channel). */ recordingUrl?: (string) | null; /** * Most recent transcript segment, for list previews. */ lastTranscriptSnippet?: (string) | null; /** * Full transcript segments (detail endpoint only; omitted from lists). */ transcript?: Array<{ text?: string; confidence?: number; at?: string; }>; billing?: { metaMinutes?: number; telnyxSeconds?: number; transcriptionSeconds?: number; transcriptionCostUSD?: number; /** * WhatsApp channel only. Meta per-minute charge, billed by Meta directly to your WABA. Display only; not billed by Zernio. */ metaCostUSD?: number; telnyxCostUSD?: number; recordingCostUSD?: number; /** * Amount Zernio bills you = telephony leg + recording + transcription (excludes any Meta portion). */ billableCostUSD?: number; /** * Full cost incl. any Meta portion you pay directly. Display only. */ totalCostUSD?: number; currency?: string; }; createdAt?: string; updatedAt?: string; }; type channel = 'whatsapp' | 'pstn'; type direction = 'inbound' | 'outbound'; type status2 = 'ringing' | 'answered' | 'ended' | 'failed'; /** * Caller ID presented on the forwarded leg. */ type forwardCallerId = 'business' | 'caller'; type transcriptionLanguage = 'auto' | 'en' | 'es'; type endReason = 'hangup' | 'no_answer' | 'rejected' | 'error'; type CampaignAnalyticsResponse = { /** * Present and true while historical data is being backfilled. */ backfillPending?: boolean; campaign?: { id?: string; name?: (string) | null; platform?: string; /** * Effective campaign status (ACTIVE when any child ad is active). */ status?: (string) | null; /** * ISO 4217 code of the ad account (e.g. USD, THB). All money values in `summary` and `daily` are in this currency. */ currency?: (string) | null; }; analytics?: { summary?: AdMetrics; daily?: Array<(AdMetrics & { date?: string; })>; breakdowns?: { [key: string]: Array<{ [key: string]: unknown; }>; }; }; }; /** * Who a comment automation answers. Instagram only - Meta exposes the follow * relationship on no other platform, and only for people who have MESSAGED the * account (a comment grants no consent). `whenUnknown` is therefore the important * setting: it decides what happens for a first-time commenter. * */ type CommentAutomationAudience = { followerStatus?: 'any' | 'follower' | 'non_follower'; /** * Skip commenters with fewer followers than this. Omit for no size rule. */ minFollowerCount?: number; /** * What to do when Instagram will not reveal the follow relationship. * * `send` (default) - deliver the DM anyway (fails open). * * `skip` - stay silent. * * `verify` - send `followGate.message` with a confirm button. Tapping it is a * message, which grants consent, so the re-check on the tap resolves and the * real DM (or `followGate.notFollowingMessage`) follows automatically. * */ whenUnknown?: 'send' | 'skip' | 'verify'; }; type followerStatus = 'any' | 'follower' | 'non_follower'; /** * What to do when Instagram will not reveal the follow relationship. * * `send` (default) - deliver the DM anyway (fails open). * * `skip` - stay silent. * * `verify` - send `followGate.message` with a confirm button. Tapping it is a * message, which grants consent, so the re-check on the tap resolves and the * real DM (or `followGate.notFollowingMessage`) follows automatically. * */ type whenUnknown = 'send' | 'skip' | 'verify'; /** * Copy for the follow gate. Sensible defaults are used for any field left empty. */ type CommentAutomationFollowGate = { /** * Confirmation DM sent when whenUnknown=verify. */ message?: string; /** * Confirm button label. Defaults to "I'm following". */ buttonLabel?: string; /** * Sent to a commenter we know does not follow (followerStatus=follower). Omit to stay silent on a keyword comment; a confirm tap always gets an answer. */ notFollowingMessage?: string; }; /** * A Meta generic template (product card) sent as the automation's first DM. * It REPLACES the plain `dmMessage` bubble: a Meta message carries one body * shape, and a comment gets exactly one private reply, so the card and the * text cannot both be delivered. Put your selling copy in `subtitle`. * Mutually exclusive with `buttons` (sending both is a 400). Works on both * the `comment` and `story_reply` triggers. * Up to 10 elements, rendered as a horizontally swipeable carousel. * Rendering confirmed on the Instagram and Messenger mobile apps. * */ type CommentAutomationTemplate = { type: 'generic'; elements: Array; }; type type2 = 'generic'; type CommentAutomationTemplateElement = { /** * Card headline (80 chars max). Also used as the Inbox preview for the sent DM. */ title: string; /** * Card description, e.g. the price or a short pitch (80 chars max). */ subtitle?: string; /** * Publicly reachable http(s) image rendered large above the card. */ imageUrl?: string; /** * Up to 3 card buttons. A generic template has NO phone button, on either platform. `url` buttons are click-tracked when linkTracking is on. */ buttons?: Array<{ type: 'url' | 'postback'; title: string; /** * Target URL (required when type is url) */ url?: string; /** * Postback payload delivered via the messaging_postbacks webhook (required when type is postback) */ payload?: string; }>; }; /** * An OAuth client (AI assistant / MCP connector) authorized by the user and still * holding at least one live token. * */ type ConnectedApp = { clientId?: string; /** * Name the client declared at registration. Registration is open, so this is self-declared and not verified. */ clientName?: string; /** * Host of the client's registered redirect URI (non-http schemes are shown as scheme//host). The destination an impostor cannot fake. */ redirectHost?: (string) | null; /** * Scopes granted on the most recent token. */ scopes?: Array<(string)>; authorizedAt?: (string) | null; /** * Last time any of the client's live tokens authenticated a request. */ lastUsedAt?: (string) | null; /** * Live tokens held by the client (an active session is typically one access plus one refresh token). */ tokenCount?: number; }; /** * A discoverable conversion destination on an ad platform — a Meta pixel, * Google conversion action, or LinkedIn conversion rule. Returned by * `listConversionDestinations`, `getConversionDestination`, * `createConversionDestination`, and `updateConversionDestination`. * */ type ConversionDestination = { /** * Platform-native identifier. Pass back as `destinationId` on event * send and as the path segment on CRUD endpoints. * */ id: string; name: string; /** * Present when the platform locks the event type/category to the * destination (Google conversion actions, LinkedIn conversion rules). * Absent for Meta pixels (which accept any event name per request). * */ type?: string; /** * For LinkedIn, `inactive` means the rule is soft-deleted (`enabled: false`). * */ status?: 'active' | 'inactive'; /** * Set by adapters whose destinations are scoped to a specific ad * account (LinkedIn). Pass back on subsequent CRUD calls to * identify the parent ad account. * */ adAccountId?: string; }; /** * For LinkedIn, `inactive` means the rule is soft-deleted (`enabled: false`). * */ type status3 = 'active' | 'inactive'; /** * A single conversion event to relay to the ad platform. All PII fields * (email, phone, names) are hashed with SHA-256 server-side using each * platform's normalization rules before they leave Zernio. Callers send * plaintext. * */ type ConversionEvent = { /** * Standard event name (Purchase, Lead, CompleteRegistration, AddToCart, * InitiateCheckout, AddPaymentInfo, Subscribe, StartTrial, ViewContent, * Search, Contact, SubmitApplication, Schedule) or a custom string * (only supported on platforms that accept custom events — Meta and * OpenAI Ads). * * Per-platform behavior: * - Meta: free-form; standard names match Meta's built-ins. * - Google: ignored — the conversion action's category determines the type. * - LinkedIn: ignored — the conversion rule's `type` is locked to the destination. * - OpenAI Ads: a fixed subset of standard names (Purchase, Lead, AddToCart, ViewContent, InitiateCheckout, CompleteRegistration, Subscribe, StartTrial, Schedule) maps 1:1 onto OpenAI's own event-type enum; anything else is sent as a custom event with the name preserved. * */ eventName: string; /** * When the conversion happened, in unix seconds. */ eventTime: number; /** * Unique dedup key. The same eventId must be used on pixel + CAPI * to prevent double-counting. Mapped to event_id on Meta, * transactionId on Google, eventId on LinkedIn (LinkedIn deduplicates * against Insight Tag events with the same eventId; the Insight Tag * event wins when both arrive). * */ eventId: string; /** * Conversion value in the specified currency. */ value?: number; /** * ISO 4217 currency code. */ currency?: string; /** * User identity fields. More signals mean higher match rates. */ user: { /** * Plaintext email. Hashed server-side. */ email?: string; /** * Phone number, ideally E.164. Hashed server-side. */ phone?: string; /** * Plaintext first name. Hashed server-side. */ firstName?: string; /** * Plaintext last name. Hashed server-side. */ lastName?: string; /** * Stable customer identifier (e.g. CRM user ID). Hashed * server-side for Meta and Google. Sent as plaintext to LinkedIn * (LinkedIn's Conversions API spec requires the raw value). * Maximum effective list size on LinkedIn is 1. * */ externalId?: string; /** * Client IP address. Sent plaintext. */ ipAddress?: string; /** * Client user-agent string. Sent plaintext. */ userAgent?: string; /** * ISO 3166-1 alpha-2 country code, e.g. 'us'. */ country?: string; /** * Meta advanced matching (ct). Plaintext city; normalized + SHA-256 hashed server-side. Meta only. */ city?: string; /** * Meta advanced matching (st). 2-letter ANSI for US; hashed server-side. Meta only. */ state?: string; /** * Meta advanced matching (zp). US uses first 5 digits; hashed server-side. Meta only. */ zip?: string; /** * Meta advanced matching (db). YYYYMMDD; hashed server-side. Meta only. */ dob?: string; /** * Meta advanced matching (ge). 'f' or 'm'; hashed server-side. Meta only. */ gender?: string; /** * Meta lead ID from a Lead Ad submission, as a string. Required * for Conversion Leads CRM events: send it with * `actionSource: 'crm'` and * `platformData: { event_source: 'crm', lead_event_source: '' }`. * Forwarded unhashed to Meta's `user_data.lead_id`. Meta only. * */ leadId?: string; /** * Platform click identifiers captured from the originating ad click. */ clickIds?: { /** * Meta click ID (from fbclid URL param). */ fbc?: string; /** * Meta browser ID (_fbp cookie). */ fbp?: string; /** * Google click ID (from gclid URL param). */ gclid?: string; /** * Google iOS 14.5+ app attribution ID. */ gbraid?: string; /** * Google iOS 14.5+ web-to-app attribution ID. */ wbraid?: string; /** * LinkedIn first-party ad tracking click ID. Captured by * parsing `li_fat_id` from landing-page URLs after the * advertiser enables enhanced conversion tracking on the * LinkedIn Insight Tag. Sent to LinkedIn as the * LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID userId. Opaque * token, not hashed. * */ li_fat_id?: string; }; }; /** * Item-level detail for ecommerce events. */ items?: Array<{ id?: string; name?: string; price?: number; quantity?: number; category?: string; }>; /** * URL where the conversion originated (used by Meta). */ sourceUrl?: string; /** * Where the conversion happened. Used by Meta. Google also requires an event source internally; omitting this field sends OTHER to Google. Send an explicit value for accurate origin reporting. */ actionSource?: 'web' | 'app' | 'offline' | 'crm' | 'phone_call' | 'system_generated'; /** * Escape hatch for platform-specific fields we haven't normalized. * On Meta, keys are shallow-merged into `custom_data` only: fields * Zernio already builds (`value`, `currency`, `contents`, * `num_items`) always win on collision, and `user_data` (hashed * match keys) is never touched. Use first-class fields (e.g. * `user.leadId`) for anything that must reach `user_data`. * */ platformData?: { [key: string]: unknown; }; }; /** * Where the conversion happened. Used by Meta. Google also requires an event source internally; omitting this field sends OTHER to Google. Send an explicit value for accurate origin reporting. */ type actionSource = 'web' | 'app' | 'offline' | 'crm' | 'phone_call' | 'system_generated'; /** * In addition to the `required` list, the request must use * EXACTLY ONE of the two shapes: * * - Single-creative: `headline`, `body`, and one of * `imageUrl` / `video` (mutually exclusive). * - Multi-creative: a non-empty `creatives[]` array. Top-level * `headline` / `body` / `imageUrl` / `video` must NOT be set * on this shape. * * The route enforces this at the Zod boundary; OpenAPI's * `required` cannot express the OR cleanly. * */ type CtwaAdRequestBody = { /** * Facebook or Instagram SocialAccount ID. */ accountId: string; /** * Meta ad account ID, e.g. `act_123456789`. */ adAccountId: string; /** * Ad display name. Used to derive campaign / ad set names. * On the multi-creative shape, each ad's Meta name gets a * " #N" suffix (1-indexed) so Ads Manager shows them as a * numbered batch. * */ name: string; /** * Single-creative shape only. Mutually exclusive with * `creatives[]`. * */ headline?: string; /** * Primary text shown above the image / video. Single-creative * shape only. Mutually exclusive with `creatives[]`. * */ body?: string; /** * Image asset for single-creative shape. Mutually exclusive * with `video` and with `creatives[]`. Required on the * single-creative shape if `video` is not supplied. * */ imageUrl?: string; /** * Video creative for single-creative shape. Mutually * exclusive with `imageUrl` and with `creatives[]`. Required * on the single-creative shape if `imageUrl` is not supplied. * */ video?: { url: string; /** * Required by Meta for every video creative. Used as the * ad thumbnail. * */ thumbnailUrl: string; }; /** * Multi-creative shape: N CTWA ads under one campaign + one * ad set, sharing budget and targeting. Mutually exclusive * with the top-level single-creative fields (`headline` / * `body` / `imageUrl` / `video`). Each entry must supply its * own headline, body, and exactly one of `imageUrl` / * `video`. * */ creatives?: Array<{ headline: string; /** * Primary text shown above the image / video. */ body: string; /** * Image asset. Mutually exclusive with this entry's * `video`. Required if `video` is not supplied. * */ imageUrl?: string; /** * Video creative. Mutually exclusive with this entry's * `imageUrl`. Required if `imageUrl` is not supplied. * */ video?: { url: string; /** * Required by Meta for every video creative. Used * as the ad thumbnail. * */ thumbnailUrl: string; }; }>; /** * Attach the creatives to this EXISTING messaging ad set instead of * building a campaign, so the ad set keeps its learning phase. It then * owns budget, targeting and schedule, so `budgetAmount`, `budgetType`, * `endDate`, `objective`, `countries`, `interests` and `audienceId` are * rejected with a 400 alongside it. Its `destination_type` must match * the ad's destination. * */ adSetId?: string; /** * Budget amount in the ad account's currency major units * (e.g. dollars for USD, not cents). Must be > 0. * Required unless `adSetId` is set, where the ad set owns it. * */ budgetAmount?: number; /** * Required unless `adSetId` is set. */ budgetType?: 'daily' | 'lifetime'; /** * ISO 4217 currency code matching the ad account's currency * (e.g. `USD`). Optional: Zernio resolves it from the ad account * when omitted. The value selects the minor-unit exponent Zernio * converts budget/bid amounts by before calling Meta (most * currencies are cents; zero-decimal currencies like JPY/KRW are * sent as-is). * */ currency?: string; /** * ISO 8601 datetime. Required when `budgetType` is `lifetime`. * */ endDate?: string; /** * ISO 3166-1 alpha-2 country codes. Defaults to `["US"]` only * when no other geo (`cities`, `regions`, `zips`, `metros`, * `customLocations`) is supplied. * */ countries?: Array<(string)>; /** * City-level geo targeting for local CTWA campaigns. Each entry maps to Meta's * TargetingGeoLocationCity. `key` is Meta's city ID. `radius` * and `distance_unit` are coupled: set both or neither. * Meta enforces a minimum city radius (~17 km / 10 mi); * smaller values resolve to a 0-size audience and the ad * fails at launch. For a tighter catchment use customLocations * (lat/lng). * */ cities?: Array<{ key: string; radius?: number; distance_unit?: 'mile' | 'kilometer'; }>; /** * Region / state-level geo targeting. `key` is Meta's region * ID (lookupable via GET /v1/ads/targeting/search?type=region). * */ regions?: Array<{ key: string; }>; /** * ZIP / postal-code geo targeting. `key` is the platform's * postal id resolved via /v1/ads/targeting/search. * */ zips?: Array<{ key: string; name?: string; }>; /** * DMA / metro-area geo targeting. `key` is Meta's metro id * (e.g. `DMA:807`). * */ metros?: Array<{ key: string; name?: string; }>; /** * Point-radius geo (Meta `geo_locations.custom_locations`). * Use for targeting a radius around a specific lat/long when * no Meta city/region key fits. `distanceUnit` is required. * */ customLocations?: Array<{ latitude: number; longitude: number; radius: number; distanceUnit: 'mile' | 'kilometer'; name?: string; address?: string; }>; ageMin?: number; ageMax?: number; interests?: Array<{ id: string; name?: string; }>; /** * Custom audience ID to target. */ audienceId?: string; /** * Manual ad placements on the shared ad set. Omit * for automatic placements. When set, restricts delivery to the chosen surfaces, * mapped onto the ad set's `targeting.{publisher_platforms, facebook_positions, instagram_positions, * messenger_positions, audience_network_positions, threads_positions, * whatsapp_positions, device_platforms}`. Enum membership is validated here; Meta * additionally enforces co-selection rules and restricts which * placements are eligible for click-to-WhatsApp ads, returning an actionable * error which we surface. * */ placements?: { /** * Top-level platforms to deliver on. A position field below is only honoured when its parent platform is included here. */ publisherPlatforms?: Array<('facebook' | 'instagram' | 'threads' | 'messenger' | 'audience_network' | 'whatsapp')>; facebookPositions?: Array<('feed' | 'right_hand_column' | 'marketplace' | 'video_feeds' | 'story' | 'search' | 'instream_video' | 'facebook_reels' | 'facebook_reels_overlay' | 'profile_feed' | 'notification')>; instagramPositions?: Array<('stream' | 'story' | 'explore' | 'explore_home' | 'reels' | 'profile_feed' | 'ig_search' | 'profile_reels')>; messengerPositions?: Array<('messenger_home' | 'sponsored_messages' | 'story')>; audienceNetworkPositions?: Array<('classic' | 'rewarded_video')>; threadsPositions?: Array<('threads_stream')>; whatsappPositions?: Array<('status')>; /** * Restrict by device. Omit to deliver on both mobile and desktop. */ devicePlatforms?: Array<('mobile' | 'desktop')>; }; /** * Meta's Advantage+ audience expansion. `0` (default) keeps * targeting strict; `1` lets Meta expand beyond the supplied * targeting when its delivery system finds better matches. * Always sent on CREATE (Meta requires it). * */ advantageAudience?: 0 | 1; /** * Defaults to `OUTCOME_ENGAGEMENT`. `OUTCOME_SALES` and `OUTCOME_LEADS` require * additional account configuration (Dataset linked to the WABA * for sales) and may be rejected by Meta if missing. * */ objective?: 'OUTCOME_ENGAGEMENT' | 'OUTCOME_SALES' | 'OUTCOME_LEADS'; /** * Meta bid strategy applied to the shared ad set. Defaults to * `LOWEST_COST_WITHOUT_CAP` (auto-bid) when omitted. * `LOWEST_COST_WITH_BID_CAP` and `COST_CAP` require * `bidAmount`. `LOWEST_COST_WITH_MIN_ROAS` requires * `roasAverageFloor`. CTWA's `optimization_goal` is fixed to * `CONVERSATIONS`, but the bid strategy is independent. * */ bidStrategy?: 'LOWEST_COST_WITHOUT_CAP' | 'LOWEST_COST_WITH_BID_CAP' | 'COST_CAP' | 'LOWEST_COST_WITH_MIN_ROAS'; /** * Whole currency units (e.g. `5` = $5.00 on a USD account). * Required when `bidStrategy` is `LOWEST_COST_WITH_BID_CAP` * or `COST_CAP`; rejected otherwise. * */ bidAmount?: number; /** * Decimal ROAS multiplier (e.g. `2.0` = 2.0× ROAS floor). * Required when `bidStrategy` is `LOWEST_COST_WITH_MIN_ROAS`; * rejected otherwise. Meta enforces its own upper bound * server-side. * */ roasAverageFloor?: number; /** * Legal entity that benefits from the ad. Required when targeting EU users * (EU DSA, Article 26). Optional if the ad account has a default beneficiary: * set it once via `PATCH /v1/ads/accounts` or in Meta Ads Manager, and Meta * fills it in whenever the field is omitted. * */ dsaBeneficiary?: string; /** * Legal entity that pays for the ad. Can differ from `dsaBeneficiary` * (for example, an agency paying for a client's ads). Same rules as * `dsaBeneficiary`: required for EU targeting unless the ad account has * a default payor. * */ dsaPayor?: string; }; /** * Required unless `adSetId` is set. */ type budgetType = 'daily' | 'lifetime'; /** * Meta's Advantage+ audience expansion. `0` (default) keeps * targeting strict; `1` lets Meta expand beyond the supplied * targeting when its delivery system finds better matches. * Always sent on CREATE (Meta requires it). * */ type advantageAudience = 0 | 1; /** * Defaults to `OUTCOME_ENGAGEMENT`. `OUTCOME_SALES` and `OUTCOME_LEADS` require * additional account configuration (Dataset linked to the WABA * for sales) and may be rejected by Meta if missing. * */ type objective = 'OUTCOME_ENGAGEMENT' | 'OUTCOME_SALES' | 'OUTCOME_LEADS'; /** * Meta bid strategy applied to the shared ad set. Defaults to * `LOWEST_COST_WITHOUT_CAP` (auto-bid) when omitted. * `LOWEST_COST_WITH_BID_CAP` and `COST_CAP` require * `bidAmount`. `LOWEST_COST_WITH_MIN_ROAS` requires * `roasAverageFloor`. CTWA's `optimization_goal` is fixed to * `CONVERSATIONS`, but the bid strategy is independent. * */ type bidStrategy = 'LOWEST_COST_WITHOUT_CAP' | 'LOWEST_COST_WITH_BID_CAP' | 'COST_CAP' | 'LOWEST_COST_WITH_MIN_ROAS'; /** * Response returned by `POST /v1/ads/ctwa` when the request used the * multi-creative shape (`creatives[]`). N persisted Ad documents share * the returned `platformCampaignId` and `platformAdSetId`. `adType` is * the union discriminator. * */ type CtwaMultiResponse = { adType: 'multi'; /** * The persisted Ad documents (one per creative), all sharing the same * `platformCampaignId` and `platformAdSetId`. * */ ads: Array<{ [key: string]: unknown; }>; platformCampaignId: string; platformAdSetId: string; message: string; }; type adType2 = 'multi'; /** * Response returned by `POST /v1/ads/ctwa` when the request used the * single-creative shape (top-level headline / body / imageUrl|video). * `adType` is the union discriminator. * */ type CtwaSingleResponse = { adType: 'single'; /** * The persisted Ad document. */ ad: { [key: string]: unknown; }; message: string; }; type adType3 = 'single'; type CustomConversion = { id?: string; name?: (string) | null; /** * Meta's rule, parsed back from the string Meta stores. */ rule?: { [key: string]: unknown; } | null; customEventType?: (string) | null; /** * Meta's event_source_id — the pixel the rule reads from. */ pixelId?: (string) | null; isArchived?: boolean; }; type CustomConversionResult = { adAccountId?: string; /** * Drops straight into promotedObject.customConversionId on POST /v1/ads/create. */ customConversionId?: string; /** * True when an existing conversion matched name + pixelId; the response is then a 200. */ reused?: boolean; customConversion?: CustomConversion; }; /** * A Discord guild member, returned verbatim from Discord's API. */ type DiscordGuildMember = { user?: { /** * User snowflake */ id?: string; username?: string; discriminator?: string; avatar?: (string) | null; /** * User's display name (post-2023 Discord rebrand) */ global_name?: (string) | null; }; /** * Guild-specific nickname */ nick?: (string) | null; /** * Snowflake IDs of roles assigned to this member */ roles?: Array<(string)>; joined_at?: string; /** * When the user started boosting the server */ premium_since?: (string) | null; }; /** * Discord message settings. Supports plain text (2,000 chars), rich embeds (up to 10), native polls, forum posts, threads, and announcement crossposts. Media attachments support images (JPEG, PNG, GIF, WebP), videos (MP4), and documents (up to 10 files, 25 MB each). Webhook identity (username + avatar) can be customized per-account via PATCH /v1/connect/discord or per-post via webhookUsername/webhookAvatarUrl. * */ type DiscordPlatformData = { /** * Target channel snowflake ID. Determines which channel in the connected server receives the message. */ channelId: string; /** * Up to 10 Discord embed objects (combined max 6,000 characters across all embeds). Sent alongside or instead of plain-text content. */ embeds?: Array<{ /** * Embed title (max 256 chars) */ title?: string; /** * Embed body text (max 4,096 chars) */ description?: string; /** * URL the title links to */ url?: string; /** * Embed accent color as decimal integer (e.g. 5814783 for blue). Convert hex to decimal. */ color?: number; image?: { url?: string; }; thumbnail?: { url?: string; }; footer?: { /** * Footer text (max 2,048 chars) */ text?: string; icon_url?: string; }; author?: { /** * Author name (max 256 chars) */ name?: string; url?: string; icon_url?: string; }; /** * Up to 25 fields per embed */ fields?: Array<{ /** * Field name (max 256 chars) */ name: string; /** * Field value (max 1,024 chars) */ value: string; /** * Display fields side-by-side */ inline?: boolean; }>; }>; /** * Native Discord poll. Cannot be combined with media attachments in the same message. */ poll?: { question?: { /** * Poll question (max 300 chars) */ text: string; }; /** * 1-10 answer options */ answers?: Array<{ poll_media?: { /** * Answer text */ text?: string; }; }>; /** * Poll duration in hours (1-768). Default 24. */ duration?: number; /** * Allow users to select multiple answers. Default false. */ allow_multiselect?: boolean; }; /** * Auto-crosspost to every server following this announcement channel (type 5). No-op for regular text channels. */ crosspost?: boolean; /** * Thread title for forum channel posts (type 15). Required when posting to a forum channel. */ forumThreadName?: string; /** * Tag snowflake IDs to apply to forum posts. Max 5 tags. */ forumAppliedTags?: Array<(string)>; /** * Create a follow-up thread under the published message. */ threadFromMessage?: { /** * Thread name (1-100 chars) */ name?: string; /** * Auto-archive after inactivity (minutes) */ autoArchiveDuration?: 60 | 1440 | 4320 | 10080; /** * Slow-mode duration in seconds (0-21600) */ rateLimitPerUser?: number; }; /** * Send as text-to-speech message. Discord reads the message aloud in the channel. */ tts?: boolean; /** * Override the webhook display name for this post only (1-80 chars). Falls back to the account-level default set via PATCH /v1/connect/discord. */ webhookUsername?: string; /** * Override the webhook avatar URL for this post only. Falls back to the account-level default. */ webhookAvatarUrl?: string; }; /** * Auto-archive after inactivity (minutes) */ type autoArchiveDuration = 60 | 1440 | 4320 | 10080; /** * A Discord guild role, returned verbatim from Discord's API. */ type DiscordRole = { /** * Role snowflake ID */ id?: string; name?: string; /** * Decimal color (0 = no color). Convert to hex via .toString(16). */ color?: number; /** * Position in role hierarchy (higher = more authority) */ position?: number; /** * Permissions bitfield as a stringified integer */ permissions?: string; /** * True for integration-managed roles (bot roles) */ managed?: boolean; mentionable?: boolean; /** * True if role is displayed separately in member list */ hoist?: boolean; }; /** * Discord guild scheduled event. Returned by /v1/discord/guilds/{guildId}/events endpoints. * Fields below are the subset Zernio consumes — Discord may return more (e.g. creator, * image hash) which we pass through verbatim. * */ type DiscordScheduledEvent = { /** * Event snowflake ID */ id?: string; guild_id?: string; /** * Voice/stage channel ID; null for external events. */ channel_id?: (string) | null; creator_id?: (string) | null; name?: string; description?: (string) | null; scheduled_start_time?: string; /** * Required for external events; optional for voice/stage. */ scheduled_end_time?: (string) | null; /** * Always 2 (GUILD_ONLY) — Discord deprecated PUBLIC events. */ privacy_level?: 2; /** * 1=SCHEDULED, 2=ACTIVE, 3=COMPLETED, 4=CANCELED */ status?: 1 | 2 | 3 | 4; /** * 1=STAGE_INSTANCE, 2=VOICE, 3=EXTERNAL */ entity_type?: 1 | 2 | 3; entity_id?: (string) | null; entity_metadata?: { /** * External event location string. */ location?: string; } | null; /** * Number of members who RSVP'd. Only present when withUserCount=true on list. */ user_count?: number; /** * Cover image hash; build URL via cdn.discordapp.com. */ image?: (string) | null; }; /** * Always 2 (GUILD_ONLY) — Discord deprecated PUBLIC events. */ type privacy_level = 2; /** * 1=SCHEDULED, 2=ACTIVE, 3=COMPLETED, 4=CANCELED */ type status4 = 1 | 2 | 3 | 4; /** * 1=STAGE_INSTANCE, 2=VOICE, 3=EXTERNAL */ type entity_type = 1 | 2 | 3; /** * A single inline button rendered inside an auto-DM via Meta's button_template. * Up to 3 buttons per automation. `url` and `postback` work on Instagram and * Facebook; `phone` is Facebook-only. When buttons are set, `dmMessage` becomes * the button_template text and must be 640 characters or less. * */ type DmButton = { type: 'url' | 'postback' | 'phone'; /** * Button label (20 chars max) */ title: string; /** * Target URL (required when type is url) */ url?: string; /** * Postback payload delivered via the messaging_postbacks webhook (required when type is postback) */ payload?: string; /** * Phone number, e.g. +14155551234 (required when type is phone; Facebook only) */ phone?: string; }; type type3 = 'url' | 'postback' | 'phone'; /** * Canonical error envelope. `error` is the human-readable message; `type`, * `code`, `param`, `platform`, and `platformError` are top-level siblings * for programmatic handling. For upstream platform failures (`type: * platform_error`), `platformError` carries the provider's raw payload * verbatim (for Meta: `error_subcode`, `error_user_title`, `error_user_msg`). * */ type ErrorResponse = { /** * Human-readable error message. */ error?: string; /** * Error class for programmatic handling. */ type?: 'invalid_request_error' | 'authentication_error' | 'permission_error' | 'not_found' | 'rate_limit_error' | 'platform_error' | 'api_error'; /** * Stable machine-readable error code. */ code?: string; /** * The request field that caused the error, when applicable. */ param?: string; /** * Upstream platform (e.g. meta, google, tiktok) — present when type is platform_error. */ platform?: string; /** * Raw error payload from the upstream platform, passed through verbatim so * integrators can read provider-specific codes. For Meta this includes * error_subcode, error_user_title, and error_user_msg. * */ platformError?: { [key: string]: unknown; }; /** * Additional structured context (e.g. field-level validation errors). */ details?: { [key: string]: unknown; }; }; /** * Error class for programmatic handling. */ type type4 = 'invalid_request_error' | 'authentication_error' | 'permission_error' | 'not_found' | 'rate_limit_error' | 'platform_error' | 'api_error'; /** * A media item on a native (external/synced) post, as carried by post.external.* webhook payloads. Distinct from the richer MediaItem used for Zernio-authored posts: external items are always already-published and limited to image or video. Kept as a separate schema so the generated SDK model does not collide with MediaItem. * */ type ExternalPostMediaItem = { type: 'image' | 'video'; /** * 'Direct URL to the media file. Null when the platform withholds it: check mediaStatus before downloading. Instagram omits the video file for Reels it flags as containing copyrighted material (its docs name audio as the usual cause), so type stays "video" while the file is permanently unreachable. For LinkedIn videos where the platform returns no file, url falls back to the cover image and the item carries mediaStatus: unavailable.' */ url: (string) | null; /** * Cover image. Still present when url is null. */ thumbnail?: string; /** * unavailable means the media file could not be retrieved (url is null or, for LinkedIn videos, a cover image standing in for the file). available or absent means the file is available at url (older synced items omit the field). */ mediaStatus?: 'available' | 'unavailable'; /** * Why the file is missing. platform_withheld means the platform declined to return it and retrying will not help. */ unavailableReason?: 'platform_withheld'; }; type type5 = 'image' | 'video'; /** * unavailable means the media file could not be retrieved (url is null or, for LinkedIn videos, a cover image standing in for the file). available or absent means the file is available at url (older synced items omit the field). */ type mediaStatus = 'available' | 'unavailable'; /** * Why the file is missing. platform_withheld means the platform declined to return it and retrying will not help. */ type unavailableReason = 'platform_withheld'; /** * A post synced from a platform (published directly on the platform, not * through Zernio). Returned by GET /v1/posts?source=external and * POST /v1/posts/sync-external. Analytics are exposed separately via * GET /v1/analytics?source=external. * */ type ExternalPostSummary = { /** * Platform the post belongs to (e.g. instagram, youtube, tiktok) */ platform?: string; /** * The platform's own post/media/video id */ platformPostId?: string; /** * Canonical URL (permalink) of the post on the platform */ platformPostUrl?: string; /** * Post caption / text */ content?: string; /** * When the post was published on the platform */ publishedAt?: string; /** * Media type (e.g. image, video, carousel) */ mediaType?: string; /** * Thumbnail URL */ thumbnailUrl?: string; /** * Per-item media (for carousels / multi-media posts) */ mediaItems?: Array<{ [key: string]: unknown; }>; /** * Instagram only: the platform media product type (e.g. FEED, REELS, STORY, AD). Absent when the platform did not report it. */ mediaProductType?: string; /** * Instagram only: whether Instagram labeled the media as AI-generated. Absent when the platform did not report it. */ isAiGenerated?: boolean; /** * Instagram reels only: whether the reel is also shared to the main feed. Absent when the platform did not report it. */ isSharedToFeed?: boolean; /** * Instagram only: audio type of the media (MUSIC or ORIGINAL_SOUND). Absent when the platform did not report it. */ mediaAudioType?: string; /** * Engagement + insights for the post. `likes` and `comments` are * available immediately after an on-demand sync (they come from the * platform listing). `reach`, `impressions`, `views` depend on the * platform's insights, which carry their own delay (e.g. ~24h on * Instagram) and read 0 until the platform makes them available. * */ analytics?: { likes?: number; comments?: number; shares?: number; saves?: number; sends?: number; clicks?: number; views?: number; reach?: number; impressions?: number; /** * Percentage, rounded to 2 decimals. Same definition as PostAnalytics.engagementRate: (likes + comments + shares + saves) / (impressions or reach or views) * 100, where the denominator is the first of the three that is non-zero. Clicks and follows are never counted. */ engagementRate?: number; /** * When these metrics were last refreshed */ lastUpdated?: string; }; }; /** * Native (external) post data shared by all post.external.* payloads. */ type ExternalPostWebhookPost = { /** * Platform-native post ID (NOT a Zernio post ID). */ id: string; /** * Platform the post lives on (e.g. "googlebusiness"). */ platform: string; /** * Zernio social account ID the post belongs to. */ accountId: string; /** * Direct URL to the post on the platform, when available. */ url: (string) | null; /** * Post text. May be empty. */ content: string; /** * One of image, video, gif, document, text, carousel. */ mediaType: string; mediaItems: Array; thumbnailUrl: (string) | null; publishedAt: string; /** * Instagram only: the platform media product type (e.g. FEED, REELS, STORY, AD). Absent when the platform did not report it. */ mediaProductType?: string; /** * Instagram only: whether Instagram labeled the media as AI-generated. Absent when the platform did not report it. */ isAiGenerated?: boolean; /** * Instagram reels only: whether the reel is also shared to the main feed. Absent when the platform did not report it. */ isSharedToFeed?: boolean; /** * Instagram only: audio type of the media (MUSIC or ORIGINAL_SOUND). Absent when the platform did not report it. */ mediaAudioType?: string; /** * Always "external" — distinguishes these from Zernio-originated post.* events. */ source: 'external'; /** * Detection time of deletion. Present on post.external.deleted; null/absent otherwise. */ deletedAt?: (string) | null; }; /** * Always "external" — distinguishes these from Zernio-originated post.* events. */ type source = 'external'; /** * Feed posts support up to 10 images (no mixed video+image). Stories require single media (24h, no captions). Reels require single vertical video (9:16, 3-60s). Geo-restriction is a hard visibility restriction: users outside the specified countries cannot see the post. Not supported for stories. Draft, carousel, and colored-background text options live under facebookSettings, see FacebookSettings. * */ type FacebookPlatformData = { /** * Set to 'story' for Page Stories (24h ephemeral) or 'reel' for Reels (short vertical video). Defaults to feed post if omitted. */ contentType?: 'story' | 'reel'; /** * Reel title (only for contentType=reel). Separate from the caption/content field. */ title?: string; /** * Optional first comment to post immediately after publishing (feed posts and reels, not stories). Skipped when facebookSettings.draft is true. */ firstComment?: string; /** * Target Facebook Page ID for multi-page posting. If omitted, uses the default page. Use GET /v1/accounts/{id}/facebook-page to list pages. */ pageId?: string; geoRestriction?: GeoRestriction; facebookSettings?: FacebookSettings; }; /** * Set to 'story' for Page Stories (24h ephemeral) or 'reel' for Reels (short vertical video). Defaults to feed post if omitted. */ type contentType = 'story' | 'reel'; /** * Lifetime monetization earnings for one Facebook post. Same "unit" / "currency" contract and * same unavailable-vs-zero contract as the Page-level response; there is no date range, no * metricType, and no daily "values", because the single lifetime bucket IS the total. * */ type FacebookPostEarningsResponse = { success?: boolean; accountId?: string; /** * The platform post ID that was queried, echoed back. */ postId?: string; platform?: string; /** * Always "lifetime": the total is cumulative since publication and must not be summed * across dates or across posts. * */ period?: 'lifetime'; /** * One entry per served metric. A metric reported here with "total": 0 genuinely earned * nothing (or its Page is not enrolled, which Meta reports identically). * */ metrics?: { [key: string]: { /** * Lifetime earnings in "unit", exactly as Meta returned them. Never rescaled. */ total?: number; /** * "micro_amount": Meta returned an object shape carrying a micro amount, and "total" is * that integer, unconverted. Zernio does not publish a divisor because Meta does not * document one; divide by the scale you have verified against the Page's own Meta * Business Suite export. This is always content_monetization_earnings. * * "unspecified": Meta returned a bare number with no unit metadata, passed through as-is; * Meta does not state whether it is major or minor currency units. This is always * monetization_approximate_earnings. * */ unit?: 'micro_amount' | 'unspecified'; /** * ISO 4217 currency, or null when Meta omitted it. Always null on * monetization_approximate_earnings; always present on content_monetization_earnings. * */ currency?: (string) | null; }; }; /** * Requested metrics Meta could not serve. Present only when at least one metric is * unavailable, and absent otherwise. Each listed metric is OMITTED from "metrics" rather than * reported as 0. The request itself still succeeds with HTTP 200. * */ unavailableMetrics?: Array<{ /** * The requested metric name. */ metric?: string; /** * "not_enrolled": the account is not enrolled in the program behind this metric. * "permission_missing": the connected user lacks access to this metric. * "unsupported_metric": Meta does not accept this metric name on the API version Zernio uses. * "no_data": Meta returned no bucket for this metric. * "unreadable_value": Meta returned a value shape Zernio cannot read, so no total is reported. * "mixed_currency": readable values disagree on currency or unit. * "upstream_error": any other platform failure. * * "no_data" is the common case in practice; the others are defensive. * */ reason?: 'not_enrolled' | 'permission_missing' | 'unsupported_metric' | 'no_data' | 'unreadable_value' | 'mixed_currency' | 'upstream_error'; /** * Platform-provided explanation when available (access tokens redacted), otherwise Zernio copy. */ message?: string; }>; dataDelay?: string; }; /** * Always "lifetime": the total is cumulative since publication and must not be summed * across dates or across posts. * */ type period = 'lifetime'; /** * Facebook options that must be nested under platformSpecificData.facebookSettings, or sent at the request root as facebookSettings. The remaining Facebook options sit directly on platformSpecificData, see FacebookPlatformData. * */ type FacebookSettings = { /** * When true, creates the post as a draft in Facebook Publishing Tools instead of publishing immediately. Supported for feed posts (text, link, image, video) and reels. Not supported for stories. Drafts expire after ~30 days. */ draft?: boolean; /** * Renders the post as a multi-link carousel (organic Page post). When set, mediaItems must be provided with the same length and all items must be images (no videos). Each cards[i] adds the click-through link and headline for the image at mediaItems[i]. Mutually exclusive with contentType=story|reel. Facebook display truncates name at ~35 chars and description at ~30 chars; longer strings are accepted but get truncated on render. * */ carouselCards?: Array<{ /** * Per-card click destination (required). */ link: string; /** * Per-card headline (optional, ~35-char display). */ name?: string; /** * Per-card subhead (optional, ~30-char display). */ description?: string; }>; /** * Optional top-level "See more" destination shown on the carousel end card. Defaults to the first card's link when omitted. Only used together with carouselCards. * */ carouselLink?: string; /** * Facebook-defined preset ID that renders the post as large text on a colored background (Graph `text_format_preset_id`). Supply the raw numeric ID from Meta; we do not publish a catalog of presets and Facebook may change the available set. Pages only (ignored on personal profiles and groups) and text-only feed posts only: the request is rejected with 400 when mediaItems or carouselCards are present, when contentType is story or reel, or when content is empty. An attachment makes Facebook drop the background silently, so those are rejected up front. Length is NOT rejected: Facebook's composer stops offering a background at around 130 characters, but Meta documents no API limit, so longer content publishes and returns a warning instead. A URL detected in the content is NOT attached as a link preview while a preset is set, because a link attachment also makes Facebook drop the background. * */ textFormatPresetId?: string; }; type FollowerStatsResponse = { accounts?: Array; stats?: { [key: string]: Array<{ date?: string; followers?: number; }>; }; dateRange?: { from?: string; to?: string; }; granularity?: string; }; type FoodMenu = { labels: Array; sections?: Array; /** * Cuisine types (e.g. AMERICAN, ITALIAN, JAPANESE) */ cuisines?: Array<(string)>; /** * URL of the original menu source */ sourceUrl?: string; }; type FoodMenuItem = { labels: Array; attributes?: FoodMenuItemAttributes; /** * Item variants/options (e.g. sizes, preparations) */ options?: Array<{ labels: Array; attributes: FoodMenuItemAttributes; }>; }; type FoodMenuItemAttributes = { price?: Money; /** * Spiciness level (e.g. MILD, MEDIUM, HOT) */ spiciness?: 'SPICINESS_UNSPECIFIED' | 'MILD' | 'MEDIUM' | 'HOT'; /** * Allergens (e.g. DAIRY, GLUTEN, SHELLFISH) */ allergen?: Array<(string)>; /** * Dietary labels (e.g. VEGETARIAN, VEGAN, GLUTEN_FREE) */ dietaryRestriction?: Array<(string)>; /** * Number of people the item serves */ servesNumPeople?: number; /** * Preparation methods (e.g. GRILLED, FRIED) */ preparationMethods?: Array<(string)>; /** * Media references for item photos */ mediaKeys?: Array<(string)>; }; /** * Spiciness level (e.g. MILD, MEDIUM, HOT) */ type spiciness = 'SPICINESS_UNSPECIFIED' | 'MILD' | 'MEDIUM' | 'HOT'; type FoodMenuLabel = { /** * Display name of the item/section/menu */ displayName: string; /** * Optional description */ description?: string; /** * BCP-47 language code (e.g. en, es) */ languageCode?: string; }; type FoodMenuSection = { labels: Array; items?: Array; }; /** * Country-level geo-restriction (allowlist). When set, the post is only visible to users in the specified countries. Supported on Facebook (feed posts, videos, reels), X/Twitter (media-level restriction), and LinkedIn (organization pages only, min 300 targeted followers). Ignored on unsupported platforms. Stories (Facebook, Instagram) do not support geo-restriction. * */ type GeoRestriction = { /** * ISO 3166-1 alpha-2 country codes (uppercase). Only users in these countries can see the post. Maximum 25 countries per post. Example: ["US", "CA", "GB", "ES"]. * */ countries: Array<(string)>; }; /** * Text and single image only (no videos). Supports STANDARD, EVENT, OFFER, and ALERT post types. Posts appear on GBP, Google Search, and Maps. Use locationId for multi-location posting. Schedule dates accept both ISO 8601 strings (e.g. '2026-04-15T09:00:00Z') and Google's native {year, month, day} objects. */ type GoogleBusinessPlatformData = { /** * Target GBP location ID (e.g. "locations/123456789"). If omitted, uses the default location. Use GET /v1/accounts/{id}/gmb-locations to list locations. */ locationId?: string; /** * BCP 47 language code (e.g. "en", "de", "es"). Auto-detected if omitted. Set explicitly for short or mixed-language posts. */ languageCode?: string; /** * Post type. STANDARD is a regular update. EVENT requires the event object. OFFER requires the offer object. Defaults to STANDARD if omitted. */ topicType?: 'STANDARD' | 'EVENT' | 'OFFER'; /** * Optional call-to-action button displayed on the post */ callToAction?: { /** * Button action type: LEARN_MORE, BOOK, ORDER, SHOP, SIGN_UP, CALL */ type: 'LEARN_MORE' | 'BOOK' | 'ORDER' | 'SHOP' | 'SIGN_UP' | 'CALL'; /** * Destination URL for the CTA button (required when callToAction is provided) */ url: string; }; /** * Event details. Required when topicType is EVENT. Google returns 400 if omitted for EVENT posts. */ event?: { /** * Event name (displayed as the event heading on Google Search and Maps) */ title: string; /** * Event date/time range. Uses Google's date format (NOT ISO 8601). */ schedule: { /** * Event start date as { year, month, day } */ startDate: { year: number; month: number; day: number; }; /** * Optional start time as { hours, minutes } in 24h format */ startTime?: { hours?: number; minutes?: number; }; /** * Event end date as { year, month, day } */ endDate: { year: number; month: number; day: number; }; /** * Optional end time as { hours, minutes } in 24h format */ endTime?: { hours?: number; minutes?: number; }; }; }; /** * Offer details. Required when topicType is OFFER. All fields are optional per Google's API, but at least one is recommended. */ offer?: { /** * URL where the offer can be redeemed online */ redeemOnlineUrl?: string; /** * Terms and conditions for the offer */ termsConditions?: string; /** * Coupon code for the offer */ couponCode?: string; }; }; /** * Post type. STANDARD is a regular update. EVENT requires the event object. OFFER requires the offer object. Defaults to STANDARD if omitted. */ type topicType = 'STANDARD' | 'EVENT' | 'OFFER'; /** * Button action type: LEARN_MORE, BOOK, ORDER, SHOP, SIGN_UP, CALL */ type type6 = 'LEARN_MORE' | 'BOOK' | 'ORDER' | 'SHOP' | 'SIGN_UP' | 'CALL'; /** * Attachment snapshot inside an edit-history entry. */ type InboxMessageEditAttachment = { type?: string; url?: string; payload?: { [key: string]: unknown; }; }; /** * One prior version of an edited message. */ type InboxMessageEditHistoryEntry = { text: (string) | null; attachments: Array; editedAt: string; }; /** * The account context included in inbox webhook payloads. */ type InboxWebhookAccount = { /** * Social account ID */ id: string; /** * Social account ID (same value as id). Canonical field so consumers can filter every webhook event on one field (e.g. route staging vs production by account). id is kept for backward compatibility. */ accountId?: string; /** * Zernio profile (workspace) ID this account belongs to. Use it to route or filter inbox webhooks by workspace. This is the profile ID only, not its name (resolve the name via the API with this ID). Optional; omitted on the shared WhatsApp sandbox account and when the account has no resolvable profile. */ profileId?: string; platform: string; username: string; displayName?: string; }; /** * The conversation context included in inbox webhook payloads. */ type InboxWebhookConversation = { id: string; platformConversationId: string; participantId?: string; participantName?: string; participantUsername?: string; participantPicture?: string; status: 'active' | 'archived'; /** * Zernio CRM Contact ID for the participant, when one exists. Resolved by * joining `participantId` to the ContactChannel collection. Best-effort: * omitted when no channel matches or `participantId` is absent. Lets * integrators join any inbox webhook back to the CRM Contact without * needing to look at the sender — which matters for outgoing and * delivery-status events whose sender is the business. * */ contactId?: string; }; type status5 = 'active' | 'archived'; /** * The message object included in inbox webhook payloads. */ type InboxWebhookMessage = { /** * Internal message ID */ id: string; /** * Internal conversation ID */ conversationId: string; platform: 'instagram' | 'facebook' | 'telegram' | 'whatsapp' | 'sms'; /** * Platform's message ID */ platformMessageId: string; direction: 'incoming' | 'outgoing'; /** * Message text content (retained on deleted messages for API consumers; Zernio dashboard UI hides this) */ text: (string) | null; attachments: Array<{ /** * Attachment type (image, video, file, sticker, audio) */ type: string; /** * Where to fetch the attachment. The contract depends on direction and * platform: inbound WhatsApp media points at the authenticated * `GET /v1/whatsapp/media/{mediaId}` and requires * `Authorization: Bearer `, while outgoing media carries the * URL originally supplied and Instagram / Facebook / Telegram carry direct * platform CDN links that need no authentication. * */ url: string; /** * Additional attachment metadata */ payload?: { [key: string]: unknown; }; }>; sender: { /** * Sender's platform identifier. For WhatsApp this is the phone number * (without leading `+`) when available, otherwise the `businessScopedUserId`. * For other platforms, the platform's own user ID. * */ id: string; /** * Zernio CRM Contact id for this sender, when one exists (joined via * the ContactChannel mapping). Lets integrators link a message straight * to a Contact without a follow-up Contacts API call. Omitted when the * sender isn't a tracked contact (e.g. outgoing messages where the * sender is the business, or first-touch messages before the contact * is created). * */ contactId?: string; name?: string; username?: string; picture?: string; /** * WhatsApp only. Sender's phone number in E.164 format (with leading `+`). * * **Nullable during the BSUID rollout (April 2026+).** WhatsApp users * who adopt a username can message businesses without exposing a phone * number — this field is omitted for them. Match by `businessScopedUserId` * instead. See `docs/whatsapp-bsuid-migration.md`. * */ phoneNumber?: (string) | null; /** * WhatsApp only. Business-scoped user ID (BSUID) — Meta's canonical * identifier for a WhatsApp user within your business. Present when * Meta includes it in the inbound payload (rollout in progress since * early April 2026). **Recommended primary identity anchor** going * forward; fall back to `phoneNumber` only when this field is absent. * */ businessScopedUserId?: string; /** * WhatsApp only. Parent BSUID for businesses with linked business * portfolios. Omitted for standalone portfolios. * */ parentBusinessScopedUserId?: string; /** * WhatsApp only. User's WhatsApp username (e.g. `@jane`). Not a * stable identifier — users can change it. Useful for display, not * recommended as an identity anchor. * */ whatsappUsername?: string; /** * Instagram profile data. Only present for Instagram conversations. */ instagramProfile?: { isFollower?: (boolean) | null; isFollowing?: (boolean) | null; followerCount?: (number) | null; isVerified?: (boolean) | null; }; }; sentAt: string; isRead: boolean; }; type platform3 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp' | 'sms'; type direction2 = 'incoming' | 'outgoing'; /** * Shared account-insights response envelope used by every platform-level * analytics endpoint (/v1/analytics/{facebook|instagram|youtube|linkedin|tiktok}*). * The name is historical - the shape was first shipped for Instagram and every * new platform endpoint reuses it for response-shape consistency. The platform * field echoes back which platform served the response. * */ type InstagramAccountInsightsResponse = { success?: boolean; /** * The Zernio SocialAccount ID */ accountId?: string; /** * Platform that served this response. */ platform?: 'facebook' | 'instagram' | 'youtube' | 'linkedin' | 'tiktok'; dateRange?: { since?: string; until?: string; }; metricType?: 'time_series' | 'total_value'; /** * Breakdown dimension used (only present when breakdown was requested) */ breakdown?: string; /** * Object keyed by metric name. For time_series: each metric has "total" (number) and "values" (array of {date, value}). * For total_value: each metric has "total" (number) and optionally "breakdowns" (array of {dimension, value}). * * Monetary metrics additionally carry "unit" and "currency". Zernio never rescales money: * "total" and every "values[].value" are the platform's raw numbers in the stated unit. * Monetary metrics also keep "values" on metricType=total_value, because their "total" is the * sum of the daily buckets the platform returned over the range: keep the series so you can * reconcile that sum against the platform's own reporting before invoicing on it. * A metric that could not be served is absent from this object and listed in * "unavailableMetrics" instead, so an unavailable metric is never reported as a zero. * */ metrics?: { [key: string]: { /** * Sum or aggregate value for the metric */ total?: number; /** * Daily values (for time_series, and always on monetary metrics) */ values?: Array<{ date?: string; value?: number; }>; /** * Breakdown values (only for total_value with breakdown) */ breakdowns?: Array<{ dimension?: string; value?: number; }>; /** * Present on monetary metrics only. The scale of "total" and of every "values[].value", * exactly as the platform returned them. * * "micro_amount": the platform returned an object shape carrying a micro amount, and the * values are that integer, summed, unconverted. Zernio does not publish a divisor because * Meta does not document one; divide by the scale you have verified against the Page's own * Meta Business Suite export. On Facebook Page insights this is always * content_monetization_earnings. * * "unspecified": the platform returned a bare number with no unit metadata. It is passed * through as-is; the platform does not state whether it is major or minor currency units. * On Facebook Page insights this is always monetization_approximate_earnings. * */ unit?: 'micro_amount' | 'unspecified'; /** * ISO 4217 currency of a monetary metric, or null when the platform omitted it. * Always null on monetization_approximate_earnings, which Meta returns as a bare number * with no currency; always present on content_monetization_earnings. * */ currency?: (string) | null; }; }; /** * Requested metrics that could not be served. Present only when at least one metric is * unavailable, and absent otherwise. Each listed metric is OMITTED from "metrics" rather than * reported as 0, which is how an unavailable metric is distinguished from a genuine zero. * The request itself still succeeds with HTTP 200. * */ unavailableMetrics?: Array<{ /** * The requested metric name. */ metric?: string; /** * "not_enrolled": the account is not enrolled in the program behind this metric. * "permission_missing": the connected user lacks access to this metric. * "unsupported_metric": the platform does not accept this metric name on the API version Zernio uses. * "no_data": the platform returned no bucket for this metric over the requested range. * "unreadable_value": the platform returned a value shape Zernio cannot read, so no total is reported. * "mixed_currency": readable values disagree on currency or unit within the range. * "upstream_error": any other platform failure. * * "no_data" is the common case in practice. The others are defensive: "not_enrolled" and * "unsupported_metric" in particular have not been observed on live Facebook traffic, since * a non-enrolled Page returns zeros rather than an error and metric names are validated * before any platform call. * */ reason?: 'not_enrolled' | 'permission_missing' | 'unsupported_metric' | 'no_data' | 'unreadable_value' | 'mixed_currency' | 'upstream_error'; /** * Platform-provided explanation when available (access tokens redacted), otherwise Zernio copy. */ message?: string; }>; dataDelay?: string; }; /** * Platform that served this response. */ type platform4 = 'facebook' | 'instagram' | 'youtube' | 'linkedin' | 'tiktok'; type metricType = 'time_series' | 'total_value'; /** * One asset from the Instagram audio catalog. Licensed music carries artist/artwork fields; original sounds carry creator fields instead, so most fields are nullable. */ type InstagramAudioAsset = { /** * Audio asset ID. Pass it as platformSpecificData.audioConfiguration.audioId when creating a Reel. */ audioId?: string; /** * Track or sound title. */ title?: (string) | null; /** * Catalog type of the asset. */ audioType?: ('music' | 'original_sound') | null; /** * Asset duration in milliseconds. */ durationInMs?: (number) | null; /** * Artist name (licensed music only). */ displayArtist?: (string) | null; /** * Cover artwork thumbnail (licensed music only). */ coverArtworkThumbnailUrl?: (string) | null; /** * Temporary preview URL. Meta expires it after roughly 1.5 days; re-fetch the asset to refresh it. */ downloadUrl?: (string) | null; /** * Creator username (original sounds only). */ igUsername?: (string) | null; /** * Creator profile picture (original sounds only). */ profilePictureUrl?: (string) | null; /** * Whether the asset is eligible for ads use. */ isAdsEligible?: (boolean) | null; /** * Instagram web link to preview the audio. */ onPlatformAudioPreviewLink?: (string) | null; }; /** * Catalog type of the asset. */ type audioType = 'music' | 'original_sound'; type InstagramDemographicsResponse = { success?: boolean; /** * The Zernio SocialAccount ID */ accountId?: string; platform?: string; metric?: 'follower_demographics' | 'engaged_audience_demographics'; /** * The timeframe used for demographic data */ timeframe?: 'this_week' | 'this_month'; /** * Object keyed by breakdown dimension (age, city, country, gender) */ demographics?: { [key: string]: Array<{ /** * The dimension value (e.g., "25-34", "US", "M") */ dimension?: string; /** * Count of accounts in this dimension */ value?: number; }>; }; note?: string; }; type metric = 'follower_demographics' | 'engaged_audience_demographics'; /** * The timeframe used for demographic data */ type timeframe = 'this_week' | 'this_month'; /** * Feed aspect ratio 0.8-1.91, carousels up to 10 items, stories require media (no captions). User tag coordinates 0.0-1.0 from top-left. Images over 8 MB and videos over platform limits are auto-compressed. */ type InstagramPlatformData = { /** * Set to 'story' to publish as a Story. Default posts become Reels or feed depending on media. */ contentType?: 'story'; /** * 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. */ shareToFeed?: boolean; /** * Up to 3 Instagram usernames to invite as collaborators (feed/Reels only) */ collaborators?: Array<(string)>; /** * Optional first comment to add after the post is created (not applied to Stories) */ firstComment?: string; /** * Trial Reels configuration. Trial reels are shared to non-followers first and can later be graduated to regular reels manually or automatically based on performance. Only applies to Reels. */ trialParams?: { /** * MANUAL (graduate from Instagram app) or SS_PERFORMANCE (auto-graduate if performs well with non-followers) */ graduationStrategy?: 'MANUAL' | 'SS_PERFORMANCE'; }; /** * Tag Instagram users by username. The tag shape depends on the media: photos require x/y coordinates, Reels and videos take username only (coordinates are ignored), stories accept optional coordinates. For carousels, use mediaIndex to target specific slides (defaults to 0); video slides take username-only tags. Photo tags without valid coordinates are skipped. */ userTags?: Array<{ /** * Instagram username (@ symbol is optional and will be removed automatically) */ username: string; /** * X coordinate position from left edge (0.0 = left, 0.5 = center, 1.0 = right). Required for photos, ignored for Reels/videos, optional for stories. */ x?: number; /** * Y coordinate position from top edge (0.0 = top, 0.5 = center, 1.0 = bottom). Required for photos, ignored for Reels/videos, optional for stories. */ y?: number; /** * Zero-based index of the carousel item to tag. Defaults to 0. Tags on out-of-range indices are ignored. */ mediaIndex?: number; }>; /** * Custom name for original audio in Reels. Replaces the default "Original Audio" label. Can only be set once. Unrelated to audioConfiguration, which attaches a catalog track. */ audioName?: string; /** * Attach a licensed music track or original sound from the Instagram audio catalog to a Reel. Reels only (single video post, not a story or image). Requires an Instagram account connected via Facebook Login; classic Instagram Login accounts get a 400 (instagram_audio_requires_facebook_login). Get audio IDs from GET /v1/accounts/{accountId}/instagram/audio. If the track becomes unavailable by publish time (removed, region-blocked, licensing change), the post fails with a user-error; it is not published without the audio. */ audioConfiguration?: { /** * Audio asset ID from the audio search endpoint. */ audioId: string; /** * Volume of the attached audio track, 0-100. Defaults to 100. */ audioVolume?: number; /** * Volume of the video's own sound, 0-100. Defaults to 100. Set 0 to mute the original video audio. */ videoVolume?: number; }; /** * Millisecond offset from video start for the Reel cover frame. Ignored when instagramThumbnail or reelCover is provided. Defaults to 0. */ thumbOffset?: number; /** * Custom cover image URL for Instagram Reels (JPG or PNG, publicly accessible). Overrides thumbOffset when provided. Also accepted as reelCover (alias). */ instagramThumbnail?: string; /** * Alias for instagramThumbnail. If both are provided, instagramThumbnail takes priority. */ reelCover?: string; /** * When true, the post is labeled by Instagram as containing AI-generated media. Per Meta, this self-disclosure label is for AI-generated media, not AI-written captions. Applies to feed posts, Reels, Stories, and carousels. */ isAiGenerated?: boolean; }; /** * Set to 'story' to publish as a Story. Default posts become Reels or feed depending on media. */ type contentType2 = 'story'; /** * MANUAL (graduate from Instagram app) or SS_PERFORMANCE (auto-graduate if performs well with non-followers) */ type graduationStrategy = 'MANUAL' | 'SS_PERFORMANCE'; /** * LinkedIn-specific options for POST /v1/ads/boost and POST /v1/ads/create: campaign bidding and delivery controls, plus the LinkedIn-only creative formats on /v1/ads/create. Unknown keys are rejected. * */ type LinkedInAdsPlatformData = { /** * Campaign cost model (billing event). Defaults to `CPM`. Required when * `unitCost` is set so the manual bid applies to an explicit cost model. * */ costType?: 'CPM' | 'CPC' | 'CPV'; /** * Manual bid in WHOLE account-currency units (e.g. 2.5 = $2.50). Requires * `costType`. Omit for LinkedIn's automated (max delivery) bidding. * LinkedIn enforces its own per-audience min/max bid bounds. * */ unitCost?: number; /** * Campaign `optimizationTargetType` (e.g. `MAX_CLICK`, `TARGET_COST_PER_CLICK`, * `MAX_IMPRESSION`). Forwarded verbatim, LinkedIn validates compatibility with * the objective and `costType`. Omit for the objective-derived default: * `awareness` gets `MAX_IMPRESSION`, `video_views` gets `MAX_VIDEO_VIEW`, and * every other goal gets `MAX_CLICK`. `lead_generation` and `conversions` also * get `MAX_CLICK`, because `MAX_LEAD` and `MAX_CONVERSION` need a lead gen form * or a conversion rule that neither creation flow attaches. The default applies * only to `SPONSORED_UPDATES` campaigns (every boost, and the image, video and * carousel standalone ads), never to the `TEXT_AD`, `DYNAMIC` and * `SPONSORED_INMAILS` campaigns the other creative formats produce. It is also * skipped when `unitCost` or a non-`CPM` `costType` is set, since those select * manual bidding and the bid is then yours to choose. * */ optimizationTargetType?: string; /** * How LinkedIn rotates creatives within the campaign. Defaults to `OPTIMIZED`. */ creativeSelection?: 'OPTIMIZED' | 'ROUND_ROBIN'; /** * Enable LinkedIn audience expansion. Defaults to false. */ audienceExpansionEnabled?: boolean; /** * Deliver on the LinkedIn Audience Network. Defaults to false. */ offsiteDeliveryEnabled?: boolean; /** * Restrict delivery to Connected TV inventory. */ connectedTelevisionOnly?: boolean; /** * POST /v1/ads/create only. Carousel ad with 2-10 image cards. * Mutually exclusive with the other creative sources. * */ carousel?: { cards: Array<{ imageUrl: string; /** * Card title. Falls back to the ad-level headline. */ headline?: string; /** * Per-card click destination. LinkedIn requires one on every * card; the ad-level `linkUrl` backfills cards that omit it. * */ landingUrl?: string; }>; }; /** * POST /v1/ads/create only. Document ad rendered as an in-feed viewer. * PDF, PPT or DOC up to 100MB. Mutually exclusive with the other * creative sources. * */ document?: { url: string; /** * Document title. */ title: string; }; /** * POST /v1/ads/create only. Dynamic Spotlight Ad personalized with the * viewer's profile photo. Supported goals: traffic, awareness. logoUrl * and organizationName default to the Company Page's; set them * explicitly if LinkedIn rejects the create with a 404. Mutually * exclusive with the other creative sources. * */ spotlight?: { headline: string; /** * Mutually exclusive with backgroundImageUrl. */ description?: string; /** * Button label text. */ callToAction: string; landingUrl: string; logoUrl?: string; organizationName?: string; /** * Defaults to true. */ showMemberProfilePhoto?: boolean; /** * Custom background. Replaces the description and the profile photo. */ backgroundImageUrl?: string; }; /** * POST /v1/ads/create only. Dynamic Follower Ad promoting the Company * Page. Supported goals: engagement, awareness. headline and * description take exactly one of preApproved or custom. Mutually * exclusive with the other creative sources. * */ follower?: { headline: { /** * LinkedIn preset id, not reviewed. Example GROW_YOUR_BUSINESS_INSIGHTS. */ preApproved?: string; /** * Free text, reviewed by LinkedIn. */ custom?: string; }; description: { /** * LinkedIn preset id, not reviewed. Example GET_LATEST_JOBS_AND_INDUSTRY_NEWS. */ preApproved?: string; /** * Free text, reviewed by LinkedIn. */ custom?: string; }; callToAction: 'VISIT_ORGANIZATION_COMPANY_PAGE' | 'VISIT_ORGANIZATION_LIFE_PAGE' | 'VISIT_ORGANIZATION_JOBS_PAGE' | 'VISIT_ORGANIZATION_CAREERS_PAGE'; logoUrl?: string; organizationName?: string; /** * Defaults to true. */ showMemberProfilePhoto?: boolean; }; /** * POST /v1/ads/create only. Dynamic Jobs Ad promoting your open roles, * personalized with the viewer's profile photo. Requires goal * job_applicants and a Company Page with active job postings. * headline and buttonLabel take exactly one of * preApproved or custom. logoUrl and organizationName default to the * Company Page's. Mutually exclusive with the other creative sources. * */ jobs?: { headline: { /** * LinkedIn preset id, not reviewed. Example MEMBER_READY_FOR_YOUR_DREAM_JOB. */ preApproved?: string; /** * Free text, reviewed by LinkedIn. */ custom?: string; }; buttonLabel: { /** * LinkedIn preset id, not reviewed. One of SEE_MORE_JOBS, VIEW_MORE, CAREERS_AT_COMPANY. */ preApproved?: string; /** * Free text, reviewed by LinkedIn. */ custom?: string; }; logoUrl?: string; organizationName?: string; /** * Defaults to true. */ showMemberProfilePhoto?: boolean; }; /** * POST /v1/ads/create only. Classic right-rail Text Ad. The copy lives * here; ad-level body and headline are not used. Mutually exclusive * with the other creative sources. * */ textAd?: { headline: string; description: string; landingUrl: string; /** * Optional 100x100 image. */ imageUrl?: string; }; /** * POST /v1/ads/create only. Conversation Ad: a choose-your-path message * tree delivered to the member's LinkedIn inbox. Messages are flat * nodes wired by local ids; each button either opens a url or leads to * nextMessageId. Cycles, unknown ids and a missing firstMessageId * return a 400. LinkedIn does not deliver message ads to EU members. * Mutually exclusive with the other creative sources. * */ conversation?: { /** * InMail subject shown in the inbox. */ subject: string; /** * Person or organization URN. Defaults to the authoring Company * Page. The sender must be approved for the ad account first * (Campaign Manager > Manage message ad senders) or LinkedIn * rejects the create with SINMAIL_SENDER_NOT_APPROVED. * */ sender?: string; /** * Optional intro body (HTML allowed). */ body?: string; /** * Terms shown at the bottom of the message. */ footer?: string; /** * Conversation headline. Defaults to the first message's first line. */ headline?: string; firstMessageId: string; messages: Array<{ id: string; text: string; buttons?: Array<{ text: string; /** * Continues the conversation at this message. Exactly one of nextMessageId or url. */ nextMessageId?: string; /** * Opens this landing page. Exactly one of nextMessageId or url. */ url?: string; }>; }>; }; /** * POST /v1/ads/create only. Promotes an existing LinkedIn Event; no * headline needed. Mutually exclusive with the other creative sources. * */ event?: { /** * LinkedIn Event URN, urn:li:event:N. */ urn: string; }; /** * POST /v1/ads/create only. Sponsors an existing LinkedIn post * (a share or ugcPost authored by your organization's Company * Page) as the creative, keeping its commentary, author and * engagement. Unlike boostPost, which provisions its own * CampaignGroup + Campaign around the post, this variant * attaches the reference under the campaign /v1/ads/create * builds — same shape as every other format, so the caller can * pick bidding / targeting / schedule freely. No headline, body, * imageUrl or organization are needed; the referenced post * carries its own commentary and author. Mutually exclusive * with the other creative sources. Posts from personal profiles * (Thought Leader Ads) are NOT supported (see postUrn). * */ thoughtLeader?: { /** * LinkedIn share or ugcPost URN, urn:li:share:N or urn:li:ugcPost:N. Get it via "Copy link to post" on the target LinkedIn post (the URL contains -share- for a share or -ugcPost- for a ugcPost, then the numeric id). The post must be authored by an organization (Company Page). Member (personal profile) posts, i.e. Thought Leader Ads proper, are rejected by LinkedIn's public Marketing API regardless of sponsorship approval and of post type (a LinkedIn limitation; their Campaign Manager creates those through a private API). Referencing a member post returns a 422 with a clear error. * */ postUrn: string; }; }; /** * Campaign cost model (billing event). Defaults to `CPM`. Required when * `unitCost` is set so the manual bid applies to an explicit cost model. * */ type costType = 'CPM' | 'CPC' | 'CPV'; /** * How LinkedIn rotates creatives within the campaign. Defaults to `OPTIMIZED`. */ type creativeSelection = 'OPTIMIZED' | 'ROUND_ROBIN'; type callToAction = 'VISIT_ORGANIZATION_COMPANY_PAGE' | 'VISIT_ORGANIZATION_LIFE_PAGE' | 'VISIT_ORGANIZATION_JOBS_PAGE' | 'VISIT_ORGANIZATION_CAREERS_PAGE'; /** * Response for DAILY aggregation (time series breakdown) */ type LinkedInAggregateAnalyticsDailyResponse = { accountId?: string; platform?: string; accountType?: string; username?: string; aggregation?: 'DAILY'; dateRange?: { startDate?: string; endDate?: string; } | null; /** * Daily breakdown of each metric as date/count pairs. Reach not available with DAILY aggregation. */ analytics?: { impressions?: Array<{ date?: string; count?: number; }>; reactions?: Array<{ date?: string; count?: number; }>; comments?: Array<{ date?: string; count?: number; }>; shares?: Array<{ date?: string; count?: number; }>; /** * Daily saves (personal accounts only) */ saves?: Array<{ date?: string; count?: number; }>; /** * Daily sends via LinkedIn messaging (personal accounts only) */ sends?: Array<{ date?: string; count?: number; }>; }; /** * Metrics that were skipped due to API limitations */ skippedMetrics?: Array<(string)>; note?: string; lastUpdated?: string; }; type aggregation = 'DAILY'; /** * Response for TOTAL aggregation (lifetime totals) */ type LinkedInAggregateAnalyticsTotalResponse = { accountId?: string; platform?: string; accountType?: string; username?: string; aggregation?: 'TOTAL'; dateRange?: { startDate?: string; endDate?: string; } | null; analytics?: { /** * Total impressions across all posts */ impressions?: number; /** * Unique members reached across all posts */ reach?: number; /** * Total reactions across all posts */ reactions?: number; /** * Total comments across all posts */ comments?: number; /** * Total reshares across all posts */ shares?: number; /** * Total times posts were saved (personal accounts only) */ saves?: number; /** * Total times posts were sent via LinkedIn messaging (personal accounts only) */ sends?: number; /** * Overall engagement rate, as a percentage rounded to 2 decimals: (reactions + comments + shares + saves + sends) / impressions * 100. Clicks are not counted, and there is no fallback denominator, so this is 0 whenever impressions is 0. This is NOT the same formula as PostAnalytics.engagementRate on GET /v1/analytics. */ engagementRate?: number; }; note?: string; lastUpdated?: string; }; type aggregation2 = 'TOTAL'; /** * Up to 20 images, no multi-video. Single PDF supported (max 100MB). Link previews auto-generated when no media attached. Use organizationUrn for multi-org posting. Geo-restriction only works for organization pages (not personal profiles) and requires the targeted audience to exceed 300 followers. Polls are supported via the poll object: 2-4 options, cannot be combined with media or reshareUrl, cannot be edited after publishing, and API-created polls are non-sponsored only. * */ type LinkedInPlatformData = { /** * Title displayed on LinkedIn document (PDF/carousel) posts. Required by LinkedIn for document posts. If omitted, falls back to the media item title, then the filename. */ documentTitle?: string; /** * Target LinkedIn Organization URN (e.g. "urn:li:organization:123456789"). If omitted, uses the default org. Use GET /v1/accounts/{id}/linkedin-organizations to list orgs. */ organizationUrn?: string; /** * Optional first comment to add after the post is created */ firstComment?: string; /** * Set to true to disable automatic link previews for URLs in the post content (default is false) */ disableLinkPreview?: boolean; /** * LinkedIn post link to repost (use the post's "Copy link to post" action), or a urn:li:share / urn:li:ugcPost / urn:li:groupPost URN. With content, the published post is a quote-reshare: your text is the commentary and the original is embedded underneath (LinkedIn's "repost with your thoughts"). Leave content empty (and omit customContent) to publish a plain repost with no text, LinkedIn's one-click "Repost". Mutually exclusive with media. Works on personal profiles and organization pages. */ reshareUrl?: string; geoRestriction?: GeoRestriction; /** * Create a LinkedIn poll with this post. Cannot be combined with media or reshareUrl. Polls cannot be edited after publishing on LinkedIn, and API-created polls are non-sponsored only (they cannot be promoted as ads). */ poll?: { /** * Poll question (max 140 characters) */ question: string; /** * Poll options (2-4 choices, max 30 characters each) */ options: Array<(string)>; /** * How long the poll accepts votes. Defaults to SEVEN_DAYS. */ duration?: 'ONE_DAY' | 'THREE_DAYS' | 'SEVEN_DAYS' | 'FOURTEEN_DAYS'; }; }; /** * How long the poll accepts votes. Defaults to SEVEN_DAYS. */ type duration = 'ONE_DAY' | 'THREE_DAYS' | 'SEVEN_DAYS' | 'FOURTEEN_DAYS'; /** * Media referenced in posts. URLs must be publicly reachable over HTTPS. Use POST /v1/media/presign for uploads up to 5GB. Zernio auto-compresses images and videos that exceed platform limits (videos over 200 MB may not be compressed). */ type MediaItem = { type?: 'image' | 'video' | 'gif' | 'document'; url?: string; /** * Optional title for the media item. Used as the document title for LinkedIn PDF/carousel posts. If omitted, falls back to the post title, then the filename. */ title?: string; /** * Accessibility alternative text for an image, applied on every platform that supports it: Instagram (feed images only, not Reels/Stories), Facebook, Threads, X/Twitter (max 1000 chars), LinkedIn, Bluesky, and Pinterest (max 500 chars). Ignored on platforms without alt-text support (TikTok, YouTube, Snapchat, Telegram, Reddit, Google Business, WhatsApp) and on video items where the platform does not accept it. Set once per image; the same value is sent to each selected platform. */ altText?: string; filename?: string; /** * Optional file size in bytes */ size?: number; /** * Optional MIME type (e.g. image/jpeg, video/mp4) */ mimeType?: string; /** * Optional custom thumbnail/cover image URL for videos. Supported for Facebook video posts, Facebook Reels, regular video uploads, and LinkedIn video posts. Max 10MB, JPG/PNG recommended. */ thumbnail?: string; /** * Custom cover image URL for Instagram Reels. Can also be set via platformSpecificData.instagramThumbnail or platformSpecificData.reelCover. Resolution order: this field > platformSpecificData.instagramThumbnail > platformSpecificData.reelCover > platformSpecificData.thumbnailUrl (legacy). */ instagramThumbnail?: string; /** * Internal flag indicating the image was resized for TikTok */ tiktokProcessed?: boolean; }; type type7 = 'image' | 'video' | 'gif' | 'document'; type MediaUploadResponse = { files?: Array; }; /** * Meta (facebook/instagram) options for platformSpecificData on POST /v1/ads/boost and /v1/ads/create. Unknown keys are rejected, not dropped. */ type MetaAdsPlatformData = { bidStrategy?: BidStrategy; /** * Whole currency units (USD: 5 = $5.00). Required when bidStrategy is LOWEST_COST_WITH_BID_CAP or COST_CAP. May also be sent alone, WITHOUT bidStrategy, to set the cap on an ad set joining a COST_CAP / LOWEST_COST_WITH_BID_CAP campaign (the strategy is inherited from the campaign). On POST /v1/ads/create that shape requires existingCampaignId and is a 400 otherwise; on POST /v1/ads/boost it is promoted to LOWEST_COST_WITH_BID_CAP. */ bidAmount?: number; /** * Decimal ROAS multiplier (2.0 = 2.0x). Required when bidStrategy is LOWEST_COST_WITH_MIN_ROAS; sending it without bidStrategy is a 400. */ roasAverageFloor?: number; }; type Money = { /** * ISO 4217 currency code (e.g. USD, EUR) */ currencyCode: string; /** * Whole units of the amount */ units: string; /** * Nano units (10^-9) of the amount */ nanos?: number; }; type MoneyAmount = { /** * Amount as a decimal string, e.g. "88.59". */ amount: string; /** * ISO 4217 currency code, e.g. "USD". */ currencyCode: string; }; type Pagination = { page?: number; limit?: number; total?: number; pages?: number; }; /** * Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409. */ type ParameterIdempotencyKeyHeader = string; /** * Page number (1-based) */ type ParameterPageParam = number; type PinterestPlatformData = { /** * Pin title. Defaults to first line of content or "Pin". Must be ≤ 100 characters. */ title?: string; /** * Target Pinterest board ID. If omitted, the first available board is used. */ boardId?: string; /** * Destination link (pin URL) */ link?: string; /** * Optional cover image for video pins */ coverImageUrl?: string; /** * Optional key frame time in seconds for derived video cover */ coverImageKeyFrameTime?: number; }; type PlatformAnalytics = { platform?: string; status?: 'published' | 'failed'; /** * The native post ID on the platform (e.g. Instagram media ID, tweet ID) */ platformPostId?: (string) | null; accountId?: string; accountUsername?: (string) | null; analytics?: (PostAnalytics | null); /** * Sync state of analytics for this platform */ syncStatus?: 'synced' | 'pending' | 'unavailable'; platformPostUrl?: (string) | null; /** * Error details when status is failed */ errorMessage?: (string) | null; }; type status6 = 'published' | 'failed'; /** * Sync state of analytics for this platform */ type syncStatus2 = 'synced' | 'pending' | 'unavailable'; type PlatformTarget = { /** * Supported values: twitter, threads, instagram, youtube, facebook, linkedin, pinterest, reddit, tiktok, bluesky, googlebusiness, telegram */ platform?: string; accountId?: (string | SocialAccount); /** * Platform-specific text override. When set, this content is used instead of the top-level post content for this platform. Useful for tailoring captions per platform (e.g. keeping tweets under 280 characters). */ customContent?: string; customMedia?: Array; /** * Optional per-platform scheduled time override (uses post.scheduledFor when omitted) */ scheduledFor?: string; /** * Platform-specific overrides and options. */ platformSpecificData?: (TwitterPlatformData | ThreadsPlatformData | FacebookPlatformData | InstagramPlatformData | LinkedInPlatformData | PinterestPlatformData | YouTubePlatformData | GoogleBusinessPlatformData | TikTokPlatformData | TelegramPlatformData | SnapchatPlatformData | RedditPlatformData | BlueskyPlatformData | DiscordPlatformData | SlackPlatformData); /** * Platform-specific status: pending, publishing, published, failed */ status?: string; /** * The native post ID on the platform (populated after successful publish) */ platformPostId?: string; /** * Public URL of the published post. Included in the response for immediate posts; for scheduled posts, fetch via GET /v1/posts/{postId} after publish time. Empty when the platform confirmed the publish without returning an id a permalink can be built from (TikTok returns a publish id for some uploads); the TikTok reconcile cron backfills it later. */ platformPostUrl?: (string) | null; /** * Timestamp when the post was published to this platform */ publishedAt?: string; /** * Set when a post that was successfully published later disappears from the platform (deleted on-platform or taken down by the platform). status stays "published" (it reflects the publish outcome); poll this field to detect post-publish removals. Absent while the post is live, and cleared if the post reappears. Detection runs with the analytics sync, so expect up to a few hours of lag. */ removedFromPlatformAt?: (string) | null; /** * Present and true only when this Instagram reel was launched as a Trial through Zernio (created with platformSpecificData.trialParams). Use it to segment trial reels in analytics. Note: Instagram's Graph API exposes no readable trial field, so this reflects creation-time intent only. It indicates the reel STARTED as a trial, not whether or when it graduated. */ isTrialReel?: boolean; /** * Graduation strategy the trial reel was launched with. Present only when isTrialReel is true. */ trialGraduationStrategy?: 'MANUAL' | 'SS_PERFORMANCE'; /** * Human-readable error message when status is failed. Contains platform-specific error details explaining why the publish failed. */ errorMessage?: string; /** * Error category for programmatic handling: auth_expired (token expired/revoked), user_content (wrong format/too long), user_abuse (rate limits/spam), account_issue (config problems), platform_rejected (policy violation), platform_error (5xx/maintenance), platform_rate_limit (platform throttling, retried automatically), quota_exhausted (shared daily API quota empty, resumes at the platform's reset), system_error (Zernio infra), unknown */ errorCategory?: 'auth_expired' | 'user_content' | 'user_abuse' | 'account_issue' | 'platform_rejected' | 'platform_error' | 'platform_rate_limit' | 'quota_exhausted' | 'system_error' | 'unknown'; /** * Who caused the error: user (fix content/reconnect), platform (outage/API change), system (Zernio issue, rare) */ errorSource?: 'user' | 'platform' | 'system'; }; /** * Graduation strategy the trial reel was launched with. Present only when isTrialReel is true. */ type trialGraduationStrategy = 'MANUAL' | 'SS_PERFORMANCE'; /** * Error category for programmatic handling: auth_expired (token expired/revoked), user_content (wrong format/too long), user_abuse (rate limits/spam), account_issue (config problems), platform_rejected (policy violation), platform_error (5xx/maintenance), platform_rate_limit (platform throttling, retried automatically), quota_exhausted (shared daily API quota empty, resumes at the platform's reset), system_error (Zernio infra), unknown */ type errorCategory = 'auth_expired' | 'user_content' | 'user_abuse' | 'account_issue' | 'platform_rejected' | 'platform_error' | 'platform_rate_limit' | 'quota_exhausted' | 'system_error' | 'unknown'; /** * Who caused the error: user (fix content/reconnect), platform (outage/API change), system (Zernio issue, rare) */ type errorSource = 'user' | 'platform' | 'system'; type Post = { _id?: string; userId?: (string | User); /** * YouTube: title must be ≤ 100 characters. * */ title?: string; content?: string; mediaItems?: Array; platforms?: Array; scheduledFor?: string; timezone?: string; status?: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial'; /** * YouTube constraints: each tag max 100 chars, combined max 500 chars, duplicates removed. */ tags?: Array<(string)>; hashtags?: Array<(string)>; /** * Stored for reference only. This field does NOT automatically create @mentions when publishing. For LinkedIn @mentions, use the /v1/accounts/{accountId}/linkedin-mentions endpoint to resolve profile URLs to URNs, then embed the returned mentionFormat directly in the post content field. */ mentions?: Array<(string)>; visibility?: 'public' | 'private' | 'unlisted'; metadata?: { [key: string]: unknown; }; recycling?: RecyclingState; /** * ID of the original post if this post was created via recycling */ recycledFromPostId?: string; /** * Profile ID if the post was scheduled via the queue */ queuedFromProfile?: string; /** * Queue ID if the post was scheduled via a specific queue */ queueId?: string; createdAt?: string; updatedAt?: string; }; type status7 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial'; type visibility = 'public' | 'private' | 'unlisted'; type PostAnalytics = { impressions?: number; reach?: number; likes?: number; comments?: number; shares?: number; /** * Number of saves/bookmarks (Instagram, Pinterest, X/Twitter) */ saves?: number; clicks?: number; views?: number; /** * Instagram feed posts and stories only: organic accounts that started following from this post. 0 for reels and other platforms. */ follows?: number; /** * Instagram Reels only: average watch time per play, in milliseconds. 0 for non-Reels media and other platforms. */ igReelsAvgWatchTime?: number; /** * Instagram Reels only: total watch time including replays, in milliseconds. 0 for non-Reels media and other platforms. */ igReelsVideoViewTotalTime?: number; /** * Video length in seconds. Currently Instagram Reels only; combine with igReelsAvgWatchTime (ms) to estimate retention. Null when unknown (other platforms, non-video media, or when Instagram does not expose the media URL, e.g. reels with copyrighted audio). */ videoDurationSeconds?: (number) | null; /** * Percentage, rounded to 2 decimals: (likes + comments + shares + saves) / (impressions or reach or views) * 100. Clicks and follows are never counted. The denominator is the FIRST of impressions, reach, views that is non-zero, so it is not the same basis on every post: a post with impressions divides by impressions, one without falls back to reach, then to views. If you need a single consistent basis (e.g. interactions / reach), compute it from the raw fields above. The engagementRate on the LinkedIn account endpoints is a different formula. */ engagementRate?: number; lastUpdated?: string; }; type PostCreateResponse = { message?: string; post?: Post; }; type PostDeleteResponse = { message?: string; }; type PostGetResponse = { post?: Post; }; type PostRetryResponse = { message?: string; post?: Post; }; type PostsListResponse = { posts?: Array; pagination?: Pagination; }; type PostUpdateResponse = { message?: string; post?: Post; warnings?: Array<(string)>; }; type Profile = { _id?: string; userId?: string; name?: string; description?: string; color?: string; isDefault?: boolean; /** * Only present when includeOverLimit=true. Indicates if this profile exceeds the plan limit. */ isOverLimit?: boolean; createdAt?: string; }; type ProfileCreateResponse = { message?: string; profile?: Profile; }; type ProfileDeleteResponse = { message?: string; }; type ProfileGetResponse = { profile?: Profile; }; type ProfilesListResponse = { profiles?: Array; /** * Total matching profiles across all pages. Present only when limit or skip was passed. */ total?: number; /** * Offset applied. Present only when limit or skip was passed. */ skip?: number; /** * Echo of the limit query param. Present only when it was passed. */ limit?: number; }; type ProfileUpdateResponse = { message?: string; profile?: Profile; }; type QueueDeleteResponse = { success?: boolean; deleted?: boolean; deletedCount?: number; message?: string; }; type QueueNextSlotResponse = { profileId?: string; nextSlot?: string; timezone?: string; /** * Queue ID this slot belongs to */ queueId?: string; /** * Queue name */ queueName?: string; }; type QueuePreviewResponse = { profileId?: string; queueId?: string; queueName?: string; count?: number; slots?: Array<(string)>; }; type QueueSchedule = { /** * Unique queue identifier */ _id?: string; /** * Profile ID this queue belongs to */ profileId?: string; /** * Queue name (e.g., "Morning Posts", "Evening Content") */ name?: string; /** * IANA timezone (e.g., America/New_York) */ timezone?: string; slots?: Array; /** * Whether the queue is active */ active?: boolean; /** * Whether this is the default queue for the profile (used when no queueId specified) */ isDefault?: boolean; createdAt?: string; updatedAt?: string; }; type QueueSlot = { /** * Day of week (0=Sunday, 6=Saturday) */ dayOfWeek?: number; /** * Time in HH:mm format (24-hour) */ time?: string; }; /** * Single queue response (default behavior) */ type QueueSlotsResponse = { exists?: boolean; schedule?: QueueSchedule; nextSlots?: Array<(string)>; }; type QueueUpdateResponse = { success?: boolean; schedule?: QueueSchedule; nextSlots?: Array<(string)>; reshuffledCount?: number; skippedDailyLimit?: number; isNewQueue?: boolean; }; /** * Configure automatic post recycling (reposting at regular intervals). * After the post is published, the system creates new scheduled copies at the * specified interval until expiration conditions are met. Supports weekly or * monthly intervals. Maximum 10 active recycling posts per account. * YouTube and TikTok platforms are excluded from recycling. * Content variations are recommended for Twitter and Pinterest to avoid duplicate flags. * */ type RecyclingConfig = { /** * Set to false to disable recycling on this post */ enabled?: boolean; /** * Number of interval units between each repost. Required when enabling recycling. */ gap?: number; /** * Interval unit for the gap. Defaults to 'month'. */ gapFreq?: 'week' | 'month'; /** * When to start the recycling cycle. Defaults to the post's scheduledFor date. */ startDate?: string; /** * Stop recycling after this many copies have been created. Send null on update to clear this limit. */ expireCount?: (number) | null; /** * Stop recycling after this date, regardless of count. Send null on update to clear this limit. */ expireDate?: (string) | null; /** * Array of content variations for recycled copies. On each recycle, the next * variation is used in round-robin order. Recommended for Twitter and Pinterest * to avoid duplicate content flags. If omitted, the original post content is * used for all recycled copies. Send an empty array [] to clear existing * variations. Must have 2+ entries when setting variations. Platform-level * customContent still overrides the base content per platform. * */ contentVariations?: Array<(string)>; }; /** * Interval unit for the gap. Defaults to 'month'. */ type gapFreq = 'week' | 'month'; /** * Current recycling configuration and state on a post */ type RecyclingState = { /** * Whether recycling is currently active */ enabled?: boolean; /** * Number of interval units between reposts */ gap?: number; /** * Interval unit (week or month) */ gapFreq?: 'week' | 'month'; startDate?: string; expireCount?: number; expireDate?: string; /** * Content variations for recycled copies (if configured) */ contentVariations?: Array<(string)>; /** * Current position in the content variations rotation (read-only) */ contentVariationIndex?: number; /** * How many recycled copies have been created so far (read-only) */ recycleCount?: number; /** * When the next recycled copy will be created (read-only) */ nextRecycleAt?: string; /** * When the last recycled copy was created (read-only) */ lastRecycledAt?: string; }; /** * Posts are either link (with URL/media), native video (via nativeVideo), or self (text-only). Use forceSelf to override. Subreddit defaults to the account's configured one. Some subreddits require a flair. */ type RedditPlatformData = { /** * Target subreddit name (without "r/" prefix). Overrides the default. Use GET /v1/accounts/{id}/reddit-subreddits to list options. */ subreddit?: string; /** * Post title. Defaults to the first line of content, truncated to 300 characters. */ title?: string; /** * URL for link posts. If provided (and forceSelf is not true), creates a link post instead of a text post. */ url?: string; /** * When true, creates a text/self post even when a URL or media is provided. */ forceSelf?: boolean; /** * Flair ID for the post. Required by some subreddits. Use GET /v1/accounts/{id}/reddit-flairs?subreddit=name to list flairs. */ flairId?: string; /** * Custom flair text, for subreddits that allow free-text flair. Ignored when flairId is provided (flairId wins). */ flairText?: string; /** * Mark the post as NSFW (Not Safe For Work / over 18). */ nsfw?: boolean; /** * Mark the post as a spoiler. The subreddit must have spoiler tagging enabled for this to take effect. */ spoiler?: boolean; /** * Whether to receive inbox replies for comments on this post. Set to false to opt out. */ sendreplies?: boolean; /** * Controls Reddit's native video upload flow. When true (default for video mediaItems), the video is uploaded to Reddit's CDN and submitted with kind=video so it renders as an embedded Reddit video player. Reddit transcodes server-side (1080p/30fps cap). Set to false to fall back to a legacy link post. If the subreddit blocks video posts, the upload falls back to a link post automatically. * */ nativeVideo?: boolean; /** * When true (and nativeVideo is active), submits the video as a silent videogif (kind=videogif). Use for short looping clips without audio. */ videogif?: boolean; /** * Optional poster/thumbnail image URL for native video posts. If omitted, the first frame of the video is extracted and used automatically. */ videoPosterUrl?: string; }; /** * A normalized Reddit post returned by the feed and search endpoints */ type RedditPost = { /** * Reddit post ID (without type prefix) */ id?: string; /** * Reddit fullname (e.g. t3_abc123) */ fullname?: string; title?: string; author?: string; subreddit?: string; /** * Post URL (may be a gallery URL, external link, or self-post URL) */ url?: string; /** * Full permalink to the Reddit post */ permalink?: string; /** * Self-post body text (empty string for link posts) */ selftext?: string; /** * Unix timestamp of post creation */ createdUtc?: number; score?: number; numComments?: number; /** * Whether the post is marked NSFW */ over18?: boolean; stickied?: boolean; /** * Link flair text if set */ flairText?: (string) | null; /** * Whether the post is a gallery with multiple images */ isGallery?: boolean; /** * Individual image URLs for gallery posts (only present when isGallery is true) */ galleryImages?: Array<(string)>; }; /** * Review data shared by review.new and review.updated payloads. */ type ReviewWebhookReview = { /** * Platform review ID (e.g. "accounts/123/locations/456/reviews/789" for Google Business). */ id: string; /** * Platform the review originated on. Currently Google Business Profile only. */ platform: 'googlebusiness'; /** * Star rating the reviewer gave. */ rating: number; /** * Review text content. May be empty if the reviewer left only a rating. */ text: string; reviewer: { /** * Platform reviewer ID. Null when the platform does not expose it (common on Google Business anonymous reviews). */ id: (string) | null; name: string; profileImage: (string) | null; }; createdAt: string; /** * Whether the connected account has replied to this review. */ hasReply: boolean; /** * Present when hasReply is true. */ reply?: { text: string; createdAt: string; }; }; /** * Platform the review originated on. Currently Google Business Profile only. */ type platform5 = 'googlebusiness'; /** * A Meta Reach & Frequency prediction. Money values in whole units of the ad account currency. */ type RfPrediction = { predictionId?: string; /** * ready | pending | failed: */ status?: string; /** * Quoted (or provided) lifetime budget for the window. */ budget?: (number) | null; /** * Predicted (or requested) unique reach. */ reach?: (number) | null; impressions?: (number) | null; /** * Meta's allowed lower bound for this spec. */ minBudget?: (number) | null; maxBudget?: (number) | null; minReach?: (number) | null; maxReach?: (number) | null; frequencyCap?: (number) | null; /** * Unix seconds; the reserved window the R&F ad set will run on. */ startTime?: (number) | null; stopTime?: (number) | null; /** * When the reservation's locked price expires (set after reserving). */ expiresAt?: (string) | null; }; /** * An ad account a tracking tag is shared with (Meta `shared_accounts` edge). */ type SharedAdAccount = { /** * Ad account id, in `act_` form. */ id: string; name?: string; /** * Business Manager id that owns the ad account, when reported. */ businessId?: string; }; /** * Slack message settings. Posts mrkdwn text (up to 40,000 chars; Slack truncates beyond that) to the channel fixed by the connected account, with up to 10 media files per post uploaded via Slack's file API (the text becomes the caption). The target channel is chosen at connect time — one connected account per channel — so channelId is NOT accepted here (a 400 is returned); connect the desired channel via /v1/connect/slack and target its accountId. Messages over 4,000 characters cannot be edited later (Slack's edit limit is stricter than its post limit). * */ type SlackPlatformData = { /** * Parent message ts to post this message as a thread reply (e.g. "1503435956.000247"). */ threadTs?: string; /** * Expand links in the message into preview cards. Default true. */ unfurlLinks?: boolean; /** * Expand media links into inline previews. Default true. */ unfurlMedia?: boolean; /** * Override the bot display name for this message only (requires no setup; shown with an APP badge). Does not change the app identity in the sidebar. */ username?: string; /** * Override the bot avatar image URL for this message only. */ iconUrl?: string; }; /** * Requires a Public Profile. Single media item only. Content types: story (ephemeral 24h), saved_story (permanent, title max 45 chars), spotlight (video, max 160 chars). */ type SnapchatPlatformData = { /** * Content type: story (ephemeral 24h, default), saved_story (permanent on Public Profile), spotlight (video feed) */ contentType?: 'story' | 'saved_story' | 'spotlight'; }; /** * Content type: story (ephemeral 24h, default), saved_story (permanent on Public Profile), spotlight (video feed) */ type contentType3 = 'story' | 'saved_story' | 'spotlight'; type SocialAccount = { _id: string; platform: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'slack' | 'whatsapp' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads' | 'openaiads' | 'sms' | 'phone' | 'rcs'; profileId: (string | Profile); username?: string; displayName?: string; /** * URL to the account's profile picture on the platform. May be null if the platform does not provide one. */ profilePicture?: (string) | null; /** * Full profile URL for the connected account on its platform. */ profileUrl?: string; isActive: boolean; /** * The platform definitively reported the stored OAuth token as dead. * While true, GET /v1/connect/{platform}/ads returns a * fresh authUrl (implicit force=true) instead of alreadyConnected, * so re-running the connect flow recovers the account. Cleared * automatically when the account is re-authorized. * */ needsReconnection?: boolean; /** * Follower count (only included if user has analytics add-on) */ followersCount?: number; /** * Last time follower count was updated (only included if user has analytics add-on) */ followersLastUpdated?: string; /** * Reference to the parent posting SocialAccount. Set for ads accounts that share * or derive from a posting account's OAuth token. null for standalone ads (Google Ads) * and all posting accounts. * */ parentAccountId?: (string) | null; /** * Whether the user explicitly activated this account. false means the account was * created as a side effect (e.g., posting account auto-created when user connected * ads first). Posting UI and scheduler ignore accounts with enabled: false. * */ enabled?: boolean; /** * Platform-specific metadata. Fields vary by platform. For WhatsApp accounts, includes: * - qualityRating: Phone number quality rating from Meta (GREEN, YELLOW, RED, or UNKNOWN) * - nameStatus: Display name review status (APPROVED, PENDING_REVIEW, DECLINED, or NONE). A declined or pending display name does not by itself block sending; sendability is reported separately via health_status (can_send_message). * - messagingLimitTier: Maximum unique business-initiated conversations per 24h rolling window (TIER_250, TIER_1K, TIER_10K, TIER_100K, or TIER_UNLIMITED). Scales automatically as quality rating improves. * - verifiedName: Meta-verified business display name * - displayPhoneNumber: Formatted phone number (e.g., "+1 555-123-4567") * - wabaId: WhatsApp Business Account ID * - phoneNumberId: Meta phone number ID * * For LinkedIn accounts, profileData carries the profile details refreshed on each daily snapshot: * - profileData.bio: The member's headline for personal accounts, or the organization description for organization accounts. null when the member has not set one. * - profileData.extraData.vanityName: The member's profile slug, i.e. the /in/{vanityName} segment of profileUrl. Personal accounts only; an organization's own slug is in metadata.organizationInfo.vanityName. * */ metadata?: { [key: string]: unknown; }; }; type platform6 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'slack' | 'whatsapp' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads' | 'openaiads' | 'sms' | 'phone' | 'rcs'; /** * Normalized, platform-agnostic ad-targeting spec. Every field is optional, an * empty object targets the platform's default broadest audience. Field names are * camelCase and identical across `POST /v1/ads/create` (the `targeting` object), * `POST /v1/ads/targeting/reach-estimate`, and `saved_targeting` audiences, so a * spec resolved once can be reused verbatim. * * Entity ids (`regions[].key`, `cities[].key`, `zips[].key`, `metros[].key`, * `interests[].id`, `behaviors[].id`) are the platform's opaque identifiers * resolved via `GET /v1/ads/targeting/search`. A spec is therefore meaningful only * for the platform it was built against, except the portable fields (`countries`, * `ageMin`/`ageMax`, `gender`, `incomeTier`, `languages`) which carry across * platforms. Fields a platform cannot honour are rejected at create time with * `INVALID_FIELD_VALUE` naming the offending field (not silently dropped). * */ type TargetingSpec = { /** * ISO 3166-1 alpha-2 country codes (e.g. ['US']). */ countries?: Array<(string)>; /** * Region/state targeting. `key` is the platform location ID from /v1/ads/targeting/search?dimension=geo&geoType=region. */ regions?: Array<{ key: string; name?: string; }>; /** * City targeting. Optional `radius` + `distanceUnit` extend beyond the city limits; both must be set together or both omitted. `radius` is only honoured on platforms whose capability map allows city radius (Meta). */ cities?: Array<{ key: string; name?: string; /** * Radius around the city. Requires distanceUnit. Meta enforces a minimum city radius (~17 km / 10 mi); smaller values resolve to a 0-size audience and the ad fails at launch. For a tighter catchment use customLocations (lat/lng), which allows a smaller radius. */ radius?: number; /** * Required if radius is set. */ distanceUnit?: 'mile' | 'kilometer'; }>; /** * Postal/ZIP targeting. `key` is the platform's postal location ID (e.g. Meta `US:94304`). Supported on Meta, Google, TikTok, Pinterest, X. */ zips?: Array<{ key: string; name?: string; }>; /** * DMA / metro-area targeting. `key` is the platform's metro ID (e.g. Meta `DMA:807`). */ metros?: Array<{ key: string; name?: string; }>; /** * Point-radius (lat/lng) targeting (Meta custom_locations / Google proximity). Honoured only where the capability map allows radius (Meta). */ customLocations?: Array<{ latitude: number; longitude: number; /** * Positive radius around the point. */ radius: number; distanceUnit: 'mile' | 'kilometer'; name?: string; /** * Optional label, sent to Meta as `address_string`. latitude/longitude take precedence for the pin location. */ address?: string; }>; /** * Geo to exclude from the audience. Mirrors the inclusion geo shape: excluded cities can carry a radius catchment and excluded custom (lat/lng) pins are supported, both on Meta (excluded_geo_locations). */ excludedLocations?: { countries?: Array<(string)>; regions?: Array<{ key: string; name?: string; }>; /** * Cities to exclude. Optional `radius` + `distanceUnit` exclude a catchment around the city (both must be set together or both omitted); Meta honours the radius on excluded cities. */ cities?: Array<{ key: string; /** * Radius around the excluded city. Requires distanceUnit. */ radius?: number; /** * Required if radius is set. */ distanceUnit?: 'mile' | 'kilometer'; }>; zips?: Array<{ key: string; name?: string; }>; /** * Named points of interest to exclude. `key` from /v1/ads/targeting/search. */ places?: Array<{ key: string; }>; /** * Named neighbourhood areas to exclude. `key` from /v1/ads/targeting/search. */ neighborhoods?: Array<{ key: string; }>; /** * Point-radius (lat/lng) pins to exclude (Meta excluded_geo_locations.custom_locations). Mirrors the inclusion customLocations shape. */ customLocations?: Array<{ latitude: number; longitude: number; /** * Positive radius around the point. */ radius: number; distanceUnit: 'mile' | 'kilometer'; name?: string; /** * Optional label, sent to Meta as `address_string`. latitude/longitude take precedence for the pin location. */ address?: string; }>; }; ageMin?: number; ageMax?: number; /** * Restrict by gender. 'all' (default) targets everyone. Applied on Meta, TikTok and Pinterest. Ignored on Google, LinkedIn and X. */ gender?: 'all' | 'male' | 'female'; /** * Normalized household-income tier (ZIP/percentile based). Meta and TikTok * express all four. Google maps only `top_10` (its INCOME_RANGE_90_UP); other * tiers on Google, and any income tier on LinkedIn / X / Pinterest, are rejected. * On Meta, income/zip targeting requires the relevant `specialAdCategories` to be * unset (housing/employment/credit ads cannot use it). * */ incomeTier?: 'top_5' | 'top_10' | 'top_10_25' | 'top_25_50'; /** * Language codes restricting the audience by language. On Meta, ISO 639-1 codes (e.g. ['en']); a bare code targets all regional variants ("en" = all English), or use a region-qualified code ("en_GB", "pt_BR") for a specific one. Unknown codes are rejected. */ languages?: Array<(string)>; /** * Interest entities from /v1/ads/targeting/search?dimension=interest. Each carries the platform's opaque id. */ interests?: Array<{ id: string; name?: string; }>; /** * Behaviour entities from /v1/ads/targeting/search?dimension=behavior. Supported on Meta and TikTok. */ behaviors?: Array<{ id: string; name?: string; }>; /** * LinkedIn B2B only. Industry URN id fragments. */ industries?: Array<(string)>; /** * LinkedIn B2B only. */ companySizes?: Array<(string)>; /** * LinkedIn B2B only. */ seniorities?: Array<(string)>; /** * LinkedIn B2B only. */ jobFunctions?: Array<(string)>; /** * Platform audience IDs to include. */ audienceInclude?: Array<(string)>; /** * Platform audience IDs to exclude. */ audienceExclude?: Array<(string)>; }; /** * Restrict by gender. 'all' (default) targets everyone. Applied on Meta, TikTok and Pinterest. Ignored on Google, LinkedIn and X. */ type gender = 'all' | 'male' | 'female'; /** * Normalized household-income tier (ZIP/percentile based). Meta and TikTok * express all four. Google maps only `top_10` (its INCOME_RANGE_90_UP); other * tiers on Google, and any income tier on LinkedIn / X / Pinterest, are rejected. * On Meta, income/zip targeting requires the relevant `specialAdCategories` to be * unset (housing/employment/credit ads cannot use it). * */ type incomeTier = 'top_5' | 'top_10' | 'top_10_25' | 'top_25_50'; /** * Text, images (up to 10), videos (up to 10), and mixed media albums. Captions up to 1024 chars for media, 4096 for text-only. */ type TelegramPlatformData = { /** * Text formatting mode for the message (default is HTML) */ parseMode?: 'HTML' | 'Markdown' | 'MarkdownV2'; /** * Disable link preview generation for URLs in the message */ disableWebPagePreview?: boolean; /** * Send the message silently (users will receive notification without sound) */ disableNotification?: boolean; /** * Protect message content from forwarding and saving */ protectContent?: boolean; }; /** * Text formatting mode for the message (default is HTML) */ type parseMode = 'HTML' | 'Markdown' | 'MarkdownV2'; /** * Up to 10 images per carousel (no videos). Videos must be H.264/AAC MP4, max 5 min. Images JPEG/PNG, max 8 MB. Use threadItems for reply chains. */ type ThreadsPlatformData = { /** * Topic tag for post categorization and discoverability on Threads. Must be 1-50 characters, cannot contain periods (.) or ampersands (&). Overrides auto-extraction from content hashtags when provided. */ topic_tag?: string; /** * Complete sequence of posts in a Threads thread. The first item becomes the root post, subsequent items are chained as replies. When threadItems is provided, the top-level content field is used only for display and search purposes, it is NOT published. You must include your first post as threadItems[0]. * */ threadItems?: Array<{ content?: string; mediaItems?: Array; }>; }; /** * Photo carousels up to 35 images. Video titles up to 2200 chars, photo titles truncated to 90 chars. * privacyLevel must match creator_info options. Both camelCase and snake_case accepted. * * Creator Inbox (draft mode): Set draft: true to send content to the TikTok Creator Inbox * instead of publishing immediately. The creator receives an inbox notification and completes * the post using TikTok's editing flow. This maps to TikTok's post_mode: "MEDIA_UPLOAD" internally. * * Important: The field publish_type is NOT supported. Use draft: true for Creator Inbox flow. * * Photo drafts use the /v2/post/publish/content/init/ endpoint with post_mode: "MEDIA_UPLOAD". * Video drafts use the dedicated /v2/post/publish/inbox/video/init/ endpoint. * * When draft: true, the video.upload scope is required. When draft is false or omitted * (direct post), the video.publish scope is required. For Creator Inbox, TikTok app version * must be 31.8 or higher. * */ type TikTokPlatformData = { /** * When true, sends the post to the TikTok Creator Inbox as a draft instead of publishing * immediately. The creator receives an inbox notification to complete posting via TikTok's * editing flow. Maps to TikTok API post_mode: "MEDIA_UPLOAD" (photos) or the dedicated * inbox endpoint (videos). When false or omitted, publishes directly via post_mode: "DIRECT_POST". * Note: publish_type is not a supported field. Use this field instead. * */ draft?: boolean; /** * One of the values returned by the TikTok creator info API for the account */ privacyLevel?: string; /** * Allow comments on the post */ allowComment?: boolean; /** * Allow duets (required for video posts) */ allowDuet?: boolean; /** * Allow stitches (required for video posts) */ allowStitch?: boolean; /** * Type of commercial content disclosure. Sufficient on its own: "brand_organic" * ("Your Brand") implies isBrandOrganicPost and "brand_content" ("Branded Content", * paid partnership) implies brandPartnerPromote, so you don't need to send the * boolean flags separately. Branded content cannot be posted with privacyLevel * SELF_ONLY. * */ commercialContentType?: 'none' | 'brand_organic' | 'brand_content'; /** * Whether the post promotes a brand partner (branded content / paid partnership). * Only needed to disclose BOTH types at once (set it alongside * commercialContentType "brand_organic"), or to override the value implied by * commercialContentType. * */ brandPartnerPromote?: boolean; /** * Whether the post promotes the creator's own brand (brand organic). Only needed * to disclose BOTH types at once (set it alongside commercialContentType * "brand_content"), or to override the value implied by commercialContentType. * */ isBrandOrganicPost?: boolean; /** * User has confirmed they previewed the content */ contentPreviewConfirmed?: boolean; /** * User has given express consent for posting */ expressConsentGiven?: boolean; /** * Optional override. Defaults based on provided media items. */ mediaType?: 'video' | 'photo'; /** * Optional for video posts. Timestamp in milliseconds to select which frame to use as thumbnail (defaults to 1000ms/1 second). Ignored when videoCoverImageUrl is provided. */ videoCoverTimestampMs?: number; /** * Optional for video posts. URL of a custom thumbnail image (JPG, PNG, or WebP, max 20MB). The image is stitched as a single frame at the start of the video and used as the cover. Overrides videoCoverTimestampMs when provided. */ videoCoverImageUrl?: string; /** * Optional for photo carousels. Index of image to use as cover, 0-based (defaults to 0/first image). */ photoCoverIndex?: number; /** * When true, TikTok may add recommended music (photos only) */ autoAddMusic?: boolean; /** * Set true to disclose AI-generated content */ videoMadeWithAi?: boolean; /** * Optional long-form description for photo posts (max 4000 chars). Recommended when content exceeds 90 chars, as photo titles are auto-truncated. */ description?: string; }; /** * Type of commercial content disclosure. Sufficient on its own: "brand_organic" * ("Your Brand") implies isBrandOrganicPost and "brand_content" ("Branded Content", * paid partnership) implies brandPartnerPromote, so you don't need to send the * boolean flags separately. Branded content cannot be posted with privacyLevel * SELF_ONLY. * */ type commercialContentType = 'none' | 'brand_organic' | 'brand_content'; /** * Optional override. Defaults based on provided media items. */ type mediaType2 = 'video' | 'photo'; /** * A platform measurement tag — the thing you create, install on a * website, send events to, and target ads against. On Meta this is a * Pixel (`kind: pixel`). The shape is platform-neutral so other platforms * (Pinterest Tag, LinkedIn Insight Tag, etc.) can be added without * changing the contract; platform-specific fields are simply absent where * a platform has no equivalent. Returned by `listTrackingTags`, * `createTrackingTag`, `getTrackingTag`, and `updateTrackingTag`. * */ type TrackingTag = { /** * Platform-native tag id. Meta: numeric pixel id, as a string. */ id: string; name: string; platform: 'metaads'; /** * Platform-native flavor of the tag (Meta: `pixel`). */ kind: 'pixel' | 'tag' | 'insight_tag'; /** * `inactive` when the platform reports the tag as broken/unavailable. */ status: 'active' | 'inactive'; /** * The base-code `