Skip to main content
Z-

Z-API

v20260413_01API Key

WhatsApp Business API: messages, media, templates, and delivery webhooks. Your agent sends receipts, confirmations, and support responses.

22 tools0 triggers๐Ÿ‡ง๐Ÿ‡ท Brazillive in production

Install

terminal
$ npm install @codespar/mcp-z-api

Quickstart

quickstart.ts
// your agent can now call any Z-API tool via MCP
import { CodeSpar } from "@codespar/sdk";

const cs = new CodeSpar();
const session = await cs.create("user_123");
const tools = await session.tools("@codespar/mcp-z-api");

Why this toolkit

Built for production AI commerce workflows

โ†’ MANAGED AUTH

OAuth2 without the pain

We handle token refresh, rotation, and multi-tenant credential storage. Your agent never touches raw secrets.

โ†’ LLM-FRIENDLY

Optimized schemas

Every tool has a JSON Schema tuned for LLM function-calling. Fewer hallucinations, fewer retries.

โ†’ SLA 99.9%

Running in production

Managed hosting with auto-scaling, circuit breakers, and retry logic. Battle-tested in real commerce loops.

Available tools ยท 22

Each tool is independent โ€” your agent loads only what it needs to reduce context and response time.

WRITEzapi_send_message
Send a text message to a WhatsApp number
โ†’
WRITEzapi_send_template
Send a pre-approved template message
โ†’
WRITEzapi_send_media
Send image, video, or document
โ†’
READzapi_message_status
Check delivery and read status
โ†’

Compatible frameworks

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Any MCP clientProtocol

Usage patterns

Pattern #1

Autonomous collections

Agent monitors overdue invoices, sends WhatsApp reminders via send_message, generates Pix charges with create_pix_charge, and reconciles payments -- fully autonomous.

Pattern #2

Overnight fiscal reconciliation

Scheduled agent cross-references ERP orders with NF-e emissions using list_receivables, flags mismatches, and auto-corrects when confidence is high.

Frequently asked questions

All credentials are encrypted at rest with AES-256 and stored in an isolated vault per organization. OAuth2 tokens are automatically refreshed before expiry. Your agent code never sees raw secrets -- it receives scoped, short-lived session tokens.
CodeSpar โ€” Commerce Infrastructure for AI Agents