Build with AI: how to set up clients' WhatsApp for an agency with Claude Code, OpenAPI and MCP
More and more agency owners build their own solutions with Claude Code, Cursor, Codex and other AIs. What separates a first version that works from one that hallucinates endpoints is the context the agent receives. ZapZap publishes the OpenAPI specification, the Postman collection, SDKs, an MCP server and llms.txt precisely for this. GM Solutions Hub, the agency of ZapZap's founder, uses ZapZap with its own clients; this is a first-party disclosure, with no result figures. ZapZap is an unofficial API: WhatsApp may limit or block numbers.
Published on · 4 min read
What exists for your AI to read
Four pieces. The llms.txt summarizes the product, price, limits and links for the agent. The OpenAPI specification and Postman collection describe the endpoints, in Portuguese, English and Spanish. The open-source MCP server (github.com/zapzapapi/zapzap-mcp) gives the agent ready-made tools, and the official SDKs (Node.js, Python and PHP, through the zapzapapi GitHub) cover integration in code. See the page on AI agents and the guide to the MCP server.
Step 1: give context, not the password
Put in the project's instructions file (CLAUDE.md, AGENTS.md or the Cursor rules) the links to the OpenAPI and llms.txt, the base URL and the names of the environment variables. Never paste the API key and secret into the prompt or the repository: the agent only needs to know that ZAPZAP_API_KEY and ZAPZAP_API_SECRET exist.
An instructions snippet that works: "The WhatsApp API is ZapZap. Specification: https://zapzapapi.com/openapi/zapzap-openapi.en.json. AI summary: https://zapzapapi.com/llms.txt. Base: https://api.zapzapapi.com/api/v1. Authentication: x-api-key and x-api-secret headers, read from ZAPZAP_API_KEY and ZAPZAP_API_SECRET. Use only endpoints present in the specification and say when a feature does not exist."
Step 2: ask for one thing at a time, with a definition of done
Prompts that work are small and verifiable. For a minimal CRM: "Create a Node.js script that receives ZapZap's incoming-message webhook and writes to a leads table (phone, name, first message, instance, date). Use only the fields the specification describes, validate the payload and respond 200 quickly." For a report: "Read the instances with GET /instances and, for each one, the campaigns with GET /{instanceId}/sender/listfolders. Generate a JSON with the counters log_total, log_delivered, log_read and log_failed." For reminders: "Schedule a message with POST /{instanceId}/sender/simple using scheduled_for in milliseconds."
Always ask for a test at the end: "write a test that runs against a staging instance". And tell the agent to cite which OpenAPI operation each call came from, which turns review into a one-minute job.
Step 3: an example the agent can use as a base
The snippet below is the base of almost everything: list the account's instances and check each one's status. It uses only documented operations, and works as a starting point for an internal dashboard of your clients' number health.
List instances and check the status of each one
const BASE = "https://api.zapzapapi.com/api/v1";
const headers = {
"x-api-key": process.env.ZAPZAP_API_KEY,
"x-api-secret": process.env.ZAPZAP_API_SECRET,
};
const instances = await (await fetch(BASE + "/instances", { headers })).json();
for (const inst of instances) {
const r = await fetch(BASE + "/" + inst.id + "/instance/status", { headers });
console.log(inst.name, r.ok ? await r.json() : "HTTP " + r.status);
await new Promise((res) => setTimeout(res, 1000));
}What to ask the AI to build first
Four high-return projects for an agency: a health dashboard for clients' numbers (which dropped, which need to reconnect), a minimal CRM fed by webhook, a monthly report per client (see automating reports) and a scheduler for follow-ups and reminders (see scheduling appointment messages). For the per-client ad lead flow, see tracking ad leads.
Start with the health dashboard: it is read-only, low risk and delivers value in the first week.
Cautions when letting AI write the code
Review every send. An agent that generates code to send messages can, by mistake, send the same message to an entire list or ignore the pace. Require delays between sends, a volume cap per run and a test mode that writes to a log instead of sending. Do not approve code that sends to a list without consent, per the acceptable use policy.
Handle security too: key and secret only on the back end, never in the browser, and one key per environment. For the niche pages, see agencies with AI and resale under the client's brand.
Quick summary
- ZapZap publishes llms.txt, OpenAPI, Postman, SDKs (Node.js, Python, PHP) and an open-source MCP server for the agent to read.
- Give the agent context (links and variable names), never the key and secret.
- Small prompts, with a definition of done, and citing the OpenAPI operation used.
- Start with a read-only health dashboard and grow into CRM, reports and scheduling.
- Review all sending code: delays, volume cap and test mode.
Keep reading
Also read
Frequently asked questions
Does ZapZap have an MCP server?
Yes, open source (github.com/zapzapapi/zapzap-mcp), with 25 tools, according to llms.txt. It works in MCP-capable clients like Claude and Cursor.
Where is the OpenAPI specification?
At zapzapapi.com/openapi/zapzap-openapi.pt.json (and .en.json and .es.json), with the Postman collection alongside, on the OpenAPI page.
Can I paste the API key into the prompt?
No. Use environment variables and let the agent know only the names. A key in a prompt can leak into history and logs.
Which SDKs exist?
Node.js, Python and PHP, distributed through zapzapapi's GitHub, according to llms.txt.
Does GM Solutions Hub use ZapZap?
Yes. GM Solutions Hub, the agency of ZapZap's founder, uses ZapZap with its own clients. It is a first-party disclosure, with no result figures.
Give your coding agent an API it understands
Create the account, generate the API key and point the agent to the OpenAPI and llms.txt. R$15 per active number per month, no per-message fee. Verify your phone and you get a welcome credit, subject to the current campaign.
