Post-Deployment Steps
Once your application is running, there is one final, crucial step to connect it to WhatsApp: configuring the webhook in the Meta Developer Dashboard.
Configure the Webhook in Meta's Dashboard
This process tells Meta where to send all incoming WhatsApp events (like new messages) for your business phone number.
Prerequisites
- Your application must be running and accessible from the public internet. If you are using the provided
compose.yml
with Traefik, this will be at the domain you configured (e.g.,https://agent-wa.example.com
). - You need the Verify Token that you set for the
WEBHOOK_VERIFY_TOKEN
variable in yourdeploy/deploy.env
file.
Configuration Steps
-
Go to the Meta Developer Dashboard and select your application.
-
From the sidebar, navigate to WhatsApp > Configuration.
-
In the Webhook section, click the Edit button.
-
A dialog box will appear with two fields:
- Callback URL: Enter the full public URL to your application's webhook endpoint. This should be
https://<your-public-domain>/webhook
. - Verify Token: Enter the exact same secret token you configured for
WEBHOOK_VERIFY_TOKEN
in your.env
file.
- Callback URL: Enter the full public URL to your application's webhook endpoint. This should be
-
Click Verify and Save.
How Verification Works
When you click "Verify and Save", Meta's servers will immediately send a GET
request to your Callback URL. This request includes the verify token and a challenge code in the query parameters.
The WhatsApp Agent application is built to handle this specific request. It checks if the received verify token matches the one from your configuration. If it matches, it responds with the challenge code, confirming to Meta that you own and control the endpoint.
If the verification is successful, the dialog will close, and your webhook will be active. You can now subscribe to specific events (like messages
) to start receiving notifications.