How to connect WhatsApp to an AI agent
There are two main routes for putting an AI agent on WhatsApp. One is WhatsApp's own Business Platform. The other is connecting your own account by QR code, which is how Spaces works. Here is what each involves, with WhatsApp's rules quoted.
Route 1: the WhatsApp Business Platform
WhatsApp's Business Messaging Policy says:
- You may only contact people who gave you their number and opted in to hear from you.
- You must respect all requests to opt out.
- You may only start conversations using an approved Message Template.
- You may reply without a template within the 24-hour customer service window, which opens and resets with each user message.
- You may use automation when responding during the 24-hour window, but you must have prompt, clear and direct escalation paths. Examples: an in-chat transfer to a human agent, a phone number, email, web support, in-store visits or a support form.
- Messages are priced according to WhatsApp's pricing policy.
Route 2: your own account by QR code (Spaces)
Spaces connects your own WhatsApp account by QR code and gives your agent an MCP server and REST API. The agent can read chats, reply, start chats and receive webhooks for new messages. This is quicker to set up, but it is not the Business Platform. Read the caveat above: WhatsApp's Terms prohibit bulk messaging, auto-messaging and non-personal use unless WhatsApp has authorised it.
Good practice on either route
- Lead with conversations the customer starts.
- Get opt-in before you message someone first, and tell them how to stop.
- Stop at once when asked.
- Offer a way to reach a person.
- Never send bulk or cold messages.
Setting up Spaces
- Sign up with your email and the 6-digit code Spaces sends. An agent can do this for you through the onboarding MCP server at https://api.spacesos.com/mcp/start.
- Add a card at checkout. Don't connect an account until checkout is finished.
- Connect WhatsApp: open the connect link and scan the QR code.
- Create an API key. It starts with spc_live_ and is shown only once, so store it safely.
- Add the MCP server https://api.spacesos.com/mcp to your agent, or call the REST API at https://api.spacesos.com/v1.
Who you message
Pricing
FAQ
What is the WhatsApp Business Platform?
It is WhatsApp's tool for businesses to manage customer conversations at scale. Its policy requires opt-in, approved Message Templates to start conversations, and allows free-form replies within a 24-hour customer service window.
Can an AI agent reply on the WhatsApp Business Platform?
WhatsApp's Business Messaging Policy says you may use automation when responding during the 24-hour window, as long as you have prompt, clear and direct escalation paths such as a transfer to a human agent.
How does Spaces connect WhatsApp?
Spaces connects your own WhatsApp account by scanning a QR code. It is not the WhatsApp Business Platform and is not affiliated with Meta or WhatsApp.
Does WhatsApp allow automation on regular accounts?
WhatsApp's Terms of Service prohibit bulk messaging, auto-messaging and non-personal use unless WhatsApp has authorised it.