How to Set Up the WhatsApp Business API
Meta’s official messaging API is part of the WhatsApp Business Platform. Its Cloud API lets software send messages and receive events. It is not configured like a mobile app: you need a Meta developer account, an app with the WhatsApp use case, a messaging account, a phone number, and suitable permissions.
This guide follows Meta’s documented test setup, then covers checks required before production. It does not claim that an account or message was configured here.
WhatsApp Business App and WhatsApp Business Platform
WhatsApp Business App is a mobile app for businesses managing conversations in the app. WhatsApp Business Platform, particularly Cloud API, is a technical interface that lets software send messages and receive events through APIs and webhooks. It requires an integration and management of tokens, permissions, webhooks, and messaging rules.
Meta also documents an onboarding option sometimes called “coexistence” in partner materials. In some Embedded Signup flows, an existing WhatsApp Business App account can connect to Cloud API while retaining certain one-to-one app use. This is not an automatic switch available in every setup. Eligibility, provider, app version, and onboarding steps matter. Check current requirements for the exact account before changing a number. As of November 28, 2026, Meta lists v5 as the latest Embedded Signup version and says v2 and v3 were deprecated on October 15, 2026. For partner integrations, consult Meta’s versioning documentation and use a currently supported configuration.
If you only need manual replies from a phone, the Business App may be enough. If you want to connect conversations to a CRM, shared inbox, or software, evaluate the Platform and its requirements.
Prepare access
For Meta’s Cloud API test flow, you need:
- A Facebook or managed Meta account and developer registration.
- A WhatsApp-enabled device that can send and receive messages.
- Access to the relevant Business portfolio if connecting your own assets.
- A public HTTPS endpoint for receiving webhooks.
- An authorized test recipient you control.
Meta recommends creating an app in its App Dashboard with the Connect with customers through WhatsApp use case. Dashboard labels may change; follow the flow currently shown in your account.
Step 1: create the app and connect a messaging account
1. Open the Meta for Developers App Dashboard and create an app with the WhatsApp use case.
2. Select or create the Business portfolio for your organization.
3. In the WhatsApp flow, select Start using the API or its equivalent.
4. In API Setup, connect an existing messaging account or create one for testing.
5. Record the account and phone number IDs shown. These identify resources and are not access-token secrets.
For tests, Meta provides a test phone number and a demonstration template named hello_world. Use the test number for development, not as a live business number.
Step 2: send a first test message
The Dashboard can generate a temporary token and prepare a first request. This is the easiest way to check access before writing an integration. Add an authorized test recipient in the Dashboard, then use this request shape with values from your environment:
~~~bash
curl -X POST "https://graph.facebook.com/v27.0/$PHONE_NUMBER_ID/messages" \
-H "Authorization: Bearer $WHATSAPP_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"to": "'"$TEST_RECIPIENT"'",
"type": "template",
"template": {
"name": "hello_world",
"language": { "code": "en_US" }
}
}'
~~~
Version v27.0 was displayed in Graph API references reviewed on November 28, 2026. Check the version supported by your Dashboard and Meta documentation before running the request; do not deploy an obsolete version.
A successful HTTP response means the API accepted the request. It does not by itself prove that the recipient received or read the message. To confirm delivery, inspect the status webhook and verify the returned identifier.
Never put a real token in an article, screenshot, Git repository, or message. Use a secret manager or protected environment variables locally. Avoid entering secret values in commands saved in terminal history.
Step 3: choose a suitable token and permissions
The temporary token from the initial test expires quickly. For automated operations on your own business, Meta documents System User access tokens. A Tech Provider or partner acting for customer businesses will generally use a Business Integration System User token obtained through Embedded Signup.
Permissions have different roles. Meta’s setup guide lists business_management, whatsapp_business_management, and whatsapp_business_messaging for its System User example. Message and call webhooks require whatsapp_business_messaging; other webhook groups use whatsapp_business_management. Effective access also depends on Business asset assignments and app review status.
For a multi-business app, do not reuse your own account token to access customer assets. Use the onboarding flow and permissions appropriate to your role. Apps requesting advanced access to other businesses’ assets must follow the applicable App Review process.
Step 4: follow template and service-window rules
When a person messages the business (or calls it through WhatsApp under the documented rules), a 24-hour customer service window opens or resets. During this window, the business can send service messages without a pre-approved template. Outside the window, only approved templates can be sent. You also need permission to contact the person and must follow Meta’s consent and policy rules.
Templates are created in WhatsApp Manager or through the template management API. They are categorized as authentication, marketing, or utility. A template can be pending, approved, rejected, or in another status; creating one does not mean it can be sent. Check its status, language, category, parameters, and required examples. Meta does not translate template text automatically, so supply each needed language version.
Step 5: receive messages and statuses with a webhook
The API sends a request. A webhook lets Meta notify your server about an incoming message, an outgoing message status, or a change to an account or template. Webhooks are needed to process incoming messages and check an outgoing message’s progress.
1. Deploy a public HTTPS endpoint with a valid TLS certificate. Meta does not accept self-signed certificates.
2. In your app’s WhatsApp configuration, enter the callback URL and a verification token you choose.
3. For the verification GET, compare hub.verify_token with the value stored on your server. If it matches, return hub.challenge with HTTP 200; otherwise reject it.
4. For each POST, calculate HMAC-SHA256 over the raw body using the app secret. Compare it with X-Hub-Signature-256 before trusting the JSON.
5. Subscribe only to fields you need, such as messages.
6. Persist valid notifications before returning HTTP 200 and deduplicate them.
Meta says notifications can be batched with up to 1,000 updates, but batching is not guaranteed. Process each request, entry, and change without assuming a fixed shape. Failed WhatsApp webhooks may be retried for up to seven days, so duplicates are expected. Store a message ID or internal key with a unique constraint.
Payloads may contain personal information. Limit retained data, restrict access, mask phone numbers in logs, and set a retention period. Meta also documents mTLS for webhooks where supported; it complements TLS and signature verification.
Verify the flow before production
On a test account, run this sequence:
- Send the demonstration template to an authorized test number.
- Reply from the recipient’s phone to open the service window.
- Send free-form text during that window.
- Verify incoming-message and delivery-status webhook events.
- Test an incorrect verification token and invalid signature.
- Simulate an unavailable database, then check recovery and duplicate handling.
- Check notifications delivered individually, in batches, repeatedly, and out of order.
For production, also check permissions, number, template status, quotas, and errors returned by the Graph API version you use. An accepted request is not proof of delivery. Report an outcome only after an observed status supports it.
When to use an integration provider
Direct setup may suit a team that can host an endpoint, protect credentials, and maintain an integration. A provider may simplify onboarding or provide an operating interface, but check its role, fees, requested access, asset ownership, data export, and exit process. It does not remove Meta’s consent or template rules.
If the business already uses WhatsApp Business App, do not migrate its number before checking available options. Coexistence through Embedded Signup exists in some partner flows; confirm eligibility and limitations for the specific account.
Summary
Cloud API is a developer API, not simply a web version of the Business App. For a first test, create a Meta app with the WhatsApp use case, connect a test account, send the demonstration template, and configure an HTTPS webhook with signature verification. Before production, choose the right token and permissions, check template and service-window rules, persist notifications, deduplicate retries, and verify a real delivery status.
Sources
- Meta — WhatsApp Cloud API: Get Started
- Meta — Access Tokens Guide
- Meta — Send messages and customer service windows
- Meta — Template fundamentals
- Meta — WhatsApp webhooks
- Meta — Create a webhook endpoint
- Meta — Onboard WhatsApp Business app users (coexistence)
- WhatsApp Help Center — WhatsApp Business products