@zernio/node 0.2.56 → 0.2.57

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.
@@ -442,102 +442,6 @@ export type BlueskyPlatformData = {
442
442
  }>;
443
443
  };
444
444
 
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
445
  export type ErrorResponse = {
542
446
  error?: string;
543
447
  details?: {
@@ -777,7 +681,7 @@ export type InboxWebhookMessage = {
777
681
  isRead: boolean;
778
682
  };
779
683
 
780
- export type platform3 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp';
684
+ export type platform2 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp';
781
685
 
782
686
  export type direction = 'incoming' | 'outgoing';
783
687
 
@@ -1387,6 +1291,8 @@ export type PostLog = {
1387
1291
  createdAt?: string;
1388
1292
  };
1389
1293
 
1294
+ export type platform3 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord';
1295
+
1390
1296
  /**
1391
1297
  * Type of action logged: publish (initial attempt), retry (after failure), media_upload, rate_limit_pause, token_refresh, cancelled
1392
1298
  */
@@ -1734,19 +1640,6 @@ export type SocialAccount = {
1734
1640
  *
1735
1641
  */
1736
1642
  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
1643
  /**
1751
1644
  * Platform-specific metadata. Fields vary by platform. For WhatsApp accounts, includes:
1752
1645
  * - `qualityRating`: Phone number quality rating from Meta (`GREEN`, `YELLOW`, `RED`, or `UNKNOWN`)
@@ -1765,20 +1658,6 @@ export type SocialAccount = {
1765
1658
 
1766
1659
  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
1660
 
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
1661
  /**
1783
1662
  * 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
1663
  */
@@ -2078,55 +1957,6 @@ export type Webhook = {
2078
1957
  };
2079
1958
  };
2080
1959
 
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
1960
  /**
2131
1961
  * Webhook payload for account connected events
2132
1962
  */
@@ -2152,7 +1982,7 @@ export type WebhookPayloadAccountConnected = {
2152
1982
  timestamp: string;
2153
1983
  };
2154
1984
 
2155
- export type event2 = 'account.connected';
1985
+ export type event = 'account.connected';
2156
1986
 
2157
1987
  /**
2158
1988
  * Webhook payload for account disconnected events
@@ -2187,7 +2017,7 @@ export type WebhookPayloadAccountDisconnected = {
2187
2017
  timestamp: string;
2188
2018
  };
2189
2019
 
2190
- export type event3 = 'account.disconnected';
2020
+ export type event2 = 'account.disconnected';
2191
2021
 
2192
2022
  /**
2193
2023
  * Whether the disconnection was intentional (user action) or unintentional (token expired/revoked)
@@ -2261,7 +2091,7 @@ export type WebhookPayloadComment = {
2261
2091
  timestamp: string;
2262
2092
  };
2263
2093
 
2264
- export type event4 = 'comment.received';
2094
+ export type event3 = 'comment.received';
2265
2095
 
2266
2096
  export type platform5 = 'instagram' | 'facebook' | 'twitter' | 'youtube' | 'linkedin' | 'bluesky' | 'reddit';
2267
2097
 
@@ -2381,7 +2211,7 @@ export type WebhookPayloadMessage = {
2381
2211
  timestamp: string;
2382
2212
  };
2383
2213
 
2384
- export type event5 = 'message.received';
2214
+ export type event4 = 'message.received';
2385
2215
 
2386
2216
  /**
2387
2217
  * Webhook payload for `message.deleted` events. Fires when the sender
@@ -2405,7 +2235,7 @@ export type WebhookPayloadMessageDeleted = {
2405
2235
  timestamp: string;
2406
2236
  };
2407
2237
 
2408
- export type event6 = 'message.deleted';
2238
+ export type event5 = 'message.deleted';
2409
2239
 
2410
2240
  /**
2411
2241
  * Shared payload for `message.delivered`, `message.read`, and
@@ -2440,7 +2270,7 @@ export type WebhookPayloadMessageDeliveryStatus = {
2440
2270
  timestamp: string;
2441
2271
  };
2442
2272
 
2443
- export type event7 = 'message.delivered' | 'message.read' | 'message.failed';
2273
+ export type event6 = 'message.delivered' | 'message.read' | 'message.failed';
2444
2274
 
2445
2275
  /**
2446
2276
  * Webhook payload for `message.edited` events. Fires when the sender
@@ -2482,7 +2312,7 @@ export type WebhookPayloadMessageEdited = {
2482
2312
  timestamp: string;
2483
2313
  };
2484
2314
 
2485
- export type event8 = 'message.edited';
2315
+ export type event7 = 'message.edited';
2486
2316
 
2487
2317
  /**
2488
2318
  * Webhook payload for message sent events (fired when a message is sent via the API)
@@ -2558,7 +2388,7 @@ export type WebhookPayloadMessageSent = {
2558
2388
  timestamp: string;
2559
2389
  };
2560
2390
 
2561
- export type event9 = 'message.sent';
2391
+ export type event8 = 'message.sent';
2562
2392
 
2563
2393
  /**
2564
2394
  * Webhook payload for post events
@@ -2586,7 +2416,7 @@ export type WebhookPayloadPost = {
2586
2416
  timestamp: string;
2587
2417
  };
2588
2418
 
2589
- export type event10 = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled';
2419
+ export type event9 = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled';
2590
2420
 
2591
2421
  /**
2592
2422
  * Webhook payload for test deliveries
@@ -2604,7 +2434,7 @@ export type WebhookPayloadTest = {
2604
2434
  timestamp: string;
2605
2435
  };
2606
2436
 
2607
- export type event11 = 'webhook.test';
2437
+ export type event10 = 'webhook.test';
2608
2438
 
2609
2439
  export type WhatsAppBodyComponent = {
2610
2440
  type: 'body';
@@ -4323,29 +4153,6 @@ export type DeleteAccountError = ({
4323
4153
  error?: string;
4324
4154
  });
4325
4155
 
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
4156
  export type GetAllAccountsHealthData = {
4350
4157
  query?: {
4351
4158
  /**
@@ -7075,139 +6882,6 @@ export type ListLogsError = ({
7075
6882
  error?: string;
7076
6883
  });
7077
6884
 
7078
- export type GetWebhookLogsData = {
7079
- query?: {
7080
- /**
7081
- * Filter by event type
7082
- */
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';
7084
- /**
7085
- * Maximum number of logs to return (max 100)
7086
- */
7087
- limit?: number;
7088
- /**
7089
- * Filter by delivery status
7090
- */
7091
- status?: 'success' | 'failed';
7092
- /**
7093
- * Filter by webhook ID
7094
- */
7095
- webhookId?: string;
7096
- };
7097
- };
7098
-
7099
- export type GetWebhookLogsResponse = ({
7100
- logs?: Array<WebhookLog>;
7101
- });
7102
-
7103
- export type GetWebhookLogsError = ({
7104
- error?: string;
7105
- });
7106
-
7107
- export type ListPostsLogsData = {
7108
- query?: {
7109
- /**
7110
- * Filter by action type
7111
- */
7112
- action?: 'publish' | 'retry' | 'media_upload' | 'rate_limit_pause' | 'token_refresh' | 'cancelled' | 'all';
7113
- /**
7114
- * Number of days to look back (max 7)
7115
- */
7116
- days?: number;
7117
- /**
7118
- * Maximum number of logs to return (max 100)
7119
- */
7120
- limit?: number;
7121
- /**
7122
- * Filter by platform
7123
- */
7124
- platform?: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'all';
7125
- /**
7126
- * Search through log entries by text content.
7127
- */
7128
- search?: string;
7129
- /**
7130
- * Number of logs to skip (for pagination)
7131
- */
7132
- skip?: number;
7133
- /**
7134
- * Filter by log status
7135
- */
7136
- status?: 'success' | 'failed' | 'pending' | 'skipped' | 'all';
7137
- };
7138
- };
7139
-
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;
7175
- /**
7176
- * Filter by platform
7177
- */
7178
- platform?: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'all';
7179
- /**
7180
- * Number of logs to skip (for pagination)
7181
- */
7182
- skip?: number;
7183
- /**
7184
- * Filter by status (shorthand for event types)
7185
- */
7186
- status?: 'success' | 'failed' | 'all';
7187
- };
7188
- };
7189
-
7190
- export type ListConnectionLogsResponse = ({
7191
- logs?: Array<ConnectionLog>;
7192
- pagination?: {
7193
- /**
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
6885
  export type GetPostLogsData = {
7212
6886
  path: {
7213
6887
  /**
@@ -8797,1140 +8471,196 @@ export type DeleteInboxReviewReplyError = ({
8797
8471
  error?: string;
8798
8472
  } | unknown);
8799
8473
 
8800
- export type SendWhatsAppBulkData = {
8801
- body: {
8474
+ export type GetWhatsAppTemplatesData = {
8475
+ query: {
8802
8476
  /**
8803
8477
  * WhatsApp social account ID
8804
8478
  */
8805
8479
  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
8480
  };
8838
8481
  };
8839
8482
 
8840
- export type SendWhatsAppBulkResponse = ({
8483
+ export type GetWhatsAppTemplatesResponse = ({
8841
8484
  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: {
8485
+ templates?: Array<{
8861
8486
  /**
8862
- * WhatsApp social account ID
8487
+ * WhatsApp template ID
8863
8488
  */
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;
8885
- /**
8886
- * Filter by tag
8887
- */
8888
- tag?: string;
8889
- };
8890
- };
8891
-
8892
- export type GetWhatsAppContactsResponse = ({
8893
- success?: boolean;
8894
- contacts?: Array<{
8895
8489
  id?: string;
8896
- phone?: string;
8897
- waId?: string;
8898
8490
  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?: {
8491
+ status?: 'APPROVED' | 'PENDING' | 'REJECTED';
8492
+ category?: 'AUTHENTICATION' | 'MARKETING' | 'UTILITY';
8493
+ language?: string;
8494
+ components?: Array<{
8909
8495
  [key: string]: unknown;
8910
- };
8911
- notes?: string;
8912
- createdAt?: string;
8496
+ }>;
8913
8497
  }>;
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
8498
  });
8925
8499
 
8926
- export type GetWhatsAppContactsError = (unknown | {
8500
+ export type GetWhatsAppTemplatesError = (unknown | {
8927
8501
  error?: string;
8928
8502
  });
8929
8503
 
8930
- export type CreateWhatsAppContactData = {
8504
+ export type CreateWhatsAppTemplateData = {
8931
8505
  body: {
8932
8506
  /**
8933
8507
  * WhatsApp social account ID
8934
8508
  */
8935
8509
  accountId: string;
8936
8510
  /**
8937
- * Phone number in E.164 format
8938
- */
8939
- phone: string;
8940
- /**
8941
- * Contact name
8511
+ * Template name (lowercase, letters/numbers/underscores, must start with a letter)
8942
8512
  */
8943
8513
  name: string;
8944
8514
  /**
8945
- * Contact email
8946
- */
8947
- email?: string;
8948
- /**
8949
- * Company name
8515
+ * Template category
8950
8516
  */
8951
- company?: string;
8517
+ category: 'AUTHENTICATION' | 'MARKETING' | 'UTILITY';
8952
8518
  /**
8953
- * Tags for categorization
8519
+ * Template language code (e.g., en_US)
8954
8520
  */
8955
- tags?: Array<(string)>;
8521
+ language: string;
8956
8522
  /**
8957
- * Groups the contact belongs to
8523
+ * Template components (header, body, footer, buttons). Required for custom templates, omit when using library_template_name.
8958
8524
  */
8959
- groups?: Array<(string)>;
8525
+ components?: Array<WhatsAppTemplateComponent>;
8960
8526
  /**
8961
- * Whether the contact has opted in to receive messages
8527
+ * Name of a pre-built template from Meta's template library (e.g., "appointment_reminder",
8528
+ * "auto_pay_reminder_1", "address_update"). When provided, the template is pre-approved
8529
+ * by Meta with no review wait. Omit `components` when using this field.
8530
+ *
8962
8531
  */
8963
- isOptedIn?: boolean;
8532
+ library_template_name?: string;
8964
8533
  /**
8965
- * Custom key-value fields
8534
+ * Optional body customizations for library templates. Available options depend on the
8535
+ * template (e.g., add_contact_number, add_learn_more_link, add_security_recommendation,
8536
+ * add_track_package_link, code_expiration_minutes).
8537
+ *
8966
8538
  */
8967
- customFields?: {
8968
- [key: string]: (string);
8539
+ library_template_body_inputs?: {
8540
+ [key: string]: unknown;
8969
8541
  };
8970
8542
  /**
8971
- * Notes about the contact
8543
+ * Optional button customizations for library templates. Each item specifies button type
8544
+ * and configuration (e.g., URL, phone number, quick reply).
8545
+ *
8972
8546
  */
8973
- notes?: string;
8547
+ library_template_button_inputs?: Array<{
8548
+ type?: 'quick_reply' | 'url' | 'phone_number';
8549
+ url?: {
8550
+ base_url?: string;
8551
+ };
8552
+ phone_number?: string;
8553
+ }>;
8974
8554
  };
8975
8555
  };
8976
8556
 
8977
- export type CreateWhatsAppContactResponse = ({
8557
+ export type CreateWhatsAppTemplateResponse = ({
8978
8558
  success?: boolean;
8979
- contact?: {
8559
+ template?: {
8980
8560
  id?: string;
8981
- phone?: string;
8982
8561
  name?: string;
8983
- email?: string;
8984
- company?: string;
8985
- tags?: Array<(string)>;
8986
- groups?: Array<(string)>;
8987
- isOptedIn?: boolean;
8988
- createdAt?: string;
8562
+ /**
8563
+ * APPROVED for library templates, PENDING for custom
8564
+ */
8565
+ status?: string;
8566
+ category?: string;
8567
+ language?: string;
8989
8568
  };
8990
8569
  });
8991
8570
 
8992
- export type CreateWhatsAppContactError = (unknown | {
8571
+ export type CreateWhatsAppTemplateError = (unknown | {
8993
8572
  error?: string;
8994
8573
  });
8995
8574
 
8996
- export type GetWhatsAppContactData = {
8575
+ export type GetWhatsAppTemplateData = {
8997
8576
  path: {
8998
8577
  /**
8999
- * Contact ID
8578
+ * Template name
9000
8579
  */
9001
- contactId: string;
8580
+ templateName: string;
8581
+ };
8582
+ query: {
8583
+ /**
8584
+ * WhatsApp social account ID
8585
+ */
8586
+ accountId: string;
9002
8587
  };
9003
8588
  };
9004
8589
 
9005
- export type GetWhatsAppContactResponse = ({
8590
+ export type GetWhatsAppTemplateResponse = ({
9006
8591
  success?: boolean;
9007
- contact?: {
8592
+ template?: {
9008
8593
  id?: string;
9009
- phone?: string;
9010
- waId?: string;
9011
8594
  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?: {
8595
+ status?: string;
8596
+ category?: string;
8597
+ language?: string;
8598
+ components?: Array<{
9025
8599
  [key: string]: unknown;
9026
- };
9027
- notes?: string;
9028
- createdAt?: string;
9029
- updatedAt?: string;
8600
+ }>;
9030
8601
  };
9031
8602
  });
9032
8603
 
9033
- export type GetWhatsAppContactError = ({
8604
+ export type GetWhatsAppTemplateError = (unknown | {
9034
8605
  error?: string;
9035
8606
  });
9036
8607
 
9037
- export type UpdateWhatsAppContactData = {
8608
+ export type UpdateWhatsAppTemplateData = {
9038
8609
  body: {
9039
8610
  /**
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)
8611
+ * WhatsApp social account ID
9069
8612
  */
9070
- customFields?: {
9071
- [key: string]: ((string) | null);
9072
- };
8613
+ accountId: string;
9073
8614
  /**
9074
- * Notes about the contact
8615
+ * Updated template components
9075
8616
  */
9076
- notes?: string;
8617
+ components: Array<WhatsAppTemplateComponent>;
9077
8618
  };
9078
8619
  path: {
9079
8620
  /**
9080
- * Contact ID
8621
+ * Template name
9081
8622
  */
9082
- contactId: string;
8623
+ templateName: string;
9083
8624
  };
9084
8625
  };
9085
8626
 
9086
- export type UpdateWhatsAppContactResponse = ({
8627
+ export type UpdateWhatsAppTemplateResponse = ({
9087
8628
  success?: boolean;
9088
- contact?: {
8629
+ template?: {
9089
8630
  id?: string;
9090
- phone?: string;
9091
8631
  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;
8632
+ status?: string;
9103
8633
  };
9104
8634
  });
9105
8635
 
9106
- export type UpdateWhatsAppContactError = ({
8636
+ export type UpdateWhatsAppTemplateError = (unknown | {
9107
8637
  error?: string;
9108
8638
  });
9109
8639
 
9110
- export type DeleteWhatsAppContactData = {
8640
+ export type DeleteWhatsAppTemplateData = {
9111
8641
  path: {
9112
8642
  /**
9113
- * Contact ID
8643
+ * Template name
9114
8644
  */
9115
- contactId: string;
8645
+ templateName: string;
9116
8646
  };
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: {
8647
+ query: {
9130
8648
  /**
9131
8649
  * WhatsApp social account ID
9132
8650
  */
9133
8651
  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
8652
  };
9210
8653
  };
9211
8654
 
9212
- export type BulkUpdateWhatsAppContactsResponse = ({
8655
+ export type DeleteWhatsAppTemplateResponse = ({
9213
8656
  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)
9233
- */
9234
- contactIds: Array<(string)>;
9235
- };
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
- query: {
9252
- /**
9253
- * WhatsApp social account ID
9254
- */
9255
- accountId: string;
9256
- };
9257
- };
9258
-
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 = ({
9521
- success?: boolean;
9522
- message?: string;
8657
+ message?: string;
9523
8658
  });
9524
8659
 
9525
8660
  export type DeleteWhatsAppTemplateError = (unknown | {
9526
8661
  error?: string;
9527
8662
  });
9528
8663
 
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
8664
  export type GetWhatsAppBusinessProfileData = {
9935
8665
  query: {
9936
8666
  /**