Skip to content

Add sendWhatsApp transactional method - #238

Merged
mike-engel merged 1 commit into
mainfrom
cdp-6330
Jul 13, 2026
Merged

mike-engel merged 1 commit into
mainfrom
cdp-6330

Conversation

@mike-engel

@mike-engel mike-engel commented Jul 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The backend serves POST /v1/send/whatsapp, but the SDK did not expose it. This adds a sendWhatsApp transactional method mirroring the existing sendSMS/sendPush surface.

Changes

  • SendWhatsAppRequest builder in lib/api/requests.ts — mirrors SendSMSRequest, plus the from and tracked fields the handler reads. to/from are E.164 phone numbers, optional only when the referenced transactional_message_id already defines them.
  • APIClient.sendWhatsApp(req) → POST /v1/send/whatsapp, with the same instance guard as the other send methods.
  • Exports: SendWhatsAppRequest re-exported from lib/api.ts; SendWhatsAppRequestOptions + WhatsAppMessage from index.ts.
  • Unit tests (invalid-object throw, template success, all optional params, error path).
  • Live integration test gated on CIO_TEST_WHATSAPP_TRANSACTIONAL_ID (+ CIO_TEST_WHATSAPP_RECIPIENT), plus env-example and header docs.
  • docs/app.md WhatsApp subsection.

Assisted by AI 🤖


Note

Low Risk
Additive API surface following the existing sendSMS pattern; no changes to auth or shared request plumbing beyond a new POST route.

Overview
Exposes transactional WhatsApp on the App API client for POST /v1/send/whatsapp, which existed on the backend but was missing from the SDK.

Adds SendWhatsAppRequest (same builder pattern as SMS, with optional E.164 to / from, plus tracked and the usual transactional flags), APIClient.sendWhatsApp, and public exports for SendWhatsAppRequestOptions / WhatsAppMessage. Unit tests cover instance validation, payload shape, and errors; a gated live test uses CIO_TEST_WHATSAPP_* env vars. docs/app.md documents usage with an example.

Reviewed by Cursor Bugbot for commit f2824ec. Bugbot is set up for automated code reviews on this repo. Configure here.

The edge backend serves POST /v1/send/whatsapp but the SDK did not expose
it. Add SendWhatsAppRequest (mirroring SendSMSRequest, plus the from/tracked
fields the handler reads) and APIClient.sendWhatsApp, with unit tests, live
integration coverage, and docs.

Verified against edge transactional/send_whatsapp.go.
@mike-engel mike-engel changed the title feat: add sendWhatsApp transactional method (CDP-6330) Add sendWhatsApp transactional method Jul 10, 2026
@mike-engel mike-engel self-assigned this Jul 10, 2026
@mike-engel
mike-engel merged commit d84e77e into main Jul 13, 2026
11 checks passed
@mike-engel
mike-engel deleted the cdp-6330 branch July 13, 2026 08:32
@mike-engel mike-engel mentioned this pull request Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants