Skip to content

Meta setup

Connecting AlphOne to WhatsApp takes one Meta app and four values. By the end of this guide you will have filled in every ALPHONE_WHATSAPP_* variable from Configuration and received your first message in the CRM inbox.

You need:

  • a Meta developer account
  • your AlphOne instance reachable over HTTPS (Meta refuses plain-HTTP webhooks)
  • a phone number that is not currently registered with WhatsApp or WhatsApp Business: a new SIM or an unused line, one that is not already registered on the consumer WhatsApp app

Go to developers.facebook.com/apps and press Create App:

The Meta Apps page with the Create App button highlighted.

The wizard starts with App details. The name is internal, pick anything that identifies the deployment:

The Create an app wizard on the App details step, with an app name and contact email filled in.

On the Use cases step, select Connect with customers through WhatsApp:

The Use cases step with the WhatsApp use case checked at the bottom of the list.

The use case requires a business portfolio. On the Business step, pick an existing portfolio or let the wizard create one, then continue through Requirements and Overview to finish.

After creation Meta drops you into the use case customization, on Basic setup → Step 1. Try it out (1). Meta claims a free test number for you:

The Try it out step showing the claimed test number, its Phone Number ID, the WhatsApp Business Account ID, and the Generate token button, numbered one to five.

Two of the four values AlphOne needs are already on this screen:

  • Phone Number ID (3) is ALPHONE_WHATSAPP_PHONE_NUMBER_ID. Copy the ID, not the phone number itself (2).
  • Generate token (5) produces ALPHONE_WHATSAPP_ACCESS_TOKEN.

The WhatsApp Business Account ID (4) is not used by AlphOne.

AlphOne checks the signature Meta attaches to every webhook delivery, which needs the app secret. Go to App settings → Basic (1), press Show on the App secret field (2), and keep the value for ALPHONE_WHATSAPP_APP_SECRET:

The App settings Basic page with the App secret field and its Show button highlighted.

To get back to this screen later, open Use cases in the sidebar and choose Customize:

The app sidebar with the Use cases entry highlighted.

Under Step 2. Production setup (1), open Configure Webhooks. Set the Callback URL to your instance’s webhook endpoint (2) and paste the verify token you invented (3), then press Verify and save (4):

The Configure Webhooks panel with the Callback URL and Verify token fields and the Verify and save button, numbered one to four.

The Callback URL is always:

https://your-domain/api/plugins/whatsapp/webhook

Verification alone delivers nothing yet. In the webhook fields table below, subscribe to the messages field, the only one AlphOne needs:

The webhook fields table with the messages field toggled to Subscribed.

At this point, you can try to send a message to the test number from your phone. It should appear in AlphOne’s inbox live. You may need to reload your Alphone instance if you just added the webhook values to the .env and restarted it.

The test number is a sandbox. For the real business line, register your own number under Step 2. Production setup → Register your WhatsApp phone number. Once it shows Registered, copy its Phone Number ID (1), which replaces the test one in ALPHONE_WHATSAPP_PHONE_NUMBER_ID, and make sure Subscribe webhooks is on for the number (2):

The registered production phone number with its Phone Number ID highlighted and the Subscribe webhooks toggle enabled.

Then, under Send message, generate the permanent access token for the business account and copy it (1) into ALPHONE_WHATSAPP_ACCESS_TOKEN:

The Send message panel with the permanent access token generated and its copy button highlighted.

Unlike the test token, this one does not expire on its own.

The four values, side by side:

VariableWhere it came from
ALPHONE_WHATSAPP_VERIFY_TOKENInvented by you in step 4, pasted on both sides.
ALPHONE_WHATSAPP_APP_SECRETApp settings → Basic → App secret (step 3).
ALPHONE_WHATSAPP_ACCESS_TOKENThe permanent token (step 5), or the 24-hour test token (step 2).
ALPHONE_WHATSAPP_PHONE_NUMBER_IDThe production number’s ID (step 5), or the test number’s (step 2).

Put them in the .env of your self-hosted install and recreate the container:

Terminal window
cd /srv/alphone
docker compose up -d

For local development, put them in the repository’s .env and restart go run ./cmd/alphone serve.

Send a WhatsApp message from your phone to the business number. The conversation appears in AlphOne’s inbox live, without a reload, and you can answer it from there.

If it does not:

  • Webhook verification failed in step 4: AlphOne was not running, not reachable over HTTPS, or the verify token in .env does not match. Fix, restart AlphOne, and press Verify and save again.
  • Messages never arrive: check the messages field subscription (step 4), the number’s Subscribe webhooks toggle (step 5), and whether the app is published.
  • Sending fails after a day: the Graph API returns error 190, which means the temporary test token expired. Generate the permanent token from step 5 or regenerate a new test token from step 2 and replace it in .env.

The four values in .env connect one number. A workspace can hold more, each with its own access token and its own label, kept in the database as Configuration describes. A number from another Meta app also carries that app’s secret and verify token, because each app signs its webhooks with its own secret. The webhook address stays the same for every number.

Subscribe a number from another Meta app to the messages field only, because a delivery that names no number can only be proved by ALPHONE_WHATSAPP_APP_SECRET.

Each number keeps its own conversations. A customer who writes to two numbers has two conversations, because each has its own 24-hour window, and a reply leaves from the number the customer wrote to. Once a workspace holds more than one number, the inbox shows which number a conversation came in on and offers a filter. Removing a number keeps its conversations readable, but a reply on one of them answers that the number is no longer connected.

The number in ALPHONE_WHATSAPP_PHONE_NUMBER_ID is listed beside the numbers a workspace connects and keeps working. Removing a stored copy of it leaves it working from the settings.

Before you remove a number, turn its subscription off in Meta. After the removal, a delivery signed with the number’s own app secret answers 403, and Meta keeps retrying it. A delivery signed with ALPHONE_WHATSAPP_APP_SECRET answers 200 and AlphOne drops it, so Meta does not retry and that message is lost.