Skip to content
Providers

WhatsApp (optional)

Connect a Meta WhatsApp Business sender to AppCore for WhatsApp one-time codes and template messages. Deferred and off by default.

On this page

AppCore can send WhatsApp authentication (one-time code) templates and approved template messages through the Meta WhatsApp Cloud API, directly from your environment's runtime. It verifies Meta's webhook challenge and every status callback's X-Hub-Signature-256 signature, enforces a destination-country allowlist and a daily spend cap, and never sends SMS. Signing in by WhatsApp does not grant marketing consent; WhatsApp campaigns additionally need the user's marketing_whatsapp consent. Console paths are as of 2026-11.

Warning

Not yet enabled: WhatsApp is deferred and off by default. The adapter is implemented and tested against a fake Graph API only (MOCK_TESTED). Even with an active connection nothing is sent until your platform operator turns WhatsApp on for the environment (messaging and, for one-time codes, identity with an allowed country list). Until then whatsapp_otp and whatsapp never appear in /v1/config/public, the webhook URL returns 404, and WhatsApp requests return 503 FEATURE_UNAVAILABLE. A phone number outside the allowed countries gets 422 with the sign-in methods that are available instead.

Before you begin

  • A verified Meta business portfolio, a WhatsApp Business Account (WABA), a registered sender phone number and a payment method in Meta. Business verification and number registration are Meta's processes and can take days.
  • A Meta developer app of type Business with the WhatsApp product added. You need admin rights on the app and the business.
  • Your environment's API host, https://<your-api-host>.
  • Meta's per-message price for authentication messages in each target country, to set the spend cap.

Steps

  1. App ID and secret. Meta for Developers → My Apps → your app → App settings → Basic: copy the App ID; App secret → Show and copy it.

  2. Sender IDs. App → WhatsApp → API Setup: copy the Phone number ID (not the phone number) and the WhatsApp Business Account ID.

  3. System-user token. Meta Business Suite → Business settings → Users → System users → Add, assign the app and the WABA as assets, then Generate new token with whatsapp_business_messaging (and whatsapp_business_management). Choose a non-expiring or long-lived token and record its expiry.

  4. Authentication template. WhatsApp Manager → Message templates → Create template → Authentication, with the copy code button, in each language you need. Submit it and wait for Approved. Note its name and language code (for example en_US).

  5. Verify token. Generate a random string (for example openssl rand -hex 32). You will paste the same value into AppCore and into Meta.

  6. In AppCore, open Setup and connections → Connections, create a Direct Meta WhatsApp connection, fill in the public fields, and paste meta_app_secret, access_token and webhook_verify_token into their write-only fields. Run Check syntax, then Read-only check, then Activate.

  7. Webhook. Copy the connection's Callback URL:

    Code
    https://<your-api-host>/webhooks/whatsapp/<connection-id>

    In App → WhatsApp → Configuration → Webhook → Edit, paste it as Callback URL, paste your verify token, and Verify and save. Then subscribe to the messages field. Verification only succeeds once your operator has enabled WhatsApp for the environment.

Paste into AppCore

AppCore fieldWhere to find itSecret?
meta_app_idApp settings → Basic → App IDPublic
meta_app_secretApp settings → Basic → App secretSecret (write-only)
waba_idWhatsApp → API Setup (or WhatsApp Manager → Account tools) → WhatsApp Business Account IDPublic
phone_number_idWhatsApp → API Setup → Phone number IDPublic
access_tokenBusiness settings → System users → your user → generated tokenSecret (write-only)
graph_api_versionThe Graph API version to pin, for example v21.0Public
authentication_template{"name": "<template-name>", "language": "en_US"} of your approved Authentication templatePublic
webhook_verify_tokenThe random string from step 5 (also pasted in Meta)Secret (write-only)
country_allowlistISO country codes where codes may be sent, for example ["IN"]Public
daily_spend_cap{"daily_cap_minor": "50000", "unit_cost_minor": "115", "currency": "INR"}: daily cap and per-message cost as integer minor-unit stringsPublic

daily_spend_cap takes exactly daily_cap_minor, unit_cost_minor (greater than zero), currency (ISO 4217) and an optional rate_card_ref; other keys are rejected when you save. If it cannot be read, AppCore treats WhatsApp as unpriced and sends nothing (fail closed). Each send reserves its cost against the day's cap; at the cap, WhatsApp stops for the rest of the day.

Verify

  • Read-only check passes with META_SENDER_READABLE: AppCore read your phone number ID from the Graph API with the token. Nothing is sent.
  • Meta's Verify and save on the webhook succeeds (AppCore answered the challenge).
  • With WhatsApp turned on by your operator, whatsapp_otp appears in auth_methods of GET https://<your-api-host>/v1/config/public when the connection is ready, a sender is configured, the country list is not empty and the authentication template is set.
  • Send a one-time code to your own number and record it as evidence for meta-otp (stage sandbox); attest meta-webhook after checking a tampered callback is rejected.

Troubleshooting

SymptomLikely causeFix
Read-only check PROVIDER_AUTH_REJECTEDToken expired or revoked, or the phone number is not assigned to the system userAssign the WABA and number to the system user; generate a new token and Rotate
Webhook verification fails in MetaWhatsApp not enabled for the environment (404), connection not active, or verify token differs (403)Ask your operator to enable WhatsApp; paste the same token on both sides
Status callbacks get 401Signature check failed: meta_app_secret is not this app's secretPaste the App secret of the app that owns the webhook
whatsapp_otp missing from auth_methodsWhatsApp off for this environment, empty country list, no template, or connection not readyCheck each with your operator
422 with alternative methodsThe number's country is not in country_allowlist (or in the operator's list)Add the country only after confirming Meta pricing and template approval there
whatsapp_otp disappears during the day, or 503 FEATURE_UNAVAILABLE ("WhatsApp budget is not priced")Daily spend cap reached, or daily_spend_cap unreadableRaise the cap or fix its JSON keys; keep another sign-in method enabled
Template rejected or paused by Meta (meta_template_pending)Meta reviewFix the template in WhatsApp Manager without changing its category