# Let your AI agent answer on WhatsApp

Source: https://postgale.com/integrations/whatsapp

Yes, an AI agent can message customers on WhatsApp through Postgale, using Meta’s official WhatsApp Business Platform (Cloud API). Connect a WhatsApp Business number once and the agent can read conversations, reply with text, media and interactive messages inside the 24-hour window, and send Meta-approved templates outside it.

## Can an AI agent message customers on WhatsApp?

Postgale is the secure layer for AI agents on social media. This page covers WhatsApp Business: what an agent can send and read, what you need, the messaging rules Postgale applies, and how to connect a number.

WhatsApp is a messaging platform, not a feed: the agent does not post, it converses. Postgale receives inbound messages by webhook, keeps the conversation with its messaging window, and gives the agent one tool to reply with text, an image, a document, an interactive message or a template, and one event stream for delivered, read and reaction updates.

MCP (Model Context Protocol) is the open standard that lets AI assistants such as Claude and Cursor use outside tools. An MCP server is what they connect to. Postgale hosts one and a REST API, so ChatGPT, Claude, Cursor, VS Code, n8n or your own agent can answer WhatsApp as a tool.

## What do you need?

- A WhatsApp Business Account and a phone number for it, set up through Meta’s Embedded Signup from the Postgale dashboard, or an existing number connected with its token.
- A Postgale workspace, and a sign-in or an API key for the agent.
- Message templates approved by Meta if the agent must write first or outside the 24-hour window.
- An AI tool that can call Postgale: [ChatGPT](https://postgale.com/guides/chatgpt), [Claude](https://postgale.com/guides/claude), [Cursor](https://postgale.com/guides/cursor), [n8n](https://postgale.com/guides/n8n), VS Code, or your own code.

## What can the agent do on WhatsApp?

| Task | What Postgale does |
| --- | --- |
| Read | List conversations (latest first, with unread count and the open messaging window) and their messages, including inbound attachments. |
| Reply | Text, image, video, audio, document, interactive messages and reactions inside the 24-hour window; mark as read. |
| Templates | Send approved templates with parameters outside the window; list templates and their status. |
| Media | Upload media to WhatsApp and read the type, size and hash of inbound media. |
| Events | message.received, message.status, message.delivered, message.read and message.reaction on your webhook, signed. |

## Which WhatsApp rules does Postgale enforce?

- Free-form replies are allowed for 24 hours after the customer’s last message. Outside that window only approved templates can be sent; Postgale refuses anything else and explains why.
- WhatsApp has no human-agent extension of the window (Instagram and Messenger do); Postgale does not pretend otherwise.
- A number must be registered before it can send; a test number can only message its allowed recipients. Postgale returns the specific error code for each case.
- The business token from Embedded Signup is stored encrypted and never shown to the agent.

## How do I connect WhatsApp to an AI agent with Postgale?

1. Create a Postgale workspace and open Dashboard → Accounts.
2. Choose Connect WhatsApp and sign in with the account you own. The link opens Meta’s Embedded Signup, where you pick or create the WhatsApp Business Account and number; Postgale subscribes the number to webhooks and registers it.
3. Connect your AI tool: add `https://postgale.com/mcp` in [ChatGPT](https://postgale.com/guides/chatgpt), [Claude](https://postgale.com/guides/claude) or [Cursor](https://postgale.com/guides/cursor) and sign in to Postgale, or create a key under Dashboard → API keys for [n8n](https://postgale.com/guides/n8n) or your own code.
4. Ask the agent for a draft first. Turn on approval in the dashboard if a person should sign off before anything goes live.

An agent can also start the connection itself: the `connect_account` tool (or `GET /api/v1/connect/whatsapp`) returns a sign-in link that is valid for 10 minutes and that the account owner opens in a browser. The agent never sees the password or the tokens.

## What does a WhatsApp reply from an agent look like?

> Ask your agent: “Check unread WhatsApp conversations every few minutes. If someone asks about sizing, answer from the size chart; if the 24-hour window is closed, send the order-update template instead.”

POST /api/v1/whatsapp/accounts/{accountId}/messages:
```json
{
  "to": "+14155550132",
  "type": "text",
  "text": "Yes, M restocks Tuesday. Want me to hold one?"
}
```

With approval turned on for the key, the same call is refused with approval_required until a person lifts it, so an agent can read the inbox before it is trusted to answer it.

## What can’t an agent do on WhatsApp through Postgale?

- Send free-form messages outside the 24-hour window. Meta requires an approved template.
- Avoid Meta’s per-conversation charges. Meta bills the WhatsApp Business Account directly for template messages.
- Post to a feed. WhatsApp is messaging only.

## Questions

### Can an AI agent reply to WhatsApp messages?

Yes. Through Postgale an agent reads WhatsApp Business conversations and replies with text, media or interactive messages inside Meta’s 24-hour window, and with approved templates outside it.

### Can the agent start a WhatsApp conversation?

Only with an approved template, which is Meta’s rule for any business-initiated message. After the customer answers, free-form replies are allowed for 24 hours.

### Does the agent see the WhatsApp token or the phone?

No. The business token stays encrypted in Postgale; the agent gets an account id and tools.

## Related

- [WhatsApp developer guide](https://postgale.com/docs/whatsapp)
- [Instagram DMs](https://postgale.com/integrations/instagram)
- [Automate with n8n](https://postgale.com/guides/n8n)
- [REST API reference](https://postgale.com/docs/api)
