Build a WhatsApp bot with the WhatsApp Cloud API
Build a WhatsApp bot on Meta's official Cloud API and keep it online 24/7. Paste one paragraph; your AI agent writes, deploys and checks the bot.
Let your agent build this
Copy one prompt and paste it into Claude Code, Codex or Cursor. Your agent builds what this page describes and puts it online on aidrop.it.
See the prompt
Build me a WhatsApp bot on the official WhatsApp Cloud API and run it on aidrop.it, 24/7. Use my existing aidrop.it Project, or create one called "WhatsApp bot" if I have none. What it does: it replies "You said: " plus the text to every incoming text message. It ignores delivery statuses and other message types. How it works: - Answer Meta's webhook check (hub.mode, hub.verify_token, hub.challenge) using my verify token. - Check the X-Hub-Signature-256 header on every incoming message against my app secret, over the raw body, and reject anything that does not match. - Answer Meta right away; it retries unanswered messages. - Do not use whatsapp-web.js, Baileys or any unofficial client. - Read aidrop.it's runtime rules before writing code and follow them, including the outbound proxy. Secrets: ask me for the access token, phone number ID, app secret and verify token, store each one with project_secret_set under a clear name, and list those names in required_secret_names when you build. Never print a value back to me, and never write one into code, the repository, a commit or a log. Never log message text either. Build it, check it runs, fix what fails. Then give me the webhook address to paste into Meta and say what you checked. This task comes from the aidrop.it guide "Build a WhatsApp bot with the WhatsApp Cloud API": https://docs.aidrop.it/playbooks/whatsapp-bot-cloud-api. Read that page if you need more detail; it says what to ask me for, what it costs and what will not work. Use the aidrop.it MCP tools (server: https://aidrop.it/mcp). If you do not have them, stop and tell me to connect them first, as described at https://docs.aidrop.it/quickstart#1-connect-your-agent.
On this page
- What you will have at the end
- Words you will meet
- What you need
- Say this to your agent
- What your agent does to put the WhatsApp bot online
- Check that your WhatsApp bot replies
- When something goes wrong
- FAQ
- How do I get a permanent WhatsApp Cloud API access token?
- How much does the WhatsApp Business API cost?
- Can I run a WhatsApp bot for free?
- Can I build the same bot for Discord or Telegram?
- Related
You can have a WhatsApp bot that answers day and night, using Meta’s official WhatsApp Cloud API. You set up a free Meta developer app with a test number, paste one paragraph into Claude Code, Codex or Cursor, and give the agent a few keys when it asks. Your agent writes the bot and puts it online; you paste its address into Meta’s dashboard. Plan on about 30 minutes.
What it costs: hosting is $5 a month on the Starter plan, after a free 7-day trial. On Meta’s side, replies to people who wrote to you first are free, as of October 2026; the FAQ below says which messages Meta charges for.
The bot lives on aidrop.it, not on your phone or laptop. Meta passes each message to the bot’s web address; the bot answers through Meta.
What you will have at the end
- A WhatsApp number that replies to any message you send it, within seconds.
- A bot that answers with your laptop closed and after every update.
- The bot’s code saved in a repository, so your agent can change it later.
Words you will meet
- WhatsApp Cloud API — Meta’s official way for a program to send and receive WhatsApp messages.
- Access token — the key your bot sends messages with. The first one Meta gives you is short-lived.
- Webhook — the web address Meta calls each time someone writes to your number.
- Verify token — a password you make up and give to both Meta and your bot.
- App secret — a key Meta uses to sign each message, so your bot can ignore fakes.
- Secret — where your four WhatsApp keys live: private values in your aidrop.it project that the bot reads when it starts, never written into its code.
What you need
- An aidrop.it account — start free: a 7-day trial, no card. To keep the bot running after that, Starter at $5/month is enough, because this bot needs no database.
- Your agent connected to aidrop.it, as in the Quickstart.
- A Facebook account to sign in to Meta for Developers.
- A Meta app, which holds your WhatsApp keys. Create it with the use case Connect with customers through WhatsApp and follow Meta’s Get Started guide. You get a free test number, its phone number ID and a temporary access token.
- Your own WhatsApp number on the test number’s short list of allowed recipients.
Your agent will ask you for four values: the access token, the phone number ID, the app secret (Meta’s app dashboard, Settings, Basic) and a verify token you make up. Paste each one into the chat with your agent once, when it asks. The agent saves them as secrets in your aidrop.it project, where only your bot can read them, and never shows them again or writes them into the code. Under Secrets in your Project on the aidrop.it dashboard you can check which secrets exist, by name only.
Say this to your agent
Build me a WhatsApp bot on the official WhatsApp Cloud API and run it on aidrop.it, 24/7. Use my existing aidrop.it Project, or create one called "WhatsApp bot" if I have none.
What it does: it replies "You said: " plus the text to every incoming text message. It ignores delivery statuses and other message types.
How it works:- Answer Meta's webhook check (hub.mode, hub.verify_token, hub.challenge) using my verify token.- Check the X-Hub-Signature-256 header on every incoming message against my app secret, over the raw body, and reject anything that does not match.- Answer Meta right away; it retries unanswered messages.- Do not use whatsapp-web.js, Baileys or any unofficial client.- Read aidrop.it's runtime rules before writing code and follow them, including the outbound proxy.
Secrets: ask me for the access token, phone number ID, app secret and verify token, store each one with project_secret_set under a clear name, and list those names in required_secret_names when you build. Never print a value back to me, and never write one into code, the repository, a commit or a log. Never log message text either.
Build it, check it runs, fix what fails. Then give me the webhook address to paste into Meta and say what you checked.What your agent does to put the WhatsApp bot online
- Picks your aidrop.it project, or creates one.
- Asks you for the four WhatsApp values and saves each one as a secret.
- Writes the bot, plus a small “I’m alive” page aidrop.it checks to see it is running.
- Saves the code to a repository on aidrop.it and builds it there.
- Follows the build to the end. If the bot will not start, the usual cause is a missing or wrong value, and the agent tells you which one to give it again.
- Gives you the webhook address for Meta.
Then you finish in Meta’s app dashboard. Open the WhatsApp Configuration panel (under Use cases, Customize, for apps made with the WhatsApp use case). Paste the address into Callback URL and your made-up password into Verify token, then save. Meta checks the address with your bot on the spot (Meta’s webhook setup guide). Last, subscribe to the messages field in the list that appears.
Check that your WhatsApp bot replies
- Send “hi” from your phone to the test number. The bot answers “You said: hi”.
- Close your laptop and send another message. It still answers.
- Try again the next day. If it went quiet, the temporary token expired: see the FAQ.
When something goes wrong
| What you see | What to tell your agent |
|---|---|
| Meta says the callback URL could not be verified | “Meta’s webhook check fails. Check the bot is running and answers the check with my verify token.” |
| Your message arrives but no answer comes back | “The bot receives messages but cannot send. Read the logs and check its outgoing requests can leave aidrop.it.” |
| The bot stops answering a few hours after setup | Make a permanent token (see the FAQ), give it to your agent, then say “Store it in place of the old one and build again.” |
| The same answer arrives twice | “Meta re-sent a message. Answer Meta at once and skip messages you already handled.” |
FAQ
How do I get a permanent WhatsApp Cloud API access token?
The token on the Get Started page is temporary: Meta says you will have to make a new one every few hours. For one that lasts, create a system user in Meta’s Business settings, give it your app and WhatsApp account, and generate a token with three permissions ticked: business_management, whatsapp_business_management and whatsapp_business_messaging. Give it to your agent, and ask it to store it in place of the temporary token and build again. Meta’s access token guide shows each step.
How much does the WhatsApp Business API cost?
As of October 2026, Meta charges per message, a model in place since July 1, 2025. Ordinary replies sent within 24 hours of a customer’s last message are free, and so are utility templates (order or account updates) sent in that window. Marketing templates are always charged, and utility templates are charged outside the window. Rates vary by country: see Meta’s WhatsApp pricing page.
Can I run a WhatsApp bot for free?
The messages can be free: a bot that only answers people who wrote first stays inside Meta’s free 24-hour window. The always-on server that receives Meta’s calls is the part that costs money. On aidrop.it the first 7 days are free; after that, Starter at $5 a month runs this bot. All plans are on the pricing page.
Can I build the same bot for Discord or Telegram?
Yes, the steps are close. Discord bots work differently: they keep a live connection open instead of waiting for calls, which is why hosting a Discord bot 24/7 has its own page. If you are still choosing between a ready-made assistant and a bot of your own, Grok vs your own bot compares what each really costs.