@zernio/node 0.2.56 → 0.2.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -106,6 +106,43 @@ export type Ad = {
106
106
  platformAdSetId?: string;
107
107
  campaignName?: string;
108
108
  adSetName?: string;
109
+ /**
110
+ * Raw Meta campaign objective (e.g. OUTCOME_SALES, OUTCOME_LEADS, OUTCOME_TRAFFIC). Only present for Meta ads.
111
+ */
112
+ platformObjective?: (string) | null;
113
+ /**
114
+ * Meta ad set optimization goal (e.g. OFFSITE_CONVERSIONS, VALUE, LEAD_GENERATION, LINK_CLICKS). Only present for Meta ads.
115
+ */
116
+ optimizationGoal?: (string) | null;
117
+ /**
118
+ * Bid strategy (e.g. LOWEST_COST_WITHOUT_CAP, COST_CAP, LOWEST_COST_WITH_MIN_ROAS). Ad set level overrides campaign level. Only present for Meta ads.
119
+ */
120
+ bidStrategy?: (string) | null;
121
+ /**
122
+ * Meta promoted object containing conversion event details. Structure varies by objective. Only present for Meta ads.
123
+ */
124
+ promotedObject?: {
125
+ /**
126
+ * Conversion event type (e.g. PURCHASE, LEAD, COMPLETE_REGISTRATION, ADD_TO_CART)
127
+ */
128
+ custom_event_type?: string;
129
+ /**
130
+ * Meta pixel ID
131
+ */
132
+ pixel_id?: string;
133
+ /**
134
+ * Facebook page ID
135
+ */
136
+ page_id?: string;
137
+ /**
138
+ * Facebook app ID
139
+ */
140
+ application_id?: string;
141
+ /**
142
+ * Product catalog set ID
143
+ */
144
+ product_set_id?: string;
145
+ } | null;
109
146
  /**
110
147
  * Platform-specific creative data. Fields vary by platform.
111
148
  */
@@ -193,6 +230,26 @@ export type AdCampaign = {
193
230
  platformAdAccountId?: string;
194
231
  accountId?: string;
195
232
  profileId?: string;
233
+ /**
234
+ * Raw Meta campaign objective (e.g. OUTCOME_SALES, OUTCOME_LEADS, OUTCOME_TRAFFIC)
235
+ */
236
+ platformObjective?: (string) | null;
237
+ /**
238
+ * Meta optimization goal. String if all ad sets share the same goal, array of distinct values if they differ.
239
+ */
240
+ optimizationGoal?: ((string | Array<(string)>) | null);
241
+ /**
242
+ * Campaign-level bid strategy (e.g. LOWEST_COST_WITHOUT_CAP, COST_CAP, LOWEST_COST_WITH_MIN_ROAS)
243
+ */
244
+ bidStrategy?: (string) | null;
245
+ /**
246
+ * Meta promoted object at campaign level (conversion event details)
247
+ */
248
+ promotedObject?: {
249
+ custom_event_type?: string;
250
+ pixel_id?: string;
251
+ page_id?: string;
252
+ } | null;
196
253
  earliestAd?: string;
197
254
  latestAd?: string;
198
255
  };
@@ -237,6 +294,22 @@ export type AdTreeAdSet = {
237
294
  type?: 'daily' | 'lifetime';
238
295
  } | null;
239
296
  metrics?: AdMetrics;
297
+ /**
298
+ * Meta ad set optimization goal (e.g. OFFSITE_CONVERSIONS, VALUE, LEAD_GENERATION)
299
+ */
300
+ optimizationGoal?: (string) | null;
301
+ /**
302
+ * Bid strategy for this ad set (overrides campaign level when set)
303
+ */
304
+ bidStrategy?: (string) | null;
305
+ /**
306
+ * Meta promoted object for this ad set (conversion event details)
307
+ */
308
+ promotedObject?: {
309
+ custom_event_type?: string;
310
+ pixel_id?: string;
311
+ page_id?: string;
312
+ } | null;
240
313
  /**
241
314
  * Individual ads within this ad set (capped at 100). Returns a subset of Ad fields from the aggregation (core fields like _id, name, platform, status, budget, metrics, creative, goal are included; targeting and schedule may be absent).
242
315
  */
@@ -267,6 +340,26 @@ export type AdTreeCampaign = {
267
340
  platformAdAccountId?: string;
268
341
  accountId?: string;
269
342
  profileId?: string;
343
+ /**
344
+ * Raw Meta campaign objective (e.g. OUTCOME_SALES, OUTCOME_LEADS, OUTCOME_TRAFFIC)
345
+ */
346
+ platformObjective?: (string) | null;
347
+ /**
348
+ * Meta optimization goal. String if all ad sets share the same goal, array of distinct values if they differ.
349
+ */
350
+ optimizationGoal?: ((string | Array<(string)>) | null);
351
+ /**
352
+ * Campaign-level bid strategy (e.g. LOWEST_COST_WITHOUT_CAP, COST_CAP, LOWEST_COST_WITH_MIN_ROAS)
353
+ */
354
+ bidStrategy?: (string) | null;
355
+ /**
356
+ * Meta promoted object at campaign level (conversion event details)
357
+ */
358
+ promotedObject?: {
359
+ custom_event_type?: string;
360
+ pixel_id?: string;
361
+ page_id?: string;
362
+ } | null;
270
363
  adSets?: Array<AdTreeAdSet>;
271
364
  };
272
365
 
@@ -442,102 +535,6 @@ export type BlueskyPlatformData = {
442
535
  }>;
443
536
  };
444
537
 
445
- /**
446
- * Connection event log showing account connection/disconnection history
447
- */
448
- export type ConnectionLog = {
449
- _id?: string;
450
- /**
451
- * User who owns the connection (may be null for early OAuth failures)
452
- */
453
- userId?: string;
454
- profileId?: string;
455
- /**
456
- * The social account ID (present on successful connections and disconnects)
457
- */
458
- accountId?: string;
459
- platform?: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord';
460
- /**
461
- * Type of connection event: connect_success, connect_failed, disconnect, reconnect_success, reconnect_failed
462
- */
463
- eventType?: 'connect_success' | 'connect_failed' | 'disconnect' | 'reconnect_success' | 'reconnect_failed';
464
- /**
465
- * How the connection was initiated
466
- */
467
- connectionMethod?: 'oauth' | 'credentials' | 'invitation';
468
- /**
469
- * Error details (present on failed events)
470
- */
471
- error?: {
472
- /**
473
- * Error code (e.g., oauth_denied, token_exchange_failed)
474
- */
475
- code?: string;
476
- /**
477
- * Human-readable error message
478
- */
479
- message?: string;
480
- /**
481
- * Raw error response (truncated to 2000 chars)
482
- */
483
- rawResponse?: string;
484
- };
485
- /**
486
- * Success details (present on successful events)
487
- */
488
- success?: {
489
- displayName?: string;
490
- username?: string;
491
- profilePicture?: string;
492
- /**
493
- * OAuth scopes/permissions granted
494
- */
495
- permissions?: Array<(string)>;
496
- tokenExpiresAt?: string;
497
- /**
498
- * Account type (personal, business, organization)
499
- */
500
- accountType?: string;
501
- };
502
- /**
503
- * Additional context about the connection attempt
504
- */
505
- context?: {
506
- isHeadlessMode?: boolean;
507
- hasCustomRedirectUrl?: boolean;
508
- isReconnection?: boolean;
509
- /**
510
- * Using bring-your-own-keys
511
- */
512
- isBYOK?: boolean;
513
- invitationToken?: string;
514
- connectToken?: string;
515
- };
516
- /**
517
- * How long the operation took in milliseconds
518
- */
519
- durationMs?: number;
520
- /**
521
- * Additional metadata
522
- */
523
- metadata?: {
524
- [key: string]: unknown;
525
- };
526
- createdAt?: string;
527
- };
528
-
529
- export type platform2 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord';
530
-
531
- /**
532
- * Type of connection event: connect_success, connect_failed, disconnect, reconnect_success, reconnect_failed
533
- */
534
- export type eventType = 'connect_success' | 'connect_failed' | 'disconnect' | 'reconnect_success' | 'reconnect_failed';
535
-
536
- /**
537
- * How the connection was initiated
538
- */
539
- export type connectionMethod = 'oauth' | 'credentials' | 'invitation';
540
-
541
538
  export type ErrorResponse = {
542
539
  error?: string;
543
540
  details?: {
@@ -777,7 +774,7 @@ export type InboxWebhookMessage = {
777
774
  isRead: boolean;
778
775
  };
779
776
 
780
- export type platform3 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp';
777
+ export type platform2 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp';
781
778
 
782
779
  export type direction = 'incoming' | 'outgoing';
783
780
 
@@ -1387,6 +1384,8 @@ export type PostLog = {
1387
1384
  createdAt?: string;
1388
1385
  };
1389
1386
 
1387
+ export type platform3 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord';
1388
+
1390
1389
  /**
1391
1390
  * Type of action logged: publish (initial attempt), retry (after failure), media_upload, rate_limit_pause, token_refresh, cancelled
1392
1391
  */
@@ -1734,19 +1733,6 @@ export type SocialAccount = {
1734
1733
  *
1735
1734
  */
1736
1735
  enabled?: boolean;
1737
- /**
1738
- * **Deprecated.** With the new ads account model, ads accounts are separate SocialAccount
1739
- * documents. Check for accounts with ads platform values (metaads, linkedinads, pinterestads,
1740
- * tiktokads, xads, googleads) instead.
1741
- *
1742
- * Legacy behavior:
1743
- * - `connected`: Ads are ready to use (same-token platforms like Meta/LinkedIn, or separate ads token is present).
1744
- * - `not_connected`: Platform supports ads but requires a separate ads OAuth. Use `GET /v1/connect/{platform}/ads` to connect.
1745
- * - `not_available`: Platform does not support ads (e.g., YouTube, Reddit, Bluesky).
1746
- *
1747
- * @deprecated
1748
- */
1749
- adsStatus?: 'connected' | 'not_connected' | 'not_available';
1750
1736
  /**
1751
1737
  * Platform-specific metadata. Fields vary by platform. For WhatsApp accounts, includes:
1752
1738
  * - `qualityRating`: Phone number quality rating from Meta (`GREEN`, `YELLOW`, `RED`, or `UNKNOWN`)
@@ -1765,20 +1751,6 @@ export type SocialAccount = {
1765
1751
 
1766
1752
  export type platform4 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'whatsapp' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads';
1767
1753
 
1768
- /**
1769
- * **Deprecated.** With the new ads account model, ads accounts are separate SocialAccount
1770
- * documents. Check for accounts with ads platform values (metaads, linkedinads, pinterestads,
1771
- * tiktokads, xads, googleads) instead.
1772
- *
1773
- * Legacy behavior:
1774
- * - `connected`: Ads are ready to use (same-token platforms like Meta/LinkedIn, or separate ads token is present).
1775
- * - `not_connected`: Platform supports ads but requires a separate ads OAuth. Use `GET /v1/connect/{platform}/ads` to connect.
1776
- * - `not_available`: Platform does not support ads (e.g., YouTube, Reddit, Bluesky).
1777
- *
1778
- * @deprecated
1779
- */
1780
- export type adsStatus = 'connected' | 'not_connected' | 'not_available';
1781
-
1782
1754
  /**
1783
1755
  * Text, images (up to 10), videos (up to 10), and mixed media albums. Captions up to 1024 chars for media, 4096 for text-only.
1784
1756
  */
@@ -2078,55 +2050,6 @@ export type Webhook = {
2078
2050
  };
2079
2051
  };
2080
2052
 
2081
- /**
2082
- * Webhook delivery log entry
2083
- */
2084
- export type WebhookLog = {
2085
- _id?: string;
2086
- /**
2087
- * ID of the webhook that was triggered
2088
- */
2089
- webhookId?: string;
2090
- /**
2091
- * Name of the webhook that was triggered
2092
- */
2093
- webhookName?: string;
2094
- event?: 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'comment.received' | 'webhook.test';
2095
- url?: string;
2096
- status?: 'success' | 'failed';
2097
- /**
2098
- * HTTP status code from webhook endpoint
2099
- */
2100
- statusCode?: number;
2101
- /**
2102
- * Payload sent to webhook endpoint
2103
- */
2104
- requestPayload?: {
2105
- [key: string]: unknown;
2106
- };
2107
- /**
2108
- * Response body from webhook endpoint (truncated to 10KB)
2109
- */
2110
- responseBody?: string;
2111
- /**
2112
- * Error message if delivery failed
2113
- */
2114
- errorMessage?: string;
2115
- /**
2116
- * Delivery attempt number (max 7 attempts)
2117
- */
2118
- attemptNumber?: number;
2119
- /**
2120
- * Response time in milliseconds
2121
- */
2122
- responseTime?: number;
2123
- createdAt?: string;
2124
- };
2125
-
2126
- export type event = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'comment.received' | 'webhook.test';
2127
-
2128
- export type status8 = 'success' | 'failed';
2129
-
2130
2053
  /**
2131
2054
  * Webhook payload for account connected events
2132
2055
  */
@@ -2152,7 +2075,7 @@ export type WebhookPayloadAccountConnected = {
2152
2075
  timestamp: string;
2153
2076
  };
2154
2077
 
2155
- export type event2 = 'account.connected';
2078
+ export type event = 'account.connected';
2156
2079
 
2157
2080
  /**
2158
2081
  * Webhook payload for account disconnected events
@@ -2187,7 +2110,7 @@ export type WebhookPayloadAccountDisconnected = {
2187
2110
  timestamp: string;
2188
2111
  };
2189
2112
 
2190
- export type event3 = 'account.disconnected';
2113
+ export type event2 = 'account.disconnected';
2191
2114
 
2192
2115
  /**
2193
2116
  * Whether the disconnection was intentional (user action) or unintentional (token expired/revoked)
@@ -2261,7 +2184,7 @@ export type WebhookPayloadComment = {
2261
2184
  timestamp: string;
2262
2185
  };
2263
2186
 
2264
- export type event4 = 'comment.received';
2187
+ export type event3 = 'comment.received';
2265
2188
 
2266
2189
  export type platform5 = 'instagram' | 'facebook' | 'twitter' | 'youtube' | 'linkedin' | 'bluesky' | 'reddit';
2267
2190
 
@@ -2381,7 +2304,7 @@ export type WebhookPayloadMessage = {
2381
2304
  timestamp: string;
2382
2305
  };
2383
2306
 
2384
- export type event5 = 'message.received';
2307
+ export type event4 = 'message.received';
2385
2308
 
2386
2309
  /**
2387
2310
  * Webhook payload for `message.deleted` events. Fires when the sender
@@ -2405,7 +2328,7 @@ export type WebhookPayloadMessageDeleted = {
2405
2328
  timestamp: string;
2406
2329
  };
2407
2330
 
2408
- export type event6 = 'message.deleted';
2331
+ export type event5 = 'message.deleted';
2409
2332
 
2410
2333
  /**
2411
2334
  * Shared payload for `message.delivered`, `message.read`, and
@@ -2440,7 +2363,7 @@ export type WebhookPayloadMessageDeliveryStatus = {
2440
2363
  timestamp: string;
2441
2364
  };
2442
2365
 
2443
- export type event7 = 'message.delivered' | 'message.read' | 'message.failed';
2366
+ export type event6 = 'message.delivered' | 'message.read' | 'message.failed';
2444
2367
 
2445
2368
  /**
2446
2369
  * Webhook payload for `message.edited` events. Fires when the sender
@@ -2482,7 +2405,7 @@ export type WebhookPayloadMessageEdited = {
2482
2405
  timestamp: string;
2483
2406
  };
2484
2407
 
2485
- export type event8 = 'message.edited';
2408
+ export type event7 = 'message.edited';
2486
2409
 
2487
2410
  /**
2488
2411
  * Webhook payload for message sent events (fired when a message is sent via the API)
@@ -2558,7 +2481,7 @@ export type WebhookPayloadMessageSent = {
2558
2481
  timestamp: string;
2559
2482
  };
2560
2483
 
2561
- export type event9 = 'message.sent';
2484
+ export type event8 = 'message.sent';
2562
2485
 
2563
2486
  /**
2564
2487
  * Webhook payload for post events
@@ -2586,7 +2509,7 @@ export type WebhookPayloadPost = {
2586
2509
  timestamp: string;
2587
2510
  };
2588
2511
 
2589
- export type event10 = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled';
2512
+ export type event9 = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled';
2590
2513
 
2591
2514
  /**
2592
2515
  * Webhook payload for test deliveries
@@ -2604,7 +2527,7 @@ export type WebhookPayloadTest = {
2604
2527
  timestamp: string;
2605
2528
  };
2606
2529
 
2607
- export type event11 = 'webhook.test';
2530
+ export type event10 = 'webhook.test';
2608
2531
 
2609
2532
  export type WhatsAppBodyComponent = {
2610
2533
  type: 'body';
@@ -4323,29 +4246,6 @@ export type DeleteAccountError = ({
4323
4246
  error?: string;
4324
4247
  });
4325
4248
 
4326
- export type DisconnectAdsData = {
4327
- body?: {
4328
- /**
4329
- * The ads platform (optional, used for logging only)
4330
- */
4331
- adsPlatform?: 'metaads' | 'linkedinads' | 'pinterestads' | 'tiktokads' | 'xads';
4332
- };
4333
- path: {
4334
- /**
4335
- * The ads SocialAccount ID to disconnect
4336
- */
4337
- accountId: string;
4338
- };
4339
- };
4340
-
4341
- export type DisconnectAdsResponse = ({
4342
- message?: string;
4343
- });
4344
-
4345
- export type DisconnectAdsError = (unknown | {
4346
- error?: string;
4347
- });
4348
-
4349
4249
  export type GetAllAccountsHealthData = {
4350
4250
  query?: {
4351
4251
  /**
@@ -7075,226 +6975,93 @@ export type ListLogsError = ({
7075
6975
  error?: string;
7076
6976
  });
7077
6977
 
7078
- export type GetWebhookLogsData = {
7079
- query?: {
6978
+ export type GetPostLogsData = {
6979
+ path: {
7080
6980
  /**
7081
- * Filter by event type
6981
+ * The post ID
7082
6982
  */
7083
- event?: 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'comment.received' | 'webhook.test';
6983
+ postId: string;
6984
+ };
6985
+ query?: {
7084
6986
  /**
7085
6987
  * Maximum number of logs to return (max 100)
7086
6988
  */
7087
6989
  limit?: number;
7088
- /**
7089
- * Filter by delivery status
7090
- */
7091
- status?: 'success' | 'failed';
7092
- /**
7093
- * Filter by webhook ID
7094
- */
7095
- webhookId?: string;
7096
6990
  };
7097
6991
  };
7098
6992
 
7099
- export type GetWebhookLogsResponse = ({
7100
- logs?: Array<WebhookLog>;
6993
+ export type GetPostLogsResponse = ({
6994
+ logs?: Array<PostLog>;
6995
+ /**
6996
+ * Number of logs returned
6997
+ */
6998
+ count?: number;
6999
+ postId?: string;
7101
7000
  });
7102
7001
 
7103
- export type GetWebhookLogsError = ({
7002
+ export type GetPostLogsError = ({
7104
7003
  error?: string;
7105
- });
7004
+ } | unknown);
7106
7005
 
7107
- export type ListPostsLogsData = {
7006
+ export type ListInboxConversationsData = {
7108
7007
  query?: {
7109
7008
  /**
7110
- * Filter by action type
7009
+ * Filter by specific social account ID
7111
7010
  */
7112
- action?: 'publish' | 'retry' | 'media_upload' | 'rate_limit_pause' | 'token_refresh' | 'cancelled' | 'all';
7011
+ accountId?: string;
7113
7012
  /**
7114
- * Number of days to look back (max 7)
7013
+ * Pagination cursor for next page
7115
7014
  */
7116
- days?: number;
7015
+ cursor?: string;
7117
7016
  /**
7118
- * Maximum number of logs to return (max 100)
7017
+ * Maximum number of conversations to return
7119
7018
  */
7120
7019
  limit?: number;
7121
7020
  /**
7122
7021
  * Filter by platform
7123
7022
  */
7124
- platform?: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'all';
7023
+ platform?: 'facebook' | 'instagram' | 'twitter' | 'bluesky' | 'reddit' | 'telegram';
7125
7024
  /**
7126
- * Search through log entries by text content.
7025
+ * Filter by profile ID
7127
7026
  */
7128
- search?: string;
7027
+ profileId?: string;
7129
7028
  /**
7130
- * Number of logs to skip (for pagination)
7029
+ * Sort order by updated time
7131
7030
  */
7132
- skip?: number;
7031
+ sortOrder?: 'asc' | 'desc';
7133
7032
  /**
7134
- * Filter by log status
7033
+ * Filter by conversation status
7135
7034
  */
7136
- status?: 'success' | 'failed' | 'pending' | 'skipped' | 'all';
7035
+ status?: 'active' | 'archived';
7137
7036
  };
7138
7037
  };
7139
7038
 
7140
- export type ListPostsLogsResponse = ({
7141
- logs?: Array<PostLog>;
7142
- pagination?: {
7143
- /**
7144
- * Total number of logs matching the query
7145
- */
7146
- total?: number;
7147
- limit?: number;
7148
- skip?: number;
7149
- /**
7150
- * Total number of pages
7151
- */
7152
- pages?: number;
7153
- hasMore?: boolean;
7154
- };
7155
- });
7156
-
7157
- export type ListPostsLogsError = ({
7158
- error?: string;
7159
- });
7160
-
7161
- export type ListConnectionLogsData = {
7162
- query?: {
7163
- /**
7164
- * Number of days to look back (max 7)
7165
- */
7166
- days?: number;
7167
- /**
7168
- * Filter by event type
7169
- */
7170
- eventType?: 'connect_success' | 'connect_failed' | 'disconnect' | 'reconnect_success' | 'reconnect_failed' | 'all';
7171
- /**
7172
- * Maximum number of logs to return (max 100)
7173
- */
7174
- limit?: number;
7039
+ export type ListInboxConversationsResponse = ({
7040
+ data?: Array<{
7041
+ id?: string;
7042
+ platform?: string;
7043
+ accountId?: string;
7044
+ accountUsername?: string;
7045
+ participantId?: string;
7046
+ participantName?: string;
7047
+ participantPicture?: (string) | null;
7175
7048
  /**
7176
- * Filter by platform
7049
+ * X/Twitter verified badge type. Only present for Twitter/X conversations.
7177
7050
  */
7178
- platform?: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'all';
7051
+ participantVerifiedType?: ('blue' | 'government' | 'business' | 'none') | null;
7052
+ lastMessage?: string;
7053
+ updatedTime?: string;
7054
+ status?: 'active' | 'archived';
7179
7055
  /**
7180
- * Number of logs to skip (for pagination)
7056
+ * Number of unread messages
7181
7057
  */
7182
- skip?: number;
7058
+ unreadCount?: (number) | null;
7183
7059
  /**
7184
- * Filter by status (shorthand for event types)
7060
+ * Direct link to open the conversation on the platform (if available)
7185
7061
  */
7186
- status?: 'success' | 'failed' | 'all';
7187
- };
7188
- };
7189
-
7190
- export type ListConnectionLogsResponse = ({
7191
- logs?: Array<ConnectionLog>;
7192
- pagination?: {
7062
+ url?: (string) | null;
7193
7063
  /**
7194
- * Total number of logs matching the query
7195
- */
7196
- total?: number;
7197
- limit?: number;
7198
- skip?: number;
7199
- /**
7200
- * Total number of pages
7201
- */
7202
- pages?: number;
7203
- hasMore?: boolean;
7204
- };
7205
- });
7206
-
7207
- export type ListConnectionLogsError = ({
7208
- error?: string;
7209
- });
7210
-
7211
- export type GetPostLogsData = {
7212
- path: {
7213
- /**
7214
- * The post ID
7215
- */
7216
- postId: string;
7217
- };
7218
- query?: {
7219
- /**
7220
- * Maximum number of logs to return (max 100)
7221
- */
7222
- limit?: number;
7223
- };
7224
- };
7225
-
7226
- export type GetPostLogsResponse = ({
7227
- logs?: Array<PostLog>;
7228
- /**
7229
- * Number of logs returned
7230
- */
7231
- count?: number;
7232
- postId?: string;
7233
- });
7234
-
7235
- export type GetPostLogsError = ({
7236
- error?: string;
7237
- } | unknown);
7238
-
7239
- export type ListInboxConversationsData = {
7240
- query?: {
7241
- /**
7242
- * Filter by specific social account ID
7243
- */
7244
- accountId?: string;
7245
- /**
7246
- * Pagination cursor for next page
7247
- */
7248
- cursor?: string;
7249
- /**
7250
- * Maximum number of conversations to return
7251
- */
7252
- limit?: number;
7253
- /**
7254
- * Filter by platform
7255
- */
7256
- platform?: 'facebook' | 'instagram' | 'twitter' | 'bluesky' | 'reddit' | 'telegram';
7257
- /**
7258
- * Filter by profile ID
7259
- */
7260
- profileId?: string;
7261
- /**
7262
- * Sort order by updated time
7263
- */
7264
- sortOrder?: 'asc' | 'desc';
7265
- /**
7266
- * Filter by conversation status
7267
- */
7268
- status?: 'active' | 'archived';
7269
- };
7270
- };
7271
-
7272
- export type ListInboxConversationsResponse = ({
7273
- data?: Array<{
7274
- id?: string;
7275
- platform?: string;
7276
- accountId?: string;
7277
- accountUsername?: string;
7278
- participantId?: string;
7279
- participantName?: string;
7280
- participantPicture?: (string) | null;
7281
- /**
7282
- * X/Twitter verified badge type. Only present for Twitter/X conversations.
7283
- */
7284
- participantVerifiedType?: ('blue' | 'government' | 'business' | 'none') | null;
7285
- lastMessage?: string;
7286
- updatedTime?: string;
7287
- status?: 'active' | 'archived';
7288
- /**
7289
- * Number of unread messages
7290
- */
7291
- unreadCount?: (number) | null;
7292
- /**
7293
- * Direct link to open the conversation on the platform (if available)
7294
- */
7295
- url?: (string) | null;
7296
- /**
7297
- * Instagram profile data for the participant. Only present for Instagram conversations.
7064
+ * Instagram profile data for the participant. Only present for Instagram conversations.
7298
7065
  */
7299
7066
  instagramProfile?: {
7300
7067
  /**
@@ -8797,457 +8564,179 @@ export type DeleteInboxReviewReplyError = ({
8797
8564
  error?: string;
8798
8565
  } | unknown);
8799
8566
 
8800
- export type SendWhatsAppBulkData = {
8801
- body: {
8567
+ export type GetWhatsAppTemplatesData = {
8568
+ query: {
8802
8569
  /**
8803
8570
  * WhatsApp social account ID
8804
8571
  */
8805
8572
  accountId: string;
8806
- /**
8807
- * List of recipients (max 100)
8808
- */
8809
- recipients: Array<{
8810
- /**
8811
- * Recipient phone number in E.164 format
8812
- */
8813
- phone: string;
8814
- /**
8815
- * Per-recipient template variables keyed by index (e.g., "1", "2")
8816
- */
8817
- variables?: {
8818
- [key: string]: (string);
8819
- };
8820
- }>;
8821
- template: {
8822
- /**
8823
- * Template name
8824
- */
8825
- name: string;
8826
- /**
8827
- * Template language code
8828
- */
8829
- language: string;
8830
- /**
8831
- * Base template components
8832
- */
8833
- components?: Array<{
8834
- [key: string]: unknown;
8835
- }>;
8836
- };
8837
8573
  };
8838
8574
  };
8839
8575
 
8840
- export type SendWhatsAppBulkResponse = ({
8576
+ export type GetWhatsAppTemplatesResponse = ({
8841
8577
  success?: boolean;
8842
- summary?: {
8843
- total?: number;
8844
- sent?: number;
8845
- failed?: number;
8846
- };
8847
- results?: Array<{
8848
- phone?: string;
8849
- success?: boolean;
8850
- messageId?: string;
8851
- error?: string;
8852
- }>;
8853
- });
8854
-
8855
- export type SendWhatsAppBulkError = (unknown | {
8856
- error?: string;
8857
- });
8858
-
8859
- export type GetWhatsAppContactsData = {
8860
- query: {
8861
- /**
8862
- * WhatsApp social account ID
8863
- */
8864
- accountId: string;
8865
- /**
8866
- * Filter by group
8867
- */
8868
- group?: string;
8869
- /**
8870
- * Maximum results (default 50)
8871
- */
8872
- limit?: number;
8873
- /**
8874
- * Filter by opt-in status
8875
- */
8876
- optedIn?: 'true' | 'false';
8877
- /**
8878
- * Search contacts by name, phone, email, or company
8879
- */
8880
- search?: string;
8881
- /**
8882
- * Offset for pagination
8883
- */
8884
- skip?: number;
8578
+ templates?: Array<{
8885
8579
  /**
8886
- * Filter by tag
8580
+ * WhatsApp template ID
8887
8581
  */
8888
- tag?: string;
8889
- };
8890
- };
8891
-
8892
- export type GetWhatsAppContactsResponse = ({
8893
- success?: boolean;
8894
- contacts?: Array<{
8895
8582
  id?: string;
8896
- phone?: string;
8897
- waId?: string;
8898
8583
  name?: string;
8899
- email?: string;
8900
- company?: string;
8901
- tags?: Array<(string)>;
8902
- groups?: Array<(string)>;
8903
- isOptedIn?: boolean;
8904
- lastMessageSentAt?: string;
8905
- lastMessageReceivedAt?: string;
8906
- messagesSentCount?: number;
8907
- messagesReceivedCount?: number;
8908
- customFields?: {
8584
+ status?: 'APPROVED' | 'PENDING' | 'REJECTED';
8585
+ category?: 'AUTHENTICATION' | 'MARKETING' | 'UTILITY';
8586
+ language?: string;
8587
+ components?: Array<{
8909
8588
  [key: string]: unknown;
8910
- };
8911
- notes?: string;
8912
- createdAt?: string;
8589
+ }>;
8913
8590
  }>;
8914
- filters?: {
8915
- tags?: Array<(string)>;
8916
- groups?: Array<(string)>;
8917
- };
8918
- pagination?: {
8919
- total?: number;
8920
- limit?: number;
8921
- skip?: number;
8922
- hasMore?: boolean;
8923
- };
8924
8591
  });
8925
8592
 
8926
- export type GetWhatsAppContactsError = (unknown | {
8593
+ export type GetWhatsAppTemplatesError = (unknown | {
8927
8594
  error?: string;
8928
8595
  });
8929
8596
 
8930
- export type CreateWhatsAppContactData = {
8597
+ export type CreateWhatsAppTemplateData = {
8931
8598
  body: {
8932
8599
  /**
8933
8600
  * WhatsApp social account ID
8934
8601
  */
8935
8602
  accountId: string;
8936
8603
  /**
8937
- * Phone number in E.164 format
8938
- */
8939
- phone: string;
8940
- /**
8941
- * Contact name
8604
+ * Template name (lowercase, letters/numbers/underscores, must start with a letter)
8942
8605
  */
8943
8606
  name: string;
8944
8607
  /**
8945
- * Contact email
8946
- */
8947
- email?: string;
8948
- /**
8949
- * Company name
8608
+ * Template category
8950
8609
  */
8951
- company?: string;
8610
+ category: 'AUTHENTICATION' | 'MARKETING' | 'UTILITY';
8952
8611
  /**
8953
- * Tags for categorization
8612
+ * Template language code (e.g., en_US)
8954
8613
  */
8955
- tags?: Array<(string)>;
8614
+ language: string;
8956
8615
  /**
8957
- * Groups the contact belongs to
8616
+ * Template components (header, body, footer, buttons). Required for custom templates, omit when using library_template_name.
8958
8617
  */
8959
- groups?: Array<(string)>;
8618
+ components?: Array<WhatsAppTemplateComponent>;
8960
8619
  /**
8961
- * Whether the contact has opted in to receive messages
8620
+ * Name of a pre-built template from Meta's template library (e.g., "appointment_reminder",
8621
+ * "auto_pay_reminder_1", "address_update"). When provided, the template is pre-approved
8622
+ * by Meta with no review wait. Omit `components` when using this field.
8623
+ *
8962
8624
  */
8963
- isOptedIn?: boolean;
8625
+ library_template_name?: string;
8964
8626
  /**
8965
- * Custom key-value fields
8627
+ * Optional body customizations for library templates. Available options depend on the
8628
+ * template (e.g., add_contact_number, add_learn_more_link, add_security_recommendation,
8629
+ * add_track_package_link, code_expiration_minutes).
8630
+ *
8966
8631
  */
8967
- customFields?: {
8968
- [key: string]: (string);
8632
+ library_template_body_inputs?: {
8633
+ [key: string]: unknown;
8969
8634
  };
8970
8635
  /**
8971
- * Notes about the contact
8636
+ * Optional button customizations for library templates. Each item specifies button type
8637
+ * and configuration (e.g., URL, phone number, quick reply).
8638
+ *
8972
8639
  */
8973
- notes?: string;
8640
+ library_template_button_inputs?: Array<{
8641
+ type?: 'quick_reply' | 'url' | 'phone_number';
8642
+ url?: {
8643
+ base_url?: string;
8644
+ };
8645
+ phone_number?: string;
8646
+ }>;
8974
8647
  };
8975
8648
  };
8976
8649
 
8977
- export type CreateWhatsAppContactResponse = ({
8650
+ export type CreateWhatsAppTemplateResponse = ({
8978
8651
  success?: boolean;
8979
- contact?: {
8652
+ template?: {
8980
8653
  id?: string;
8981
- phone?: string;
8982
8654
  name?: string;
8983
- email?: string;
8984
- company?: string;
8985
- tags?: Array<(string)>;
8986
- groups?: Array<(string)>;
8987
- isOptedIn?: boolean;
8988
- createdAt?: string;
8655
+ /**
8656
+ * APPROVED for library templates, PENDING for custom
8657
+ */
8658
+ status?: string;
8659
+ category?: string;
8660
+ language?: string;
8989
8661
  };
8990
8662
  });
8991
8663
 
8992
- export type CreateWhatsAppContactError = (unknown | {
8664
+ export type CreateWhatsAppTemplateError = (unknown | {
8993
8665
  error?: string;
8994
8666
  });
8995
8667
 
8996
- export type GetWhatsAppContactData = {
8668
+ export type GetWhatsAppTemplateData = {
8997
8669
  path: {
8998
8670
  /**
8999
- * Contact ID
8671
+ * Template name
8672
+ */
8673
+ templateName: string;
8674
+ };
8675
+ query: {
8676
+ /**
8677
+ * WhatsApp social account ID
9000
8678
  */
9001
- contactId: string;
8679
+ accountId: string;
9002
8680
  };
9003
8681
  };
9004
8682
 
9005
- export type GetWhatsAppContactResponse = ({
8683
+ export type GetWhatsAppTemplateResponse = ({
9006
8684
  success?: boolean;
9007
- contact?: {
8685
+ template?: {
9008
8686
  id?: string;
9009
- phone?: string;
9010
- waId?: string;
9011
8687
  name?: string;
9012
- email?: string;
9013
- company?: string;
9014
- tags?: Array<(string)>;
9015
- groups?: Array<(string)>;
9016
- isOptedIn?: boolean;
9017
- optInDate?: string;
9018
- optOutDate?: string;
9019
- isBlocked?: boolean;
9020
- lastMessageSentAt?: string;
9021
- lastMessageReceivedAt?: string;
9022
- messagesSentCount?: number;
9023
- messagesReceivedCount?: number;
9024
- customFields?: {
8688
+ status?: string;
8689
+ category?: string;
8690
+ language?: string;
8691
+ components?: Array<{
9025
8692
  [key: string]: unknown;
9026
- };
9027
- notes?: string;
9028
- createdAt?: string;
9029
- updatedAt?: string;
8693
+ }>;
9030
8694
  };
9031
8695
  });
9032
8696
 
9033
- export type GetWhatsAppContactError = ({
8697
+ export type GetWhatsAppTemplateError = (unknown | {
9034
8698
  error?: string;
9035
8699
  });
9036
8700
 
9037
- export type UpdateWhatsAppContactData = {
8701
+ export type UpdateWhatsAppTemplateData = {
9038
8702
  body: {
9039
8703
  /**
9040
- * Contact name
9041
- */
9042
- name?: string;
9043
- /**
9044
- * Contact email
9045
- */
9046
- email?: string;
9047
- /**
9048
- * Company name
9049
- */
9050
- company?: string;
9051
- /**
9052
- * Tags (replaces existing)
9053
- */
9054
- tags?: Array<(string)>;
9055
- /**
9056
- * Groups (replaces existing)
9057
- */
9058
- groups?: Array<(string)>;
9059
- /**
9060
- * Opt-in status (changes are timestamped)
9061
- */
9062
- isOptedIn?: boolean;
9063
- /**
9064
- * Block status
9065
- */
9066
- isBlocked?: boolean;
9067
- /**
9068
- * Custom fields to merge (set value to null to remove a field)
8704
+ * WhatsApp social account ID
9069
8705
  */
9070
- customFields?: {
9071
- [key: string]: ((string) | null);
9072
- };
8706
+ accountId: string;
9073
8707
  /**
9074
- * Notes about the contact
8708
+ * Updated template components
9075
8709
  */
9076
- notes?: string;
8710
+ components: Array<WhatsAppTemplateComponent>;
9077
8711
  };
9078
8712
  path: {
9079
8713
  /**
9080
- * Contact ID
8714
+ * Template name
9081
8715
  */
9082
- contactId: string;
8716
+ templateName: string;
9083
8717
  };
9084
8718
  };
9085
8719
 
9086
- export type UpdateWhatsAppContactResponse = ({
8720
+ export type UpdateWhatsAppTemplateResponse = ({
9087
8721
  success?: boolean;
9088
- contact?: {
8722
+ template?: {
9089
8723
  id?: string;
9090
- phone?: string;
9091
8724
  name?: string;
9092
- email?: string;
9093
- company?: string;
9094
- tags?: Array<(string)>;
9095
- groups?: Array<(string)>;
9096
- isOptedIn?: boolean;
9097
- isBlocked?: boolean;
9098
- customFields?: {
9099
- [key: string]: unknown;
9100
- };
9101
- notes?: string;
9102
- updatedAt?: string;
8725
+ status?: string;
9103
8726
  };
9104
8727
  });
9105
8728
 
9106
- export type UpdateWhatsAppContactError = ({
8729
+ export type UpdateWhatsAppTemplateError = (unknown | {
9107
8730
  error?: string;
9108
8731
  });
9109
8732
 
9110
- export type DeleteWhatsAppContactData = {
8733
+ export type DeleteWhatsAppTemplateData = {
9111
8734
  path: {
9112
8735
  /**
9113
- * Contact ID
9114
- */
9115
- contactId: string;
9116
- };
9117
- };
9118
-
9119
- export type DeleteWhatsAppContactResponse = ({
9120
- success?: boolean;
9121
- message?: string;
9122
- });
9123
-
9124
- export type DeleteWhatsAppContactError = ({
9125
- error?: string;
9126
- });
9127
-
9128
- export type ImportWhatsAppContactsData = {
9129
- body: {
9130
- /**
9131
- * WhatsApp social account ID
9132
- */
9133
- accountId: string;
9134
- /**
9135
- * Contacts to import (max 1000)
9136
- */
9137
- contacts: Array<{
9138
- /**
9139
- * Phone number in E.164 format
9140
- */
9141
- phone: string;
9142
- /**
9143
- * Contact name
9144
- */
9145
- name: string;
9146
- email?: string;
9147
- company?: string;
9148
- tags?: Array<(string)>;
9149
- groups?: Array<(string)>;
9150
- customFields?: {
9151
- [key: string]: (string);
9152
- };
9153
- notes?: string;
9154
- }>;
9155
- /**
9156
- * Tags applied to all imported contacts
9157
- */
9158
- defaultTags?: Array<(string)>;
9159
- /**
9160
- * Groups applied to all imported contacts
9161
- */
9162
- defaultGroups?: Array<(string)>;
9163
- /**
9164
- * Skip contacts with existing phone numbers
9165
- */
9166
- skipDuplicates?: boolean;
9167
- };
9168
- };
9169
-
9170
- export type ImportWhatsAppContactsResponse = ({
9171
- success?: boolean;
9172
- summary?: {
9173
- total?: number;
9174
- created?: number;
9175
- skipped?: number;
9176
- failed?: number;
9177
- };
9178
- results?: Array<{
9179
- phone?: string;
9180
- name?: string;
9181
- success?: boolean;
9182
- contactId?: string;
9183
- error?: string;
9184
- }>;
9185
- });
9186
-
9187
- export type ImportWhatsAppContactsError = (unknown | {
9188
- error?: string;
9189
- });
9190
-
9191
- export type BulkUpdateWhatsAppContactsData = {
9192
- body: {
9193
- /**
9194
- * Bulk action to perform
9195
- */
9196
- action: 'addTags' | 'removeTags' | 'addGroups' | 'removeGroups' | 'optIn' | 'optOut' | 'block' | 'unblock';
9197
- /**
9198
- * Contact IDs to update (max 500)
9199
- */
9200
- contactIds: Array<(string)>;
9201
- /**
9202
- * Tags to add or remove (required for addTags/removeTags)
9203
- */
9204
- tags?: Array<(string)>;
9205
- /**
9206
- * Groups to add or remove (required for addGroups/removeGroups)
9207
- */
9208
- groups?: Array<(string)>;
9209
- };
9210
- };
9211
-
9212
- export type BulkUpdateWhatsAppContactsResponse = ({
9213
- success?: boolean;
9214
- action?: string;
9215
- /**
9216
- * Number of contacts modified
9217
- */
9218
- modified?: number;
9219
- /**
9220
- * Number of contacts matched
9221
- */
9222
- matched?: number;
9223
- });
9224
-
9225
- export type BulkUpdateWhatsAppContactsError = (unknown | {
9226
- error?: string;
9227
- });
9228
-
9229
- export type BulkDeleteWhatsAppContactsData = {
9230
- body: {
9231
- /**
9232
- * Contact IDs to delete (max 500)
8736
+ * Template name
9233
8737
  */
9234
- contactIds: Array<(string)>;
8738
+ templateName: string;
9235
8739
  };
9236
- };
9237
-
9238
- export type BulkDeleteWhatsAppContactsResponse = ({
9239
- success?: boolean;
9240
- /**
9241
- * Number of contacts deleted
9242
- */
9243
- deleted?: number;
9244
- });
9245
-
9246
- export type BulkDeleteWhatsAppContactsError = (unknown | {
9247
- error?: string;
9248
- });
9249
-
9250
- export type GetWhatsAppGroupsData = {
9251
8740
  query: {
9252
8741
  /**
9253
8742
  * WhatsApp social account ID
@@ -9256,268 +8745,7 @@ export type GetWhatsAppGroupsData = {
9256
8745
  };
9257
8746
  };
9258
8747
 
9259
- export type GetWhatsAppGroupsResponse = ({
9260
- success?: boolean;
9261
- groups?: Array<{
9262
- name?: string;
9263
- /**
9264
- * Total contacts in this group
9265
- */
9266
- totalCount?: number;
9267
- /**
9268
- * Opted-in contacts in this group
9269
- */
9270
- optedInCount?: number;
9271
- }>;
9272
- summary?: {
9273
- totalContacts?: number;
9274
- optedInContacts?: number;
9275
- groupCount?: number;
9276
- };
9277
- });
9278
-
9279
- export type GetWhatsAppGroupsError = (unknown | {
9280
- error?: string;
9281
- });
9282
-
9283
- export type RenameWhatsAppGroupData = {
9284
- body: {
9285
- /**
9286
- * WhatsApp social account ID
9287
- */
9288
- accountId: string;
9289
- /**
9290
- * Current group name
9291
- */
9292
- oldName: string;
9293
- /**
9294
- * New group name
9295
- */
9296
- newName: string;
9297
- };
9298
- };
9299
-
9300
- export type RenameWhatsAppGroupResponse = ({
9301
- success?: boolean;
9302
- message?: string;
9303
- /**
9304
- * Number of contacts updated
9305
- */
9306
- modified?: number;
9307
- });
9308
-
9309
- export type RenameWhatsAppGroupError = (unknown | {
9310
- error?: string;
9311
- });
9312
-
9313
- export type DeleteWhatsAppGroupData = {
9314
- body: {
9315
- /**
9316
- * WhatsApp social account ID
9317
- */
9318
- accountId: string;
9319
- /**
9320
- * Group name to delete
9321
- */
9322
- groupName: string;
9323
- };
9324
- };
9325
-
9326
- export type DeleteWhatsAppGroupResponse = ({
9327
- success?: boolean;
9328
- message?: string;
9329
- /**
9330
- * Number of contacts updated
9331
- */
9332
- modified?: number;
9333
- });
9334
-
9335
- export type DeleteWhatsAppGroupError = (unknown | {
9336
- error?: string;
9337
- });
9338
-
9339
- export type GetWhatsAppTemplatesData = {
9340
- query: {
9341
- /**
9342
- * WhatsApp social account ID
9343
- */
9344
- accountId: string;
9345
- };
9346
- };
9347
-
9348
- export type GetWhatsAppTemplatesResponse = ({
9349
- success?: boolean;
9350
- templates?: Array<{
9351
- /**
9352
- * WhatsApp template ID
9353
- */
9354
- id?: string;
9355
- name?: string;
9356
- status?: 'APPROVED' | 'PENDING' | 'REJECTED';
9357
- category?: 'AUTHENTICATION' | 'MARKETING' | 'UTILITY';
9358
- language?: string;
9359
- components?: Array<{
9360
- [key: string]: unknown;
9361
- }>;
9362
- }>;
9363
- });
9364
-
9365
- export type GetWhatsAppTemplatesError = (unknown | {
9366
- error?: string;
9367
- });
9368
-
9369
- export type CreateWhatsAppTemplateData = {
9370
- body: {
9371
- /**
9372
- * WhatsApp social account ID
9373
- */
9374
- accountId: string;
9375
- /**
9376
- * Template name (lowercase, letters/numbers/underscores, must start with a letter)
9377
- */
9378
- name: string;
9379
- /**
9380
- * Template category
9381
- */
9382
- category: 'AUTHENTICATION' | 'MARKETING' | 'UTILITY';
9383
- /**
9384
- * Template language code (e.g., en_US)
9385
- */
9386
- language: string;
9387
- /**
9388
- * Template components (header, body, footer, buttons). Required for custom templates, omit when using library_template_name.
9389
- */
9390
- components?: Array<WhatsAppTemplateComponent>;
9391
- /**
9392
- * Name of a pre-built template from Meta's template library (e.g., "appointment_reminder",
9393
- * "auto_pay_reminder_1", "address_update"). When provided, the template is pre-approved
9394
- * by Meta with no review wait. Omit `components` when using this field.
9395
- *
9396
- */
9397
- library_template_name?: string;
9398
- /**
9399
- * Optional body customizations for library templates. Available options depend on the
9400
- * template (e.g., add_contact_number, add_learn_more_link, add_security_recommendation,
9401
- * add_track_package_link, code_expiration_minutes).
9402
- *
9403
- */
9404
- library_template_body_inputs?: {
9405
- [key: string]: unknown;
9406
- };
9407
- /**
9408
- * Optional button customizations for library templates. Each item specifies button type
9409
- * and configuration (e.g., URL, phone number, quick reply).
9410
- *
9411
- */
9412
- library_template_button_inputs?: Array<{
9413
- type?: 'quick_reply' | 'url' | 'phone_number';
9414
- url?: {
9415
- base_url?: string;
9416
- };
9417
- phone_number?: string;
9418
- }>;
9419
- };
9420
- };
9421
-
9422
- export type CreateWhatsAppTemplateResponse = ({
9423
- success?: boolean;
9424
- template?: {
9425
- id?: string;
9426
- name?: string;
9427
- /**
9428
- * APPROVED for library templates, PENDING for custom
9429
- */
9430
- status?: string;
9431
- category?: string;
9432
- language?: string;
9433
- };
9434
- });
9435
-
9436
- export type CreateWhatsAppTemplateError = (unknown | {
9437
- error?: string;
9438
- });
9439
-
9440
- export type GetWhatsAppTemplateData = {
9441
- path: {
9442
- /**
9443
- * Template name
9444
- */
9445
- templateName: string;
9446
- };
9447
- query: {
9448
- /**
9449
- * WhatsApp social account ID
9450
- */
9451
- accountId: string;
9452
- };
9453
- };
9454
-
9455
- export type GetWhatsAppTemplateResponse = ({
9456
- success?: boolean;
9457
- template?: {
9458
- id?: string;
9459
- name?: string;
9460
- status?: string;
9461
- category?: string;
9462
- language?: string;
9463
- components?: Array<{
9464
- [key: string]: unknown;
9465
- }>;
9466
- };
9467
- });
9468
-
9469
- export type GetWhatsAppTemplateError = (unknown | {
9470
- error?: string;
9471
- });
9472
-
9473
- export type UpdateWhatsAppTemplateData = {
9474
- body: {
9475
- /**
9476
- * WhatsApp social account ID
9477
- */
9478
- accountId: string;
9479
- /**
9480
- * Updated template components
9481
- */
9482
- components: Array<WhatsAppTemplateComponent>;
9483
- };
9484
- path: {
9485
- /**
9486
- * Template name
9487
- */
9488
- templateName: string;
9489
- };
9490
- };
9491
-
9492
- export type UpdateWhatsAppTemplateResponse = ({
9493
- success?: boolean;
9494
- template?: {
9495
- id?: string;
9496
- name?: string;
9497
- status?: string;
9498
- };
9499
- });
9500
-
9501
- export type UpdateWhatsAppTemplateError = (unknown | {
9502
- error?: string;
9503
- });
9504
-
9505
- export type DeleteWhatsAppTemplateData = {
9506
- path: {
9507
- /**
9508
- * Template name
9509
- */
9510
- templateName: string;
9511
- };
9512
- query: {
9513
- /**
9514
- * WhatsApp social account ID
9515
- */
9516
- accountId: string;
9517
- };
9518
- };
9519
-
9520
- export type DeleteWhatsAppTemplateResponse = ({
8748
+ export type DeleteWhatsAppTemplateResponse = ({
9521
8749
  success?: boolean;
9522
8750
  message?: string;
9523
8751
  });
@@ -9526,411 +8754,6 @@ export type DeleteWhatsAppTemplateError = (unknown | {
9526
8754
  error?: string;
9527
8755
  });
9528
8756
 
9529
- export type GetWhatsAppBroadcastsData = {
9530
- query: {
9531
- /**
9532
- * WhatsApp social account ID
9533
- */
9534
- accountId: string;
9535
- /**
9536
- * Maximum results (default 50)
9537
- */
9538
- limit?: number;
9539
- /**
9540
- * Offset for pagination
9541
- */
9542
- skip?: number;
9543
- /**
9544
- * Filter by broadcast status
9545
- */
9546
- status?: 'draft' | 'scheduled' | 'sending' | 'completed' | 'failed' | 'cancelled';
9547
- };
9548
- };
9549
-
9550
- export type GetWhatsAppBroadcastsResponse = ({
9551
- success?: boolean;
9552
- broadcasts?: Array<{
9553
- id?: string;
9554
- name?: string;
9555
- description?: string;
9556
- template?: {
9557
- name?: string;
9558
- language?: string;
9559
- };
9560
- status?: 'draft' | 'scheduled' | 'sending' | 'completed' | 'failed' | 'cancelled';
9561
- /**
9562
- * Template name or message text snippet
9563
- */
9564
- messagePreview?: string;
9565
- recipientCount?: number;
9566
- scheduledAt?: string;
9567
- startedAt?: string;
9568
- completedAt?: string;
9569
- sentCount?: number;
9570
- deliveredCount?: number;
9571
- readCount?: number;
9572
- failedCount?: number;
9573
- createdAt?: string;
9574
- }>;
9575
- pagination?: {
9576
- total?: number;
9577
- limit?: number;
9578
- skip?: number;
9579
- hasMore?: boolean;
9580
- };
9581
- });
9582
-
9583
- export type GetWhatsAppBroadcastsError = (unknown | {
9584
- error?: string;
9585
- });
9586
-
9587
- export type CreateWhatsAppBroadcastData = {
9588
- body: {
9589
- /**
9590
- * WhatsApp social account ID
9591
- */
9592
- accountId: string;
9593
- /**
9594
- * Broadcast name
9595
- */
9596
- name: string;
9597
- /**
9598
- * Broadcast description
9599
- */
9600
- description?: string;
9601
- template: {
9602
- /**
9603
- * Template name
9604
- */
9605
- name: string;
9606
- /**
9607
- * Template language code
9608
- */
9609
- language: string;
9610
- /**
9611
- * Base template components
9612
- */
9613
- components?: Array<{
9614
- [key: string]: unknown;
9615
- }>;
9616
- };
9617
- /**
9618
- * Initial recipients (optional)
9619
- */
9620
- recipients?: Array<{
9621
- /**
9622
- * Phone number in E.164 format
9623
- */
9624
- phone: string;
9625
- name?: string;
9626
- /**
9627
- * Per-recipient template variables
9628
- */
9629
- variables?: {
9630
- [key: string]: (string);
9631
- };
9632
- }>;
9633
- };
9634
- };
9635
-
9636
- export type CreateWhatsAppBroadcastResponse = ({
9637
- success?: boolean;
9638
- broadcast?: {
9639
- id?: string;
9640
- name?: string;
9641
- description?: string;
9642
- template?: {
9643
- [key: string]: unknown;
9644
- };
9645
- /**
9646
- * Always "draft" for new broadcasts
9647
- */
9648
- status?: string;
9649
- recipientCount?: number;
9650
- createdAt?: string;
9651
- };
9652
- });
9653
-
9654
- export type CreateWhatsAppBroadcastError = (unknown | {
9655
- error?: string;
9656
- });
9657
-
9658
- export type GetWhatsAppBroadcastData = {
9659
- path: {
9660
- /**
9661
- * Broadcast ID
9662
- */
9663
- broadcastId: string;
9664
- };
9665
- };
9666
-
9667
- export type GetWhatsAppBroadcastResponse = ({
9668
- success?: boolean;
9669
- broadcast?: {
9670
- id?: string;
9671
- name?: string;
9672
- description?: string;
9673
- template?: {
9674
- [key: string]: unknown;
9675
- };
9676
- status?: 'draft' | 'scheduled' | 'sending' | 'completed' | 'failed' | 'cancelled';
9677
- recipientCount?: number;
9678
- scheduledAt?: string;
9679
- startedAt?: string;
9680
- completedAt?: string;
9681
- sentCount?: number;
9682
- deliveredCount?: number;
9683
- readCount?: number;
9684
- failedCount?: number;
9685
- createdAt?: string;
9686
- updatedAt?: string;
9687
- };
9688
- });
9689
-
9690
- export type GetWhatsAppBroadcastError = ({
9691
- error?: string;
9692
- });
9693
-
9694
- export type DeleteWhatsAppBroadcastData = {
9695
- path: {
9696
- /**
9697
- * Broadcast ID
9698
- */
9699
- broadcastId: string;
9700
- };
9701
- };
9702
-
9703
- export type DeleteWhatsAppBroadcastResponse = ({
9704
- success?: boolean;
9705
- message?: string;
9706
- });
9707
-
9708
- export type DeleteWhatsAppBroadcastError = (unknown | {
9709
- error?: string;
9710
- });
9711
-
9712
- export type SendWhatsAppBroadcastData = {
9713
- path: {
9714
- /**
9715
- * Broadcast ID
9716
- */
9717
- broadcastId: string;
9718
- };
9719
- };
9720
-
9721
- export type SendWhatsAppBroadcastResponse = ({
9722
- success?: boolean;
9723
- /**
9724
- * Final broadcast status
9725
- */
9726
- status?: 'completed' | 'failed';
9727
- /**
9728
- * Number of messages sent successfully
9729
- */
9730
- sent?: number;
9731
- /**
9732
- * Number of messages that failed
9733
- */
9734
- failed?: number;
9735
- /**
9736
- * Total recipient count
9737
- */
9738
- total?: number;
9739
- });
9740
-
9741
- export type SendWhatsAppBroadcastError = (unknown | {
9742
- error?: string;
9743
- });
9744
-
9745
- export type ScheduleWhatsAppBroadcastData = {
9746
- body: {
9747
- /**
9748
- * ISO 8601 date-time for sending (must be in the future, max 30 days)
9749
- */
9750
- scheduledAt: string;
9751
- };
9752
- path: {
9753
- /**
9754
- * Broadcast ID
9755
- */
9756
- broadcastId: string;
9757
- };
9758
- };
9759
-
9760
- export type ScheduleWhatsAppBroadcastResponse = ({
9761
- success?: boolean;
9762
- broadcast?: {
9763
- id?: string;
9764
- /**
9765
- * "scheduled"
9766
- */
9767
- status?: string;
9768
- scheduledAt?: string;
9769
- };
9770
- });
9771
-
9772
- export type ScheduleWhatsAppBroadcastError = (unknown | {
9773
- error?: string;
9774
- });
9775
-
9776
- export type CancelWhatsAppBroadcastScheduleData = {
9777
- path: {
9778
- /**
9779
- * Broadcast ID
9780
- */
9781
- broadcastId: string;
9782
- };
9783
- };
9784
-
9785
- export type CancelWhatsAppBroadcastScheduleResponse = ({
9786
- success?: boolean;
9787
- broadcast?: {
9788
- id?: string;
9789
- /**
9790
- * "draft"
9791
- */
9792
- status?: string;
9793
- };
9794
- message?: string;
9795
- });
9796
-
9797
- export type CancelWhatsAppBroadcastScheduleError = (unknown | {
9798
- error?: string;
9799
- });
9800
-
9801
- export type GetWhatsAppBroadcastRecipientsData = {
9802
- path: {
9803
- /**
9804
- * Broadcast ID
9805
- */
9806
- broadcastId: string;
9807
- };
9808
- query?: {
9809
- /**
9810
- * Maximum results (default 100)
9811
- */
9812
- limit?: number;
9813
- /**
9814
- * Offset for pagination
9815
- */
9816
- skip?: number;
9817
- /**
9818
- * Filter by recipient delivery status
9819
- */
9820
- status?: 'pending' | 'sent' | 'delivered' | 'read' | 'failed';
9821
- };
9822
- };
9823
-
9824
- export type GetWhatsAppBroadcastRecipientsResponse = ({
9825
- success?: boolean;
9826
- recipients?: Array<{
9827
- phone?: string;
9828
- name?: string;
9829
- variables?: {
9830
- [key: string]: unknown;
9831
- };
9832
- status?: 'pending' | 'sent' | 'delivered' | 'read' | 'failed';
9833
- messageId?: string;
9834
- error?: string;
9835
- sentAt?: string;
9836
- deliveredAt?: string;
9837
- readAt?: string;
9838
- }>;
9839
- pagination?: {
9840
- total?: number;
9841
- limit?: number;
9842
- skip?: number;
9843
- hasMore?: boolean;
9844
- };
9845
- summary?: {
9846
- total?: number;
9847
- pending?: number;
9848
- sent?: number;
9849
- delivered?: number;
9850
- read?: number;
9851
- failed?: number;
9852
- };
9853
- });
9854
-
9855
- export type GetWhatsAppBroadcastRecipientsError = ({
9856
- error?: string;
9857
- });
9858
-
9859
- export type AddWhatsAppBroadcastRecipientsData = {
9860
- body: {
9861
- /**
9862
- * Recipients to add (max 1000)
9863
- */
9864
- recipients: Array<{
9865
- /**
9866
- * Phone number in E.164 format
9867
- */
9868
- phone: string;
9869
- name?: string;
9870
- variables?: {
9871
- [key: string]: (string);
9872
- };
9873
- }>;
9874
- };
9875
- path: {
9876
- /**
9877
- * Broadcast ID
9878
- */
9879
- broadcastId: string;
9880
- };
9881
- };
9882
-
9883
- export type AddWhatsAppBroadcastRecipientsResponse = ({
9884
- success?: boolean;
9885
- /**
9886
- * Number of new recipients added
9887
- */
9888
- added?: number;
9889
- /**
9890
- * Number of duplicate phone numbers skipped
9891
- */
9892
- duplicates?: number;
9893
- /**
9894
- * Total recipient count after addition
9895
- */
9896
- totalRecipients?: number;
9897
- });
9898
-
9899
- export type AddWhatsAppBroadcastRecipientsError = (unknown | {
9900
- error?: string;
9901
- });
9902
-
9903
- export type RemoveWhatsAppBroadcastRecipientsData = {
9904
- body: {
9905
- /**
9906
- * Phone numbers to remove
9907
- */
9908
- phones: Array<(string)>;
9909
- };
9910
- path: {
9911
- /**
9912
- * Broadcast ID
9913
- */
9914
- broadcastId: string;
9915
- };
9916
- };
9917
-
9918
- export type RemoveWhatsAppBroadcastRecipientsResponse = ({
9919
- success?: boolean;
9920
- /**
9921
- * Number of recipients removed
9922
- */
9923
- removed?: number;
9924
- /**
9925
- * Remaining recipient count
9926
- */
9927
- totalRecipients?: number;
9928
- });
9929
-
9930
- export type RemoveWhatsAppBroadcastRecipientsError = (unknown | {
9931
- error?: string;
9932
- });
9933
-
9934
8757
  export type GetWhatsAppBusinessProfileData = {
9935
8758
  query: {
9936
8759
  /**