@wirecat/whatsapp-cli 0.4.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/README.md +9 -3
  2. package/dist/adapter/adapter.d.ts +4 -2
  3. package/dist/adapter/adapter.d.ts.map +1 -1
  4. package/dist/adapter/adapter.js +20 -406
  5. package/dist/adapter/adapter.js.map +1 -1
  6. package/dist/adapter/channels.d.ts.map +1 -1
  7. package/dist/adapter/channels.js.map +1 -1
  8. package/dist/adapter/comments.d.ts +5 -0
  9. package/dist/adapter/comments.d.ts.map +1 -0
  10. package/dist/adapter/comments.js +14 -0
  11. package/dist/adapter/comments.js.map +1 -0
  12. package/dist/adapter/discovery.d.ts +5 -0
  13. package/dist/adapter/discovery.d.ts.map +1 -0
  14. package/dist/adapter/discovery.js +28 -0
  15. package/dist/adapter/discovery.js.map +1 -0
  16. package/dist/adapter/errors.d.ts +1 -1
  17. package/dist/adapter/errors.d.ts.map +1 -1
  18. package/dist/adapter/errors.js +4 -2
  19. package/dist/adapter/errors.js.map +1 -1
  20. package/dist/adapter/groups.d.ts.map +1 -1
  21. package/dist/adapter/groups.js +1 -1
  22. package/dist/adapter/groups.js.map +1 -1
  23. package/dist/adapter/listen.d.ts +11 -0
  24. package/dist/adapter/listen.d.ts.map +1 -0
  25. package/dist/adapter/listen.js +264 -0
  26. package/dist/adapter/listen.js.map +1 -0
  27. package/dist/adapter/map.d.ts +1 -1
  28. package/dist/adapter/map.d.ts.map +1 -1
  29. package/dist/adapter/map.js +13 -22
  30. package/dist/adapter/map.js.map +1 -1
  31. package/dist/adapter/polls.d.ts +2 -1
  32. package/dist/adapter/polls.d.ts.map +1 -1
  33. package/dist/adapter/polls.js +14 -3
  34. package/dist/adapter/polls.js.map +1 -1
  35. package/dist/adapter/privacy.d.ts.map +1 -1
  36. package/dist/adapter/privacy.js +26 -11
  37. package/dist/adapter/privacy.js.map +1 -1
  38. package/dist/adapter/sends.d.ts +14 -0
  39. package/dist/adapter/sends.d.ts.map +1 -0
  40. package/dist/adapter/sends.js +156 -0
  41. package/dist/adapter/sends.js.map +1 -0
  42. package/dist/adapter/settings.js +4 -1
  43. package/dist/adapter/settings.js.map +1 -1
  44. package/dist/app.d.ts +8 -0
  45. package/dist/app.d.ts.map +1 -1
  46. package/dist/app.js +20 -1
  47. package/dist/app.js.map +1 -1
  48. package/dist/bot/adapter.d.ts +18 -0
  49. package/dist/bot/adapter.d.ts.map +1 -0
  50. package/dist/bot/adapter.js +74 -0
  51. package/dist/bot/adapter.js.map +1 -0
  52. package/dist/bot/generated/definitions.d.ts +3 -0
  53. package/dist/bot/generated/definitions.d.ts.map +1 -0
  54. package/dist/bot/generated/definitions.js +9254 -0
  55. package/dist/bot/generated/definitions.js.map +1 -0
  56. package/dist/bot/generated/manifest.d.ts +3 -0
  57. package/dist/bot/generated/manifest.d.ts.map +1 -0
  58. package/dist/bot/generated/manifest.js +2614 -0
  59. package/dist/bot/generated/manifest.js.map +1 -0
  60. package/dist/bot/generated/schemas.d.ts +803 -0
  61. package/dist/bot/generated/schemas.d.ts.map +1 -0
  62. package/dist/bot/generated/schemas.js +3052 -0
  63. package/dist/bot/generated/schemas.js.map +1 -0
  64. package/dist/bot/generated/types.d.ts +3439 -0
  65. package/dist/bot/generated/types.d.ts.map +1 -0
  66. package/dist/bot/generated/types.js +5 -0
  67. package/dist/bot/generated/types.js.map +1 -0
  68. package/dist/bot/graph.d.ts +53 -0
  69. package/dist/bot/graph.d.ts.map +1 -0
  70. package/dist/bot/graph.js +141 -0
  71. package/dist/bot/graph.js.map +1 -0
  72. package/dist/bot/messaging.d.ts +30 -0
  73. package/dist/bot/messaging.d.ts.map +1 -0
  74. package/dist/bot/messaging.js +124 -0
  75. package/dist/bot/messaging.js.map +1 -0
  76. package/dist/bot/mime.d.ts +3 -0
  77. package/dist/bot/mime.d.ts.map +1 -0
  78. package/dist/bot/mime.js +20 -0
  79. package/dist/bot/mime.js.map +1 -0
  80. package/dist/bot/webhook.d.ts +13 -0
  81. package/dist/bot/webhook.d.ts.map +1 -0
  82. package/dist/bot/webhook.js +148 -0
  83. package/dist/bot/webhook.js.map +1 -0
  84. package/dist/commands/bot-templates.d.ts +9 -0
  85. package/dist/commands/bot-templates.d.ts.map +1 -0
  86. package/dist/commands/bot-templates.js +141 -0
  87. package/dist/commands/bot-templates.js.map +1 -0
  88. package/dist/commands/bot.d.ts +14 -0
  89. package/dist/commands/bot.d.ts.map +1 -0
  90. package/dist/commands/bot.js +208 -0
  91. package/dist/commands/bot.js.map +1 -0
  92. package/dist/commands/session.d.ts +0 -44
  93. package/dist/commands/session.d.ts.map +1 -1
  94. package/dist/commands/session.js +15 -141
  95. package/dist/commands/session.js.map +1 -1
  96. package/dist/commands/setup.d.ts.map +1 -1
  97. package/dist/commands/setup.js +9 -8
  98. package/dist/commands/setup.js.map +1 -1
  99. package/dist/commands/update.d.ts +2 -1
  100. package/dist/commands/update.d.ts.map +1 -1
  101. package/dist/commands/update.js.map +1 -1
  102. package/dist/diagnose.d.ts +6 -41
  103. package/dist/diagnose.d.ts.map +1 -1
  104. package/dist/diagnose.js.map +1 -1
  105. package/dist/engine/channels.d.ts +1 -0
  106. package/dist/engine/channels.d.ts.map +1 -1
  107. package/dist/engine/contract.d.ts +32 -2
  108. package/dist/engine/contract.d.ts.map +1 -1
  109. package/dist/engine/contract.js +9 -1
  110. package/dist/engine/contract.js.map +1 -1
  111. package/dist/engine/discovery.d.ts +34 -0
  112. package/dist/engine/discovery.d.ts.map +1 -0
  113. package/dist/engine/discovery.js +22 -0
  114. package/dist/engine/discovery.js.map +1 -0
  115. package/dist/engine/events.d.ts +1 -1
  116. package/dist/engine/events.d.ts.map +1 -1
  117. package/dist/engine/events.js.map +1 -1
  118. package/dist/engine/go-engine.d.ts.map +1 -1
  119. package/dist/engine/go-engine.js +4 -0
  120. package/dist/engine/go-engine.js.map +1 -1
  121. package/dist/messenger.d.ts +4 -1
  122. package/dist/messenger.d.ts.map +1 -1
  123. package/dist/messenger.js +8 -10
  124. package/dist/messenger.js.map +1 -1
  125. package/dist/program.d.ts.map +1 -1
  126. package/dist/program.js +8 -2
  127. package/dist/program.js.map +1 -1
  128. package/dist/session.d.ts +56 -0
  129. package/dist/session.d.ts.map +1 -0
  130. package/dist/session.js +136 -0
  131. package/dist/session.js.map +1 -0
  132. package/dist/version.d.ts +1 -1
  133. package/dist/version.js +1 -1
  134. package/package.json +16 -11
  135. package/skills/whatsapp-cli/SKILL.md +16 -13
@@ -0,0 +1,3439 @@
1
+ /** Connected client business information and configuration */
2
+ export type ConnectedClientBusiness = {
3
+ /** Unique identifier for the connected client business */
4
+ id: string;
5
+ /** Name of the connected client business */
6
+ name: string;
7
+ verification_status?: BusinessVerificationStatus;
8
+ business_status?: BusinessStatus;
9
+ /** Timestamp when the business connection was created */
10
+ created_time?: string;
11
+ /** Timestamp when the business connection was last updated */
12
+ updated_time?: string;
13
+ };
14
+ /** Verification status of the connected client business */
15
+ export type BusinessVerificationStatus = "VERIFIED" | "UNVERIFIED" | "PENDING" | "REJECTED";
16
+ /** Current status of the connected client business */
17
+ export type BusinessStatus = "ACTIVE" | "INACTIVE" | "SUSPENDED" | "PENDING_APPROVAL";
18
+ /** Response containing list of connected client businesses */
19
+ export type ConnectedClientBusinessesResponse = {
20
+ /** Array of connected client businesses */
21
+ data?: Array<ConnectedClientBusiness>;
22
+ paging?: CursorPaging;
23
+ };
24
+ /** Cursor-based pagination information */
25
+ export type CursorPaging = {
26
+ cursors?: {
27
+ /** Cursor pointing to the start of the page of data */
28
+ before?: string;
29
+ /** Cursor pointing to the end of the page of data */
30
+ after?: string;
31
+ };
32
+ /** URL for the previous page of results */
33
+ previous?: string;
34
+ /** URL for the next page of results */
35
+ next?: string;
36
+ };
37
+ /** Standard Graph API error response */
38
+ export type GraphAPIError = {
39
+ error: {
40
+ /** Human-readable error message */
41
+ message: string;
42
+ /** Error category type */
43
+ type: string;
44
+ /** Numeric error code */
45
+ code: number;
46
+ /** More specific error subcode when available */
47
+ error_subcode?: number;
48
+ /** Unique identifier for debugging and support requests with Meta */
49
+ fbtrace_id?: string;
50
+ /** Indicates whether this error is temporary and the request should be retried */
51
+ is_transient?: boolean;
52
+ /** User-friendly error title for display purposes */
53
+ error_user_title?: string;
54
+ /** User-friendly error message for display purposes */
55
+ error_user_msg?: string;
56
+ };
57
+ };
58
+ /** Request payload for creating a Multi-Partner Solution */
59
+ export type WhatsAppBusinessSolutionCreateRequest = {
60
+ /** Configurable permissions granted to the solution owner app. Currently supports only MESSAGING permission. Use empty array if owner should not have configurable permissions. */
61
+ owner_permissions: Array<WhatsAppBusinessAccountConfigurablePermissionTask>;
62
+ /** Facebook Application ID of the partner app that will participate in this solution. Must be a valid application ID accessible to the requesting entity. */
63
+ partner_app_id: string;
64
+ /** Configurable permissions granted to the partner app. Currently supports only MESSAGING permission. Use empty array if partner should not have configurable permissions. */
65
+ partner_permissions: Array<WhatsAppBusinessAccountConfigurablePermissionTask>;
66
+ /** Human-readable name for the Multi-Partner Solution. Used for identification and management purposes in partner dashboards and solution management interfaces. */
67
+ solution_name: string;
68
+ };
69
+ /** Successful response containing the created solution identifier */
70
+ export type WhatsAppBusinessSolutionCreateResponse = {
71
+ /** Unique identifier for the newly created Multi-Partner Solution. Use this ID for subsequent solution management operations. */
72
+ solution_id: string;
73
+ };
74
+ /** Configurable permission tasks for WhatsApp Business Account access in Multi-Partner Solutions. Currently only MESSAGING permission is configurable through this API. */
75
+ export type WhatsAppBusinessAccountConfigurablePermissionTask = "MESSAGING";
76
+ /** Standard Graph API error response structure */
77
+ export type GraphAPIError1 = {
78
+ error: {
79
+ /** Human-readable error message describing the issue */
80
+ message: string;
81
+ /** Error type classification for programmatic handling */
82
+ type: string;
83
+ /** Numeric error code for specific error identification */
84
+ code: number;
85
+ /** More specific error subcode when applicable */
86
+ error_subcode?: number;
87
+ /** Facebook trace ID for debugging and support purposes */
88
+ fbtrace_id?: string;
89
+ /** Indicates whether this error is temporary and the request should be retried */
90
+ is_transient?: boolean;
91
+ /** User-friendly error title for display purposes */
92
+ error_user_title?: string;
93
+ /** User-friendly error message for display purposes */
94
+ error_user_msg?: string;
95
+ };
96
+ };
97
+ /** Multi-Partner Solution details and configuration */
98
+ export type WhatsAppBusinessSolution = {
99
+ /** Unique identifier for the Multi-Partner Solution */
100
+ id: string;
101
+ /** Human-readable name of the Multi-Partner Solution */
102
+ name: string;
103
+ status: WhatsAppBusinessSolutionStatus;
104
+ status_for_pending_request: WhatsAppBusinessSolutionPendingStatus;
105
+ owner_app?: ApplicationNode;
106
+ /** List of WhatsApp Business Account permissions granted to the solution owner */
107
+ owner_permissions?: Array<WhatsAppBusinessAccountPermissionTask>;
108
+ };
109
+ /** Current effective status of the Multi-Partner Solution */
110
+ export type WhatsAppBusinessSolutionStatus = "DRAFT" | "INITIATED" | "ACTIVE" | "REJECTED" | "DEACTIVATED";
111
+ /** Status of any pending solution status transition requests */
112
+ export type WhatsAppBusinessSolutionPendingStatus = "PENDING_ACTIVATION" | "PENDING_DEACTIVATION" | "NONE";
113
+ /** Granular permission tasks for WhatsApp Business Account access */
114
+ export type WhatsAppBusinessAccountPermissionTask = "MANAGE" | "DEVELOP" | "MANAGE_TEMPLATES" | "MANAGE_PHONE" | "VIEW_COST" | "MANAGE_EXTENSIONS" | "VIEW_PHONE_ASSETS" | "MANAGE_PHONE_ASSETS" | "VIEW_TEMPLATES" | "VIEW_INSIGHTS" | "RECEIVE_INCOMING_MESSAGES" | "MANAGE_BILLING" | "MANAGE_USERS" | "MESSAGING" | "FULL_CONTROL";
115
+ /** Role of the application in relation to the Multi-Partner Solution */
116
+ export type WhatsAppBusinessSolutionApplicationRole = "OWNER" | "PARTNER";
117
+ /** Meta application that owns the Multi-Partner Solution */
118
+ export type ApplicationNode = {
119
+ /** Unique identifier for the Meta application */
120
+ id?: string;
121
+ /** Name of the Meta application */
122
+ name?: string;
123
+ };
124
+ /** Response containing list of Multi-Partner Solutions with pagination */
125
+ export type WhatsAppBusinessSolutionsResponse = {
126
+ /** Array of Multi-Partner Solutions */
127
+ data?: Array<WhatsAppBusinessSolution>;
128
+ paging?: CursorPaging;
129
+ };
130
+ /** Cursor-based pagination information */
131
+ export type CursorPaging1 = {
132
+ cursors?: {
133
+ /** Cursor pointing to the start of the page of data that has been returned */
134
+ before?: string;
135
+ /** Cursor pointing to the end of the page of data that has been returned */
136
+ after?: string;
137
+ };
138
+ /** Graph API endpoint URL for the previous page of data */
139
+ previous?: string;
140
+ /** Graph API endpoint URL for the next page of data */
141
+ next?: string;
142
+ };
143
+ /** Request payload for adding a phone number to a business account */
144
+ export type AddPhoneNumbersRequest = {
145
+ /** Phone number to add to the business account. Accepts E.164 format or formatted numbers with spaces, hyphens, and parentheses (e.g., +1555-0104, +1555-0134, +1555-0135). The phone number will be normalized and validated by the endpoint. */
146
+ phone_number: string;
147
+ };
148
+ /** Response containing the ID of the successfully added phone number */
149
+ export type AddPhoneNumbersResponse = {
150
+ /** Unique identifier for the preverified phone number entity that was created */
151
+ id: string;
152
+ };
153
+ /** Pre-verified phone number details and status information */
154
+ export type PreVerifiedPhoneNumber = {
155
+ /** Unique identifier for the pre-verified phone number */
156
+ id: string;
157
+ /** Formatted display version of the phone number */
158
+ display_phone_number: string;
159
+ /** Country code prefix for the phone number */
160
+ country_prefix?: number;
161
+ verification_status: PhoneNumberVerificationStatus;
162
+ availability_status?: PhoneNumberAvailabilityStatus;
163
+ /** Timestamp when the phone number was pre-verified */
164
+ created_time?: string;
165
+ /** Timestamp when the phone number information was last updated */
166
+ last_updated?: string;
167
+ /** List of WhatsApp Business features supported by this phone number */
168
+ supported_features?: Array<WhatsAppBusinessFeature>;
169
+ /** ISO 3166-1 alpha-2 country code for the phone number */
170
+ country_code?: string;
171
+ /** Geographic region or area for the phone number */
172
+ region?: string;
173
+ };
174
+ /** Current verification status of the pre-verified phone number */
175
+ export type PhoneNumberVerificationStatus = "VERIFIED" | "PENDING" | "FAILED" | "EXPIRED";
176
+ /** Current availability status of the pre-verified phone number */
177
+ export type PhoneNumberAvailabilityStatus = "AVAILABLE" | "IN_USE" | "RESERVED" | "UNAVAILABLE";
178
+ /** WhatsApp Business features supported by the phone number */
179
+ export type WhatsAppBusinessFeature = "MESSAGING" | "BUSINESS_PROFILE" | "WEBHOOKS" | "TEMPLATES" | "ANALYTICS" | "COMMERCE" | "FLOWS";
180
+ /** Response containing list of pre-verified phone numbers */
181
+ export type PreVerifiedPhoneNumbersResponse = {
182
+ /** List of pre-verified phone numbers */
183
+ data: Array<PreVerifiedPhoneNumber>;
184
+ paging?: CursorPaging;
185
+ };
186
+ /** Cursor-based pagination information */
187
+ export type CursorPaging2 = {
188
+ cursors?: {
189
+ /** Cursor pointing to the start of the page of data that has been returned */
190
+ before?: string;
191
+ /** Cursor pointing to the end of the page of data that has been returned */
192
+ after?: string;
193
+ };
194
+ /** Graph API endpoint URL for the next page of results */
195
+ next?: string;
196
+ /** Graph API endpoint URL for the previous page of results */
197
+ previous?: string;
198
+ };
199
+ /** WhatsApp Business Account details and configuration */
200
+ export type WhatsAppBusinessAccount = {
201
+ /** Unique identifier for the WhatsApp Business Account */
202
+ id: string;
203
+ /** Human-readable name of the WhatsApp Business Account */
204
+ name: string;
205
+ account_review_status?: AccountReviewStatus;
206
+ /** Purchase order number associated with the account */
207
+ purchase_order_number?: string;
208
+ /** List of audience segments associated with the account */
209
+ audiences?: Array<string>;
210
+ ownership_type?: OwnershipType;
211
+ /** List of applications subscribed to this WABA */
212
+ subscribed_apps?: Array<SubscribedApp>;
213
+ business_verification_status?: BusinessVerificationStatus;
214
+ /** Country code where the WABA is registered */
215
+ country?: string;
216
+ /** Currency code for the WABA */
217
+ currency?: string;
218
+ /** Timezone identifier for the WABA */
219
+ timezone_id?: string;
220
+ on_behalf_of_business_info?: OnBehalfOfBusinessInfo;
221
+ /** Business hours and scheduling information */
222
+ schedules?: Array<BusinessSchedule>;
223
+ /** Whether insights are enabled for this WABA */
224
+ is_enabled_for_insights?: boolean;
225
+ dcc_config?: DCCConfig;
226
+ /** Message templates associated with the WABA */
227
+ message_templates?: Array<MessageTemplate>;
228
+ /** Phone numbers associated with the WABA */
229
+ phone_numbers?: Array<PhoneNumber>;
230
+ };
231
+ /** Review status of the WhatsApp Business Account */
232
+ export type AccountReviewStatus = "APPROVED" | "PENDING" | "REJECTED" | "RESTRICTED";
233
+ /** Type of ownership for the WhatsApp Business Account */
234
+ export type OwnershipType = "SELF_OWNED" | "CLIENT_OWNED" | "AGENCY_OWNED";
235
+ /** Verification status of the business associated with the WABA */
236
+ export type BusinessVerificationStatus1 = "VERIFIED" | "UNVERIFIED" | "PENDING" | "REJECTED";
237
+ /** Application subscribed to the WABA */
238
+ export type SubscribedApp = {
239
+ /** Application ID */
240
+ id?: string;
241
+ /** Application name */
242
+ name?: string;
243
+ };
244
+ /** Information about the business on whose behalf the WABA operates */
245
+ export type OnBehalfOfBusinessInfo = {
246
+ /** Business ID */
247
+ id?: string;
248
+ /** Business name */
249
+ name?: string;
250
+ };
251
+ /** Business hours schedule information */
252
+ export type BusinessSchedule = {
253
+ day_of_week?: "MONDAY" | "TUESDAY" | "WEDNESDAY" | "THURSDAY" | "FRIDAY" | "SATURDAY" | "SUNDAY";
254
+ /** Opening time in HH:MM format */
255
+ open_time?: string;
256
+ /** Closing time in HH:MM format */
257
+ close_time?: string;
258
+ };
259
+ /** Data and Content Control configuration */
260
+ export type DCCConfig = {
261
+ /** Whether DCC is enabled */
262
+ enabled?: boolean;
263
+ /** URL to the DCC policy */
264
+ policy_url?: string;
265
+ };
266
+ /** Message template information */
267
+ export type MessageTemplate = {
268
+ /** Template ID */
269
+ id?: string;
270
+ /** Template name */
271
+ name?: string;
272
+ status?: "APPROVED" | "PENDING" | "REJECTED" | "DISABLED";
273
+ };
274
+ /** Phone number associated with the WABA */
275
+ export type PhoneNumber = {
276
+ /** Phone number ID */
277
+ id?: string;
278
+ /** Formatted phone number for display */
279
+ display_phone_number?: string;
280
+ /** Verified business name for the phone number */
281
+ verified_name?: string;
282
+ };
283
+ /** Response containing list of client WhatsApp Business Accounts */
284
+ export type ClientWhatsAppBusinessAccountsResponse = {
285
+ /** Array of client WhatsApp Business Accounts */
286
+ data?: Array<WhatsAppBusinessAccount>;
287
+ paging?: CursorPaging;
288
+ };
289
+ /** Cursor-based pagination information */
290
+ export type CursorPaging3 = {
291
+ cursors?: {
292
+ /** Cursor pointing to the start of the page of data */
293
+ before?: string;
294
+ /** Cursor pointing to the end of the page of data */
295
+ after?: string;
296
+ };
297
+ /** URL for the previous page of results */
298
+ previous?: string;
299
+ /** URL for the next page of results */
300
+ next?: string;
301
+ };
302
+ /** MM Lite onboarding request details */
303
+ export type MMLiteOnboardingRequest = {
304
+ /** Unique identifier for the MM Lite onboarding request */
305
+ request_id: string;
306
+ };
307
+ /** WhatsApp Business Account owned by the business */
308
+ export type WhatsAppBusinessAccount1 = {
309
+ /** Unique identifier for the WhatsApp Business Account */
310
+ id: string;
311
+ /** Human-readable name of the WhatsApp Business Account */
312
+ name: string;
313
+ /** Namespace identifier for message templates associated with this account */
314
+ message_template_namespace: string;
315
+ /** Timezone identifier for the WhatsApp Business Account */
316
+ timezone_id: string;
317
+ };
318
+ /** Type of WhatsApp Business Account */
319
+ export type WhatsAppBusinessType = "ENTERPRISE" | "SMB";
320
+ /** Filter for accounts based on onboarding status */
321
+ export type WhatsAppBusinessAccountOnboardingFilter = "ONBOARDED" | "NOT_ONBOARDED" | "ALL";
322
+ /** Paginated collection of owned WhatsApp Business Accounts */
323
+ export type WhatsAppBusinessAccountsConnection = {
324
+ /** Array of owned WhatsApp Business Account records */
325
+ data: Array<WhatsAppBusinessAccount>;
326
+ paging?: CursorPaging;
327
+ };
328
+ /** Cursor-based pagination information */
329
+ export type CursorPaging4 = {
330
+ cursors?: {
331
+ /** Cursor pointing to the start of the page of data that has been returned */
332
+ before?: string;
333
+ /** Cursor pointing to the end of the page of data that has been returned */
334
+ after?: string;
335
+ };
336
+ /** URL for the next page of results */
337
+ next?: string;
338
+ /** URL for the previous page of results */
339
+ previous?: string;
340
+ };
341
+ /** Request payload for sharing a pre-verified phone number with another business */
342
+ export type PreVerifiedPhoneNumberShareRequest = {
343
+ /** Unique identifier of the pre-verified phone number to be shared. Must be a valid phone number ID that the requesting business owns or has sharing rights to. */
344
+ preverified_id: string;
345
+ /** Business ID of the partner business that will receive access to the pre-verified phone number. Must be a valid business entity accessible to the requesting app. */
346
+ partner_business_id: string;
347
+ };
348
+ /** Specific permissions that can be granted for shared pre-verified phone numbers */
349
+ export type PreVerifiedPhoneNumberPermission = "MESSAGING" | "VIEW_DETAILS" | "MANAGE_SETTINGS" | "VIEW_ANALYTICS" | "MANAGE_WEBHOOKS";
350
+ /** Response containing details of the successful phone number sharing operation */
351
+ export type PreVerifiedPhoneNumberShareResponse = {
352
+ /** Indicates whether the sharing operation was successful */
353
+ success: boolean;
354
+ };
355
+ /** Current status of the phone number sharing relationship */
356
+ export type SharingStatus = "ACTIVE" | "PENDING" | "EXPIRED" | "REVOKED";
357
+ /** Details of the shared pre-verified phone number */
358
+ export type SharedPreVerifiedPhoneNumber = {
359
+ /** Unique identifier for the pre-verified phone number */
360
+ id?: string;
361
+ /** Formatted display version of the phone number */
362
+ display_phone_number?: string;
363
+ /** Country code prefix for the phone number */
364
+ country_prefix?: number;
365
+ /** Current verification status of the phone number */
366
+ verification_status?: "VERIFIED" | "PENDING" | "FAILED";
367
+ };
368
+ /** Summary information about a business entity */
369
+ export type BusinessSummary = {
370
+ /** Unique identifier for the business */
371
+ id?: string;
372
+ /** Name of the business */
373
+ name?: string;
374
+ /** Business verification status */
375
+ verification_status?: "VERIFIED" | "UNVERIFIED" | "PENDING";
376
+ };
377
+ export type BlockedUser = {
378
+ messaging_product?: string;
379
+ wa_id?: string;
380
+ };
381
+ export type PaginationCursors = {
382
+ after?: string;
383
+ before?: string;
384
+ };
385
+ export type Paging = {
386
+ cursors?: PaginationCursors;
387
+ };
388
+ export type GetBlockedUsersData = {
389
+ data?: Array<BlockedUser>;
390
+ paging?: Paging;
391
+ };
392
+ export type BlockedUserOperation = {
393
+ input?: string;
394
+ wa_id?: string;
395
+ };
396
+ export type BlockUsersResult = {
397
+ added_users?: Array<BlockedUserOperation>;
398
+ };
399
+ export type UnblockUsersResult = {
400
+ removed_users?: Array<BlockedUserOperation>;
401
+ };
402
+ export type BlockUsersData = {
403
+ block_users?: BlockUsersResult;
404
+ messaging_product?: string;
405
+ };
406
+ export type UnblockUsersData = {
407
+ block_users?: UnblockUsersResult;
408
+ messaging_product?: string;
409
+ };
410
+ export type CallPermissionCheckResponsePayload = {
411
+ /** Messaging product */
412
+ messaging_product: string;
413
+ /** Call permission details */
414
+ permission: {
415
+ /** Current permission status for calling this user */
416
+ status: "granted" | "pending" | "denied" | "expired";
417
+ /** Unix timestamp when the permission expires (if applicable) */
418
+ expiration_time?: string;
419
+ };
420
+ /** Available actions and their restrictions */
421
+ actions?: Array<{
422
+ /** Name of the action */
423
+ action_name: "start_call" | "send_call_permission_request";
424
+ /** Whether the business can perform this action */
425
+ can_perform_action: boolean;
426
+ /** Rate limits for this action */
427
+ limits?: Array<{
428
+ /** Time period for the limit */
429
+ time_period: string;
430
+ /** Current usage count */
431
+ current_usage: number;
432
+ /** Maximum allowed usage */
433
+ max_allowed: number;
434
+ /** Unix timestamp when the limit resets */
435
+ limit_expiration_time?: string;
436
+ }>;
437
+ }>;
438
+ };
439
+ export type CallRequestPayload = {
440
+ /** Messaging product */
441
+ messaging_product: string;
442
+ /** The number being called (callee) */
443
+ to: string;
444
+ /** The action being taken on the given call ID */
445
+ action: "connect" | "pre_accept" | "accept" | "reject" | "terminate";
446
+ /** Contains the session description protocol (SDP) type and description language */
447
+ session?: {
448
+ /** SDP type - "offer" for connect action, "answer" for accept action */
449
+ sdp_type: "offer" | "answer";
450
+ /** The SDP info of the device on the other end of the call. The SDP must be compliant with RFC 8866 */
451
+ sdp: string;
452
+ };
453
+ /** An arbitrary string you can pass in that is useful for tracking and logging purposes. Any app subscribed to the "calls" webhook field on your WhatsApp Business Account can receive this string, as it is included in the calls object within the subsequent Call Terminate Webhook payload. Cloud API does not process this field. Maximum 512 characters */
454
+ biz_opaque_callback_data?: string;
455
+ };
456
+ export type CallTerminateRequestPayload = {
457
+ /** Messaging product */
458
+ messaging_product: string;
459
+ /** The WhatsApp call ID */
460
+ call_id: string;
461
+ /** Action to terminate the call */
462
+ action: "terminate";
463
+ };
464
+ export type CallResponsePayload = {
465
+ messaging_product?: string;
466
+ calls?: Array<{
467
+ id?: string;
468
+ }>;
469
+ };
470
+ export type CallTerminateResponsePayload = {
471
+ success?: boolean;
472
+ };
473
+ export type ErrorObject = {
474
+ /** Human-readable description of the error */
475
+ message: string;
476
+ /** Error type classification */
477
+ type: string;
478
+ /** Numeric error code */
479
+ code: number;
480
+ };
481
+ export type ErrorResponse = {
482
+ error: ErrorObject;
483
+ };
484
+ export type ErrorObject1 = ErrorObject;
485
+ export type ErrorResponse1 = ErrorResponse;
486
+ export type PagingInfo = {
487
+ cursors?: {
488
+ /** Before cursor */
489
+ before?: string;
490
+ /** After cursor */
491
+ after?: string;
492
+ };
493
+ /** Previous page URL */
494
+ previous?: string;
495
+ /** Next page URL */
496
+ next?: string;
497
+ };
498
+ export type TemplateObject = {
499
+ /** Name of the template. */
500
+ name: string;
501
+ /** Contains a `language` object. Specifies the language the template may be rendered in */
502
+ language: LanguageObject;
503
+ /** Array of `components` objects containing the parameters of the message. */
504
+ components?: Array<TemplateComponent>;
505
+ };
506
+ export type LanguageObject = {
507
+ /** The language policy the message should follow. */
508
+ policy: "deterministic";
509
+ /** The code of the language or locale to use (e.g., `"en"`, `"en_US"`). */
510
+ code: string;
511
+ };
512
+ export type TemplateComponent = HeaderComponent | BodyComponent | ButtonComponent;
513
+ export type HeaderComponent = {
514
+ type: "header";
515
+ /** Required when `type=button`. Not used for other types. Type of button to create. */
516
+ sub_type?: "quick_reply" | "url" | "catalog";
517
+ /** Parameters for the header component, which can be `image`, `video`, `document`, or `text`. [15, 16] */
518
+ parameters?: Array<ParameterObject>;
519
+ /** Required when `type=button`. Not used for other types. Position index of the button (0-9). */
520
+ index?: string;
521
+ };
522
+ export type BodyComponent = {
523
+ type: "body";
524
+ /** Required when `type=button`. Not used for other types. Type of button to create. */
525
+ sub_type?: "quick_reply" | "url" | "catalog";
526
+ /** Parameters for the body component, which can be `text`, `currency`, or `date_time`. [17] */
527
+ parameters?: Array<ParameterObject>;
528
+ /** Required when `type=button`. Not used for other types. Position index of the button (0-9). */
529
+ index?: string;
530
+ };
531
+ export type ButtonComponent = {
532
+ type: "button";
533
+ sub_type: "quick_reply" | "url" | "catalog";
534
+ /** Parameters for the button component, which are `payload` for quick reply or `text` for URL buttons. */
535
+ parameters: Array<ButtonParameterObject>;
536
+ index: string;
537
+ };
538
+ export type ParameterObject = CurrencyParameter | DateTimeParameter | DocumentParameter | ImageParameter | TextParameter | VideoParameter;
539
+ export type TextParameter = {
540
+ type: "text";
541
+ /** The message's text. */
542
+ text: string;
543
+ };
544
+ export type CurrencyParameter = {
545
+ type: "currency";
546
+ currency: CurrencyObject;
547
+ };
548
+ export type DateTimeParameter = {
549
+ type: "date_time";
550
+ date_time: DateTimeObject;
551
+ };
552
+ export type DocumentParameter = {
553
+ type: "document";
554
+ /** Only PDF documents are supported for media-based message templates. Captions not supported. */
555
+ document: MediaObject;
556
+ };
557
+ export type ImageParameter = {
558
+ type: "image";
559
+ /** A media object of type image. Captions not supported. [15] */
560
+ image: MediaObject;
561
+ };
562
+ export type VideoParameter = {
563
+ type: "video";
564
+ /** A media object of type video. Captions not supported. [16] */
565
+ video: MediaObject;
566
+ };
567
+ export type CurrencyObject = {
568
+ /** Default text if localization fails. */
569
+ fallback_value: string;
570
+ /** Currency code as defined in ISO 4217. */
571
+ code: string;
572
+ /** Amount multiplied by 1000 (e.g., 100000 for $100.00). */
573
+ amount_1000: number;
574
+ };
575
+ export type DateTimeObject = {
576
+ /** Default text. For Cloud API, this fallback value is always used. */
577
+ fallback_value: string;
578
+ };
579
+ /** A media object. Either `id` or `link` is required. */
580
+ export type MediaObject = {
581
+ /** The media object ID. **Required when `link` is not used.** */
582
+ id: string;
583
+ } | {
584
+ /** The protocol and URL of the media to be sent (HTTP/HTTPS only). */
585
+ link: string;
586
+ };
587
+ export type ButtonParameterObject = ButtonPayloadParameter | ButtonTextParameter;
588
+ export type ButtonPayloadParameter = {
589
+ type: "payload";
590
+ /** Developer-defined payload that is returned when the quick reply button is clicked. */
591
+ payload: string;
592
+ };
593
+ export type ButtonTextParameter = {
594
+ type: "text";
595
+ /** Developer-provided suffix that is appended to the predefined prefix URL in the template. */
596
+ text: string;
597
+ };
598
+ export type MarketingMessageRequestPayload = {
599
+ /** Messaging service used. Must be "whatsapp" */
600
+ messaging_product: "whatsapp";
601
+ /** Type of recipient. Must be "individual" */
602
+ recipient_type: "individual";
603
+ /** WhatsApp ID or phone number of the message recipient */
604
+ to: string;
605
+ /** Type of message. Must be "template" for marketing messages */
606
+ type: "template";
607
+ template: TemplateObject;
608
+ /** Optional product policy setting */
609
+ product_policy?: "CLOUD_API_FALLBACK" | "STRICT";
610
+ /** Optional flag to control message activity sharing */
611
+ message_activity_sharing?: boolean;
612
+ };
613
+ /** The status of a WhatsApp message: - `accepted`: The message has been accepted by WhatsApp and is being processed - `held_for_quality_assessment`: The message is being held for quality assessment before delivery - `paused`: The message delivery has been paused */
614
+ export type MessageStatus = "accepted" | "held_for_quality_assessment" | "paused";
615
+ export type MarketingMessageResponsePayload = {
616
+ contacts?: Array<{
617
+ input?: string;
618
+ wa_id?: string;
619
+ }>;
620
+ messages?: Array<{
621
+ id?: string;
622
+ message_status?: MessageStatus;
623
+ }>;
624
+ messaging_product?: string;
625
+ };
626
+ /** Common properties shared by all message types */
627
+ export type BaseMessageProperties = {
628
+ messaging_product: string;
629
+ /** The type of recipient. */
630
+ recipient_type: "individual" | "group";
631
+ /** The recipient's phone number for individual messages, and group-id for group message. */
632
+ to: string;
633
+ /** The type of message */
634
+ type: string;
635
+ context?: MessageContext;
636
+ };
637
+ /** Context information for replying to a message */
638
+ export type MessageContext = {
639
+ /** The ID of the message to which this message is a reply. */
640
+ message_id?: string;
641
+ };
642
+ /** A media object. Either `id` or `link` is required. */
643
+ export type MediaObject1 = {
644
+ /** The media object ID. **Required when `link` is not used.** */
645
+ id: string;
646
+ /** Optional caption for the media */
647
+ caption?: string;
648
+ } | {
649
+ /** The protocol and URL of the media to be sent (HTTP/HTTPS only). */
650
+ link: string;
651
+ /** Optional caption for the media */
652
+ caption?: string;
653
+ };
654
+ export type Message = TextMessage | AudioMessage | DocumentMessage | ImageMessage | LocationMessage | VideoMessage | StickerMessage | ReactionMessage | InteractiveMessage | TemplateMessage | ContactsMessage;
655
+ export type TextMessage = {
656
+ messaging_product: string;
657
+ /** The type of recipient. */
658
+ recipient_type: "individual" | "group";
659
+ /** The recipient's phone number for individual messages, and group-id for group message. */
660
+ to: string;
661
+ type: "text";
662
+ context?: MessageContext;
663
+ text: {
664
+ /** The text of the message. */
665
+ body?: string;
666
+ preview_url?: boolean;
667
+ };
668
+ };
669
+ export type AudioMessage = {
670
+ messaging_product: string;
671
+ /** The type of recipient. */
672
+ recipient_type: "individual" | "group";
673
+ /** The recipient's phone number for individual messages, and group-id for group message. */
674
+ to: string;
675
+ type: "audio";
676
+ context?: MessageContext;
677
+ audio: MediaObject;
678
+ };
679
+ export type VideoMessage = {
680
+ messaging_product: string;
681
+ /** The type of recipient. */
682
+ recipient_type: "individual" | "group";
683
+ /** The recipient's phone number for individual messages, and group-id for group message. */
684
+ to: string;
685
+ type: "video";
686
+ context?: MessageContext;
687
+ video: MediaObject;
688
+ };
689
+ export type DocumentMessage = {
690
+ messaging_product: string;
691
+ /** The type of recipient. */
692
+ recipient_type: "individual" | "group";
693
+ /** The recipient's phone number for individual messages, and group-id for group message. */
694
+ to: string;
695
+ type: "document";
696
+ context?: MessageContext;
697
+ document: MediaObject;
698
+ };
699
+ export type ImageMessage = {
700
+ messaging_product: string;
701
+ /** The type of recipient. */
702
+ recipient_type: "individual" | "group";
703
+ /** The recipient's phone number for individual messages, and group-id for group message. */
704
+ to: string;
705
+ type: "image";
706
+ context?: MessageContext;
707
+ image: MediaObject;
708
+ };
709
+ export type LocationMessage = {
710
+ messaging_product: string;
711
+ /** The type of recipient. */
712
+ recipient_type: "individual" | "group";
713
+ /** The recipient's phone number for individual messages, and group-id for group message. */
714
+ to: string;
715
+ type: "location";
716
+ context?: MessageContext;
717
+ location: {
718
+ /** The address of the location. */
719
+ address?: string;
720
+ /** The latitude of the location. */
721
+ latitude?: string;
722
+ /** The longitude of the location. */
723
+ longitude?: string;
724
+ /** The name of the location. */
725
+ name?: string;
726
+ };
727
+ };
728
+ export type StickerMessage = {
729
+ messaging_product: string;
730
+ /** The type of recipient. */
731
+ recipient_type: "individual" | "group";
732
+ /** The recipient's phone number for individual messages, and group-id for group message. */
733
+ to: string;
734
+ type: "sticker";
735
+ context?: MessageContext;
736
+ sticker: {
737
+ /** The ID of the sticker. */
738
+ id: string;
739
+ } | {
740
+ /** The URL of the sticker. */
741
+ link: string;
742
+ };
743
+ };
744
+ export type ReactionMessage = {
745
+ messaging_product: string;
746
+ /** The type of recipient. */
747
+ recipient_type: "individual" | "group";
748
+ /** The recipient's phone number for individual messages, and group-id for group message. */
749
+ to: string;
750
+ type: "reaction";
751
+ context?: MessageContext;
752
+ reaction: {
753
+ /** emoji */
754
+ emoji?: string;
755
+ /** reacted message-id */
756
+ message_id?: string;
757
+ };
758
+ };
759
+ export type InteractiveMessage = {
760
+ messaging_product: string;
761
+ /** The type of recipient. */
762
+ recipient_type: "individual" | "group";
763
+ /** The recipient's phone number for individual messages, and group-id for group message. */
764
+ to: string;
765
+ type: "interactive";
766
+ context?: MessageContext;
767
+ interactive: InteractiveObject;
768
+ };
769
+ /** An object containing the content for an interactive message. */
770
+ export type InteractiveObject = {
771
+ /** The type of interactive message to send. */
772
+ type: "button" | "call_permission_request" | "catalog_message" | "list" | "product" | "product_list" | "flow";
773
+ header?: HeaderObject;
774
+ body?: BodyObject;
775
+ footer?: FooterObject;
776
+ action: ActionObject;
777
+ };
778
+ /** Header content displayed on top of a message. Required for 'product_list' type. Cannot be set for 'product' type. */
779
+ export type HeaderObject = {
780
+ /** The header type. */
781
+ type: "text" | "video" | "image" | "document";
782
+ /** Text for the header. Required if 'type' is 'text'. Emojis supported, no markdown. */
783
+ text?: string;
784
+ /** Optional sub-text for the header. Emojis supported, no markdown. */
785
+ sub_text?: string;
786
+ /** Contains the media object for this document. Required if 'type' is 'document'. */
787
+ document?: MediaObject;
788
+ /** Contains the media object for this image. Required if 'type' is 'image'. */
789
+ image?: MediaObject;
790
+ /** Contains the media object for this video. Required if 'type' is 'video'. */
791
+ video?: MediaObject;
792
+ };
793
+ /** An object with the body of the message. Optional for 'product' type, required for other interactive message types. */
794
+ export type BodyObject = {
795
+ /** The content of the message body. Emojis and markdown are supported. */
796
+ text: string;
797
+ };
798
+ /** An object with the footer of the message. Optional. */
799
+ export type FooterObject = {
800
+ /** The footer content. Emojis, markdown, and links are supported. */
801
+ text: string;
802
+ };
803
+ /** Action you want the user to perform after reading the message. Its structure varies by interactive message type. */
804
+ export type ActionObject = {
805
+ /** Button content for List Messages. Cannot be empty, must be unique. Emojis supported, no markdown. */
806
+ button: string;
807
+ /** Array of section objects. */
808
+ sections: Array<SectionObject>;
809
+ } | {
810
+ /** Array of button objects. */
811
+ buttons: Array<{
812
+ /** Only supported type is "reply" for Reply Button. */
813
+ type: "reply";
814
+ reply: {
815
+ /** Unique identifier for your button. No leading/trailing spaces. */
816
+ id: string;
817
+ /** Button title. Cannot be empty, must be unique. Emojis supported, no markdown. */
818
+ title: string;
819
+ };
820
+ }>;
821
+ } | {
822
+ /** Unique identifier of the Facebook catalog linked to your WhatsApp Business Account. */
823
+ catalog_id: string;
824
+ /** Unique identifier of the product in a catalog. Required for Single Product Messages. */
825
+ product_retailer_id?: string;
826
+ /** Array of section objects. */
827
+ sections?: Array<SectionObject>;
828
+ } | {
829
+ name: "catalog_message";
830
+ parameters: {
831
+ /** Product retailer ID for the thumbnail. */
832
+ thumbnail_product_retailer_id: string;
833
+ };
834
+ } | {
835
+ name: "flow";
836
+ parameters: Record<string, unknown> | Record<string, unknown>;
837
+ } | {
838
+ name: "call_permission_request";
839
+ };
840
+ /** A section object, used in List Messages and Multi-Product Messages. */
841
+ export type SectionObject = {
842
+ /** Title of the section. Required if the message has more than one section. Max 24 characters. */
843
+ title?: string;
844
+ /** Array of product objects. */
845
+ product_items?: Array<{
846
+ /** Unique identifier of the product in a catalog. */
847
+ product_retailer_id: string;
848
+ }>;
849
+ /** Contains a list of rows. */
850
+ rows?: Array<{
851
+ /** Unique row identifier. */
852
+ id: string;
853
+ /** Row title. */
854
+ title: string;
855
+ /** Optional row description. */
856
+ description?: string;
857
+ }>;
858
+ };
859
+ export type TemplateMessage = {
860
+ messaging_product: string;
861
+ /** The type of recipient. */
862
+ recipient_type: "individual" | "group";
863
+ /** The recipient's phone number for individual messages, and group-id for group message. */
864
+ to: string;
865
+ type: "template";
866
+ context?: MessageContext;
867
+ template: TemplateObject;
868
+ };
869
+ export type ContactsMessage = {
870
+ messaging_product: string;
871
+ /** The type of recipient. */
872
+ recipient_type: "individual" | "group";
873
+ /** The recipient's phone number for individual messages, and group-id for group message. */
874
+ to: string;
875
+ type: "contacts";
876
+ context?: MessageContext;
877
+ contacts: Array<ContactObject>;
878
+ };
879
+ export type ContactObject = {
880
+ /** Full contact address(es) */
881
+ addresses?: Array<AddressObject>;
882
+ /** Date of birth (YYYY-MM-DD format) */
883
+ birthday?: string;
884
+ /** Contact email address(es) */
885
+ emails?: Array<EmailObject>;
886
+ /** Contact name object */
887
+ name?: NameObject;
888
+ /** Contact organization information */
889
+ org?: OrganizationObject;
890
+ /** Contact phone number(s) */
891
+ phones?: Array<PhoneObject>;
892
+ /** Contact URL(s) */
893
+ urls?: Array<UrlObject>;
894
+ };
895
+ export type AddressObject = {
896
+ /** City name */
897
+ city?: string;
898
+ /** Full country name */
899
+ country?: string;
900
+ /** Two-letter ISO country code */
901
+ country_code?: string;
902
+ /** State abbreviation */
903
+ state?: string;
904
+ /** Street address */
905
+ street?: string;
906
+ /** Address type */
907
+ type?: "HOME" | "WORK";
908
+ /** ZIP code */
909
+ zip?: string;
910
+ };
911
+ export type EmailObject = {
912
+ /** Email address */
913
+ email: string;
914
+ /** Email type */
915
+ type?: "HOME" | "WORK";
916
+ };
917
+ export type NameObject = {
918
+ /** First name */
919
+ first_name?: string;
920
+ /** Formatted full name */
921
+ formatted_name?: string;
922
+ /** Last name */
923
+ last_name?: string;
924
+ /** Middle name */
925
+ middle_name?: string;
926
+ /** Name prefix */
927
+ prefix?: string;
928
+ /** Name suffix */
929
+ suffix?: string;
930
+ };
931
+ export type OrganizationObject = {
932
+ /** Company name */
933
+ company?: string;
934
+ /** Department name */
935
+ department?: string;
936
+ /** Job title */
937
+ title?: string;
938
+ };
939
+ export type PhoneObject = {
940
+ /** Phone number */
941
+ phone: string;
942
+ /** Phone type */
943
+ type?: "HOME" | "WORK";
944
+ /** WhatsApp ID */
945
+ wa_id?: string;
946
+ };
947
+ export type UrlObject = {
948
+ /** URL type */
949
+ type?: "HOME" | "WORK";
950
+ /** URL */
951
+ url: string;
952
+ };
953
+ export type MessageResponsePayload = {
954
+ contacts?: Array<{
955
+ input?: string;
956
+ wa_id?: string;
957
+ }>;
958
+ messages?: Array<{
959
+ id?: string;
960
+ message_status?: MessageStatus;
961
+ }>;
962
+ messaging_product?: string;
963
+ };
964
+ export type MarkMessageRequestPayload = {
965
+ message_id: string;
966
+ messaging_product: string;
967
+ status: string;
968
+ };
969
+ export type MarkMessageResponsePayload = {
970
+ success?: boolean;
971
+ };
972
+ /** Complete details of a message QR code */
973
+ export type QrCodeDetails = {
974
+ /** Unique 14-character QR code identifier */
975
+ code: string;
976
+ /** Pre-filled message text that appears in customer chat */
977
+ prefilled_message: string;
978
+ /** WhatsApp deep link URL for direct conversation initiation */
979
+ deep_link_url: string;
980
+ /** Unix timestamp when QR code was created (first-party apps only) */
981
+ creation_time?: number;
982
+ /** QR code image download URL (when format specified in fields) */
983
+ qr_image_url?: string;
984
+ };
985
+ /** List of message QR codes with pagination information */
986
+ export type QrCodeList = {
987
+ /** Array of QR code objects */
988
+ data: Array<QrCodeDetails>;
989
+ /** Pagination information for navigating through large result sets. Contains cursors for accessing previous and next pages of results. */
990
+ paging?: {
991
+ cursors?: {
992
+ /** Cursor for accessing the previous page of results */
993
+ before?: string;
994
+ /** Cursor for accessing the next page of results */
995
+ after?: string;
996
+ };
997
+ /** URL for the previous page of results */
998
+ previous?: string;
999
+ /** URL for the next page of results */
1000
+ next?: string;
1001
+ };
1002
+ };
1003
+ /** Request payload for creating a new message QR code */
1004
+ export type CreateQrCodeRequest = {
1005
+ /** Pre-filled message text (max 140 characters) that appears in customer chat */
1006
+ prefilled_message: string;
1007
+ /** QR image format. When specified, response includes qr_image_url */
1008
+ generate_qr_image?: "PNG" | "SVG";
1009
+ };
1010
+ /** Request payload for updating an existing message QR code */
1011
+ export type UpdateQrCodeRequest = {
1012
+ /** 14-character QR code identifier to update */
1013
+ code: string;
1014
+ /** New pre-filled message text (max 140 characters) */
1015
+ prefilled_message: string;
1016
+ };
1017
+ /** Response containing QR code details after creation or update */
1018
+ export type QrCodeResponse = {
1019
+ /** Unique 14-character identifier for the QR code. This code is used for future updates or deletions. */
1020
+ code: string;
1021
+ /** The pre-filled message text associated with this QR code. This text appears when customers use the QR code. */
1022
+ prefilled_message: string;
1023
+ /** WhatsApp deep link URL that can be used directly without QR code scanning. Customers can click this link to start a conversation with the pre-filled message. */
1024
+ deep_link_url: string;
1025
+ /** URL to download the QR code image. Only present if generate_qr_image parameter was specified in the request. Image format matches the requested format. */
1026
+ qr_image_url?: string;
1027
+ };
1028
+ /** Standard Graph API error response */
1029
+ export type GraphAPIError2 = {
1030
+ error: {
1031
+ /** Human-readable error message */
1032
+ message: string;
1033
+ /** Error category type */
1034
+ type: string;
1035
+ /** Numeric error code */
1036
+ code: number;
1037
+ /** More specific error subcode when available */
1038
+ error_subcode?: number;
1039
+ /** Unique identifier for debugging and support requests with Meta */
1040
+ fbtrace_id?: string;
1041
+ /** Indicates whether this error is temporary and the request should be retried */
1042
+ is_transient?: boolean;
1043
+ /** User-friendly error title for display purposes */
1044
+ error_user_title?: string;
1045
+ /** User-friendly error message for display purposes */
1046
+ error_user_msg?: string;
1047
+ };
1048
+ };
1049
+ /** Individual QR code response containing a single QR code in data array format */
1050
+ export type QrCodeResponse1 = {
1051
+ /** Array containing the single QR code object (maintains consistency with collection endpoint) */
1052
+ data: Array<QrCodeDetails>;
1053
+ };
1054
+ /** Response confirming successful QR code deletion */
1055
+ export type DeleteQrCodeResponse = {
1056
+ /** Indicates whether the QR code was successfully deleted */
1057
+ success: boolean;
1058
+ };
1059
+ /** Standard Graph API error response */
1060
+ export type GraphAPIError3 = {
1061
+ error: {
1062
+ /** Human-readable error message */
1063
+ message: string;
1064
+ /** Error category type */
1065
+ type: string;
1066
+ /** Numeric error code */
1067
+ code: number;
1068
+ /** More specific error subcode when available */
1069
+ error_subcode?: number;
1070
+ /** Unique identifier for debugging and support requests with Meta */
1071
+ fbtrace_id?: string;
1072
+ /** Indicates whether this error is temporary and the request should be retried */
1073
+ is_transient?: boolean;
1074
+ /** User-friendly error title for display purposes */
1075
+ error_user_title?: string;
1076
+ /** User-friendly error message for display purposes */
1077
+ error_user_msg?: string;
1078
+ };
1079
+ };
1080
+ export type EncryptedMessageRequest = {
1081
+ /** Messaging service used for the request. Use whatsapp. */
1082
+ messaging_product: "whatsapp";
1083
+ /** JWE payload with encrypted messages structure. This should be a valid JWE token containing the encrypted message payload. */
1084
+ encrypted_contents: string;
1085
+ };
1086
+ export type EncryptedMessageResponse = {
1087
+ /** JWE payload with encrypted messages response structure. Contains the encrypted response from the WhatsApp Business API. */
1088
+ encrypted_contents: string;
1089
+ };
1090
+ export type ErrorResponse2 = {
1091
+ error?: {
1092
+ /** Error message describing what went wrong */
1093
+ message?: string;
1094
+ /** Error type */
1095
+ type?: string;
1096
+ /** Error code */
1097
+ code?: number;
1098
+ /** Error subcode for more specific error identification */
1099
+ error_subcode?: number;
1100
+ };
1101
+ };
1102
+ /** Official Business Account status information for a WhatsApp Business Account phone number */
1103
+ export type OfficialBusinessAccountStatus = {
1104
+ /** Unique identifier for the WhatsApp Business Account phone number */
1105
+ id: string;
1106
+ oba_status: WhatsAppBusinessAppealStatus;
1107
+ /** Human-readable message describing the current Official Business Account status */
1108
+ status_message: string;
1109
+ };
1110
+ /** Request payload for updating Official Business Account status */
1111
+ export type OfficialBusinessAccountUpdateRequest = {
1112
+ /** Official business website URL */
1113
+ business_website_url: string;
1114
+ /** Primary country where the business operates */
1115
+ primary_country_of_operation: string;
1116
+ /** Primary language used by the business */
1117
+ primary_language?: string;
1118
+ /** Parent business or brand name */
1119
+ parent_business_or_brand?: string;
1120
+ /** Supporting links that demonstrate business notability (minimum 5, maximum 10) */
1121
+ supporting_links?: Array<string>;
1122
+ /** Additional information to support the Official Business Account application */
1123
+ additional_supporting_information?: string;
1124
+ };
1125
+ /** Response for Official Business Account status update operation */
1126
+ export type OfficialBusinessAccountUpdateResponse = {
1127
+ /** Indicates if the operation was successful */
1128
+ success: boolean;
1129
+ /** Human-readable message describing the result of the operation */
1130
+ message: string;
1131
+ updated_status?: OfficialBusinessAccountStatus;
1132
+ /** Unique identifier for tracking the application/update request */
1133
+ tracking_id?: string;
1134
+ };
1135
+ /** Official Business Account appeal and verification status */
1136
+ export type WhatsAppBusinessAppealStatus = "PENDING" | "APPROVED" | "REJECTED" | "UNDER_REVIEW" | "EXPIRED" | "CANCELLED";
1137
+ /** Phone number information and status */
1138
+ export type PhoneNumberInfo = {
1139
+ /** The ID associated with the phone number */
1140
+ id?: string;
1141
+ /** The string representation of the phone number */
1142
+ display_phone_number?: string;
1143
+ /** The verified name associated with the phone number */
1144
+ verified_name?: string;
1145
+ /** The quality rating of the phone number based on how messages have been received by recipients in recent days. - GREEN: High Quality - YELLOW: Medium Quality - RED: Low Quality - NA: Quality has not been determined */
1146
+ quality_rating?: "GREEN" | "YELLOW" | "RED" | "NA";
1147
+ /** The two-step verification status for the phone number indicating whether the number has completed two-step verification. - VERIFIED: Phone number has completed two-step verification - UNVERIFIED: Two-step verification is pending or incomplete */
1148
+ code_verification_status?: "VERIFIED" | "UNVERIFIED";
1149
+ /** The status of a display name associated with a specific phone number. - APPROVED: The display name has been approved and is ready to use. - AVAILABLE_WITHOUT_REVIEW: The display name is ready to use without review. - DECLINED: The display name has not been approved. - EXPIRED: The display name approval has expired. - PENDING_REVIEW: The display name is under review. - NONE: No display name verification request exists. */
1150
+ name_status?: "APPROVED" | "AVAILABLE_WITHOUT_REVIEW" | "DECLINED" | "EXPIRED" | "PENDING_REVIEW" | "NONE";
1151
+ };
1152
+ /** Request to send a message via WhatsApp Business API */
1153
+ export type MessageRequest = {
1154
+ /** Messaging service used for the request */
1155
+ messaging_product: "whatsapp";
1156
+ /** Type of recipient */
1157
+ recipient_type?: "individual" | "group";
1158
+ /** Recipient's phone number (with country code) or group ID */
1159
+ to: string;
1160
+ /** Type of message being sent */
1161
+ type: "text" | "image" | "audio" | "video" | "document" | "location" | "contacts" | "template" | "interactive" | "reaction" | "sticker";
1162
+ text?: TextMessage;
1163
+ context?: MessageContext;
1164
+ };
1165
+ export type TextMessage1 = {
1166
+ /** Text content of the message */
1167
+ body: string;
1168
+ /** Whether to show URL preview */
1169
+ preview_url?: boolean;
1170
+ };
1171
+ export type MessageContext1 = {
1172
+ /** ID of message being replied to */
1173
+ message_id?: string;
1174
+ };
1175
+ /** Request to update phone number settings */
1176
+ export type SettingsRequest = {
1177
+ calling?: CallingSettings;
1178
+ };
1179
+ export type CallingSettings = {
1180
+ /** Enable or disable calling feature */
1181
+ status: "enabled" | "disabled";
1182
+ /** Control visibility of the call icon */
1183
+ call_icon_visibility?: "visible" | "hidden";
1184
+ };
1185
+ export type RegisterRequest = {
1186
+ /** Messaging service used for the request */
1187
+ messaging_product: "whatsapp";
1188
+ /** 6-digit PIN for two-step verification */
1189
+ pin: string;
1190
+ };
1191
+ export type VerifyCodeRequest = {
1192
+ /** 6-digit verification code received via SMS or voice */
1193
+ code: string;
1194
+ };
1195
+ export type TwoStepVerificationRequest = {
1196
+ /** 6-digit PIN for two-step verification */
1197
+ pin: string;
1198
+ };
1199
+ /** Request to update phone number status and configuration */
1200
+ export type PhoneNumberStatusUpdateRequest = {
1201
+ connection_status?: WhatsAppBusinessAccountToNumberStatus;
1202
+ /** Webhook URL for receiving message notifications */
1203
+ webhook_url?: string;
1204
+ whatsapp_business_api_data?: WhatsAppBusinessApiData;
1205
+ /** Two-step verification PIN (can be empty string) */
1206
+ pin?: string;
1207
+ search_visibility?: WAAPIBusinessGlobalSearchStateStatus;
1208
+ webhook_configuration?: WebhookConfiguration;
1209
+ /** New display name for name verification request */
1210
+ new_display_name?: string;
1211
+ /** Username for the WhatsApp Business Account */
1212
+ username?: string;
1213
+ };
1214
+ /** WhatsApp Business API configuration data */
1215
+ export type WhatsAppBusinessApiData = {
1216
+ /** Two-step verification PIN (can be empty string) */
1217
+ pin?: string;
1218
+ /** Whether to show security notifications */
1219
+ show_security_notifications?: boolean;
1220
+ /** Whether to notify users when changing number */
1221
+ notify_user_change_number?: boolean;
1222
+ };
1223
+ /** Webhook configuration settings */
1224
+ export type WebhookConfiguration = {
1225
+ /** Override callback URI for webhook notifications (can be empty string) */
1226
+ override_callback_uri: string;
1227
+ /** Token used to verify webhook requests */
1228
+ verify_token?: string;
1229
+ };
1230
+ /** Connection status between WhatsApp Business Account and phone number */
1231
+ export type WhatsAppBusinessAccountToNumberStatus = "CONNECTED" | "DISCONNECTED" | "PENDING" | "FLAGGED" | "RESTRICTED" | "RATE_LIMITED" | "MESSAGING_LIMIT_TIER_0" | "MESSAGING_LIMIT_TIER_1" | "MESSAGING_LIMIT_TIER_2" | "MESSAGING_LIMIT_TIER_3" | "MESSAGING_LIMIT_TIER_4";
1232
+ /** Search visibility status for the WhatsApp Business Account */
1233
+ export type WAAPIBusinessGlobalSearchStateStatus = "VISIBLE" | "HIDDEN";
1234
+ /** Response from sending a message */
1235
+ export type MessageResponse = {
1236
+ /** Messaging service */
1237
+ messaging_product: "whatsapp";
1238
+ /** Contact information */
1239
+ contacts: Array<ContactResponse>;
1240
+ /** Message information */
1241
+ messages: Array<MessageResponseItem>;
1242
+ };
1243
+ export type ContactResponse = {
1244
+ /** Input phone number */
1245
+ input: string;
1246
+ /** WhatsApp ID */
1247
+ wa_id?: string;
1248
+ };
1249
+ export type MessageResponseItem = {
1250
+ /** Message ID */
1251
+ id: string;
1252
+ };
1253
+ /** Generic success response */
1254
+ export type SuccessResponse = {
1255
+ /** Operation success status */
1256
+ success: boolean;
1257
+ };
1258
+ /** Standard Graph API error response */
1259
+ export type GraphAPIError4 = {
1260
+ error: {
1261
+ /** Human-readable error message */
1262
+ message: string;
1263
+ /** Error category type */
1264
+ type: string;
1265
+ /** Numeric error code */
1266
+ code: number;
1267
+ /** More specific error subcode when available */
1268
+ error_subcode?: number;
1269
+ /** Unique identifier for debugging and support requests with Meta */
1270
+ fbtrace_id?: string;
1271
+ /** Indicates whether this error is temporary and the request should be retried */
1272
+ is_transient?: boolean;
1273
+ };
1274
+ };
1275
+ /** Response indicating successful phone number deregistration */
1276
+ export type DeregisterResponse = {
1277
+ /** Indicates whether the deregistration was successful */
1278
+ success: boolean;
1279
+ };
1280
+ /** Standard Graph API error response */
1281
+ export type GraphAPIError5 = {
1282
+ error: {
1283
+ /** Human-readable error message */
1284
+ message: string;
1285
+ /** Error category type */
1286
+ type: string;
1287
+ /** Numeric error code */
1288
+ code: number;
1289
+ /** More specific error subcode when available */
1290
+ error_subcode?: number;
1291
+ /** Unique identifier for debugging and support requests with Meta */
1292
+ fbtrace_id?: string;
1293
+ /** Indicates whether this error is temporary and the request should be retried */
1294
+ is_transient?: boolean;
1295
+ /** User-friendly error title for display purposes */
1296
+ error_user_title?: string;
1297
+ /** User-friendly error message for display purposes */
1298
+ error_user_msg?: string;
1299
+ };
1300
+ };
1301
+ /** WhatsApp message history entry with delivery status information */
1302
+ export type WhatsAppMessageHistory = {
1303
+ /** Unique identifier for the message history entry */
1304
+ id: string;
1305
+ /** WhatsApp message ID (WAMID) for the message */
1306
+ message_id: string;
1307
+ /** Message delivery status events and occurrences */
1308
+ events?: {
1309
+ /** Array of delivery status events */
1310
+ data?: Array<MessageDeliveryStatusEvent>;
1311
+ paging?: PaginationInfo;
1312
+ };
1313
+ };
1314
+ /** Message delivery status event occurrence */
1315
+ export type MessageDeliveryStatusEvent = {
1316
+ /** Unique identifier for the delivery status event */
1317
+ id: string;
1318
+ delivery_status: WhatsAppMessageDeliveryStatus;
1319
+ webhook_update_state?: WebhookUpdateState;
1320
+ /** Unix timestamp when the delivery status event occurred */
1321
+ timestamp: string;
1322
+ /** Application information for the event */
1323
+ application?: {
1324
+ /** Application ID that processed the event */
1325
+ id?: string;
1326
+ };
1327
+ /** Webhook URI where the event was delivered */
1328
+ webhook_uri?: string;
1329
+ /** Error description if the delivery failed */
1330
+ error_description?: string;
1331
+ };
1332
+ /** Message delivery status */
1333
+ export type WhatsAppMessageDeliveryStatus = "SENT" | "DELIVERED" | "READ" | "FAILED" | "DELETED";
1334
+ /** State of webhook update delivery */
1335
+ export type WebhookUpdateState = "PENDING" | "DELIVERED" | "FAILED" | "RETRYING";
1336
+ /** Paginated response containing message history entries */
1337
+ export type MessageHistoryResponse = {
1338
+ /** Array of message history entries */
1339
+ data?: Array<WhatsAppMessageHistory>;
1340
+ paging?: PaginationInfo;
1341
+ };
1342
+ /** Pagination information for navigating through results */
1343
+ export type PaginationInfo = {
1344
+ /** Pagination cursors for navigation */
1345
+ cursors?: {
1346
+ /** Cursor for the previous page of results */
1347
+ before?: string;
1348
+ /** Cursor for the next page of results */
1349
+ after?: string;
1350
+ };
1351
+ /** URL for the previous page of results */
1352
+ previous?: string;
1353
+ /** URL for the next page of results */
1354
+ next?: string;
1355
+ };
1356
+ /** Request payload for registering a WhatsApp Business phone number */
1357
+ export type WhatsAppBusinessPhoneNumberRegistrationRequest = {
1358
+ /** Must be 'whatsapp' to indicate WhatsApp Business messaging product */
1359
+ messaging_product: "whatsapp";
1360
+ /** 6-digit PIN for two-step verification setup */
1361
+ pin: string;
1362
+ backup?: WhatsAppBusinessAccountBackup;
1363
+ data_localization_region?: WhatsAppDataLocalizationRegion;
1364
+ /** Message retention period in minutes (deprecated in v21+) */
1365
+ meta_store_retention_minutes?: number;
1366
+ };
1367
+ /** Backup data for migrating existing WhatsApp Business accounts */
1368
+ export type WhatsAppBusinessAccountBackup = {
1369
+ /** Backup password for account migration */
1370
+ password?: string;
1371
+ /** Encrypted backup data for account migration */
1372
+ data?: string;
1373
+ };
1374
+ /** Data localization region for message storage (deprecated in v21+) */
1375
+ export type WhatsAppDataLocalizationRegion = "AE" | "AU" | "BH" | "BR" | "CA" | "CH" | "DE" | "GB" | "ID" | "IN" | "JP" | "KR" | "SG" | "ZA";
1376
+ /** Response from phone number registration request */
1377
+ export type WhatsAppBusinessPhoneNumberRegistrationResponse = {
1378
+ /** Indicates whether the registration was successful */
1379
+ success: boolean;
1380
+ };
1381
+ /** Standard Graph API error response */
1382
+ export type GraphAPIError6 = {
1383
+ error: {
1384
+ /** Human-readable error message */
1385
+ message: string;
1386
+ /** Error category type */
1387
+ type: string;
1388
+ /** Numeric error code */
1389
+ code: number;
1390
+ /** More specific error subcode when available */
1391
+ error_subcode?: number;
1392
+ /** Unique identifier for debugging and support requests with Meta */
1393
+ fbtrace_id?: string;
1394
+ /** Indicates whether this error is temporary and the request should be retried */
1395
+ is_transient?: boolean;
1396
+ /** User-friendly error title for display purposes */
1397
+ error_user_title?: string;
1398
+ /** User-friendly error message for display purposes */
1399
+ error_user_msg?: string;
1400
+ };
1401
+ };
1402
+ /** Request body for requesting a verification code */
1403
+ export type RequestCodeRequest = {
1404
+ /** Method for receiving the verification code */
1405
+ code_method: "SMS" | "VOICE";
1406
+ /** Language locale for the verification message */
1407
+ language: string;
1408
+ };
1409
+ /** Response after successfully requesting a verification code */
1410
+ export type RequestCodeResponse = {
1411
+ /** Indicates whether the verification code request was successful */
1412
+ success: boolean;
1413
+ };
1414
+ export type CallingSettingsRequest = {
1415
+ calling: CallingSettings;
1416
+ };
1417
+ export type CallingSettings1 = {
1418
+ /** Enable or disable calling feature */
1419
+ status: "enabled" | "disabled";
1420
+ /** Control visibility of the call icon */
1421
+ call_icon_visibility?: "visible" | "hidden";
1422
+ video?: VideoSettings;
1423
+ sip?: SipSettings;
1424
+ /** SRTP key exchange protocol */
1425
+ srtp_key_exchange_protocol?: "DTLS-SRTP" | "SDES-SRTP";
1426
+ };
1427
+ export type VideoSettings = {
1428
+ /** Enable or disable video calling */
1429
+ status: "enabled" | "disabled";
1430
+ };
1431
+ export type SipSettings = {
1432
+ /** Enable or disable SIP calling */
1433
+ status: "enabled" | "disabled";
1434
+ };
1435
+ export type UserIdentityChangeSettingsRequest = {
1436
+ user_identity_change: UserIdentityChangeSettings;
1437
+ };
1438
+ export type UserIdentityChangeSettings = {
1439
+ /** Enable or disable user identity change notifications */
1440
+ enabled: boolean;
1441
+ };
1442
+ export type PayloadEncryptionSettingsRequest = {
1443
+ payload_encryption: PayloadEncryptionSettings;
1444
+ };
1445
+ export type PayloadEncryptionSettings = {
1446
+ /** Enable or disable payload encryption */
1447
+ status: "enabled" | "disabled";
1448
+ /** Base64-encoded public key for payload encryption (required when enabling encryption) */
1449
+ client_encryption_key?: string;
1450
+ };
1451
+ export type StorageConfigurationSettingsRequest = {
1452
+ storage_configuration: StorageConfigurationSettings;
1453
+ };
1454
+ export type StorageConfigurationSettings = {
1455
+ /** Enable or disable custom storage configuration */
1456
+ enabled: boolean;
1457
+ /** Data storage region */
1458
+ region?: string;
1459
+ };
1460
+ export type PhoneNumberSettingsResponse = {
1461
+ calling: CallingSettingsResponse;
1462
+ payload_encryption?: PayloadEncryptionSettingsResponse;
1463
+ storage_configuration: StorageConfigurationSettingsResponse;
1464
+ };
1465
+ export type CallingSettingsResponse = {
1466
+ /** Current calling feature status */
1467
+ status: "enabled" | "disabled";
1468
+ /** Current call icon visibility setting */
1469
+ call_icon_visibility: "visible" | "hidden";
1470
+ ip_addresses: {
1471
+ /** Default IP addresses for calling */
1472
+ default: Array<string>;
1473
+ };
1474
+ /** Callback permission status */
1475
+ callback_permission_status: "enabled" | "disabled";
1476
+ /** SRTP key exchange protocol (optional) */
1477
+ srtp_key_exchange_protocol?: "DTLS-SRTP" | "SDES-SRTP";
1478
+ call_hours?: CallHoursSettings;
1479
+ call_icons?: CallIconsSettings;
1480
+ sip?: SipSettingsResponse;
1481
+ video?: VideoSettingsResponse;
1482
+ audio?: AudioSettingsResponse;
1483
+ restrictions?: CallingRestrictionsResponse;
1484
+ };
1485
+ export type CallHoursSettings = {
1486
+ /** Call hours feature status */
1487
+ status: "enabled" | "disabled";
1488
+ /** Timezone for call hours */
1489
+ timezone?: string;
1490
+ /** Start day of the week */
1491
+ day_of_week_start?: string;
1492
+ };
1493
+ export type CallIconsSettings = {
1494
+ /** List of countries where call icons are restricted */
1495
+ restrict_to_user_countries?: Array<string>;
1496
+ };
1497
+ export type SipSettingsResponse = {
1498
+ /** SIP calling status */
1499
+ status: "enabled" | "disabled";
1500
+ /** SIP server configuration */
1501
+ servers?: Array<SipServerInfo>;
1502
+ };
1503
+ export type SipServerInfo = {
1504
+ /** Application ID for SIP server */
1505
+ app_id: string;
1506
+ /** SIP server hostname */
1507
+ hostname: string;
1508
+ /** SIP server port (optional) */
1509
+ port?: number;
1510
+ /** SIP password (only included when include_sip_credentials=true) */
1511
+ password?: string;
1512
+ };
1513
+ export type VideoSettingsResponse = {
1514
+ /** Video calling status */
1515
+ status: "enabled" | "disabled";
1516
+ };
1517
+ export type AudioSettingsResponse = {
1518
+ /** Audio calling status */
1519
+ status?: "enabled" | "disabled";
1520
+ };
1521
+ export type CallingRestrictionsResponse = {
1522
+ restrictions?: Array<{
1523
+ /** Type of restriction */
1524
+ type?: string;
1525
+ /** Expiration timestamp for the restriction */
1526
+ expiration?: string;
1527
+ }>;
1528
+ };
1529
+ export type PayloadEncryptionSettingsResponse = {
1530
+ /** Payload encryption status */
1531
+ status: "enabled" | "disabled";
1532
+ /** Client encryption key fingerprint (when encryption is enabled) */
1533
+ client_encryption_key_fingerprint?: string;
1534
+ /** Cloud encryption key (when encryption is enabled) */
1535
+ cloud_encryption_key?: string;
1536
+ };
1537
+ export type StorageConfigurationSettingsResponse = {
1538
+ /** Data storage configuration status */
1539
+ status: "default" | "in_country_storage_enabled";
1540
+ /** Data localization region (when in-country storage is enabled) */
1541
+ data_localization_region?: string;
1542
+ };
1543
+ /** Request payload for phone number verification code verification */
1544
+ export type VerifyCodeRequest1 = {
1545
+ /** The verification code received via SMS or voice call */
1546
+ code: string;
1547
+ };
1548
+ /** Response from phone number verification code verification */
1549
+ export type VerifyCodeResponse = {
1550
+ /** Indicates whether the verification code was successfully verified */
1551
+ success: boolean;
1552
+ /** The phone number ID that was verified */
1553
+ id?: string;
1554
+ };
1555
+ /** Standard Graph API error response */
1556
+ export type GraphAPIError7 = {
1557
+ error: {
1558
+ /** Human-readable error message */
1559
+ message: string;
1560
+ /** Error category type */
1561
+ type: string;
1562
+ /** Numeric error code */
1563
+ code: number;
1564
+ /** More specific error subcode when available */
1565
+ error_subcode?: number;
1566
+ /** Unique identifier for debugging and support requests with Meta */
1567
+ fbtrace_id?: string;
1568
+ /** Indicates whether this error is temporary and the request should be retried */
1569
+ is_transient?: boolean;
1570
+ /** User-friendly error title for display purposes */
1571
+ error_user_title?: string;
1572
+ /** User-friendly error message for display purposes */
1573
+ error_user_msg?: string;
1574
+ };
1575
+ };
1576
+ /** Business encryption public key information and verification status */
1577
+ export type WhatsAppBusinessEncryptionInfo = {
1578
+ /** The business public key used for encrypting message payloads. This key is used to encrypt data channel requests and responses. */
1579
+ business_public_key: string;
1580
+ business_public_key_signature_status: BusinessPublicKeyVerificationStatus;
1581
+ };
1582
+ /** Status of business public key signature verification */
1583
+ export type BusinessPublicKeyVerificationStatus = "VALID" | "MISMATCH";
1584
+ /** Request payload for uploading business public key */
1585
+ export type WhatsAppBusinessEncryptionUploadRequest = {
1586
+ /** The business public key in PEM format to be uploaded and signed. Must be a valid RSA public key that will be used for payload encryption. */
1587
+ business_public_key: string;
1588
+ };
1589
+ /** Response after successful public key upload */
1590
+ export type WhatsAppBusinessEncryptionUploadResponse = {
1591
+ /** Indicates whether the public key was successfully uploaded and signed */
1592
+ success: boolean;
1593
+ };
1594
+ /** Standard Graph API error response */
1595
+ export type GraphAPIError8 = {
1596
+ error: {
1597
+ /** Human-readable error message */
1598
+ message: string;
1599
+ /** Error category type */
1600
+ type: string;
1601
+ /** Numeric error code */
1602
+ code: number;
1603
+ /** More specific error subcode when available */
1604
+ error_subcode?: number;
1605
+ /** Unique identifier for debugging and support requests with Meta */
1606
+ fbtrace_id?: string;
1607
+ /** Indicates whether this error is temporary and the request should be retried */
1608
+ is_transient?: boolean;
1609
+ /** User-friendly error title for display purposes */
1610
+ error_user_title?: string;
1611
+ /** User-friendly error message for display purposes */
1612
+ error_user_msg?: string;
1613
+ };
1614
+ };
1615
+ /** WhatsApp Business Profile information and settings */
1616
+ export type WhatsAppBusinessProfile = {
1617
+ /** The messaging service used for the request */
1618
+ messaging_product: "whatsapp";
1619
+ /** The text to display in business profile's About section */
1620
+ about?: string;
1621
+ /** The address of the business */
1622
+ address?: string;
1623
+ /** Description of the business */
1624
+ description?: string;
1625
+ /** The contact email address of the business */
1626
+ email?: string;
1627
+ /** URL of the business profile picture */
1628
+ profile_picture_url?: string;
1629
+ /** URLs associated with the business */
1630
+ websites?: Array<string>;
1631
+ vertical?: WhatsAppBusinessVertical;
1632
+ };
1633
+ /** Request payload for updating WhatsApp Business Profile */
1634
+ export type WhatsAppBusinessProfileUpdateRequest = {
1635
+ /** The messaging service used for the request */
1636
+ messaging_product: "whatsapp";
1637
+ /** The text to display in business profile's About section */
1638
+ about?: string;
1639
+ /** The address of the business */
1640
+ address?: string;
1641
+ /** Description of the business */
1642
+ description?: string;
1643
+ /** The contact email address of the business */
1644
+ email?: string;
1645
+ /** The handle of the profile picture generated from Resumable Upload API */
1646
+ profile_picture_handle?: string;
1647
+ /** URLs associated with the business */
1648
+ websites?: Array<string>;
1649
+ vertical?: WhatsAppBusinessVertical;
1650
+ };
1651
+ /** The industry type of the business */
1652
+ export type WhatsAppBusinessVertical = "OTHER" | "AUTO" | "BEAUTY" | "APPAREL" | "EDU" | "ENTERTAIN" | "EVENT_PLAN" | "FINANCE" | "GROCERY" | "GOVT" | "HOTEL" | "HEALTH" | "NONPROFIT" | "PROF_SERVICES" | "RETAIL" | "TRAVEL" | "RESTAURANT" | "ALCOHOL" | "ONLINE_GAMBLING" | "PHYSICAL_GAMBLING" | "OTC_DRUGS";
1653
+ /** Response containing business profile information */
1654
+ export type WhatsAppBusinessProfileResponse = {
1655
+ data?: Array<{
1656
+ business_profile?: WhatsAppBusinessProfile;
1657
+ }>;
1658
+ };
1659
+ /** Response after updating business profile */
1660
+ export type WhatsAppBusinessProfileUpdateResponse = {
1661
+ /** Indicates whether the update was successful */
1662
+ success?: boolean;
1663
+ };
1664
+ /** WhatsApp Business Account compliance information and regulatory details */
1665
+ export type BusinessComplianceInfo = {
1666
+ /** Unique identifier for the WhatsApp Business Account */
1667
+ whatsapp_business_account_id: string;
1668
+ /** Messaging product identifier, always 'whatsapp' for WhatsApp Business */
1669
+ messaging_product?: "whatsapp";
1670
+ /** Legal name of the business entity */
1671
+ entity_name?: string;
1672
+ /** Type of business entity (e.g., Partnership, Private Limited Company, etc.) */
1673
+ entity_type?: string;
1674
+ /** Custom entity type description when standard types don't apply */
1675
+ entity_type_custom?: string;
1676
+ /** Whether the business entity is officially registered with regulatory authorities */
1677
+ is_registered?: boolean;
1678
+ grievance_officer_details?: GrievanceOfficerDetails;
1679
+ customer_care_details?: CustomerCareDetails;
1680
+ };
1681
+ /** Contact information for the designated grievance officer */
1682
+ export type GrievanceOfficerDetails = {
1683
+ /** Full name of the grievance officer */
1684
+ name?: string;
1685
+ /** Email address for grievance officer contact */
1686
+ email?: string;
1687
+ /** Mobile phone number for grievance officer (with country code) */
1688
+ mobile_number?: string;
1689
+ /** Landline phone number for grievance officer (with country code) */
1690
+ landline_number?: string;
1691
+ };
1692
+ /** Contact information for customer care and support */
1693
+ export type CustomerCareDetails = {
1694
+ /** Email address for customer care contact */
1695
+ email?: string;
1696
+ /** Mobile phone number for customer care (with country code) */
1697
+ mobile_number?: string;
1698
+ /** Landline phone number for customer care (with country code) */
1699
+ landline_number?: string;
1700
+ };
1701
+ /** Request object for updating WhatsApp Business Account compliance information */
1702
+ export type BusinessComplianceInfoUpdateRequest = {
1703
+ /** Messaging product identifier, must be 'whatsapp' */
1704
+ messaging_product: "whatsapp";
1705
+ /** Legal name of the business entity */
1706
+ entity_name: string;
1707
+ entity_type: BusinessEntityType;
1708
+ /** Custom entity type description when entity_type is "OTHER". Required for OTHER entity type. */
1709
+ entity_type_custom?: string;
1710
+ /** Whether the business entity is officially registered with regulatory authorities. Can only be used with "OTHER" or "PARTNERSHIP" entity types. */
1711
+ is_registered?: boolean;
1712
+ grievance_officer_details: GrievanceOfficerUpdateDetails;
1713
+ customer_care_details: CustomerCareUpdateDetails;
1714
+ };
1715
+ /** Type of business entity for compliance purposes */
1716
+ export type BusinessEntityType = "LIMITED_LIABILITY_PARTNERSHIP" | "SOLE_PROPRIETORSHIP" | "PARTNERSHIP" | "PUBLIC_COMPANY" | "PRIVATE_COMPANY" | "OTHER";
1717
+ /** Contact information for the designated grievance officer */
1718
+ export type GrievanceOfficerUpdateDetails = {
1719
+ /** Full name of the grievance officer */
1720
+ name: string;
1721
+ /** Email address for grievance officer contact */
1722
+ email: string;
1723
+ /** Mobile phone number for grievance officer (with country code) */
1724
+ mobile_number?: string;
1725
+ /** Landline phone number for grievance officer (with country code) */
1726
+ landline_number?: string;
1727
+ };
1728
+ /** Contact information for customer care and support */
1729
+ export type CustomerCareUpdateDetails = {
1730
+ /** Email address for customer care contact */
1731
+ email: string;
1732
+ /** Mobile phone number for customer care (with country code) */
1733
+ mobile_number?: string;
1734
+ /** Landline phone number for customer care (with country code) */
1735
+ landline_number?: string;
1736
+ };
1737
+ export type ApiError = {
1738
+ /** Error code */
1739
+ code?: number;
1740
+ /** Error message */
1741
+ message?: string;
1742
+ /** Error title */
1743
+ title?: string;
1744
+ error_data?: {
1745
+ /** Error details */
1746
+ details?: string;
1747
+ };
1748
+ };
1749
+ export type GroupInfo = {
1750
+ /** Group ID */
1751
+ id?: string;
1752
+ messaging_product?: string;
1753
+ /** Join approval mode for the group */
1754
+ join_approval_mode?: "approval_required" | "auto_approve";
1755
+ /** Group subject */
1756
+ subject?: string;
1757
+ /** Group description */
1758
+ description?: string;
1759
+ /** Returns true if the group has been suspended by WhatsApp */
1760
+ suspended?: boolean;
1761
+ /** UNIX timestamp in seconds at which the group was created */
1762
+ creation_timestamp?: number;
1763
+ /** List of participants in the group */
1764
+ participants?: Array<{
1765
+ /** WhatsApp user ID */
1766
+ wa_id?: string;
1767
+ }>;
1768
+ /** Total number of participants in the group, excluding your business */
1769
+ total_participant_count?: number;
1770
+ };
1771
+ /** Edge containing message delivery status occurrence with pagination cursor */
1772
+ export type WhatsAppMessageHistoryEventsEdge = {
1773
+ /** Pagination cursor for this edge */
1774
+ cursor?: string;
1775
+ node: WhatsAppBusinessMessageDeliveryStatusOccurrence;
1776
+ };
1777
+ /** Message delivery status occurrence with detailed event information */
1778
+ export type WhatsAppBusinessMessageDeliveryStatusOccurrence = {
1779
+ /** Unique identifier for the message delivery status occurrence */
1780
+ id: string;
1781
+ delivery_status: WhatsAppMessageDeliveryStatus;
1782
+ /** Error description if the delivery encountered an error */
1783
+ error_description?: string;
1784
+ /** Unix timestamp when the delivery status occurrence happened */
1785
+ occurrence_timestamp: string;
1786
+ /** Unix timestamp when the status was recorded */
1787
+ status_timestamp?: string;
1788
+ application?: ApplicationNode;
1789
+ };
1790
+ /** Message delivery status */
1791
+ export type WhatsAppMessageDeliveryStatus1 = "ACCEPTED" | "DELIVERED" | "ERROR" | "READ" | "SENT";
1792
+ /** Meta application that processed the delivery status event */
1793
+ export type ApplicationNode1 = {
1794
+ /** Unique identifier for the Meta application */
1795
+ id?: string;
1796
+ /** Name of the Meta application */
1797
+ name?: string;
1798
+ };
1799
+ /** Paginated response containing message history events */
1800
+ export type MessageHistoryEventsResponse = {
1801
+ /** Array of message history event edges */
1802
+ data?: Array<WhatsAppMessageHistoryEventsEdge>;
1803
+ paging?: PaginationInfo;
1804
+ };
1805
+ /** Pagination information for navigating through results */
1806
+ export type PaginationInfo1 = {
1807
+ /** Pagination cursors for navigation */
1808
+ cursors?: {
1809
+ /** Cursor for the previous page of results */
1810
+ before?: string;
1811
+ /** Cursor for the next page of results */
1812
+ after?: string;
1813
+ };
1814
+ /** URL for the previous page of results */
1815
+ previous?: string;
1816
+ /** URL for the next page of results */
1817
+ next?: string;
1818
+ };
1819
+ /** WhatsApp Business Account migration intent details and status */
1820
+ export type WhatsAppBusinessAccountMigrationIntent = {
1821
+ /** Unique identifier for the migration intent */
1822
+ id: string;
1823
+ status: WhatsAppBusinessAccountMigrationStatus;
1824
+ };
1825
+ /** Current status of the WhatsApp Business Account migration intent */
1826
+ export type WhatsAppBusinessAccountMigrationStatus = "ACCEPTED" | "COMPLETED" | "INITIATED" | "REJECTED";
1827
+ /** Pre-verified phone number validation details and status */
1828
+ export type PreVerifiedPhoneNumberValidation = {
1829
+ /** Unique identifier for the pre-verified phone number */
1830
+ id?: string;
1831
+ /** Country code prefix for the phone number */
1832
+ country_prefix?: number;
1833
+ /** Formatted display version of the phone number */
1834
+ display_phone_number?: string;
1835
+ /** Error message if validation failed */
1836
+ error_msg?: string;
1837
+ /** Whether the provided phone number ID is valid */
1838
+ is_input_id_valid: boolean;
1839
+ };
1840
+ /** Response containing partner businesses for a pre-verified phone number */
1841
+ export type WhatsAppBusinessPreVerifiedPhoneNumberPartnersResponse = {
1842
+ /** List of partner businesses with access to the pre-verified phone number */
1843
+ data: Array<BusinessPartner>;
1844
+ paging?: CursorPaging;
1845
+ };
1846
+ /** Business entity that has partner access to the pre-verified phone number */
1847
+ export type BusinessPartner = {
1848
+ /** Unique identifier for the partner business */
1849
+ id: string;
1850
+ /** Name of the partner business */
1851
+ name: string;
1852
+ /** ISO 8601 timestamp when the business was created */
1853
+ created_time?: string;
1854
+ /** ISO 8601 timestamp when the business was last updated */
1855
+ updated_time?: string;
1856
+ /** Business verification status */
1857
+ verification_status?: "not_verified" | "pending" | "verified";
1858
+ /** Primary Facebook Page ID associated with the business */
1859
+ primary_page?: string;
1860
+ /** Timezone identifier for the business location */
1861
+ timezone_id?: number;
1862
+ /** Two-factor authentication method configured for the business */
1863
+ two_factor_type?: "none" | "admin_required";
1864
+ };
1865
+ /** Cursor-based pagination information */
1866
+ export type CursorPaging5 = {
1867
+ cursors?: {
1868
+ /** Cursor pointing to the start of the page of data that has been returned */
1869
+ before?: string;
1870
+ /** Cursor pointing to the end of the page of data that has been returned */
1871
+ after?: string;
1872
+ };
1873
+ /** Graph API endpoint URL for the next page of results */
1874
+ next?: string;
1875
+ /** Graph API endpoint URL for the previous page of results */
1876
+ previous?: string;
1877
+ };
1878
+ /** Request body for requesting verification code */
1879
+ export type RequestCodeRequest1 = {
1880
+ code_method: PhoneVerificationMethodCode;
1881
+ /** Language/locale code for the verification message. Must be a valid locale identifier. The verification message will be sent in this language if supported. Supports various formats including xx_XX, xx-XX, and extended locale codes. */
1882
+ language: string;
1883
+ };
1884
+ /** Method for receiving the verification code */
1885
+ export type PhoneVerificationMethodCode = "SMS" | "VOICE";
1886
+ /** Response after successfully requesting verification code */
1887
+ export type RequestCodeResponse1 = {
1888
+ /** Indicates whether the verification code request was successful */
1889
+ success: boolean;
1890
+ };
1891
+ /** Request payload for verifying OTP code */
1892
+ export type VerifyCodeRequest2 = {
1893
+ /** The numeric verification code received via SMS or voice call. This code is provided after calling the request_code endpoint. */
1894
+ code: string;
1895
+ };
1896
+ /** Response indicating successful code verification */
1897
+ export type VerifyCodeResponse1 = {
1898
+ /** Indicates whether the code verification was successful */
1899
+ success: boolean;
1900
+ };
1901
+ /** Standard Graph API error response */
1902
+ export type GraphAPIError9 = {
1903
+ error: {
1904
+ /** Human-readable error message */
1905
+ message: string;
1906
+ /** Error category type */
1907
+ type: string;
1908
+ /** Numeric error code */
1909
+ code: number;
1910
+ /** More specific error subcode when available */
1911
+ error_subcode?: number;
1912
+ /** Unique identifier for debugging and support requests with Meta */
1913
+ fbtrace_id?: string;
1914
+ /** Indicates whether this error is temporary and the request should be retried */
1915
+ is_transient?: boolean;
1916
+ /** User-friendly error title for display purposes */
1917
+ error_user_title?: string;
1918
+ /** User-friendly error message for display purposes */
1919
+ error_user_msg?: string;
1920
+ };
1921
+ };
1922
+ /** Granular BISU access token response for Multi-Partner Solution partners */
1923
+ export type WhatsAppBusinessSolutionAccessToken = {
1924
+ /** Granular BISU access token for accessing customer business resources */
1925
+ access_token: string;
1926
+ /** Unix timestamp indicating when the access token expires */
1927
+ expires_at: string;
1928
+ };
1929
+ /** WhatsApp Business Multi-Partner Solution object with core node fields only */
1930
+ export type WhatsAppBusinessSolution1 = {
1931
+ /** Unique identifier for the WhatsApp Business Solution */
1932
+ id: string;
1933
+ /** Human-readable name for the solution (UGC text, 2-75 characters) */
1934
+ name: string;
1935
+ status: WhatsAppBusinessSolutionStatus;
1936
+ status_for_pending_request: WhatsAppBusinessSolutionPendingStatus;
1937
+ /** Array of permissions granted to the solution owner */
1938
+ owner_permissions?: Array<WhatsAppBusinessAccountPermissionTask>;
1939
+ };
1940
+ /** Current status of the WhatsApp Business Solution */
1941
+ export type WhatsAppBusinessSolutionStatus1 = "DRAFT" | "INITIATED" | "ACTIVE" | "REJECTED" | "DEACTIVATED" | "PENDING_DEACTIVATION";
1942
+ /** Status of any pending requests for the solution */
1943
+ export type WhatsAppBusinessSolutionPendingStatus1 = "PENDING_ACTIVATION" | "PENDING_DEACTIVATION" | "NONE";
1944
+ /** Standard Graph API error response */
1945
+ export type GraphAPIError10 = {
1946
+ error: {
1947
+ /** Human-readable error message */
1948
+ message: string;
1949
+ /** Error type classification */
1950
+ type: "OAuthException" | "GraphMethodException" | "GraphAPIException";
1951
+ /** Numeric error code */
1952
+ code: number;
1953
+ /** More specific error subcode */
1954
+ error_subcode?: number;
1955
+ /** Internal trace ID for debugging */
1956
+ fbtrace_id?: string;
1957
+ /** Whether this error might be resolved by retrying */
1958
+ is_transient?: boolean;
1959
+ /** User-friendly error title */
1960
+ error_user_title?: string;
1961
+ /** User-friendly error message */
1962
+ error_user_msg?: string;
1963
+ };
1964
+ };
1965
+ /** Request payload for accepting a Multi-Partner Solution invitation */
1966
+ export type WhatsAppBusinessSolutionAcceptRequest = {
1967
+ /** ID of the partner application accepting the solution invitation. This must match the app ID that received the original invitation. */
1968
+ partner_app_id: string;
1969
+ /** Optional session identifier for logging and debugging purposes. Used to track the acceptance flow across multiple API calls. */
1970
+ log_session_id?: string;
1971
+ };
1972
+ /** Successful response confirming solution acceptance */
1973
+ export type WhatsAppBusinessSolutionAcceptResponse = {
1974
+ /** ID of the Multi-Partner Solution that was accepted */
1975
+ solution_id: string;
1976
+ partner_status: WhatsAppBusinessSolutionPartnerStatus;
1977
+ /** Indicates whether the acceptance was successful */
1978
+ success: boolean;
1979
+ /** Human-readable confirmation message */
1980
+ message?: string;
1981
+ /** Timestamp when the acceptance was processed */
1982
+ update_time?: string;
1983
+ };
1984
+ /** Current status of the partner's participation in the Multi-Partner Solution */
1985
+ export type WhatsAppBusinessSolutionPartnerStatus = "DRAFT" | "INITIATED" | "NOTIFICATION_SENT" | "ACCEPTED" | "REJECTED" | "DEACTIVATED";
1986
+ /** Multi-Partner Solution details after rejecting deactivation request */
1987
+ export type WhatsAppBusinessSolution2 = {
1988
+ /** Unique identifier for the Multi-Partner Solution */
1989
+ id: string;
1990
+ /** Human-readable name of the Multi-Partner Solution */
1991
+ name: string;
1992
+ status: WhatsAppBusinessSolutionStatus;
1993
+ status_for_pending_request: WhatsAppBusinessSolutionPendingStatus;
1994
+ owner_app?: ApplicationNode;
1995
+ /** List of WhatsApp Business Account permissions granted to the solution owner */
1996
+ owner_permissions?: Array<WhatsAppBusinessAccountPermissionTask>;
1997
+ };
1998
+ /** Standard Graph API error response */
1999
+ export type GraphAPIError11 = {
2000
+ error: {
2001
+ /** Human-readable error message */
2002
+ message: string;
2003
+ /** Error type classification */
2004
+ type: string;
2005
+ /** Numeric error code */
2006
+ code: number;
2007
+ /** More specific error subcode when available */
2008
+ error_subcode?: number;
2009
+ /** Unique identifier for debugging and support requests with Meta */
2010
+ fbtrace_id?: string;
2011
+ /** Indicates whether this error is temporary and the request should be retried */
2012
+ is_transient?: boolean;
2013
+ /** User-friendly error title for display purposes */
2014
+ error_user_title?: string;
2015
+ /** User-friendly error message for display purposes */
2016
+ error_user_msg?: string;
2017
+ };
2018
+ };
2019
+ /** Request payload for rejecting a Multi-Partner Solution request */
2020
+ export type SolutionRejectRequest = {
2021
+ /** Type of request being rejected */
2022
+ request_type: "PARTNERSHIP_REQUEST" | "DEACTIVATION_REQUEST";
2023
+ /** Optional reason for rejecting the request */
2024
+ rejection_reason?: string;
2025
+ /** The app ID of the requesting partner. Required when request_type is PARTNERSHIP_REQUEST, not used for DEACTIVATION_REQUEST */
2026
+ partner_app_id?: string;
2027
+ };
2028
+ /** Successful response for solution rejection operation */
2029
+ export type SolutionRejectResponse = {
2030
+ /** Indicates whether the rejection was successful */
2031
+ success: boolean;
2032
+ /** The ID of the Multi-Partner Solution */
2033
+ solution_id: string;
2034
+ /** Type of request that was rejected */
2035
+ rejected_request_type: "PARTNERSHIP_REQUEST" | "DEACTIVATION_REQUEST";
2036
+ /** ISO 8601 timestamp when the rejection was processed */
2037
+ rejection_timestamp?: string;
2038
+ /** App ID of the partner whose request was rejected (for partnership rejections) */
2039
+ partner_app_id?: string;
2040
+ };
2041
+ /** Request payload for sending a Multi-Partner Solution deactivation request */
2042
+ export type WhatsAppBusinessSolutionDeactivationRequest = {
2043
+ /** Optional reason for the deactivation request */
2044
+ reason?: string;
2045
+ };
2046
+ /** Successful response for deactivation request submission */
2047
+ export type WhatsAppBusinessSolutionDeactivationResponse = {
2048
+ /** Indicates whether the deactivation request was successfully submitted */
2049
+ success: boolean;
2050
+ /** Human-readable message describing the result */
2051
+ message: string;
2052
+ /** Unique identifier for tracking the deactivation request */
2053
+ request_id?: string;
2054
+ };
2055
+ /** WhatsApp Business Account assigned to a user */
2056
+ export type AssignedWhatsAppBusinessAccount = {
2057
+ /** Unique identifier for the WhatsApp Business Account */
2058
+ id: string;
2059
+ /** Display name of the WhatsApp Business Account */
2060
+ name: string;
2061
+ status: WhatsAppBusinessAccountStatus;
2062
+ /** Date and time when the account was assigned to the user */
2063
+ assignment_date?: string;
2064
+ /** List of permissions granted to the user for this account */
2065
+ permissions?: Array<WhatsAppBusinessAccountPermission>;
2066
+ /** Business ID that owns this WhatsApp Business Account */
2067
+ business_id?: string;
2068
+ /** Phone numbers associated with this WhatsApp Business Account */
2069
+ phone_numbers?: Array<PhoneNumberInfo>;
2070
+ };
2071
+ /** Current status of the WhatsApp Business Account */
2072
+ export type WhatsAppBusinessAccountStatus = "ACTIVE" | "PENDING" | "RESTRICTED" | "DISABLED";
2073
+ /** Permission level for WhatsApp Business Account access */
2074
+ export type WhatsAppBusinessAccountPermission = "MANAGE" | "DEVELOP" | "MANAGE_TEMPLATES" | "MANAGE_PHONE" | "VIEW_COST" | "MANAGE_EXTENSIONS" | "VIEW_PHONE_ASSETS" | "MANAGE_PHONE_ASSETS" | "VIEW_TEMPLATES" | "VIEW_INSIGHTS" | "RECEIVE_INCOMING_MESSAGES" | "MANAGE_BILLING" | "MANAGE_USERS" | "MESSAGING" | "FULL_CONTROL";
2075
+ /** Phone number information for WhatsApp Business Account */
2076
+ export type PhoneNumberInfo1 = {
2077
+ /** Phone number ID */
2078
+ id?: string;
2079
+ /** Formatted phone number for display */
2080
+ display_phone_number?: string;
2081
+ /** Verified business name for this phone number */
2082
+ verified_name?: string;
2083
+ /** Status of the phone number */
2084
+ status?: "CONNECTED" | "DISCONNECTED" | "MIGRATED" | "PENDING" | "DELETED";
2085
+ };
2086
+ /** Response containing assigned WhatsApp Business Accounts */
2087
+ export type AssignedAccountsResponse = {
2088
+ /** List of assigned WhatsApp Business Accounts */
2089
+ data: Array<AssignedWhatsAppBusinessAccount>;
2090
+ paging?: PagingInfo;
2091
+ };
2092
+ /** Pagination information for the response */
2093
+ export type PagingInfo1 = {
2094
+ cursors?: {
2095
+ /** Cursor for the previous page */
2096
+ before?: string;
2097
+ /** Cursor for the next page */
2098
+ after?: string;
2099
+ };
2100
+ /** URL for the next page of results */
2101
+ next?: string;
2102
+ /** URL for the previous page of results */
2103
+ previous?: string;
2104
+ };
2105
+ /** WhatsApp Account Number details and configuration */
2106
+ export type WhatsAppAccountNumber = {
2107
+ /** Unique identifier for the WhatsApp Account Number */
2108
+ id: string;
2109
+ /** Phone number in international format for display purposes */
2110
+ display_phone_number: string;
2111
+ /** Business name verified for this phone number */
2112
+ verified_name?: string;
2113
+ status: WhatsAppAccountNumberStatus;
2114
+ quality_rating?: WhatsAppPhoneNumberQualityRating;
2115
+ /** ISO 3166-1 alpha-2 country code */
2116
+ country_code?: string;
2117
+ /** Country dialing code */
2118
+ country_dial_code?: string;
2119
+ code_verification_status?: WhatsAppCodeVerificationStatus;
2120
+ name_status?: WhatsAppDisplayNameStatus;
2121
+ /** Current messaging limit tier for the account number */
2122
+ messaging_limit_tier?: "TIER_50" | "TIER_250" | "TIER_1K" | "TIER_10K" | "TIER_100K" | "TIER_UNLIMITED";
2123
+ account_mode?: WhatsAppBusinessSandboxEligibility;
2124
+ /** Business certificate information for the account number */
2125
+ certificate?: string;
2126
+ /** Whether this is an official business account */
2127
+ is_official_business_account?: boolean;
2128
+ };
2129
+ /** Current status of the WhatsApp Account Number */
2130
+ export type WhatsAppAccountNumberStatus = "CONNECTED" | "DISCONNECTED" | "UNVERIFIED" | "PENDING" | "FLAGGED" | "RESTRICTED";
2131
+ /** Quality rating based on message delivery and user feedback */
2132
+ export type WhatsAppPhoneNumberQualityRating = "GREEN" | "YELLOW" | "RED" | "NA";
2133
+ /** Two-step verification status for the phone number */
2134
+ export type WhatsAppCodeVerificationStatus = "VERIFIED" | "UNVERIFIED";
2135
+ /** Status of the display name associated with the phone number */
2136
+ export type WhatsAppDisplayNameStatus = "APPROVED" | "AVAILABLE_WITHOUT_REVIEW" | "DECLINED" | "EXPIRED" | "PENDING_REVIEW" | "NONE";
2137
+ /** Account mode indicating sandbox or live environment */
2138
+ export type WhatsAppBusinessSandboxEligibility = "LIVE" | "SANDBOX";
2139
+ /** User assigned to WhatsApp Business Account with permissions */
2140
+ export type AssignedUser = {
2141
+ /** Unique identifier for the assigned user */
2142
+ id: string;
2143
+ /** Display name of the assigned user */
2144
+ name: string;
2145
+ business?: BusinessNode;
2146
+ user_type?: AssignedUserType;
2147
+ };
2148
+ /** Type of user assignment */
2149
+ export type AssignedUserType = "BUSINESS_USER" | "SYSTEM_USER" | "PERSONAL_USER";
2150
+ /** Business entity associated with the user */
2151
+ export type BusinessNode = {
2152
+ /** Unique identifier for the business */
2153
+ id?: string;
2154
+ /** Name of the business */
2155
+ name?: string;
2156
+ };
2157
+ /** Response containing list of assigned users with pagination */
2158
+ export type AssignedUsersResponse = {
2159
+ /** Array of assigned users */
2160
+ data: Array<AssignedUser>;
2161
+ paging?: CursorPaging;
2162
+ summary?: AssignedUsersSummary;
2163
+ };
2164
+ /** Summary information about assigned users */
2165
+ export type AssignedUsersSummary = {
2166
+ /** Total number of assigned users */
2167
+ total_count?: number;
2168
+ };
2169
+ /** Cursor-based pagination information */
2170
+ export type CursorPaging6 = {
2171
+ cursors?: {
2172
+ /** Cursor pointing to the start of the page of data */
2173
+ before?: string;
2174
+ /** Cursor pointing to the end of the page of data */
2175
+ after?: string;
2176
+ };
2177
+ /** Graph API endpoint for the next page of results */
2178
+ next?: string;
2179
+ /** Graph API endpoint for the previous page of results */
2180
+ previous?: string;
2181
+ };
2182
+ /** Standard success response for write operations */
2183
+ export type SuccessResponse1 = {
2184
+ /** Indicates whether the operation was successful */
2185
+ success: boolean;
2186
+ };
2187
+ /** Request payload for configuring conversational automation settings */
2188
+ export type ConversationalAutomationRequest = {
2189
+ /** Whether to enable welcome messages for new conversations */
2190
+ enable_welcome_message?: boolean;
2191
+ /** List of conversation prompts (ice breakers) to help guide customer interactions */
2192
+ prompts?: Array<string>;
2193
+ /** List of bot commands for automated responses */
2194
+ commands?: Array<BotCommand>;
2195
+ };
2196
+ /** Bot command configuration for automated responses */
2197
+ export type BotCommand = {
2198
+ /** Name of the bot command (without leading slash) */
2199
+ command_name: string;
2200
+ /** Description of what the command does */
2201
+ command_description: string;
2202
+ };
2203
+ /** Response after successfully configuring conversational automation */
2204
+ export type ConversationalAutomationResponse = {
2205
+ /** Indicates whether the automation configuration was successful */
2206
+ success: boolean;
2207
+ };
2208
+ /** On-behalf request details for business owned objects */
2209
+ export type BusinessOwnedObjectOnBehalfOfRequest = {
2210
+ /** Unique identifier for the on-behalf request */
2211
+ id: string;
2212
+ status: BusinessRequestStatus;
2213
+ /** ID of the business owned object (WhatsApp Business Account) for this request */
2214
+ business_owned_object: string;
2215
+ receiving_business?: BusinessNode;
2216
+ requesting_business?: BusinessNode;
2217
+ };
2218
+ /** Current status of the business request */
2219
+ export type BusinessRequestStatus = "APPROVE" | "DECLINE" | "IN_PROGRESS" | "EXPIRED" | "PENDING" | "CANCELED" | "INVALID";
2220
+ /** Business entity information */
2221
+ export type BusinessNode1 = {
2222
+ /** Unique identifier for the business */
2223
+ id?: string;
2224
+ /** Name of the business */
2225
+ name?: string;
2226
+ };
2227
+ /** Pagination information for cursor-based pagination */
2228
+ export type PaginationInfo2 = {
2229
+ cursors?: {
2230
+ /** Cursor pointing to the start of the page */
2231
+ before?: string;
2232
+ /** Cursor pointing to the end of the page */
2233
+ after?: string;
2234
+ };
2235
+ paging?: {
2236
+ /** URL for the previous page of results */
2237
+ previous?: string;
2238
+ /** URL for the next page of results */
2239
+ next?: string;
2240
+ };
2241
+ };
2242
+ /** Response containing in-progress on-behalf requests with pagination */
2243
+ export type InProgressOnBehalfRequestResponse = {
2244
+ /** Array of in-progress on-behalf requests */
2245
+ data: Array<BusinessOwnedObjectOnBehalfOfRequest>;
2246
+ paging?: PaginationInfo;
2247
+ };
2248
+ /** WhatsApp Business Account OBO Mobility Intent Node */
2249
+ export type OBOMobilityIntentNode = {
2250
+ /** Unique identifier for the OBO Mobility Intent Node */
2251
+ id: string;
2252
+ waba: WhatsAppBusinessAccount;
2253
+ solution: WhatsAppBusinessSolution;
2254
+ /** Current status of the OBO mobility intent */
2255
+ status?: "PENDING" | "ACTIVE" | "COMPLETED" | "CANCELLED" | "FAILED";
2256
+ /** Timestamp when the OBO mobility intent was created (ISO 8601 format) */
2257
+ created_time?: string;
2258
+ /** Timestamp when the OBO mobility intent was last updated (ISO 8601 format) */
2259
+ updated_time?: string;
2260
+ };
2261
+ /** WhatsApp Business Account information */
2262
+ export type WhatsAppBusinessAccount2 = {
2263
+ /** WhatsApp Business Account ID */
2264
+ id: string;
2265
+ /** Business account name */
2266
+ name: string;
2267
+ /** Current status of the business account */
2268
+ status?: "ACTIVE" | "INACTIVE" | "PENDING";
2269
+ };
2270
+ /** WhatsApp Business Solution information */
2271
+ export type WhatsAppBusinessSolution3 = {
2272
+ /** Solution ID */
2273
+ id: string;
2274
+ /** Solution name */
2275
+ name: string;
2276
+ /** Partner ID associated with the solution */
2277
+ partner_id?: string;
2278
+ /** Current status of the solution */
2279
+ status?: "ACTIVE" | "INACTIVE" | "PENDING";
2280
+ };
2281
+ /** Request payload for OBO mobility intent operations */
2282
+ export type OBOMobilityIntentRequest = {
2283
+ /** Unique identifier for the WhatsApp Business Solution */
2284
+ solution_id: string;
2285
+ intent_type: MobilityIntentType;
2286
+ /** Target solution ID for mobility operations (required for transfers) */
2287
+ target_solution_id?: string;
2288
+ /** Reason for the mobility intent */
2289
+ mobility_reason?: string;
2290
+ /** Scheduled time for mobility execution (ISO 8601 format) */
2291
+ scheduled_execution_time?: string;
2292
+ /** Additional metadata for the mobility operation */
2293
+ metadata?: Record<string, unknown>;
2294
+ };
2295
+ /** Type of mobility intent operation */
2296
+ export type MobilityIntentType = "INITIATE_TRANSFER" | "CONFIRM_TRANSFER" | "CANCEL_TRANSFER" | "REQUEST_HANDOVER" | "APPROVE_HANDOVER" | "REJECT_HANDOVER";
2297
+ /** Response for OBO mobility intent operations */
2298
+ export type OBOMobilityIntentResponse = {
2299
+ /** Indicates if the mobility intent operation was successful */
2300
+ success: boolean;
2301
+ /** Unique identifier for the mobility intent request */
2302
+ mobility_intent_id: string;
2303
+ /** Current status of the mobility intent */
2304
+ status?: "PENDING" | "APPROVED" | "REJECTED" | "SCHEDULED" | "IN_PROGRESS" | "COMPLETED" | "FAILED";
2305
+ /** Estimated completion time for the mobility operation (ISO 8601 format) */
2306
+ estimated_completion_time?: string;
2307
+ /** Indicates if additional approval is required for the operation */
2308
+ approval_required?: boolean;
2309
+ /** List of next steps required to complete the mobility operation */
2310
+ next_steps?: Array<string>;
2311
+ };
2312
+ /** WhatsApp Business Account phone number details and status information */
2313
+ export type WhatsAppBusinessAccountPhoneNumber = {
2314
+ /** Unique identifier for the phone number status record */
2315
+ id: string;
2316
+ /** Phone number in international format for display purposes */
2317
+ display_phone_number: string;
2318
+ /** Business name verified for this phone number */
2319
+ verified_name?: string;
2320
+ status: WhatsAppPhoneNumberStatus;
2321
+ quality_rating?: WhatsAppPhoneNumberQualityRating;
2322
+ /** ISO 3166-1 alpha-2 country code */
2323
+ country_code?: string;
2324
+ /** Country dialing code */
2325
+ country_dial_code?: string;
2326
+ code_verification_status?: WhatsAppCodeVerificationStatus;
2327
+ unified_cert_status?: WhatsAppBusinessUnifiedCertStatus;
2328
+ account_mode?: WhatsAppBusinessSandboxEligibility;
2329
+ host_platform?: WhatsAppBusinessAccountHostPlatform;
2330
+ /** Current messaging limit tier for the phone number */
2331
+ messaging_limit_tier?: "TIER_50" | "TIER_250" | "TIER_1K" | "TIER_10K" | "TIER_100K" | "TIER_UNLIMITED";
2332
+ /** Whether this is an official business account */
2333
+ is_official_business_account?: boolean;
2334
+ /** WhatsApp username for the business account (if available) */
2335
+ username?: string | null;
2336
+ };
2337
+ /** Current status of the phone number in the WhatsApp Business Account */
2338
+ export type WhatsAppPhoneNumberStatus = "PENDING" | "LINKED" | "UNLINKED" | "DELETED" | "MIGRATED" | "BANNED" | "RESTRICTED";
2339
+ /** Quality rating for the phone number based on messaging patterns */
2340
+ export type WhatsAppPhoneNumberQualityRating1 = "GREEN" | "YELLOW" | "RED" | "UNKNOWN";
2341
+ /** Status of phone number verification code */
2342
+ export type WhatsAppCodeVerificationStatus1 = "VERIFIED" | "NOT_VERIFIED";
2343
+ /** Unified certification status combining business and name verification */
2344
+ export type WhatsAppBusinessUnifiedCertStatus = "APPROVED" | "NAME_PENDING_REVIEW" | "NAME_NOT_APPROVED" | "ACCOUNT_REVIEW_NOT_STARTED" | "LIMITED_ACCESS";
2345
+ /** Account mode indicating sandbox or live environment eligibility */
2346
+ export type WhatsAppBusinessSandboxEligibility1 = "LIVE" | "SANDBOX";
2347
+ /** Platform hosting the WhatsApp Business Account */
2348
+ export type WhatsAppBusinessAccountHostPlatform = "CLOUD_API" | "ON_PREMISE" | "NOT_APPLICABLE";
2349
+ /** Paginated collection of WhatsApp Business Account phone numbers */
2350
+ export type WhatsAppBusinessAccountPhoneNumbersConnection = {
2351
+ /** Array of phone number records */
2352
+ data: Array<WhatsAppBusinessAccountPhoneNumber>;
2353
+ paging?: CursorPaging;
2354
+ };
2355
+ /** Cursor-based pagination information */
2356
+ export type CursorPaging7 = {
2357
+ cursors?: {
2358
+ /** Cursor pointing to the start of the page */
2359
+ before?: string;
2360
+ /** Cursor pointing to the end of the page */
2361
+ after?: string;
2362
+ };
2363
+ /** URL for the previous page of results */
2364
+ previous?: string;
2365
+ /** URL for the next page of results */
2366
+ next?: string;
2367
+ };
2368
+ /** Request payload for creating a new phone number registration */
2369
+ export type PhoneNumberCreateRequest = {
2370
+ /** Phone number in E.164 format without the + prefix */
2371
+ phone_number: string;
2372
+ /** Business name to be verified for this phone number */
2373
+ verified_name: string;
2374
+ /** Country code for the phone number */
2375
+ cc?: string;
2376
+ /** Whether this is a phone number migration from on-premises */
2377
+ migrate_phone_number?: boolean;
2378
+ /** Pre-verified phone number ID for BSP scenarios */
2379
+ preverified_id?: string;
2380
+ };
2381
+ /** Response after successfully creating a phone number registration */
2382
+ export type PhoneNumberCreateResponse = {
2383
+ /** Unique identifier for the created phone number status record */
2384
+ id: string;
2385
+ };
2386
+ /** WhatsApp Business Account schedule configuration and details */
2387
+ export type WhatsAppBusinessAccountSchedule = {
2388
+ /** Unique identifier for the schedule */
2389
+ id: string;
2390
+ /** Human-readable name for the schedule */
2391
+ name: string;
2392
+ status: WhatsAppScheduleStatus;
2393
+ schedule_type: WhatsAppScheduleType;
2394
+ /** Optional description of the schedule purpose */
2395
+ description?: string;
2396
+ /** Schedule start time in HH:MM format */
2397
+ start_time?: string;
2398
+ /** Schedule end time in HH:MM format */
2399
+ end_time?: string;
2400
+ /** Timezone identifier for the schedule */
2401
+ timezone?: string;
2402
+ /** Days of the week when the schedule is active */
2403
+ days_of_week?: Array<DayOfWeek>;
2404
+ /** ISO 8601 timestamp when the schedule was created */
2405
+ created_time?: string;
2406
+ /** ISO 8601 timestamp when the schedule was last updated */
2407
+ updated_time?: string;
2408
+ /** Whether the schedule is currently active */
2409
+ is_active?: boolean;
2410
+ recurrence_pattern?: RecurrencePattern;
2411
+ };
2412
+ /** Current status of the schedule */
2413
+ export type WhatsAppScheduleStatus = "ACTIVE" | "INACTIVE" | "PAUSED" | "EXPIRED" | "DRAFT";
2414
+ /** Type of schedule configuration */
2415
+ export type WhatsAppScheduleType = "BUSINESS_HOURS" | "AUTOMATED_RESPONSE" | "MESSAGE_CAMPAIGN" | "MAINTENANCE_WINDOW" | "CUSTOM";
2416
+ /** Day of the week */
2417
+ export type DayOfWeek = "MONDAY" | "TUESDAY" | "WEDNESDAY" | "THURSDAY" | "FRIDAY" | "SATURDAY" | "SUNDAY";
2418
+ /** Pattern for recurring schedules */
2419
+ export type RecurrencePattern = {
2420
+ frequency?: "DAILY" | "WEEKLY" | "MONTHLY" | "YEARLY";
2421
+ /** Interval between recurrences */
2422
+ interval?: number;
2423
+ /** End date for the recurrence pattern */
2424
+ end_date?: string;
2425
+ };
2426
+ /** Paginated collection of WhatsApp Business Account schedules */
2427
+ export type WhatsAppBusinessAccountSchedulesConnection = {
2428
+ /** Array of schedule records */
2429
+ data: Array<WhatsAppBusinessAccountSchedule>;
2430
+ paging?: CursorPaging;
2431
+ };
2432
+ /** Cursor-based pagination information */
2433
+ export type CursorPaging8 = {
2434
+ cursors?: {
2435
+ /** Cursor pointing to the start of the page */
2436
+ before?: string;
2437
+ /** Cursor pointing to the end of the page */
2438
+ after?: string;
2439
+ };
2440
+ /** URL for the previous page of results */
2441
+ previous?: string;
2442
+ /** URL for the next page of results */
2443
+ next?: string;
2444
+ };
2445
+ /** Request payload for creating a new schedule */
2446
+ export type ScheduleCreateRequest = {
2447
+ /** Human-readable name for the schedule */
2448
+ name: string;
2449
+ schedule_type: WhatsAppScheduleType;
2450
+ /** Optional description of the schedule purpose */
2451
+ description?: string;
2452
+ /** Schedule start time in HH:MM format */
2453
+ start_time: string;
2454
+ /** Schedule end time in HH:MM format */
2455
+ end_time: string;
2456
+ /** Timezone identifier for the schedule */
2457
+ timezone?: string;
2458
+ /** Days of the week when the schedule is active */
2459
+ days_of_week?: Array<DayOfWeek>;
2460
+ /** Whether the schedule should be active upon creation */
2461
+ is_active?: boolean;
2462
+ recurrence_pattern?: RecurrencePattern;
2463
+ };
2464
+ /** Response after successfully creating a schedule */
2465
+ export type ScheduleCreateResponse = {
2466
+ /** Unique identifier for the created schedule */
2467
+ id: string;
2468
+ };
2469
+ /** Request payload for setting OBO mobility intent */
2470
+ export type SetOBOMobilityIntentRequest = {
2471
+ /** WhatsApp Business Account ID for which to set OBO mobility intent */
2472
+ waba_id: string;
2473
+ /** Unique identifier for the Multi-Partner Solution */
2474
+ solution_id?: string;
2475
+ /** Application ID requesting OBO mobility intent */
2476
+ app_id?: string;
2477
+ /** Actor ID performing the OBO mobility intent operation */
2478
+ actor_id?: string;
2479
+ /** Client-provided mutation identifier for request tracking */
2480
+ client_mutation_id?: string;
2481
+ };
2482
+ /** Response for setting OBO mobility intent */
2483
+ export type SetOBOMobilityIntentResponse = {
2484
+ /** Indicates if the OBO mobility intent was set successfully */
2485
+ success: boolean;
2486
+ /** Unique identifier for the created OBO mobility intent */
2487
+ intent_id?: string;
2488
+ /** Client-provided mutation identifier echoed back */
2489
+ client_mutation_id?: string;
2490
+ /** Error message if the operation failed */
2491
+ error_msg?: string;
2492
+ };
2493
+ /** Request payload for setting solution migration intent */
2494
+ export type SetSolutionMigrationIntentRequest = {
2495
+ /** Unique identifier for the Multi-Partner Solution */
2496
+ solution_id: string;
2497
+ migration_intent: SolutionMigrationIntent;
2498
+ /** Target solution ID for migration (required for certain migration intents) */
2499
+ target_solution_id?: string;
2500
+ /** Reason for the migration intent */
2501
+ migration_reason?: string;
2502
+ /** Scheduled time for migration execution (ISO 8601 format) */
2503
+ scheduled_migration_time?: string;
2504
+ };
2505
+ /** Intent for solution migration */
2506
+ export type SolutionMigrationIntent = "INITIATE_MIGRATION" | "CANCEL_MIGRATION" | "CONFIRM_MIGRATION" | "SCHEDULE_MIGRATION";
2507
+ /** Response for setting solution migration intent */
2508
+ export type SetSolutionMigrationIntentResponse = {
2509
+ /** Indicates if the migration intent was set successfully */
2510
+ success: boolean;
2511
+ /** Unique identifier for the migration intent request */
2512
+ migration_intent_id: string;
2513
+ /** Current status of the migration intent */
2514
+ status?: "PENDING" | "APPROVED" | "REJECTED" | "SCHEDULED";
2515
+ /** Estimated completion time for the migration (ISO 8601 format) */
2516
+ estimated_completion_time?: string;
2517
+ };
2518
+ /** Paginated list of Multi-Partner Solutions */
2519
+ export type SolutionsList = {
2520
+ /** Array of Multi-Partner Solutions associated with the WABA */
2521
+ data: Array<WhatsAppBusinessSolution>;
2522
+ paging?: Paging;
2523
+ };
2524
+ /** Pagination information for cursor-based pagination */
2525
+ export type Paging1 = {
2526
+ cursors?: {
2527
+ /** Cursor pointing to the start of the page of data that has been returned */
2528
+ before?: string;
2529
+ /** Cursor pointing to the end of the page of data that has been returned */
2530
+ after?: string;
2531
+ };
2532
+ /** Graph API endpoint URL for the previous page of data */
2533
+ previous?: string;
2534
+ /** Graph API endpoint URL for the next page of data */
2535
+ next?: string;
2536
+ };
2537
+ /** Standard Graph API error response */
2538
+ export type GraphAPIError12 = {
2539
+ error: {
2540
+ /** Human-readable error message */
2541
+ message: string;
2542
+ /** Error category type */
2543
+ type: string;
2544
+ /** Numeric error code */
2545
+ code: number;
2546
+ /** More specific error subcode when available */
2547
+ error_subcode?: number;
2548
+ /** Unique identifier for debugging and support requests with Meta */
2549
+ fbtrace_id?: string;
2550
+ /** Indicates whether this error is temporary and the request should be retried */
2551
+ is_transient?: boolean;
2552
+ /** User-friendly error title for display purposes */
2553
+ error_user_title?: string;
2554
+ /** User-friendly error message for display purposes */
2555
+ error_user_msg?: string;
2556
+ };
2557
+ };
2558
+ /** Application subscription data for WhatsApp Business Account */
2559
+ export type WhatsAppBusinessApiData1 = {
2560
+ /** Unique identifier for the subscribed application */
2561
+ id: string;
2562
+ /** Name of the subscribed application */
2563
+ name: string;
2564
+ /** URL link to the application */
2565
+ link?: string;
2566
+ };
2567
+ /** Subscribed application details */
2568
+ export type SubscribedApp1 = {
2569
+ whatsapp_business_api_data: WhatsAppBusinessApiData;
2570
+ /** Custom webhook callback URL for this subscription */
2571
+ override_callback_uri?: string;
2572
+ };
2573
+ /** Response containing list of subscribed applications */
2574
+ export type SubscribedAppsResponse = {
2575
+ /** Array of subscribed applications */
2576
+ data: Array<SubscribedApp>;
2577
+ };
2578
+ /** Request body for subscribing to WABA webhooks */
2579
+ export type SubscriptionRequest = {
2580
+ /** Custom webhook callback URL to override app default */
2581
+ override_callback_uri?: string;
2582
+ /** Verification token for webhook security */
2583
+ verify_token?: string;
2584
+ };
2585
+ /** Response after successful subscription operation */
2586
+ export type SubscriptionResponse = {
2587
+ /** Indicates whether the subscription operation was successful */
2588
+ success: boolean;
2589
+ /** Array containing subscription details */
2590
+ data?: Array<SubscribedApp>;
2591
+ };
2592
+ /** WhatsApp Business Account activity record */
2593
+ export type WhatsAppBusinessAccountActivity = {
2594
+ /** Unique identifier for the activity record */
2595
+ id: string;
2596
+ activity_type: ActivityType;
2597
+ /** ISO 8601 timestamp when the activity occurred */
2598
+ timestamp: string;
2599
+ actor_type: ActorType;
2600
+ /** ID of the user or system that performed the activity */
2601
+ actor_id?: string;
2602
+ /** Name of the user or system that performed the activity */
2603
+ actor_name?: string;
2604
+ /** Human-readable description of the activity */
2605
+ description?: string;
2606
+ /** Additional structured details about the activity */
2607
+ details?: Record<string, unknown>;
2608
+ /** IP address from which the activity was performed (when available) */
2609
+ ip_address?: string;
2610
+ /** User agent string from the client that performed the activity */
2611
+ user_agent?: string;
2612
+ };
2613
+ /** Type of activity performed on the WhatsApp Business Account */
2614
+ export type ActivityType = "ACCOUNT_CREATED" | "ACCOUNT_UPDATED" | "ACCOUNT_DELETED" | "PHONE_NUMBER_ADDED" | "PHONE_NUMBER_REMOVED" | "PHONE_NUMBER_VERIFIED" | "USER_ADDED" | "USER_REMOVED" | "USER_ROLE_CHANGED" | "PERMISSION_GRANTED" | "PERMISSION_REVOKED" | "TEMPLATE_CREATED" | "TEMPLATE_UPDATED" | "TEMPLATE_DELETED" | "WEBHOOK_CONFIGURED" | "API_ACCESS_GRANTED" | "API_ACCESS_REVOKED" | "BILLING_UPDATED" | "COMPLIANCE_ACTION" | "SECURITY_EVENT";
2615
+ /** Type of entity that performed the activity */
2616
+ export type ActorType = "USER" | "SYSTEM" | "API" | "ADMIN" | "AUTOMATED_PROCESS";
2617
+ /** Paginated list of WhatsApp Business Account activities */
2618
+ export type ActivityList = {
2619
+ /** Array of activity records */
2620
+ data: Array<WhatsAppBusinessAccountActivity>;
2621
+ paging?: Paging;
2622
+ };
2623
+ /** Pagination information for activity results */
2624
+ export type Paging2 = {
2625
+ cursors?: {
2626
+ /** Cursor pointing to the start of the page of data */
2627
+ before?: string;
2628
+ /** Cursor pointing to the end of the page of data */
2629
+ after?: string;
2630
+ };
2631
+ /** Graph API endpoint URL for the previous page of results */
2632
+ previous?: string;
2633
+ /** Graph API endpoint URL for the next page of results */
2634
+ next?: string;
2635
+ };
2636
+ /** WhatsApp Business Account details and configuration */
2637
+ export type WhatsAppBusinessAccount3 = {
2638
+ /** Unique identifier for the WhatsApp Business Account */
2639
+ id: string;
2640
+ /** Human-readable name of the WhatsApp Business Account */
2641
+ name: string;
2642
+ /** Timezone identifier for the WhatsApp Business Account */
2643
+ timezone_id?: string;
2644
+ /** Message template namespace for the WhatsApp Business Account */
2645
+ message_template_namespace?: string;
2646
+ account_review_status?: WhatsAppBusinessAccountReviewStatus;
2647
+ business_verification_status?: WhatsAppBusinessAccountVerificationStatus;
2648
+ /** Country code for the WhatsApp Business Account */
2649
+ country?: string;
2650
+ ownership_type?: WhatsAppBusinessAccountOwnershipType;
2651
+ /** Primary business location for the WhatsApp Business Account */
2652
+ primary_business_location?: string;
2653
+ };
2654
+ /** Review status of the WhatsApp Business Account */
2655
+ export type WhatsAppBusinessAccountReviewStatus = "PENDING" | "APPROVED" | "REJECTED" | "LIMIT_REACHED";
2656
+ /** Business verification status of the WhatsApp Business Account */
2657
+ export type WhatsAppBusinessAccountVerificationStatus = "VERIFIED" | "UNVERIFIED" | "PENDING";
2658
+ /** Ownership type of the WhatsApp Business Account */
2659
+ export type WhatsAppBusinessAccountOwnershipType = "SELF_OWNED" | "CLIENT_OWNED" | "AGENCY_OWNED";
2660
+ /** WhatsApp Business Bot configuration and details */
2661
+ export type WhatsAppBusinessBot = {
2662
+ /** Unique identifier for the WhatsApp Business Bot */
2663
+ id: string;
2664
+ /** List of bot prompts and automated responses */
2665
+ prompts?: Array<string>;
2666
+ /** List of available bot commands and their descriptions */
2667
+ commands?: Array<WhatsAppBusinessBotCommand>;
2668
+ /** Whether the welcome message is enabled for this bot */
2669
+ enable_welcome_message?: boolean;
2670
+ };
2671
+ /** Bot command configuration with name and description */
2672
+ export type WhatsAppBusinessBotCommand = {
2673
+ /** Name of the bot command */
2674
+ command_name: string;
2675
+ /** Description of what the command does */
2676
+ command_description: string;
2677
+ };
2678
+ /** WhatsApp Business Profile node details and configuration */
2679
+ export type WhatsAppBusinessProfileNode = {
2680
+ /** Unique identifier for the WhatsApp Business Profile */
2681
+ id: string;
2682
+ /** Name of the business account */
2683
+ account_name?: string;
2684
+ /** Business description text */
2685
+ description?: string;
2686
+ /** Contact email address of the business */
2687
+ email?: string;
2688
+ /** About section text for the business profile */
2689
+ about?: string;
2690
+ /** Physical address of the business */
2691
+ address?: string;
2692
+ vertical?: WhatsAppBusinessVertical;
2693
+ /** List of website URLs associated with the business */
2694
+ websites?: Array<string>;
2695
+ /** URL of the business profile picture */
2696
+ profile_picture_url?: string;
2697
+ /** Handle of the profile picture for upload operations */
2698
+ profile_picture_handle?: string;
2699
+ /** The messaging service used */
2700
+ messaging_product?: "whatsapp";
2701
+ };
2702
+ /** Request payload for updating WhatsApp Business Profile information */
2703
+ export type WhatsAppBusinessProfileUpdateRequest1 = {
2704
+ /** The messaging service used for the request */
2705
+ messaging_product: "whatsapp";
2706
+ /** Name of the business account */
2707
+ account_name?: string;
2708
+ /** Business description text */
2709
+ description?: string;
2710
+ /** Contact email address of the business */
2711
+ email?: string;
2712
+ /** About section text for the business profile */
2713
+ about?: string;
2714
+ /** Physical address of the business */
2715
+ address?: string;
2716
+ vertical?: WhatsAppBusinessVertical;
2717
+ /** List of website URLs associated with the business */
2718
+ websites?: Array<string>;
2719
+ /** Handle of the profile picture generated from Resumable Upload API */
2720
+ profile_picture_handle?: string;
2721
+ };
2722
+ /** Response from updating WhatsApp Business Profile */
2723
+ export type WhatsAppBusinessProfileUpdateResponse1 = {
2724
+ /** WhatsApp Business Profile ID that was updated */
2725
+ id?: string;
2726
+ /** Indicates if the update was successful */
2727
+ success?: boolean;
2728
+ };
2729
+ /** Industry vertical classification for the business */
2730
+ export type WhatsAppBusinessVertical1 = "UNDEFINED" | "OTHER" | "AUTO" | "BEAUTY" | "APPAREL" | "EDU" | "ENTERTAIN" | "EVENT_PLAN" | "FINANCE" | "GROCERY" | "GOVT" | "HOTEL" | "HEALTH" | "NONPROFIT" | "PROF_SERVICES" | "RETAIL" | "TRAVEL" | "RESTAURANT" | "NOT_A_BIZ";
2731
+ export type WebhookPayload = {
2732
+ /** Always 'whatsapp_business_account' for these webhooks. */
2733
+ object: string;
2734
+ entry: Array<Entry>;
2735
+ };
2736
+ export type Entry = {
2737
+ /** WhatsApp Business Account ID. */
2738
+ id: string;
2739
+ changes: Array<Change>;
2740
+ };
2741
+ export type Change = {
2742
+ value: IncomingMessageValueGeneral | IncomingMessageValueSystem | StatusMessageValue | GroupValue;
2743
+ /** The field indicate to what object is the webhook related: - messages: the webhook is related to messages from consumer or status of message sent by business to consumer. - group_lifecycle_update: the webhook is related to group creation and deletion. - group_settings_update: the webhook is related to group settings update. - group_participant_update: the webhook is related to participants joining and leaving the groups. */
2744
+ field: "messages" | "group_lifecycle_update" | "group_settings_update" | "group_participant_update";
2745
+ };
2746
+ export type Metadata = {
2747
+ /** Business display phone number. */
2748
+ display_phone_number: string;
2749
+ /** Business phone number ID. */
2750
+ phone_number_id: string;
2751
+ };
2752
+ export type ContactProfile = {
2753
+ profile: {
2754
+ /** WhatsApp user's name as it appears in their profile in the WhatsApp client. */
2755
+ name: string;
2756
+ };
2757
+ /** WhatsApp user ID. Note that a WhatsApp user's ID and phone number may not always match. */
2758
+ wa_id?: string;
2759
+ };
2760
+ export type IncomingMessageValueGeneral = {
2761
+ /** Always 'whatsapp'. */
2762
+ messaging_product: string;
2763
+ metadata: Metadata;
2764
+ /** Array of contact profiles for the sender. Included for all non-system incoming messages. */
2765
+ contacts: Array<ContactProfile>;
2766
+ /** Array of message objects. The structure varies based on the 'type' property. */
2767
+ messages: Array<IncomingMessage>;
2768
+ };
2769
+ export type IncomingMessageValueSystem = {
2770
+ /** Always 'whatsapp'. */
2771
+ messaging_product: string;
2772
+ metadata: Metadata;
2773
+ /** Array containing only 'system' message objects. */
2774
+ messages: Array<SystemMessage>;
2775
+ };
2776
+ export type StatusMessageValue = {
2777
+ /** Always 'whatsapp'. */
2778
+ messaging_product: string;
2779
+ metadata: Metadata;
2780
+ /** Array of status objects. */
2781
+ statuses: Array<Statuses>;
2782
+ };
2783
+ export type Statuses = {
2784
+ /** Unique WhatsApp message ID the status is associated with. */
2785
+ id: string;
2786
+ status: "sent" | "delivered" | "read" | "failed";
2787
+ timestamp: string;
2788
+ /** Recipeint phone number. */
2789
+ recipient_id: string;
2790
+ /** Group ID if the message was sent to a group. */
2791
+ group_id?: string;
2792
+ conversation?: Conversation;
2793
+ pricing?: Pricing;
2794
+ errors?: Array<StatusError>;
2795
+ };
2796
+ export type Conversation = {
2797
+ id?: string;
2798
+ expiration_timestamp?: string;
2799
+ origin?: ConversationOrigin;
2800
+ };
2801
+ export type ConversationOrigin = {
2802
+ type?: string;
2803
+ };
2804
+ export type Pricing = {
2805
+ billable?: boolean;
2806
+ pricing_model?: "CBP" | "PMP";
2807
+ category?: string;
2808
+ };
2809
+ export type StatusError = {
2810
+ code?: number;
2811
+ title?: string;
2812
+ message?: string;
2813
+ error_data?: ErrorData;
2814
+ href?: string;
2815
+ };
2816
+ export type ErrorData = {
2817
+ details?: string;
2818
+ };
2819
+ export type GroupValue = {
2820
+ /** Always 'whatsapp'. */
2821
+ messaging_product: string;
2822
+ metadata: Metadata;
2823
+ /** Array of group objects. */
2824
+ groups: Array<Groups>;
2825
+ };
2826
+ export type Groups = {
2827
+ /** Unix timestamp of the group event */
2828
+ timestamp: number;
2829
+ /** Unique identifier for the group */
2830
+ group_id: string;
2831
+ /** Type of group event */
2832
+ type: "group_create" | "group_delete" | "group_settings_update" | "group_add_participants" | "group_remove_participants";
2833
+ /** Unique identifier for the request */
2834
+ request_id: string;
2835
+ /** Group subject/name */
2836
+ subject?: string;
2837
+ /** Group description */
2838
+ description?: string;
2839
+ /** List of participants added to the group */
2840
+ added_participants?: Array<GroupParticipant>;
2841
+ /** List of participants removed from the group */
2842
+ removed_participants?: Array<GroupParticipant>;
2843
+ /** Group profile picture information */
2844
+ profile_picture?: GroupProfilePicture;
2845
+ };
2846
+ export type GroupParticipant = {
2847
+ /** Input phone number or WhatsApp ID */
2848
+ input?: string;
2849
+ /** WhatsApp ID of the participant */
2850
+ wa_id?: string;
2851
+ };
2852
+ export type GroupProfilePicture = {
2853
+ /** MIME type of the profile picture */
2854
+ mime_type?: string;
2855
+ /** SHA256 hash of the profile picture */
2856
+ sha256?: string;
2857
+ };
2858
+ export type BaseMessageProperties1 = {
2859
+ /** WhatsApp user phone number. Note that a WhatsApp user's phone number and ID may not always match. */
2860
+ from: string;
2861
+ /** Unique WhatsApp message ID. */
2862
+ id: string;
2863
+ /** Unix timestamp indicating when the webhook was triggered. */
2864
+ timestamp: string;
2865
+ };
2866
+ export type IncomingMessage = TextMessage | ReactionMessage | AudioMessage | DocumentMessage | ImageMessage | StickerMessage | VideoMessage | LocationMessage | ContactSharingMessage | UnsupportedMessage | UnsupportedMessage | ButtonMessage | InteractiveMessageReply | OrderMessage;
2867
+ export type TextMessage2 = {
2868
+ messaging_product: string;
2869
+ /** The type of recipient. */
2870
+ recipient_type: "individual" | "group";
2871
+ /** The recipient's phone number for individual messages, and group-id for group message. */
2872
+ to: string;
2873
+ type: "text";
2874
+ context?: ContextObject;
2875
+ text: {
2876
+ /** Text body of the message. */
2877
+ body: string;
2878
+ };
2879
+ referral?: ReferralObject;
2880
+ };
2881
+ /** Only included if message via a "Message business" button. */
2882
+ export type ContextObject = {
2883
+ /** Business display phone number. */
2884
+ from: string;
2885
+ /** WhatsApp message ID of the message the user used to access the "Message business" button. */
2886
+ id: string;
2887
+ referred_product: {
2888
+ /** Product catalog ID. */
2889
+ catalog_id: string;
2890
+ /** Product ID. */
2891
+ product_retailer_id: string;
2892
+ };
2893
+ };
2894
+ /** Only included if message via a Click to WhatsApp ad. */
2895
+ export type ReferralObject = {
2896
+ /** Ad URL. */
2897
+ source_url: string;
2898
+ /** Ad ID. */
2899
+ source_id: string;
2900
+ source_type: "ad" | "post";
2901
+ /** Ad primary text. */
2902
+ body: string;
2903
+ /** Ad headline. */
2904
+ headline: string;
2905
+ media_type: "image" | "video";
2906
+ /** Only included for image media_type. */
2907
+ image_url?: string;
2908
+ /** Only included for video media_type. */
2909
+ video_url?: string;
2910
+ /** Only included for video media_type. */
2911
+ thumbnail_url?: string;
2912
+ /** Ad click ID. */
2913
+ ctwa_clid: string;
2914
+ welcome_message?: {
2915
+ /** Ad greeting text. */
2916
+ text: string;
2917
+ };
2918
+ };
2919
+ export type ReactionMessage1 = {
2920
+ messaging_product: string;
2921
+ /** The type of recipient. */
2922
+ recipient_type: "individual" | "group";
2923
+ /** The recipient's phone number for individual messages, and group-id for group message. */
2924
+ to: string;
2925
+ type: "reaction";
2926
+ context?: MessageContext;
2927
+ reaction: {
2928
+ /** WhatsApp message ID of the message the WhatsApp user reacted to. */
2929
+ message_id: string;
2930
+ /** Emoji sent by the WhatsApp user as a reaction. */
2931
+ emoji: string;
2932
+ };
2933
+ };
2934
+ export type MediaMessageProperties = {
2935
+ /** Media asset MIME type. */
2936
+ mime_type: string;
2937
+ /** Media asset SHA-256 hash. */
2938
+ sha256: string;
2939
+ /** Media asset ID. A GET request on this ID can provide the asset URL. */
2940
+ id: string;
2941
+ };
2942
+ export type AudioMessage1 = {
2943
+ messaging_product: string;
2944
+ /** The type of recipient. */
2945
+ recipient_type: "individual" | "group";
2946
+ /** The recipient's phone number for individual messages, and group-id for group message. */
2947
+ to: string;
2948
+ type: "audio";
2949
+ context?: MessageContext;
2950
+ audio: {
2951
+ /** Media asset MIME type. */
2952
+ mime_type: string;
2953
+ /** Media asset SHA-256 hash. */
2954
+ sha256: string;
2955
+ /** Media asset ID. A GET request on this ID can provide the asset URL. */
2956
+ id: string;
2957
+ /** Boolean indicating if audio is a recording made with the WhatsApp client voice recording feature (true) or not (false). */
2958
+ voice: boolean;
2959
+ };
2960
+ };
2961
+ export type DocumentMessage1 = {
2962
+ messaging_product: string;
2963
+ /** The type of recipient. */
2964
+ recipient_type: "individual" | "group";
2965
+ /** The recipient's phone number for individual messages, and group-id for group message. */
2966
+ to: string;
2967
+ type: "document";
2968
+ context?: MessageContext;
2969
+ document: {
2970
+ /** Media asset MIME type. */
2971
+ mime_type: string;
2972
+ /** Media asset SHA-256 hash. */
2973
+ sha256: string;
2974
+ /** Media asset ID. A GET request on this ID can provide the asset URL. */
2975
+ id: string;
2976
+ /** Media asset filename. */
2977
+ filename: string;
2978
+ };
2979
+ };
2980
+ export type ImageMessage1 = {
2981
+ messaging_product: string;
2982
+ /** The type of recipient. */
2983
+ recipient_type: "individual" | "group";
2984
+ /** The recipient's phone number for individual messages, and group-id for group message. */
2985
+ to: string;
2986
+ type: "image";
2987
+ context?: MessageContext;
2988
+ image: {
2989
+ /** Media asset MIME type. */
2990
+ mime_type: string;
2991
+ /** Media asset SHA-256 hash. */
2992
+ sha256: string;
2993
+ /** Media asset ID. A GET request on this ID can provide the asset URL. */
2994
+ id: string;
2995
+ /** Media asset caption text. */
2996
+ caption?: string;
2997
+ };
2998
+ };
2999
+ export type StickerMessage1 = {
3000
+ messaging_product: string;
3001
+ /** The type of recipient. */
3002
+ recipient_type: "individual" | "group";
3003
+ /** The recipient's phone number for individual messages, and group-id for group message. */
3004
+ to: string;
3005
+ type: "sticker";
3006
+ context?: MessageContext;
3007
+ sticker: {
3008
+ /** Media asset MIME type. */
3009
+ mime_type: string;
3010
+ /** Media asset SHA-256 hash. */
3011
+ sha256: string;
3012
+ /** Media asset ID. A GET request on this ID can provide the asset URL. */
3013
+ id: string;
3014
+ /** Boolean indicating if the sticker is animated (true) or not (false). */
3015
+ animated: boolean;
3016
+ };
3017
+ };
3018
+ export type VideoMessage1 = {
3019
+ messaging_product: string;
3020
+ /** The type of recipient. */
3021
+ recipient_type: "individual" | "group";
3022
+ /** The recipient's phone number for individual messages, and group-id for group message. */
3023
+ to: string;
3024
+ type: "video";
3025
+ context?: MessageContext;
3026
+ video: {
3027
+ /** Media asset MIME type. */
3028
+ mime_type: string;
3029
+ /** Media asset SHA-256 hash. */
3030
+ sha256: string;
3031
+ /** Media asset ID. A GET request on this ID can provide the asset URL. */
3032
+ id: string;
3033
+ /** Media asset caption text. */
3034
+ caption?: string;
3035
+ };
3036
+ };
3037
+ export type LocationMessage1 = {
3038
+ messaging_product: string;
3039
+ /** The type of recipient. */
3040
+ recipient_type: "individual" | "group";
3041
+ /** The recipient's phone number for individual messages, and group-id for group message. */
3042
+ to: string;
3043
+ type: "location";
3044
+ context?: MessageContext;
3045
+ location: {
3046
+ /** Location address. */
3047
+ address: string;
3048
+ /** Location latitude. */
3049
+ latitude: number;
3050
+ /** Location longitude. */
3051
+ longitude: number;
3052
+ /** Location name. */
3053
+ name: string;
3054
+ /** Location URL. Usually only included for business locations. */
3055
+ url?: string;
3056
+ };
3057
+ };
3058
+ export type ContactSharingMessage = {
3059
+ messaging_product: string;
3060
+ /** The type of recipient. */
3061
+ recipient_type: "individual" | "group";
3062
+ /** The recipient's phone number for individual messages, and group-id for group message. */
3063
+ to: string;
3064
+ type: "contacts";
3065
+ context?: MessageContext;
3066
+ /** Array of contact objects. Many contact object properties may be omitted if the WhatsApp user chooses not to share them, or their device prevents them from being shared. */
3067
+ contacts: Array<ContactObject>;
3068
+ };
3069
+ export type ContactObject1 = {
3070
+ addresses?: Array<{
3071
+ /** City mentioned in the contact address */
3072
+ city?: string;
3073
+ /** Country mentioned in the contact address */
3074
+ country?: string;
3075
+ /** ISO country code for the contact address */
3076
+ country_code?: string;
3077
+ /** State mentioned in the contact address */
3078
+ state?: string;
3079
+ /** Street mentioned in the contact address */
3080
+ street?: string;
3081
+ /** Type of address, such as home or work */
3082
+ type?: string;
3083
+ /** Zip code in the contact address */
3084
+ zip?: string;
3085
+ }>;
3086
+ /** Contact birthday (YYYY-MM-DD). */
3087
+ birthday?: string;
3088
+ emails?: Array<{
3089
+ /** Email address of the contact */
3090
+ email?: string;
3091
+ /** Type of email, such as personal or work */
3092
+ type?: string;
3093
+ }>;
3094
+ name?: {
3095
+ /** Contact's formatted name */
3096
+ formatted_name: string;
3097
+ /** Contact’s first name */
3098
+ first_name?: string;
3099
+ /** Contact’s last name */
3100
+ last_name?: string;
3101
+ /** Contact’s middle name */
3102
+ middle_name?: string;
3103
+ /** Contact’s name suffix */
3104
+ suffix?: string;
3105
+ /** Contact’s name prefix */
3106
+ prefix?: string;
3107
+ };
3108
+ org?: {
3109
+ /** Name of the company where the contact works */
3110
+ company?: string;
3111
+ /** Name of the department where the contact works */
3112
+ department?: string;
3113
+ /** Contact's job title */
3114
+ title?: string;
3115
+ };
3116
+ phones?: Array<{
3117
+ /** Contact’s Phone number */
3118
+ phone?: string;
3119
+ /** Contact's WhatsApp Number. Note that a WhatsApp user's ID and phone number may not always match. */
3120
+ wa_id?: string;
3121
+ /** Type of phone number. For example, cell, mobile, main, iPhone, home, work, etc. */
3122
+ type?: string;
3123
+ }>;
3124
+ urls?: Array<{
3125
+ /** Website URL associated with the contact or their company */
3126
+ url?: string;
3127
+ /** Type of website. For example, company, work, personal, Facebook Page, Instagram, etc. */
3128
+ type?: string;
3129
+ }>;
3130
+ };
3131
+ export type UnsupportedMessage = {
3132
+ messaging_product: string;
3133
+ /** The type of recipient. */
3134
+ recipient_type: "individual" | "group";
3135
+ /** The recipient's phone number for individual messages, and group-id for group message. */
3136
+ to: string;
3137
+ type: "unsupported" | "unknown";
3138
+ context?: MessageContext;
3139
+ errors: Array<ErrorObject>;
3140
+ };
3141
+ export type ErrorObject2 = {
3142
+ /** Error code. */
3143
+ code: number;
3144
+ /** Error code title. */
3145
+ title: string;
3146
+ /** Error code message. */
3147
+ message: string;
3148
+ error_data: {
3149
+ /** Error code details. */
3150
+ details: string;
3151
+ };
3152
+ /** Link to error code documentation. */
3153
+ href?: string;
3154
+ };
3155
+ export type ButtonMessage = {
3156
+ messaging_product: string;
3157
+ /** The type of recipient. */
3158
+ recipient_type: "individual" | "group";
3159
+ /** The recipient's phone number for individual messages, and group-id for group message. */
3160
+ to: string;
3161
+ type: "button";
3162
+ context: {
3163
+ /** Business display phone number. */
3164
+ from: string;
3165
+ /** WhatsApp message ID of the message containing the button the WhatsApp user tapped. */
3166
+ id: string;
3167
+ };
3168
+ button: {
3169
+ /** Quick-reply button payload. */
3170
+ payload: string;
3171
+ /** Quick-reply button label text. */
3172
+ text: string;
3173
+ };
3174
+ };
3175
+ export type InteractiveMessageReply = {
3176
+ messaging_product: string;
3177
+ /** The type of recipient. */
3178
+ recipient_type: "individual" | "group";
3179
+ /** The recipient's phone number for individual messages, and group-id for group message. */
3180
+ to: string;
3181
+ type: "interactive";
3182
+ context: {
3183
+ /** Business display phone number. */
3184
+ from: string;
3185
+ /** WhatsApp message ID of the message containing the interactive component the user tapped. */
3186
+ id: string;
3187
+ };
3188
+ interactive: {
3189
+ /** Type of interactive reply (list_reply or button_reply). */
3190
+ type: "list_reply" | "button_reply";
3191
+ };
3192
+ };
3193
+ export type InteractiveListReplyContent = {
3194
+ list_reply: {
3195
+ /** Row ID. */
3196
+ id: string;
3197
+ /** Row title. */
3198
+ title: string;
3199
+ /** Row description. */
3200
+ description: string;
3201
+ };
3202
+ };
3203
+ export type InteractiveButtonReplyContent = {
3204
+ button_reply: {
3205
+ /** Button ID. */
3206
+ id: string;
3207
+ /** Button label text. */
3208
+ title: string;
3209
+ };
3210
+ };
3211
+ export type OrderMessage = {
3212
+ messaging_product: string;
3213
+ /** The type of recipient. */
3214
+ recipient_type: "individual" | "group";
3215
+ /** The recipient's phone number for individual messages, and group-id for group message. */
3216
+ to: string;
3217
+ type: "order";
3218
+ context?: MessageContext;
3219
+ order: {
3220
+ /** Product catalog ID. */
3221
+ catalog_id: string;
3222
+ /** Empty string. */
3223
+ text: string;
3224
+ product_items: Array<{
3225
+ /** Product ID. */
3226
+ product_retailer_id: string;
3227
+ /** Product quantity. */
3228
+ quantity: number;
3229
+ /** Individual product price. */
3230
+ item_price: number;
3231
+ /** Catalog currency code. */
3232
+ currency: string;
3233
+ }>;
3234
+ };
3235
+ };
3236
+ export type SystemMessage = {
3237
+ messaging_product: string;
3238
+ /** The type of recipient. */
3239
+ recipient_type: "individual" | "group";
3240
+ /** The recipient's phone number for individual messages, and group-id for group message. */
3241
+ to: string;
3242
+ type: "system";
3243
+ context?: MessageContext;
3244
+ system: {
3245
+ /** Description of the system change (e.g., user changed number). */
3246
+ body: string;
3247
+ /** The user's WhatsApp ID. On user_changed_number messages this is the new phone number. Omitted when the user has no phone number visible to the business. */
3248
+ wa_id?: string;
3249
+ /** Type of system message. user_changed_number reports a change to the user's phone number and carries the new number. user_changed_user_id reports a change to the user's business-scoped user ID, with no phone number included. */
3250
+ type: "user_changed_number" | "user_changed_user_id";
3251
+ /** The user's current business-scoped user ID (BSUID). Omitted when business-scoped user IDs are not enabled for the business. */
3252
+ user_id?: string;
3253
+ /** The user's current business-scoped user ID (BSUID) scoped to the parent business portfolio. Omitted when the business is not onboarded to parent-scoped IDs. */
3254
+ parent_user_id?: string;
3255
+ /** The business-scoped user ID (BSUID) the user had before the change. Omitted when the previous BSUID is unavailable. */
3256
+ previous_user_id?: string;
3257
+ /** The parent-scoped business-scoped user ID (BSUID) the user had before the change. Omitted when the previous parent BSUID is unavailable. */
3258
+ previous_parent_user_id?: string;
3259
+ };
3260
+ };
3261
+ export type GetBusinessPortfolioResponse = {
3262
+ id?: string;
3263
+ name?: string;
3264
+ timezone_id?: number;
3265
+ };
3266
+ export type BlockUsersRequest = {
3267
+ block_users?: Array<{
3268
+ user?: string;
3269
+ }>;
3270
+ messaging_product?: string;
3271
+ };
3272
+ export type UnblockUsersRequest = {
3273
+ block_users?: Array<{
3274
+ user?: string;
3275
+ }>;
3276
+ messaging_product?: string;
3277
+ };
3278
+ export type ManageCallsRequest = CallRequestPayload | CallTerminateRequestPayload;
3279
+ export type ManageCallsResponse = CallResponsePayload | CallTerminateResponsePayload;
3280
+ export type UploadMediaRequest = {
3281
+ file?: string;
3282
+ messaging_product?: string;
3283
+ };
3284
+ export type UploadMediaResponse = {
3285
+ id?: string;
3286
+ };
3287
+ export type CreateOrUpdateQrCodeRequest = CreateQrCodeRequest | UpdateQrCodeRequest;
3288
+ export type UpdatePhoneNumberResponse = MessageResponse | SuccessResponse;
3289
+ export type UpdatePhoneNumberSettingsRequest = CallingSettingsRequest | UserIdentityChangeSettingsRequest | PayloadEncryptionSettingsRequest | StorageConfigurationSettingsRequest;
3290
+ export type UpdatePhoneNumberSettingsResponse = {
3291
+ success?: boolean;
3292
+ };
3293
+ export type GetEncryptionPublicKeyResponse = {
3294
+ data?: Array<WhatsAppBusinessEncryptionInfo>;
3295
+ };
3296
+ export type GetCommerceSettingsResponse = {
3297
+ data?: Array<{
3298
+ id?: string;
3299
+ is_cart_enabled?: boolean;
3300
+ is_catalog_visible?: boolean;
3301
+ }>;
3302
+ };
3303
+ export type SetCommerceSettingsResponse = {
3304
+ success?: boolean;
3305
+ };
3306
+ export type GetBusinessComplianceInfoResponse = {
3307
+ data?: Array<BusinessComplianceInfo>;
3308
+ };
3309
+ export type UpdateBusinessComplianceInfoResponse = {
3310
+ /** Indicates whether the compliance information was successfully updated */
3311
+ success: boolean;
3312
+ };
3313
+ export type GetMediaResponse = {
3314
+ file_size?: string;
3315
+ id?: string;
3316
+ messaging_product?: string;
3317
+ mime_type?: string;
3318
+ sha256?: string;
3319
+ url?: string;
3320
+ };
3321
+ export type DeleteMediaResponse = {
3322
+ success?: boolean;
3323
+ };
3324
+ export type AddAssignedUserRequest = {
3325
+ /** User ID of the person to add to the WhatsApp Business Account. This must be a valid Facebook user ID. */
3326
+ user: string;
3327
+ /** Array of permission tasks to grant to the user. These tasks determine what actions the user can perform on the WhatsApp Business Account. */
3328
+ tasks: Array<WhatsAppBusinessAccountPermissionTask>;
3329
+ };
3330
+ export type RemoveAssignedUserRequest = {
3331
+ /** User ID of the person to remove from the WhatsApp Business Account. This must be a valid Facebook user ID that is currently assigned to the account. */
3332
+ user: string;
3333
+ };
3334
+ export type GetCreditLinesResponse = {
3335
+ data?: Array<{
3336
+ id?: string;
3337
+ legal_entity_name?: string;
3338
+ }>;
3339
+ };
3340
+ export type GetTemplateResponse = {
3341
+ category?: string;
3342
+ components?: Array<{
3343
+ buttons?: Array<{
3344
+ text?: string;
3345
+ type?: string;
3346
+ }>;
3347
+ example?: {
3348
+ body_text?: Array<Array<string>>;
3349
+ };
3350
+ format?: string;
3351
+ text?: string;
3352
+ type?: string;
3353
+ }>;
3354
+ id?: string;
3355
+ language?: string;
3356
+ name?: string;
3357
+ status?: string;
3358
+ };
3359
+ export type EditTemplateRequest = {
3360
+ category?: string;
3361
+ components?: Array<{
3362
+ buttons?: Array<{
3363
+ text?: string;
3364
+ type?: string;
3365
+ }>;
3366
+ example?: {
3367
+ body_text?: Array<Array<string>>;
3368
+ };
3369
+ format?: string;
3370
+ text?: string;
3371
+ type?: string;
3372
+ }>;
3373
+ language?: string;
3374
+ name?: string;
3375
+ };
3376
+ export type EditTemplateResponse = {
3377
+ success?: boolean;
3378
+ };
3379
+ export type ListTemplatesResponse = {
3380
+ data?: Array<{
3381
+ category?: string;
3382
+ components?: Array<{
3383
+ buttons?: Array<{
3384
+ text?: string;
3385
+ type?: string;
3386
+ }>;
3387
+ example?: {
3388
+ body_text?: Array<Array<string>>;
3389
+ };
3390
+ format?: string;
3391
+ text?: string;
3392
+ type?: string;
3393
+ }>;
3394
+ id?: string;
3395
+ language?: string;
3396
+ name?: string;
3397
+ status?: string;
3398
+ }>;
3399
+ paging?: {
3400
+ cursors?: {
3401
+ after?: string;
3402
+ before?: string;
3403
+ };
3404
+ };
3405
+ };
3406
+ export type CreateTemplateRequest = {
3407
+ category?: string;
3408
+ components?: Array<{
3409
+ buttons?: Array<{
3410
+ flow_action?: string;
3411
+ flow_id?: string;
3412
+ navigate_screen?: string;
3413
+ text?: string;
3414
+ type?: string;
3415
+ }>;
3416
+ text?: string;
3417
+ type?: string;
3418
+ }>;
3419
+ language?: string;
3420
+ name?: string;
3421
+ };
3422
+ export type CreateTemplateResponse = {
3423
+ category?: string;
3424
+ id?: string;
3425
+ status?: string;
3426
+ };
3427
+ export type DeleteTemplateResponse = {
3428
+ success?: boolean;
3429
+ };
3430
+ export type UpdateBusinessAccountRequest = {
3431
+ /** Updated name for the WhatsApp Business Account */
3432
+ name?: string;
3433
+ /** Updated timezone identifier for the WhatsApp Business Account */
3434
+ timezone_id?: string;
3435
+ };
3436
+ export type UpdateBusinessAccountResponse = {
3437
+ success?: boolean;
3438
+ };
3439
+ //# sourceMappingURL=types.d.ts.map