Skip to main content
Languages: every operation supports cURL, Node.js (TypeScript), Python, Go, Ruby, and PHP. The first 15 operations on this page show all six languages; the remaining 80 show cURL and TypeScript — the two most-used.

WhatsApp API

WhatsApp endpoints exposed by the Devotel CPaaS API Base path: /api/v1/whatsapp Endpoint count: 93

title: “Worked samples” description: “Read → update → re-read the conversational-automation config (ice breakers, slash commands, welcome toggle), an interactive send with the full envelope, the test-account analytics envelope, and validation errors.”

Worked request and response samples

Copy a request as written, substitute your own values, and compare the response envelope. The conversational-automation chain a WhatsApp admin runs: read the config → write the full desired state → re-read to verify. Every sample below pairs curl with raw Node and Python (fetch / requests) — the Node SDK’s client.request(method, path, body) escape hatch and the Python SDK take the same route shape. Template sends live elsewhere. The loop for approved-template sends (GET /templates → POST /api/v1/messages/whatsapp) is worked end to end in API recipes, task 13. This overlay covers the operations on this page: the WhatsApp-specific config surface, interactive sends, and test-account analytics.

1. Read the conversational-automation config

GET /api/v1/whatsapp/conversational-automation
This returns the first-open affordances on your organization’s default WhatsApp connection: the welcome-message toggle, up to four ice breakers (prompts), and the slash-command menu (commands) — the same object you send back on update.

2. Update the config (full desired state)

PUT /api/v1/whatsapp/conversational-automation
WhatsApp replaces each field present on the write, so send the complete desired state — omitting prompts clears the ice breakers rather than leaving them as they were. Owners and admins only. command_name must be lowercase letters, digits, and underscores (no spaces); the caps — at most four ice breakers of 80 characters each, at most 30 commands — are validated here, so a bad config returns a 422 before it reaches Meta. Request
Re-read with step 1 to confirm the state Meta accepted. A field violation comes back as 422 with the offending field in error.details — for example a command_name with a space or an upper-case letter:
422

3. Send an interactive message

POST /api/v1/whatsapp/messages/send-interactive
Inside the recipient’s 24-hour customer-service window you can send without a template. action.buttons takes up to three reply buttons; the tap returns on your inbound webhook as button_reply. A list menu (action.button + action.sections) is the alternative shape. Request

4. Test-account analytics KPIs

GET /api/v1/whatsapp/test-account/analytics
Pre-aggregated counts for the test-account analytics card in the dashboard, scoped to your OTP-verified test recipient. Read-only aggregate with no provider or billing side-effect. daily holds up to 30 data points, oldest first. Request

SDK surface bridge — Send the anchored demo message, page its reply index, or pull the alias-index snapshot — everything against the sandbox key.

These three tabs mirror SDK status and coverage. Python fronts client.request, Go fronts client.Request, and TS fronts fetch-TS — each with the sandbox key.

Send the anchored demo message

Alias a demo thread

Read the alias index




List costs

GET /api/v1/whatsapp/analytics/costs

List templates

GET /api/v1/whatsapp/analytics/templates

List block-users

GET /api/v1/whatsapp/block-users

List business-profile

GET /api/v1/whatsapp/business-profile

List catalogs

GET /api/v1/whatsapp/businesses/{businessId}/catalogs
string
required
—

List permissions

GET /api/v1/whatsapp/calling/permissions

List catalog

GET /api/v1/whatsapp/catalog

List catalogs

GET /api/v1/whatsapp/catalogs

List products

GET /api/v1/whatsapp/catalogs/{catalogId}/products
string
required
—

List connections

GET /api/v1/whatsapp/connections

List calling

GET /api/v1/whatsapp/connections/{phoneNumberId}/calling
string
required
Obtain from GET /api/v1/numbers.

List exists

GET /api/v1/whatsapp/connections/exists

List conversational-automation

GET /api/v1/whatsapp/conversational-automation

GET /api/v1/whatsapp/conversations/search

List flows

GET /api/v1/whatsapp/flows

Get flows

Need this flow in Python, Go, Ruby, or PHP? The Worked sequences section renders this surface’s hero flows in the full six-language group.
GET /api/v1/whatsapp/flows/{flowId}
string
required
Obtain from GET /api/v1/flows.

List funnel

GET /api/v1/whatsapp/flows/{flowId}/funnel
string
required
Obtain from GET /api/v1/flows.

List json

GET /api/v1/whatsapp/flows/{flowId}/json
string
required
Obtain from GET /api/v1/flows.

List submissions

GET /api/v1/whatsapp/flows/{flowId}/submissions
string
required
Obtain from GET /api/v1/flows.

List health

GET /api/v1/whatsapp/health

List kb-config

GET /api/v1/whatsapp/kb-config

Get media

GET /api/v1/whatsapp/media/{mediaId}
string
required
Obtain from GET /api/v1/media on the page.

List download

GET /api/v1/whatsapp/media/{mediaId}/download
string
required
Obtain from GET /api/v1/media on the page.

List phone-numbers

GET /api/v1/whatsapp/phone-numbers

List pricing-analytics

GET /api/v1/whatsapp/pricing-analytics

List quality

GET /api/v1/whatsapp/quality

List status

GET /api/v1/whatsapp/status

List templates

GET /api/v1/whatsapp/templates

List library

GET /api/v1/whatsapp/templates/library

List analytics

GET /api/v1/whatsapp/test-account/analytics

List calling-availability

GET /api/v1/whatsapp/test-account/calling-availability

List catalog

GET /api/v1/whatsapp/test-account/catalog

List flows

GET /api/v1/whatsapp/test-account/flows

List status

GET /api/v1/whatsapp/test-account/status

List webhook

GET /api/v1/whatsapp/webhook

Block-users whatsapp

POST /api/v1/whatsapp/block-users

Picture business-profile

POST /api/v1/whatsapp/business-profile/picture

Create accept

POST /api/v1/whatsapp/calling/calls/{metaCallId}/accept
string
required
Obtain from GET /api/v1/voice/calls.

Create decline

POST /api/v1/whatsapp/calling/calls/{metaCallId}/decline
string
required
Obtain from GET /api/v1/voice/calls.

Create accept

POST /api/v1/whatsapp/calls/{callId}/accept
string
required
Obtain from GET /api/v1/voice/calls.

Create pre_accept

POST /api/v1/whatsapp/calls/{callId}/pre_accept
string
required
Obtain from GET /api/v1/voice/calls.

Create reject

POST /api/v1/whatsapp/calls/{callId}/reject
string
required
Obtain from GET /api/v1/voice/calls.

Create terminate

POST /api/v1/whatsapp/calls/{callId}/terminate
string
required
Obtain from GET /api/v1/voice/calls.

Initiate calls

POST /api/v1/whatsapp/calls/initiate

Permission calls

POST /api/v1/whatsapp/calls/permission

Send catalog

POST /api/v1/whatsapp/catalog/send

Send-list catalog

POST /api/v1/whatsapp/catalog/send-list

Catalogs whatsapp

POST /api/v1/whatsapp/catalogs

Create products

POST /api/v1/whatsapp/catalogs/{catalogId}/products
string
required
—

Create send

POST /api/v1/whatsapp/catalogs/{catalogId}/send
string
required
—

Connect whatsapp

POST /api/v1/whatsapp/connect

Disable calling

POST /api/v1/whatsapp/connections/{phoneNumberId}/calling/disable
string
required
Obtain from GET /api/v1/numbers.

Enable calling

POST /api/v1/whatsapp/connections/{phoneNumberId}/calling/enable
string
required
Obtain from GET /api/v1/numbers.

Register-webhook calling

POST /api/v1/whatsapp/connections/{phoneNumberId}/calling/register-webhook
string
required
Obtain from GET /api/v1/numbers.

Create archive

POST /api/v1/whatsapp/conversations/{conversationId}/archive
string
required
Obtain from GET /api/v1/conversations.

Create read

POST /api/v1/whatsapp/conversations/{conversationId}/read
string
required
Obtain from GET /api/v1/conversations.

Create resolve-bsuid

POST /api/v1/whatsapp/conversations/{conversationId}/resolve-bsuid
string
required
Obtain from GET /api/v1/conversations.

Estimate WhatsApp marketing campaign cost

POST /api/v1/whatsapp/cost-optimizer/estimate
Estimate a WhatsApp MARKETING campaign’s Meta conversation cost from the two variables that drive it: the number of recipients and their country. Returns the per-recipient marketing rate and projected spend. Pure planning — does NOT send anything.
integer
required
Number of recipients the marketing campaign will reach.
string
ISO-3166 alpha-2 target country (e.g. “BR”). Omitted → Meta’s default rate card.

Plan WhatsApp campaign cost optimization

POST /api/v1/whatsapp/cost-optimizer/plan
Pre-send conversation-cost optimizer: cheapest-category selection + utility-before-marketing sequencing + per-campaign budget guard. Returns a projected-spend + savings report. Pure planning — does NOT send anything.
number
Optional total campaign budget (USD). Sends beyond it are deferred.
object[]
required
—

Flows whatsapp

POST /api/v1/whatsapp/flows

Create assets

POST /api/v1/whatsapp/flows/{flowId}/assets
string
required
Obtain from GET /api/v1/flows.

Create publish

POST /api/v1/whatsapp/flows/{flowId}/publish
string
required
Obtain from GET /api/v1/flows.

Generate flows

POST /api/v1/whatsapp/flows/generate

Kb-config whatsapp

POST /api/v1/whatsapp/kb-config

Send WhatsApp marketing message

POST /api/v1/whatsapp/marketing-messages/send
Send a MARKETING-category template via Meta’s Marketing Messages API (MM Lite) for send-time/creative optimization. Reuses the tenant’s connected WABA token. tracking_id correlates status webhooks back to a campaign/journey.
string
required
Recipient E.164 phone number.
string
required
Approved marketing template name.
string
required
Template language code (e.g. en_US).
object[]
Meta template components (header/body/buttons).
string
Echoed on status webhooks for campaign/CTR correlation.
string
Optional WABA selector for multi-WABA tenants.

Create read

POST /api/v1/whatsapp/messages/{messageId}/read
string
required
Obtain from GET /api/v1/messages on the page.

Send WhatsApp address-request message

POST /api/v1/whatsapp/messages/send-address-request
Prompt the recipient to submit (or pick a saved) structured delivery address, inside the 24h customer-service window — no template review required. country (ISO 3166-1 alpha-2) selects the field set Meta renders. The reply arrives as an address_message interactive reply on the inbound webhook.
string
required
Recipient E.164 phone number OR WhatsApp Business Solution UID.
string
required
Prompt text shown above the address form (1-1024 chars).
string
required
ISO 3166-1 alpha-2 country code selecting Meta’s address field set (e.g. IN, SG).
object
Optional pre-fill values keyed by Meta’s per-country field names.
object[]
Optional previously-saved addresses the recipient can pick from, in markets that support it.

Send-flow messages

POST /api/v1/whatsapp/messages/send-flow

Send WhatsApp interactive message

POST /api/v1/whatsapp/messages/send-interactive
Send an interactive WhatsApp message (reply-buttons, list-menu, or a CTA-URL button) inside the 24h customer-service window — no template review required. The recipient’s tap on a reply-button/list returns as button_reply/list_reply on the inbound webhook; a CTA-URL tap opens the link directly. action is one of (max 3 reply buttons), (list menu, max 10 sections × 10 rows), or (a single labelled https link button).
string
required
Recipient E.164 phone number OR WhatsApp Business Solution UID.
string
Optional short header text (max 60 chars).
string
required
Message body text (1-1024 chars).
Optional footer text (max 60 chars).
object
required
Reply-buttons () OR list-menu () OR a CTA-URL button ().

Send WhatsApp location-request message

POST /api/v1/whatsapp/messages/send-location-request
Prompt the recipient to share their current location via a ‘Send location’ button, inside the 24h customer-service window — no template review required. The reply arrives as a plain location message on the inbound webhook.
string
required
Recipient E.164 phone number OR WhatsApp Business Solution UID.
string
required
Prompt text shown above the ‘Send location’ button (1-1024 chars).

Request-code phone

POST /api/v1/whatsapp/phone/request-code

Verify-code phone

POST /api/v1/whatsapp/phone/verify-code

Create edit

POST /api/v1/whatsapp/templates/{externalId}/edit
string
required
—

Generate templates

POST /api/v1/whatsapp/templates/generate

Library templates

POST /api/v1/whatsapp/templates/library

Sync templates

POST /api/v1/whatsapp/templates/sync

Change-number test-account

POST /api/v1/whatsapp/test-account/change-number

Clear-verification test-account

POST /api/v1/whatsapp/test-account/clear-verification

Send-otp test-account

POST /api/v1/whatsapp/test-account/send-otp

Verify-otp test-account

POST /api/v1/whatsapp/test-account/verify-otp

Unblock-users whatsapp

POST /api/v1/whatsapp/unblock-users

Webhook whatsapp

POST /api/v1/whatsapp/webhook

Update business-profile

PUT /api/v1/whatsapp/business-profile

Update default

PUT /api/v1/whatsapp/connections/{phoneNumberId}/default
string
required
Obtain from GET /api/v1/numbers.

Update conversational-automation

PUT /api/v1/whatsapp/conversational-automation

Update products

PUT /api/v1/whatsapp/products/{productId}
string
required
—

Patch connections

PATCH /api/v1/whatsapp/connections/{phoneNumberId}
string
required
Obtain from GET /api/v1/numbers.

Delete catalogs

DELETE /api/v1/whatsapp/catalogs/{catalogId}
string
required
—

Delete connections

DELETE /api/v1/whatsapp/connections/{phoneNumberId}
string
required
Obtain from GET /api/v1/numbers.

Delete disconnect

DELETE /api/v1/whatsapp/disconnect

Delete flows

DELETE /api/v1/whatsapp/flows/{flowId}
string
required
Obtain from GET /api/v1/flows.

Delete products

DELETE /api/v1/whatsapp/products/{productId}
string
required
—

Delete templates

DELETE /api/v1/whatsapp/templates/{name}
string
required
—

Worked sequences

The page above trims every operation past the fifteenth to cURL plus TypeScript. This section renders the first hero flow(s) past the cut in the full six-language group, so the operation a pipeline reaches next is copy-paste complete.

Get flows

List funnel