{# "Setup guide" popup of the WhatsApp page: one tab per way of sending. vars: channel, settings, webhook_url, verify_token, https, web_webhook_url #} {% macro copy(label, value) %} {% if label %}{{ label }}{% endif %} {{ value }} {% endmacro %} {% macro code(text) %} {{ text }} {% endmacro %} {% macro part(n, title, link=None, link_label='Open') %}
{{ n }}

{{ title }}

{% if link %} {{ icon('external-link', 'h-3.5 w-3.5') }}{{ link_label }} {% endif %}
    {{ caller() }}
{% endmacro %} {% macro note(title, color='gray') %}

{{ title }}

{{ caller() }}
{% endmacro %} {% macro problems() %}
{{ icon('life-buoy', 'h-4 w-4') }}

Common problems

{{ caller() }}
{% endmacro %} {% macro problem(title) %}
{{ title }}
{{ caller() }}
{% endmacro %} {% set b = 'font-medium text-gray-950 dark:text-white' %} {% set tabs = [('cloud', 'Cloud API', 'badge-check'), ('web', 'WhatsApp Web', 'smartphone'), ('', 'Links only', 'link')] %}
{# ---------------------------------------------------------------- Cloud API #}
{% call note('Before you start') %} {% if not https %}

{{ icon('circle-alert', 'h-5 w-5 shrink-0') }}This panel is open on http, not https. Meta will refuse the webhook. Open the panel on its https address, or set app_url in your code.

{% endif %} {% endcall %} {% call part(1, 'Create a Meta app', 'https://developers.facebook.com/apps/creation/', 'Meta for Developers') %}
  • Sign in at developers.facebook.com. The first time, press Get started and confirm your phone and email.
  • Press Create app, type a name and your email, then Next.
  • Use case: pick Connect with customers through WhatsApp. Pick your business portfolio (or make one), then Create app.
  • {% endcall %} {% call part(2, 'Add your phone number') %}
  • In the app open Use cases, then Customize next to WhatsApp, then API Setup (older apps: WhatsApp, API Setup).
  • In From, press Add phone number. Type your business name and category, then your number, and enter the code Meta sends by SMS or call.
  • Pick your number in From. Copy its Phone number ID and the WhatsApp Business Account ID (Meta may call it Messaging account ID).
  • Adding your number makes a new WhatsApp Business Account for it. Use that account's ID here, and pick that account for billing (step 9) and templates (step 11), not the test one.
  • Meta also gives a free test number. It is fine for a first try, but switch to your own number for real use.
  • {% endcall %} {% call part(3, 'Make a permanent access token', 'https://business.facebook.com/latest/settings', 'Business settings') %}
  • In Business settings open Users, then System users. Press Add, give a name, pick role Admin.
  • Press Assign assets. Give it Full control of your app and of your WhatsApp account.
  • Press Generate token. Pick your app, expiry Never, and tick whatsapp_business_messaging and whatsapp_business_management. Copy the token right away; Meta shows it once.
  • Do not use the temporary token from API Setup. It stops working within hours.
  • {% endcall %} {% call part(4, 'Copy the App secret') %}
  • In your app open App settings, then Basic. Next to App secret press Show and copy it. It proves that messages really come from Meta.
  • {% endcall %} {% call part(5, 'Fill this page') %}
  • Close this guide. In How to send pick Cloud API (official).
  • Paste the Phone number ID, WhatsApp Business Account ID, Access token and App secret, then press Save changes. The page reloads with the buttons for the next steps.
  • {% endcall %} {% call part(6, 'Register your number') %}
  • Press More, then Register number, and type a 6-digit PIN. Meta needs this once before your own number can send.
  • If two-step verification is already on for the number, type that PIN. Keep the PIN safe; Meta asks for it again if you move the number.
  • {% endcall %} {% call part(7, 'Connect the webhook') %}
  • In your app open Use cases, Customize next to WhatsApp, then Configuration (older apps: WhatsApp, Configuration).
  • Paste these two and press Verify and save: {{ copy('Callback URL', webhook_url) }} {{ copy('Verify token', verify_token) }}
  • Under Webhook fields, press Subscribe next to messages.
  • {% endcall %} {% call part(8, 'Publish the app') %}
  • In App settings, Basic, fill the contact email, a Privacy Policy URL and a Terms of Service URL (pages on your website), a category and an icon, then save.
  • Left menu: Publish. The list shows anything still missing. Then press Go live. Some messages are not sent to apps that are still in development.
  • {% endcall %} {% call part(9, 'Add a payment method', 'https://business.facebook.com/latest/billing_hub/payment_methods/', 'Billing') %}
  • In Billing, pick your WhatsApp account and add a card. In India you can add funds by UPI instead.
  • Choose with care: Meta does not let you switch between prepaid (UPI) and card later.
  • {% endcall %} {% call part(10, 'Check and test') %}
  • Press Check connection. It checks your number and makes sure replies come in here.
  • From your own phone, send "Hi" to the business number. It shows in WhatsApp chats.
  • Press Send a test and send a message back to your phone.
  • {% endcall %} {% call part(11, 'Templates, to start chats', 'https://business.facebook.com/latest/whatsapp_manager/message_templates', 'WhatsApp Manager') %}
  • WhatsApp only lets you send free text within 24 hours of the person's last message. To write first, or later, you need a template Meta approved.
  • In WhatsApp Manager, Message templates, press Create template. Use number variables like {{ '{{1}}' }} for the name.
  • When Meta approves it, press More, then Sync templates. It now shows in the WhatsApp button on leads.
  • {% endcall %} {% call problems() %} {% call problem('Error 190, or the token expired') %}The temporary token from API Setup was used. Make the permanent one in step 3 and paste it again.{% endcall %} {% call problem('Error 133010 or 131045, or the number is not registered') %}Do step 6, then press Check connection.{% endcall %} {% call problem('Error 131047, or "re-engagement message"') %}More than 24 hours passed since the person's last message. Send a template instead.{% endcall %} {% call problem('Error 132001, or the template does not exist') %}The template is not approved yet, or its language is different. Press Sync templates and pick it from the list.{% endcall %} {% call problem('Error 131042, or a payment problem') %}Add a payment method or funds in step 9.{% endcall %} {% call problem('Verify and save fails in Meta') %}This panel must be public https with a real certificate, and the token must match exactly. Save this page first, then copy both values again.{% endcall %} {% call problem('Messages go out, but replies never show here') %}Publish the app (step 8), check that messages is subscribed (step 7), then press Check connection. If the App secret was reset in Meta, paste the new one here.{% endcall %} {% call problem("A chat from a strange number appeared after Meta's Test button") %}Meta's test sends a made-up message. You can delete that chat and lead.{% endcall %} {% endcall %}
    {# ---------------------------------------------------------------- WhatsApp Web #}
    {% call note('Read this first', 'warning') %}

    WhatsApp Web mode is not an official API. It links your own WhatsApp number, like WhatsApp Web on a laptop. WhatsApp may block numbers that send bulk or unwanted messages, so use it to talk with people who expect your messages.

    You need a Linux server with Docker (a VPS with 2 CPU and 4 GB memory is safe). Shared cPanel hosting cannot run it, but this panel can stay there.

    {% endcall %} {% call part(1, 'Install the WAHA gateway', 'https://waha.devlike.pro/blog/waha-on-docker/', 'WAHA docs') %}
  • Log in to your server with SSH and install Docker: {{ code('curl -fsSL https://get.docker.com | sh') }}
  • Download WAHA's setup file: {{ code('mkdir waha && cd waha\nwget -O docker-compose.yaml https://raw.githubusercontent.com/devlikeapro/waha/refs/heads/core/docker-compose.yaml\ntouch .env') }}
  • Open docker-compose.yaml (for example nano docker-compose.yaml) and change the line image: devlikeapro/waha-plus to image: devlikeapro/waha. On an ARM server (for example Oracle Ampere or Hetzner CAX) use image: devlikeapro/waha:arm.
  • Make the passwords and the API key, then start it: {{ code('docker compose run --no-deps -v "$(pwd)":/app/env waha init-waha /app/env\ndocker compose up -d') }}
  • The first line prints Use this API key in the x-api-key header and a key under it. Copy that key; you paste it here soon. It is also saved in the .env file.
  • This setup keeps WAHA private on the server, keeps your phone linked after restarts, and starts again by itself.
  • {% endcall %} {% call part(2, 'Let this panel reach WAHA') %}
  • Same server as this panel: the Gateway URL is http://127.0.0.1:3000.
  • Another server (for example this panel on cPanel): point a subdomain such as waha.yourbusiness.in at the server, and put Nginx with a free Let's Encrypt certificate in front of port 3000. The Gateway URL is then https://waha.yourbusiness.in.
  • Never open port 3000 itself to the internet. The API key goes with every call.
  • WAHA also calls this panel when a message comes in, at the address below, so this panel must be reachable from the WAHA server: {{ copy(None, web_webhook_url) }}
  • {% endcall %} {% call part(3, 'Fill this page') %}
  • Close this guide. In How to send pick WhatsApp Web (linked phone).
  • Type the Gateway URL and the API key. Leave the session name as default. Press Save changes.
  • The page reloads, and the Link phone button shows at the top.
  • {% endcall %} {% call part(4, 'Link your phone') %}
  • Open this page on a computer, not on the phone you are linking.
  • Press Link phone. On the phone open WhatsApp, then the ⋮ menu (iPhone: Settings), Linked devices, Link a device, and scan the code.
  • The code renews itself every few seconds, so take your time. Once scanned, the popup says Linked.
  • Press I have scanned it to save it. The status turns Linked.
  • {% endcall %} {% call part(5, 'Test it') %}
  • From a different phone, send a message to your WhatsApp number. It shows in WhatsApp chats, and becomes a lead if "New chats become leads" is on.
  • Press Send a test to send one back.
  • {% endcall %} {% call note('Keep it working') %} {% endcall %} {% call problems() %} {% call problem('"Unauthorized" or 401') %}The API key is wrong or missing. Find it on the WAHA server with cd waha && grep WAHA_API_KEY .env, paste it here and save.{% endcall %} {% call problem('"Could not reach" the gateway') %}Check the Gateway URL, and that WAHA runs: cd waha && docker compose ps. docker compose logs -f shows what it does.{% endcall %} {% call problem('"pull access denied" while installing') %}The image line still says waha-plus. Change it to devlikeapro/waha (step 1).{% endcall %} {% call problem('"env file not found", or "exec format error"') %}"env file": run touch .env in the waha folder, then the setup line again. "exec format error": the server is ARM; use devlikeapro/waha:arm (step 1).{% endcall %} {% call problem('The phone must be linked again after every restart') %}The sessions folder is missing. Use WAHA's setup file from step 1; it keeps that folder.{% endcall %} {% call problem('Incoming messages do not show here') %}WAHA cannot reach this panel. The address in step 2 must open from the WAHA server. Also, messages you send from the linked phone itself are not shown.{% endcall %} {% endcall %}
    {# ---------------------------------------------------------------- Links only #}
    {% call part(1, 'Nothing to set up') %}
  • In How to send pick Links only and press Save changes.
  • Set the Country code. It is added to 10-digit numbers.
  • The WhatsApp button on a lead opens WhatsApp on your computer or phone with the chat ready. You press send there.
  • Nothing is sent by itself, and messages are not saved here. For that, use the Cloud API or WhatsApp Web.
  • {% endcall %}