# Build an AI WhatsApp bot for your business

URL: https://bridge.wekoya.tech/guides/whatsapp-ai-bot
Updated: 2026-11-19

**In short:** Connect your WhatsApp Business number to Meta's WhatsApp Cloud API, point its webhook at your server, and answer each message with a model on Bridge by Wekoya, paid in naira. Your bot can reply freely within 24 hours of a customer's last message; after that, WhatsApp allows only pre-approved templates.

## What you need

- A WhatsApp Business number on Meta's [WhatsApp Cloud API](https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/send-messages), with its phone number ID and an access token.
- A server with a public HTTPS address for WhatsApp's webhook.
- A Bridge account with a naira balance and a key. [Create a free account](https://bridge.wekoya.tech/sign-up).

## WhatsApp's rules your bot must follow

- When a customer messages you, a 24-hour customer service window opens, and each new message from them restarts it. Inside it you can reply with anything.
- Outside the window you can only send templates that Meta has approved in advance.
- Only message people who have agreed to hear from you.

From [Meta's WhatsApp documentation](https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/send-messages), checked on 19 November 2026. Meta also charges for some messages; its pages are the authority on rules and prices.

## The webhook

WhatsApp sends every incoming message to your webhook. This Node.js server confirms the webhook once, then answers each text message with a model on Bridge and sends the reply back through the Cloud API.

```javascript
import express from "express"
import OpenAI from "openai"

const bridge = new OpenAI({ apiKey: process.env.BRIDGE_API_KEY, baseURL: "https://wekoya-api.wekoya.tech/v1" })
const GRAPH = "https://graph.facebook.com/v27.0/" + process.env.WHATSAPP_PHONE_NUMBER_ID + "/messages"
const BUSINESS = "You answer customers of Ada's Salon in Yaba, Lagos, on WhatsApp. Be brief and friendly. Open 9am to 7pm, Monday to Saturday. Braids from N15,000."

const app = express()
app.use(express.json())

// WhatsApp checks the webhook once when you set it up.
app.get("/whatsapp", (req, res) => {
  if (req.query["hub.verify_token"] === process.env.WHATSAPP_VERIFY_TOKEN) return res.send(req.query["hub.challenge"])
  res.sendStatus(403)
})

app.post("/whatsapp", async (req, res) => {
  res.sendStatus(200) // answer WhatsApp at once; reply to the customer after
  const message = req.body.entry?.[0]?.changes?.[0]?.value?.messages?.[0]
  if (message?.type !== "text") return

  const reply = await bridge.chat.completions.create({
    model: "gpt-6-luna",
    max_tokens: 400,
    messages: [{ role: "system", content: BUSINESS }, { role: "user", content: message.text.body }],
  })

  await fetch(GRAPH, {
    method: "POST",
    headers: { Authorization: "Bearer " + process.env.WHATSAPP_TOKEN, "Content-Type": "application/json" },
    body: JSON.stringify({ messaging_product: "whatsapp", to: message.from, type: "text", text: { body: reply.choices[0].message.content } }),
  })
})

app.listen(3000)
```

Before you go live, check the `X-Hub-Signature-256` header on each webhook with your Meta app secret, so nobody else can post to it, and keep each customer's last few messages so the bot remembers the conversation.

## Voice notes

Customers send voice notes. Download the audio with Meta's media API, turn it into text with Bridge's [speech to text](https://bridge.wekoya.tech/docs/voice), and answer the text as above. English and Hausa are supported; Yoruba, Igbo and Nigerian Pidgin voice notes are not yet. For live, spoken conversations in Yoruba, Hausa and Pidgin, see [the voice agent guide](https://bridge.wekoya.tech/guides/voice-agent-yoruba-hausa-pidgin).

## What it costs

Bridge charges per reply from your naira balance; Meta's own charges are separate. Work out a month of replies on any model:

| Model | One everyday message | 50 a day for 30 days |
| --- | --- | --- |
| [DeepSeek V4.1 Flash 1017](https://bridge.wekoya.tech/models/deepseek-v4-1-flash) | ₦0.568 | ₦851 |
| [Gemini 3.8 Flash](https://bridge.wekoya.tech/models/gemini-3-8-flash) | ₦5.01 | ₦7,518 |
| [Claude Haiku 5.5](https://bridge.wekoya.tech/models/claude-haiku-5-5) | ₦0.668 | ₦1,002 |

Put a naira limit on the bot's key under API keys, so a busy day can never spend more than you set. See [key limits](https://bridge.wekoya.tech/docs/restrict-models).

[Create a free account](https://bridge.wekoya.tech/sign-up)

## Common questions

**Can I use ChatGPT on my WhatsApp Business number?**

Not ChatGPT itself, but the same kind of model: connect your number to Meta's WhatsApp Cloud API and answer each message with GPT, Claude, Gemini or DeepSeek through Bridge, paid in naira.

**Can the bot message customers first?**

Only with a template Meta has approved. Free replies are allowed only within 24 hours of the customer's last message.

**Can it reply in Yoruba, Hausa or Pidgin?**

For text, ask the model to reply in the customer's language; N-ATLAS, Nigeria's own model, writes Yoruba, Hausa and Igbo. Voice notes can be turned into text in English and Hausa.

## Read next

- [Add an AI chatbot to your website](https://bridge.wekoya.tech/guides/ai-chatbot-for-your-website)
- [Build a voice agent that speaks Yoruba, Hausa and Pidgin](https://bridge.wekoya.tech/guides/voice-agent-yoruba-hausa-pidgin)
- [AI cost calculator in naira](https://bridge.wekoya.tech/guides/ai-cost-calculator-naira)
