one_msg_sdk 2.0.0 → 2.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acad13655cf0bc37aa2f27181c32af989565d62bf16fafbd2c8552004d111c65
4
- data.tar.gz: b14c038d952759865ccb940e5db3a4e9fabfe914edb29f1abcff5668601d2be5
3
+ metadata.gz: 562955c57e7fee4e623a742fe09a8022223b43fe4110ae601550252e5477105a
4
+ data.tar.gz: 29353a857e5dc45bb81bdbef1cfe71de23a1681fa754f4096cf5a13f84d8172a
5
5
  SHA512:
6
- metadata.gz: cbb69587141bf92b5b18010342ac724febcd3d87e4d5306b2096bb11742affe30bacb88ee481c6566d207ea46dac6e87133d394f9916061d10bc2a03362ae807
7
- data.tar.gz: dd33b1468539f126eab754f99390f4e838f802105554ab7f419afd1597e4c32f14af7c0cf558af8c79b9f87271cd447d0b0bbbb1d1b8464f8e7f07e71b516ae0
6
+ metadata.gz: 2b0576b002411912429b7f16c29ab33f9874625970e0861b13f1f6206960ba8f0ea9aa986953241535bbeb69a8c656aea716b68c5635893d261fc3da8af98666
7
+ data.tar.gz: d4d4f1813b1216f9fde934c27a016b562e8c04a682e0314d2131780de3018f9963015e0360a38e23f66f9ade749a99ecc1f2467cfb34b6de3375bb793eaf989e
data/AGENTS.md ADDED
@@ -0,0 +1,707 @@
1
+ # AGENTS.md — one_msg_sdk
2
+
3
+ > **Purpose:** exhaustive machine-readable integration guide for AI coding agents.
4
+ > **Human docs:** [README.md](./README.md)
5
+
6
+ ## Identity
7
+
8
+ ```yaml
9
+ package: "one_msg_sdk"
10
+ registry: https://rubygems.org/gems/one_msg_sdk
11
+ repository: https://github.com/1msg/1msg-sdk/tree/main/ruby
12
+ language: Ruby
13
+ version: 2.0.1
14
+ public_only: true
15
+ never_mention: chat-api
16
+ ```
17
+
18
+ ## Decision tree
19
+
20
+ ```text
21
+ Need WhatsApp messaging from Ruby?
22
+ └─ yes → gem install one_msg_sdk
23
+ └─ OneMsgSdk.configure + MessagingApi.new
24
+ ├─ text reply → sendMessage(token, body, chatId|phone)
25
+ ├─ file/media → sendFile / uploadMedia
26
+ ├─ template (24h closed) → sendTemplate
27
+ ├─ interactive list/buttons → sendList / sendButton
28
+ ├─ read inbox → listMessages
29
+ ├─ profile → getMe
30
+ ├─ groups → GroupsApi.*
31
+ ├─ flows → FlowsApi.*
32
+ └─ templates list → listTemplates
33
+ ```
34
+
35
+ ## Auth invariants
36
+
37
+ 1. Base path is `{baseUrl}/{instanceId}` (no trailing slash issues).
38
+ 2. URL: `https://{baseUrl}/{instanceId}/{path}?token={token}`.
39
+ 3. Pass channel token as the first arg to generated methods.
40
+ 4. Never log, commit, or expose tokens.
41
+ 5. Server-side only — no browser usage.
42
+
43
+ ## Client map
44
+
45
+ ```ruby
46
+ MessagingApi # send/list messages, media, interactive
47
+ ProfileApi # getMe
48
+ GroupsApi # create/list/manage groups
49
+ FlowsApi # WhatsApp Flows lifecycle
50
+ TemplatesApi # listTemplates
51
+ ChannelApi # channel helpers
52
+ CallingApi # calling
53
+ WebhooksApi # webhooks
54
+ ```
55
+
56
+ ## Recipient rules
57
+
58
+ - `chatId`: `12020721369@c.us` (1:1) or `...@g.us` (group)
59
+ - `phone`: country code + number, no `+`
60
+ - Exactly one of `chatId` | `phone` per request
61
+
62
+ ## Anti-patterns
63
+
64
+ - ❌ Raw HTTP without token query param
65
+ - ❌ Hardcoding token in source
66
+ - ❌ Using sendMessage when 24h window is closed (use sendTemplate)
67
+ - ❌ Referencing internal `chat-api` repo name in user-facing code
68
+
69
+ ## Operation catalog
70
+
71
+ ### getCallingSettings
72
+
73
+ ```yaml
74
+ operationId: getCallingSettings
75
+ http: GET /callingSettings
76
+ clientGroup: calling
77
+ summary: Get calling settings
78
+ description: WhatsApp Calling API settings (beta). Requires Meta Calling enablement on the WABA. Not production-complete — paths and webhook field names may change. Trial/subscription-limited channels are blocked.
79
+ responses: 200, 401, 500
80
+ ```
81
+
82
+ ### initiateCall
83
+
84
+ ```yaml
85
+ operationId: initiateCall
86
+ http: POST /initiateCall
87
+ clientGroup: calling
88
+ summary: Initiate WhatsApp call
89
+ description: Outbound Calling API (beta). Requires Meta Calling enablement and product consent. Not production-complete — verify on stage before relying on this in production. Trial/subscription-limited channels are blocked.
90
+ responses: 200, 401, 500
91
+ ```
92
+
93
+ ### updateCallingSettings
94
+
95
+ ```yaml
96
+ operationId: updateCallingSettings
97
+ http: POST /callingSettings
98
+ clientGroup: calling
99
+ summary: Update calling settings
100
+ description: Update WhatsApp Calling API settings (beta). Requires Meta Calling enablement. Trial/subscription-limited channels are blocked.
101
+ responses: 200, 401, 500
102
+ ```
103
+
104
+ ### createCommerce
105
+
106
+ ```yaml
107
+ operationId: createCommerce
108
+ http: POST /commerce
109
+ clientGroup: catalog
110
+ summary: Set Commerce Settings
111
+ description: Update catalog/cart commerce settings via the `params` object. - `params.is_catalog_visible` — show catalog storefront icon (`true`) or hide it (`false`). - `params.is_cart_enabled` — enable cart (`true`) or disable it (`false`). Blocked when the channel subscription limit is exceeded. Requires a commerce-capable channel (Cloud Functions `/commerceWAV2`).
112
+ responses: 200, 401, 500
113
+ ```
114
+
115
+ ### getCommerce
116
+
117
+ ```yaml
118
+ operationId: getCommerce
119
+ http: GET /commerce
120
+ clientGroup: catalog
121
+ summary: Get Commerce Settings
122
+ description: Returns catalog/cart commerce settings for the channel. - `is_catalog_visible` — show catalog storefront icon (`true`) or hide it (`false`). - `is_cart_enabled` — enable cart (`true`) or disable it (`false`).
123
+ responses: 200, 401, 500
124
+ ```
125
+
126
+ ### getConversationalAutomation
127
+
128
+ ```yaml
129
+ operationId: getConversationalAutomation
130
+ http: GET /conversationalAutomation
131
+ clientGroup: channel
132
+ summary: Get conversational automation settings
133
+ description: Get WhatsApp conversational components for the channel (welcome message, ice-breaker prompts, and slash commands). Proxies Meta/360dialog `GET /conversational_automation`. When `enable_welcome_message` is true and a user opens chat for the first time, Meta delivers a webhook message with `type: request_welcome`. The inbound formatter exposes that as `type: "request_welcome"` and `meta.request_welcome: true` so your webhook can send a custom welcome reply.
134
+ responses: 200, 401, 500
135
+ ```
136
+
137
+ ### getStatus
138
+
139
+ ```yaml
140
+ operationId: getStatus
141
+ http: GET /status
142
+ clientGroup: channel
143
+ summary: Get channel status
144
+ description: Returns WhatsApp Business API client connection status.
145
+ responses: 200, 401, 500
146
+ ```
147
+
148
+ ### setConversationalAutomation
149
+
150
+ ```yaml
151
+ operationId: setConversationalAutomation
152
+ http: POST /conversationalAutomation
153
+ clientGroup: channel
154
+ summary: Set conversational automation settings
155
+ description: Update WhatsApp conversational components. Allowed body fields (others are ignored): - `enable_welcome_message` (boolean) - `prompts` (string[], max 4, each ≤ 80 chars) - `commands` (`{ command_name, command_description }[]`) Proxies Meta/360dialog `POST /conversational_automation`.
156
+ responses: 200, 401, 500
157
+ ```
158
+
159
+ ### createFlows
160
+
161
+ ```yaml
162
+ operationId: createFlows
163
+ http: POST /flows
164
+ clientGroup: flows
165
+ summary: Create Flow
166
+ responses: 200
167
+ ```
168
+
169
+ ### createFlowsFlowIdDeprecate
170
+
171
+ ```yaml
172
+ operationId: createFlowsFlowIdDeprecate
173
+ http: POST /flows/{flowId}/deprecate
174
+ clientGroup: flows
175
+ summary: Deprecate Flow
176
+ responses: 200
177
+ ```
178
+
179
+ ### createFlowsFlowIdPublish
180
+
181
+ ```yaml
182
+ operationId: createFlowsFlowIdPublish
183
+ http: POST /flows/{flowId}/publish
184
+ clientGroup: flows
185
+ summary: Publish Flow
186
+ responses: 200
187
+ ```
188
+
189
+ ### deleteFlowsFlowId
190
+
191
+ ```yaml
192
+ operationId: deleteFlowsFlowId
193
+ http: DELETE /flows/{flowId}
194
+ clientGroup: flows
195
+ summary: Delete Flow
196
+ responses: 200
197
+ ```
198
+
199
+ ### getFlowsFlowId
200
+
201
+ ```yaml
202
+ operationId: getFlowsFlowId
203
+ http: GET /flows/{flowId}
204
+ clientGroup: flows
205
+ summary: Get Flow Details
206
+ responses: 200
207
+ ```
208
+
209
+ ### getFlowsFlowIdPreview
210
+
211
+ ```yaml
212
+ operationId: getFlowsFlowIdPreview
213
+ http: GET /flows/{flowId}/preview
214
+ clientGroup: flows
215
+ summary: Preview Flow
216
+ responses: 200
217
+ ```
218
+
219
+ ### getWhatsappBusinessEncryption
220
+
221
+ ```yaml
222
+ operationId: getWhatsappBusinessEncryption
223
+ http: GET /whatsapp_business_encryption
224
+ clientGroup: flows
225
+ summary: Get business encryption public key
226
+ description: Retrieve the WhatsApp business public key and signature status for this channel's phone number. Required before publishing or sending Flows that use data encryption.
227
+ responses: 200, 401, 500
228
+ ```
229
+
230
+ ### listFlows
231
+
232
+ ```yaml
233
+ operationId: listFlows
234
+ http: GET /flows
235
+ clientGroup: flows
236
+ summary: List Flows
237
+ responses: 200
238
+ ```
239
+
240
+ ### patchFlowsFlowIdAssets
241
+
242
+ ```yaml
243
+ operationId: patchFlowsFlowIdAssets
244
+ http: PATCH /flows/{flowId}/assets
245
+ clientGroup: flows
246
+ summary: Update Flow Structure
247
+ responses: 200
248
+ ```
249
+
250
+ ### patchFlowsFlowIdMetadata
251
+
252
+ ```yaml
253
+ operationId: patchFlowsFlowIdMetadata
254
+ http: PATCH /flows/{flowId}/metadata
255
+ clientGroup: flows
256
+ summary: Update Flow Metadata
257
+ responses: 200
258
+ ```
259
+
260
+ ### setWhatsappBusinessEncryption
261
+
262
+ ```yaml
263
+ operationId: setWhatsappBusinessEncryption
264
+ http: POST /whatsapp_business_encryption
265
+ clientGroup: flows
266
+ summary: Set business encryption public key
267
+ description: Upload and sign a 2048-bit RSA business public key (PEM) for this channel's phone number. Meta requires a signed key before Flow publish/send. Only one active key per number; a new upload replaces the previous key.
268
+ responses: 200, 400, 401, 500
269
+ ```
270
+
271
+ ### createGroups
272
+
273
+ ```yaml
274
+ operationId: createGroups
275
+ http: POST /groups
276
+ clientGroup: groups
277
+ summary: Create Group
278
+ responses: 200
279
+ ```
280
+
281
+ ### createGroupsGroupId
282
+
283
+ ```yaml
284
+ operationId: createGroupsGroupId
285
+ http: POST /groups/{groupId}
286
+ clientGroup: groups
287
+ summary: Update Group Info
288
+ responses: 200
289
+ ```
290
+
291
+ ### createGroupsGroupIdInvitelink
292
+
293
+ ```yaml
294
+ operationId: createGroupsGroupIdInvitelink
295
+ http: POST /groups/{groupId}/inviteLink
296
+ clientGroup: groups
297
+ summary: Reset Invite Link
298
+ responses: 200
299
+ ```
300
+
301
+ ### deleteGroupsGroupId
302
+
303
+ ```yaml
304
+ operationId: deleteGroupsGroupId
305
+ http: DELETE /groups/{groupId}
306
+ clientGroup: groups
307
+ summary: Delete Group
308
+ responses: 200
309
+ ```
310
+
311
+ ### getGroupsGroupId
312
+
313
+ ```yaml
314
+ operationId: getGroupsGroupId
315
+ http: GET /groups/{groupId}
316
+ clientGroup: groups
317
+ summary: Get Group Info
318
+ responses: 200
319
+ ```
320
+
321
+ ### getGroupsGroupIdInvitelink
322
+
323
+ ```yaml
324
+ operationId: getGroupsGroupIdInvitelink
325
+ http: GET /groups/{groupId}/inviteLink
326
+ clientGroup: groups
327
+ summary: Get Invite Link
328
+ responses: 200
329
+ ```
330
+
331
+ ### listGroups
332
+
333
+ ```yaml
334
+ operationId: listGroups
335
+ http: GET /groups
336
+ clientGroup: groups
337
+ summary: Get Groups List
338
+ responses: 200
339
+ ```
340
+
341
+ ### createReadMessage
342
+
343
+ ```yaml
344
+ operationId: createReadMessage
345
+ http: POST /readMessage
346
+ clientGroup: messaging
347
+ summary: Mark message as read
348
+ responses: 200, 401
349
+ ```
350
+
351
+ ### createUploadMedia
352
+
353
+ ```yaml
354
+ operationId: createUploadMedia
355
+ http: POST /uploadMedia
356
+ clientGroup: messaging
357
+ summary: Upload media
358
+ responses: 200
359
+ ```
360
+
361
+ ### deleteMedia
362
+
363
+ ```yaml
364
+ operationId: deleteMedia
365
+ http: DELETE /media/{mediaId}
366
+ clientGroup: messaging
367
+ summary: Delete media from WABA storage
368
+ description: Delete previously uploaded media by numeric `mediaId` (from `/uploadMedia`). This is the canonical deletion endpoint and uses the REST `DELETE` verb on the media resource path. The older `POST /deleteMedia` is a deprecated alias.
369
+ responses: 200, 400, 401, 500
370
+ ```
371
+
372
+ ### deleteMediaLegacy
373
+
374
+ ```yaml
375
+ operationId: deleteMediaLegacy
376
+ http: POST /deleteMedia
377
+ clientGroup: messaging
378
+ summary: Delete media from WABA storage (deprecated alias)
379
+ description: **Deprecated.** Use `DELETE /media/{mediaId}` instead. This POST alias is kept for backward compatibility with earlier integrations. New integrations should call `DELETE /media/{mediaId}`: 1msg follows REST conventions for resource deletion going forward (delete a resource with the `DELETE` verb on its resource path).
380
+ responses: 200, 400, 401, 500
381
+ ```
382
+
383
+ ### getMmLiteStatus
384
+
385
+ ```yaml
386
+ operationId: getMmLiteStatus
387
+ http: GET /mmLiteStatus
388
+ clientGroup: messaging
389
+ summary: Get MM Lite availability and status
390
+ responses: 200, 401, 500
391
+ ```
392
+
393
+ ### listMessages
394
+
395
+ ```yaml
396
+ operationId: listMessages
397
+ http: GET /messages
398
+ clientGroup: messaging
399
+ summary: Get messages list
400
+ responses: 200
401
+ ```
402
+
403
+ ### retrieveMedia
404
+
405
+ ```yaml
406
+ operationId: retrieveMedia
407
+ http: GET /retrieveMedia
408
+ clientGroup: messaging
409
+ summary: Retrieve uploaded media metadata
410
+ description: Get WABA media URL and metadata by mediaId (from uploadMedia). The returned `url` is temporary and typically expires within ~5 minutes.
411
+ responses: 200, 400, 401, 500
412
+ ```
413
+
414
+ ### sendAddressMessage
415
+
416
+ ```yaml
417
+ operationId: sendAddressMessage
418
+ http: POST /sendAddressMessage
419
+ clientGroup: messaging
420
+ summary: Send address request message
421
+ description: Request shipping address from the user (WhatsApp interactive `address_message`). **India and Singapore only.** Requires: - Business WhatsApp number registered in that country - Recipient phone matching the country (`+91` ↔ `IN`, `+65` ↔ `SG`) Pass `country: "IN"` or `country: "SG"`. Eligibility is validated upstream; mismatches (e.g. Singapore phone with `country: "IN"`) return errors such as `Unsupported Interactive Message type` (HTTP 200 with `sent: false`). Optional action parameters: `values`, `saved_addresses`, `validation_errors`.
422
+ responses: 200, 400, 401, 429, 500
423
+ ```
424
+
425
+ ### sendButton
426
+
427
+ ```yaml
428
+ operationId: sendButton
429
+ http: POST /sendButton
430
+ clientGroup: messaging
431
+ summary: Send Reply Buttons Message
432
+ responses: 200, 400, 401, 429, 500
433
+ ```
434
+
435
+ ### sendCarousel
436
+
437
+ ```yaml
438
+ operationId: sendCarousel
439
+ http: POST /sendCarousel
440
+ clientGroup: messaging
441
+ summary: Send Carousel
442
+ description: You can send product cards via Carousel in two ways: Template messages: do not require a 24-hour customer service window between you and the recipient. Use sendTemplate. Free-form messages: can be sent only when a customer service window is open between you and the recipient. Use sendCarousel. The message structure in /sendCarousel is largely similar to sending a template. However, in this case you must explicitly specify all elements that are created in advance when working with templates. This is because the message is sent without using a template. In /sendCarousel, for sending a Catalog Carousel there can be either 1 URL button or one or more quick reply buttons.
443
+ responses: 200, 400, 401, 429, 500
444
+ ```
445
+
446
+ ### sendContact
447
+
448
+ ```yaml
449
+ operationId: sendContact
450
+ http: POST /sendContact
451
+ clientGroup: messaging
452
+ summary: Send a Contact
453
+ responses: 200, 400, 401, 429, 500
454
+ ```
455
+
456
+ ### sendCtaUrl
457
+
458
+ ```yaml
459
+ operationId: sendCtaUrl
460
+ http: POST /sendCtaUrl
461
+ clientGroup: messaging
462
+ summary: Send CTA URL interactive message
463
+ description: Send an interactive message with a single call-to-action URL button.
464
+ responses: 200, 400, 401, 429, 500
465
+ ```
466
+
467
+ ### sendFile
468
+
469
+ ```yaml
470
+ operationId: sendFile
471
+ http: POST /sendFile
472
+ clientGroup: messaging
473
+ summary: Send a File
474
+ description: Send a file to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone.
475
+ responses: 200, 400, 401, 429, 500
476
+ ```
477
+
478
+ ### sendFlow
479
+
480
+ ```yaml
481
+ operationId: sendFlow
482
+ http: POST /sendFlow
483
+ clientGroup: messaging
484
+ summary: Send WhatsApp Flow Message
485
+ description: Send Interactive WhatsApp Flow message to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone. Use this method to send a published WhatsApp Flow as a service (interactive) message. If the 24-hour window is closed, send a template with a FLOW button via /sendTemplate.
486
+ responses: 200, 400, 401, 429, 500
487
+ ```
488
+
489
+ ### sendList
490
+
491
+ ```yaml
492
+ operationId: sendList
493
+ http: POST /sendList
494
+ clientGroup: messaging
495
+ summary: Send List Message
496
+ responses: 200, 400, 401, 429, 500
497
+ ```
498
+
499
+ ### sendLocation
500
+
501
+ ```yaml
502
+ operationId: sendLocation
503
+ http: POST /sendLocation
504
+ clientGroup: messaging
505
+ summary: Send a Location
506
+ description: Send a location to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone.
507
+ responses: 200, 400, 401, 429, 500
508
+ ```
509
+
510
+ ### sendLocationRequest
511
+
512
+ ```yaml
513
+ operationId: sendLocationRequest
514
+ http: POST /sendLocationRequest
515
+ clientGroup: messaging
516
+ summary: Send Location Request Message
517
+ responses: 200, 400, 401, 429, 500
518
+ ```
519
+
520
+ ### sendMessage
521
+
522
+ ```yaml
523
+ operationId: sendMessage
524
+ http: POST /sendMessage
525
+ clientGroup: messaging
526
+ summary: Send a Message
527
+ description: Send a message to an existing chat. (Only if the dialogue has an Open Session). The message will be added to the queue for sending and delivered even if the phone is disconnected from the Internet or authorization is not passed. Only one of two parameters is needed to determine the destination - chatId or phone.
528
+ responses: 200, 400, 401, 429, 500
529
+ ```
530
+
531
+ ### sendOrderDetails
532
+
533
+ ```yaml
534
+ operationId: sendOrderDetails
535
+ http: POST /sendOrderDetails
536
+ clientGroup: messaging
537
+ summary: Send order details (India payments template)
538
+ description: Send a WhatsApp **order details** payment / invoice message using a pre-approved **Utility** template that has an `ORDER_DETAILS` button. **India only** (WhatsApp Payments India). Requires: - India WhatsApp Business number - Commerce enabled on the channel (`GET`/`POST /commerce`) - Approved template with an `ORDER_DETAILS` button Use this method when you need structured fields (`order`, `referenceId`, `currency`, `paymentSettings`). The API appends a template button `sub_type: order_details` and sends via the same path as `POST /sendTemplate`. Works **outside the 24-hour session window** (template message). You can also send the same payload yourself with `POST /sendTemplate` by including a button component in `params`: ```json { "type": "button", "sub_type": "order_details", "index": 0, "parameters": [{ "type": "action", "action": { "order_details": { "reference_id": "order-123", "currency": "INR", "order": { "status": "pending", "items": [], "subtotal": { "offset": 100, "value": 50000 } } } } }] } ```
539
+ responses: 200, 400, 401, 500
540
+ ```
541
+
542
+ ### sendPaymentRequest
543
+
544
+ ```yaml
545
+ operationId: sendPaymentRequest
546
+ http: POST /sendPaymentRequest
547
+ clientGroup: messaging
548
+ summary: Send payment request (regional)
549
+ description: Send a regional payment request interactive message (beta scaffold). `region` must be IN, SG, or BR. Payload shape follows Meta regional payments docs; verify on stage before production use. Full regional builders are not implemented yet.
550
+ responses: 200, 400, 401, 500
551
+ ```
552
+
553
+ ### sendProduct
554
+
555
+ ```yaml
556
+ operationId: sendProduct
557
+ http: POST /sendProduct
558
+ clientGroup: messaging
559
+ summary: Send a Product
560
+ responses: 200, 400, 401, 429, 500
561
+ ```
562
+
563
+ ### sendReaction
564
+
565
+ ```yaml
566
+ operationId: sendReaction
567
+ http: POST /sendReaction
568
+ clientGroup: messaging
569
+ summary: Send Reaction
570
+ responses: 200, 400, 401, 429, 500
571
+ ```
572
+
573
+ ### sendSticker
574
+
575
+ ```yaml
576
+ operationId: sendSticker
577
+ http: POST /sendSticker
578
+ clientGroup: messaging
579
+ summary: Send sticker message
580
+ description: Send a WhatsApp sticker by mediaId or link URL.
581
+ responses: 200, 400, 401, 429, 500
582
+ ```
583
+
584
+ ### getMe
585
+
586
+ ```yaml
587
+ operationId: getMe
588
+ http: GET /me
589
+ clientGroup: profile
590
+ summary: Get Profile Info
591
+ description: Get WhatsApp Business Account profile information
592
+ responses: 200, 401, 500
593
+ ```
594
+
595
+ ### updateMe
596
+
597
+ ```yaml
598
+ operationId: updateMe
599
+ http: POST /me
600
+ clientGroup: profile
601
+ summary: Update profile info
602
+ description: Update WhatsApp Business Account profile fields. At least one of about, description, email, photo, address, vertical, websites is required. Blocked when the channel subscription limit is exceeded.
603
+ responses: 200, 401, 422, 500
604
+ ```
605
+
606
+ ### addTemplate
607
+
608
+ ```yaml
609
+ operationId: addTemplate
610
+ http: POST /addTemplate
611
+ clientGroup: templates
612
+ summary: Create message template
613
+ responses: 200, 401, 500
614
+ ```
615
+
616
+ ### listTemplates
617
+
618
+ ```yaml
619
+ operationId: listTemplates
620
+ http: GET /templates
621
+ clientGroup: templates
622
+ summary: Get templates list
623
+ responses: 200
624
+ ```
625
+
626
+ ### removeTemplate
627
+
628
+ ```yaml
629
+ operationId: removeTemplate
630
+ http: POST /removeTemplate
631
+ clientGroup: templates
632
+ summary: Remove message template
633
+ responses: 200, 401, 500
634
+ ```
635
+
636
+ ### sendTemplate
637
+
638
+ ```yaml
639
+ operationId: sendTemplate
640
+ http: POST /sendTemplate
641
+ clientGroup: templates
642
+ summary: Send Template Message
643
+ description: Send a WhatsApp template message (works outside the 24-hour session window). Supported `params` button `sub_type` values include: `url`, `quick_reply`, `copy_code` / `coupon_code`, `catalog`, `flow`, `limited_time_offer`, and **`order_details`** (WhatsApp Payments **India only** — requires an approved Utility template with an ORDER_DETAILS button). For India order/invoice payments outside 24h, include a button component: ```json { "type": "button", "sub_type": "order_details", "index": 0, "parameters": [{ "type": "action", "action": { "order_details": { "reference_id": "...", "currency": "INR", "order": {} } } }] } ``` Convenience wrapper with structured fields: `POST /sendOrderDetails`.
644
+ responses: 200
645
+ ```
646
+
647
+ ### blockUser
648
+
649
+ ```yaml
650
+ operationId: blockUser
651
+ http: POST /blockUser
652
+ clientGroup: users
653
+ summary: Block WhatsApp user
654
+ responses: 200, 400, 401, 500
655
+ ```
656
+
657
+ ### listBlockedUsers
658
+
659
+ ```yaml
660
+ operationId: listBlockedUsers
661
+ http: GET /blockedUsers
662
+ clientGroup: users
663
+ summary: List blocked WhatsApp users
664
+ description: Returns users currently blocked on this WhatsApp channel (WABA `GET /block_users`). Same channel token auth as `blockUser` / `unblockUser`.
665
+ responses: 200, 401, 500
666
+ ```
667
+
668
+ ### unblockUser
669
+
670
+ ```yaml
671
+ operationId: unblockUser
672
+ http: POST /unblockUser
673
+ clientGroup: users
674
+ summary: Unblock WhatsApp user
675
+ responses: 200, 400, 401, 500
676
+ ```
677
+
678
+ ### getWebhook
679
+
680
+ ```yaml
681
+ operationId: getWebhook
682
+ http: GET /webhook
683
+ clientGroup: webhooks
684
+ summary: Get webhook URL
685
+ description: Returns the configured client webhook URL for this channel.
686
+ responses: 200, 401, 500
687
+ ```
688
+
689
+ ### setWebhook
690
+
691
+ ```yaml
692
+ operationId: setWebhook
693
+ http: POST /webhook
694
+ clientGroup: webhooks
695
+ summary: Set webhook URL
696
+ description: Configure the client webhook URL for inbound events.
697
+ responses: 200, 401, 500
698
+ ```
699
+
700
+ ## Metadata
701
+
702
+ openapi_title: 1MSG WhatsApp Business API (Public)
703
+ openapi_version: 1.0.0
704
+ operations: 60
705
+ package: one_msg_sdk
706
+ registry: RubyGems
707
+