A simple and clean starter template for building WhatsApp automation, bots, and integrations using the Meta WhatsApp Cloud API and Python FastAPI.
Perfect for:
- Developers building WhatsApp bots
- Automation workflows
- Webhook receivers
- Message notifications
- Learning the Cloud API basics
- Receive messages via webhook
- Send text messages
- Send images, documents, templates
- Verify webhook token
- Clean folder structure
.envenvironment setup- Works on localhost or production
- Easy to deploy
whatsapp-cloud-api-starter/
├─ src/
│ ├─ server.py # FastAPI server
│ ├─ send_message.py # Send message function
│ ├─ webhook.py # Webhook handler
│ └─ utils/
│ └─ verify_signature.py
├─ examples/
│ └─ sample_payload.json
├─ .env.example
├─ requirements.txt
├─ README.md
└─ LICENSE
pip install -r requirements.txt
WHATSAPP_TOKEN=
WHATSAPP_PHONE_NUMBER_ID=
WHATSAPP_SECRET=
VERIFY_TOKEN=your_webhook_verify_token
uvicorn src.server:app --reload
http://localhost:8000
GET /webhook?hub.verify_token=xxx&hub.challenge=yyy
POST http://localhost:8000/send-message
{
"to": "2348012345678",
"message": "Hello from WhatsApp Cloud API Starter Kit!"
}
POST /webhook
{
"entry": [
{
"changes": [
{
"value": {
"messages": [
{
"from": "2348012345678",
"text": { "body": "Hello" }
}
]
}
}
]
}
]
}
MIT License Free to use, modify, and distribute.
- Lasisi Ibrahim Pelumi
- Full-Stack Engineer • WhatsApp Automation Expert
- GitHub: https://github.com/ibrahimpelumi6142