Messlo · WhatsApp Business API
WhatsApp Business API documentation — easiest REST integration
Messlo provides a developer-friendly REST API on top of the official WhatsApp Business Platform (Cloud API). Integrate WhatsApp messaging into your product, CRM, or automation stack without building Meta infrastructure from scratch.
Use this page as your complete WhatsApp API reference: authentication, endpoint list, request examples, and copy-ready cURL commands. Sign up free to generate an API key and test endpoints from the browser.
Quick start — implement WhatsApp API in minutes
- Create a Messlo account and connect WhatsAppRegister at Messlo, connect your WhatsApp Business Account (WABA), and verify your phone number in the dashboard.
- Generate an API keyOpen Integration Tools → API Credentials and create a key. Store it securely — it is shown only once.
- Optional: Messlo MCP in CursorInstall @getmesslo/messlo-mcp in Cursor MCP settings (see Integration Tools → Cursor MCP). Ask the AI to create templates, API keys, or check integration status.
- Call the REST API with your keySend the X-API-Key header (or Authorization: ApiKey <key>) on every request. Start with GET /api/whatsapp/connections to list your WABA IDs.
- Send your first messagePOST to /api/whatsapp/send with phone_number_id, recipient, and message payload. Use approved templates for outbound marketing outside the 24-hour window.
- Optional: Login with WhatsAppCreate a Login app in Messlo. Use npm packages @getmesslo/messlo-node-sdk (backend) and @getmesslo/messlo-whatsapp-login (React/Next.js), or call REST directly. See /developers#whatsapp-auth and the demo at github.com/GetMesslo/nextjs-whatsapp-login-demo.
Example: list WhatsApp connections
curl -s -X GET "https://api.messlo.com/api/whatsapp/connections" \
-H "X-API-Key: YOUR_API_KEY"Example: send a text message
curl -s -X POST "https://api.messlo.com/api/whatsapp/send" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"contact_no":"919876543210","whatsapp_phone_number":"911234567890","messageType":"text","message":"Hello!"}'Create a free account to get an API key and test requests in the browser.
Cursor MCP — build with AI in your IDE
Install @getmesslo/messlo-mcp in Cursor (or any MCP-compatible editor) to create API keys, templates, automation flows, checkout webhooks, and Login apps using natural language. Use messlo_plan_integration with goals like inbound_automation, ecommerce_checkout, or industry_pack_onboarding. After sign-in, open Integration Tools → Cursor MCP for config and example prompts.
{
"mcpServers": {
"messlo": {
"command": "npx",
"args": ["-y", "@getmesslo/messlo-mcp"],
"env": {
"MESSLO_API_KEY": "your_api_key_here"
}
}
}
}Login with WhatsApp — official SDKs & demo
Prefer npm packages over raw REST. Use @getmesslo/messlo-node-sdk on your backend and @getmesslo/messlo-whatsapp-login in React or Next.js. Clone the Next.js demo for a working full-stack reference.
Official npm packages & demo
Ship Login with WhatsApp faster using our published SDKs. Your API key and webhook secret stay on the server; the client SDK calls your proxy routes only.
MESSLO_WA_LOGIN_API_KEY=your_api_key_from_messlo_dashboard
MESSLO_WA_LOGIN_WEBHOOK_SECRET=your_webhook_secret_from_app_create
MESSLO_API_BASE_URL=https://api.messlo.comimport { MessloNodeSdk, nextAdapter } from "@getmesslo/messlo-node-sdk";
const sdk = new MessloNodeSdk({
apiKey: process.env.MESSLO_WA_LOGIN_API_KEY!,
baseUrl: process.env.MESSLO_API_BASE_URL,
});
// app/api/auth/whatsapp-login/start/route.ts
export const POST = nextAdapter.startRoute(sdk);
// app/api/auth/whatsapp-login/status/[sessionId]/route.ts
export const GET = nextAdapter.statusRoute(sdk);
// app/api/auth/whatsapp-login/events/[sessionId]/route.ts
export const GET = nextAdapter.eventsRoute(sdk);import { useMessloWhatsAppLogin } from "@getmesslo/messlo-whatsapp-login/react";
const { startLogin, status, waLink, error } = useMessloWhatsAppLogin({
basePath: "/api/auth/whatsapp-login",
onVerified: async (verificationToken) => {
await fetch("/api/auth/session", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ verificationToken }),
});
},
});Complete WhatsApp REST API endpoint reference
All endpoints use HTTPS and API key authentication. Base URL: https://api.messlo.com
WhatsApp Configuration
Handle WhatsApp account connections and numbers. Call these endpoints first to obtain waba_id and phone numbers.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/whatsapp/connections | Fetch WABA Connections |
| GET | /api/whatsapp/phone-numbers | Fetch All Phone Numbers |
| GET | /api/whatsapp/:wabaId/phone-numbers | Fetch WABA-Specific Phone NumbersReplace :wabaId with your WABA document ID or Meta business account ID. |
| POST | /api/whatsapp/:wabaId/webhooks/setup | Setup WABA webhooks (Meta)Subscribe Meta webhooks for inbound messages and delivery events. Business API (Cloud API) only — run after connecting WABA. |
| POST | /api/whatsapp/workspace/sync | Sync workspace from Meta |
Login with WhatsApp
Verify users via WhatsApp without OTP: create a Login app in Messlo, then integrate with @getmesslo/messlo-node-sdk and @getmesslo/messlo-whatsapp-login (recommended) or call the REST endpoints below. Example app: github.com/GetMesslo/nextjs-whatsapp-login-demo. Each Login app stores whether users message your WABA or Messlo's shared number; Messlo returns a verification JWT — validate it on your server and issue your own session.
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/auth/whatsapp/start | Start auth sessionCreates a pending session and returns a wa.me deep link. The user must send the pre-filled LOGIN message from their WhatsApp app. Optional phone_number_id selects which connected number receives the login message (defaults to primary active Cloud API phone). Set use_messlo_phone to true to use Messlo's shared number instead — mutually exclusive with phone_number_id. |
| GET | /v1/auth/whatsapp/events/:sessionId?token={subscribeToken} | Listen for verification (SSE)Open a Server-Sent Events stream using subscribeToken from /start. Messlo pushes verified when Meta webhook receives the user's LOGIN message — preferred over polling at scale. |
| GET | /v1/auth/whatsapp/status/:sessionId | Get verification token (optional poll)One-shot or fallback poll after SSE verified (or if you cannot use SSE). Returns verificationToken when the session is success. |
| POST | /v1/auth/verify-token | Verify token (server-side)Your backend validates the Messlo-signed JWT and receives the verified phone and profile name. Token is single-use. Issue your own app JWT/session after this call. |
Contact Management System
Organize contacts and their associations.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/contacts | List Contacts |
| POST | /api/contacts | Create Contact |
Interactive Messaging API
Deliver engaging messages to your contacts
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/whatsapp/send | Send Text MessageNote: `contact_no` is the receiver's phone number, and `whatsapp_phone_number` is the sender's registered phone number. Ensure that a WABA is connected with this sender number for the request to work. |
| POST | /api/whatsapp/send | Upload Image (URL) |
| POST | /api/whatsapp/send | Upload Document (URL) |
| POST | /api/whatsapp/send | Send Video via URL |
| POST | /api/whatsapp/send | Share Location Info |
| POST | /api/whatsapp/send | Send Multiple Media via URLsSends multiple media files in sequence using public URLs. |
| POST | /api/whatsapp/send | Send approved templateSend a Meta-approved template. Use mediaUrl for a dynamic document/image header per message (e.g. invoice PDF URL at checkout). |
| POST | /api/whatsapp/send | Send Media from Local Device |
| GET | /api/whatsapp/chats | List recent chatsInbox threads for debugging automations. |
| GET | /api/whatsapp/messages | List messages in threadQuery: contact_id (from chats or contacts). |
| POST | /api/whatsapp/assign-chat | Assign chat to agent |
| POST | /api/whatsapp/send | Send Audio via URL |
Messaging Templates API
Manage and send predefined WhatsApp message templates.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/template/create | Simple TemplateStart here — basic MARKETING template with body and optional footer. |
| POST | /api/template/create | Template with Variables |
| POST | /api/template/create | Template with Quick Reply Buttons |
| POST | /api/template/create | Template with CTA Buttons |
| POST | /api/template/create | Template with Coupon Code |
| POST | /api/template/create | OTP / Authentication Templatecategory must be AUTHENTICATION — enables OTP-specific fields and buttons. |
| POST | /api/template/create | Limited Time Offer Template |
| POST | /api/template/create | Template with Catalog Button |
| POST | /api/template/create | Template with Call Permission |
| POST | /api/template/create | Carousel Template |
| POST | /api/template/create | Template with document header (URL)Use a public HTTPS URL for the sample PDF/image/video header. Meta requires the URL to be reachable at create time. |
| POST | /api/template/validate-media-url | Validate template media URL |
| POST | /api/template/sync-status | Sync template approval status |
Broadcast API
Launch and control bulk messaging campaigns.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/campaigns | Campaign ListList existing campaigns and statuses before creating a new send. |
| POST | /api/campaigns | Setup Campaign (All Contacts)Simplest broadcast — sends an approved template to every contact. |
| POST | /api/campaigns | Setup Campaign (Specific Contacts) |
| POST | /api/campaigns | Setup Scheduled Campaign (By Tags) |
| POST | /api/campaigns | Setup Campaign with Media |
| POST | /api/campaigns | Setup Campaign with Dynamic Coupon |
| POST | /api/campaigns | Setup Campaign for Limited Time Offer |
| POST | /api/campaigns | Setup Campaign with Product Carousel |
| POST | /api/campaigns | Setup Campaign with Media Carousel |
| POST | /api/campaigns | Setup Campaign with Media Carousel (Local Files) |
Automation flows
WhatsApp bot flows as JSON (nodes, connections, triggers). Build in the dashboard or use @getmesslo/messlo-mcp (messlo_compose_automation_flow, industry packs).
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/automation | List automation flows |
| GET | /api/automation/node-types | Node types catalogAll valid node types and parameters for flow JSON. |
| POST | /api/automation | Create automation flow |
| PATCH | /api/automation/:flowId/toggle | Toggle flow active |
| POST | /api/automation/:flowId/test | Test flow |
| GET | /api/automation/:flowId/executions | List executions |
CRM: segments, tags & custom fields
Organize contacts for automations (add_to_segment, add_tag, update_contact nodes) and broadcast campaigns.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/segments | List segments |
| POST | /api/segments | Create segment |
| GET | /api/tags | List tags |
| POST | /api/tags | Create tag |
| GET | /api/custom-fields | List custom fields |
| PUT | /api/contacts/:id | Update contact |
AI chatbots & keyword bots
AI assistants (assign_chatbot nodes) and keyword auto-replies (message bots). Quick replies are agent inbox shortcuts.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/chatbots | List chatbotsQuery: waba_id (required). |
| POST | /api/chatbots | Create chatbot |
| POST | /api/chatbots/:id/train | Train chatbot (Q&A) |
| GET | /api/message-bots | List message botsQuery: waba_id (required). |
| POST | /api/message-bots | Create message bot |
| GET | /api/quick-replies | List quick replies |
WhatsApp Flow forms
Meta Flow lead forms. In automations, form_flow nodes use flow.flow_id from GET form (not the MongoDB form _id).
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/forms | List formsQuery: waba_id (required). |
| POST | /api/forms | Create form |
| PATCH | /api/forms/:id/publish | Publish form |
Industry packs
One-shot vertical onboarding: CRM fields, tags, segments, automation flows, and chatbot presets per industry.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/industry-packs/public | List public packs |
| GET | /api/industry-packs/public/:slug/preview | Preview packOptional query: company_name, city, etc. |
| POST | /api/industry-packs/apply | Apply pack |
Ops & integrations
Agents, drip sequences, Google Sheets/Calendar, plan usage, kanban pipelines, and bulk imports.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/subscriptions/usage | Subscription usage |
| GET | /api/agent/all | List agents |
| POST | /api/whatsapp/assign-chat | Assign chat to agent |
| GET | /api/google/connect | Google OAuth connectReturns URL to connect Google account. |
| GET | /api/sequences | List sequencesQuery: waba_id (required). |
| GET | /api/kanban-funnels | List kanban funnels |
Commerce & checkout
Meta catalogs, order webhooks (Shopify/WooCommerce), and template sends with dynamic header media (e.g. per-order PDF via mediaUrl).
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/ecommerce-catalog/waba/:waba_id/sync-catalogs | Sync WABA catalogs |
| GET | /api/ecommerce-catalog/catalog/:catalog_id/products | List catalog products |
| POST | /api/ecommerce-webhook/create | Create order webhook |
| POST | /api/ecommerce-webhook/:id/map-template | Map template to webhook |
| POST | /api/whatsapp/send | Send template with dynamic PDF header |
81 documented endpoints across messaging, contacts, templates, and campaigns.
Frequently asked questions — WhatsApp API integration
- What is the easiest way to implement the WhatsApp Business API?
- Use Messlo’s REST API: connect your WABA once in the dashboard, generate an API key, and call documented endpoints with standard HTTP tools (cURL, Postman, or any SDK). You avoid direct Meta app review complexity for common messaging, contacts, templates, and campaigns.
- How do I send a WhatsApp message via API?
- Authenticate with X-API-Key, obtain your phone_number_id from GET /api/whatsapp/phone-numbers, then POST to /api/whatsapp/send (session messages) or use template endpoints for marketing and notifications.
- Is this the official WhatsApp Business API?
- Yes. Messlo integrates with the WhatsApp Business Platform (Cloud API). Your messages are sent through your connected WABA and comply with Meta’s messaging policies and template rules.
- How does API authentication work?
- Include your API key in the X-API-Key header or as Authorization: ApiKey <your_key>. JWT Bearer tokens are used for dashboard sessions; server-to-server integrations should use API keys.
- Can I send bulk WhatsApp messages or campaigns via API?
- Yes. Use the Broadcast API to create campaigns, attach an approved template, and send to contact lists or segments. List campaigns with GET /api/campaigns before creating new sends.
- How does Login with WhatsApp work?
- Create a Login app in the Messlo dashboard (choose your WhatsApp Business number or Messlo's shared number). Use @getmesslo/messlo-node-sdk and @getmesslo/messlo-whatsapp-login for production integrations, or call POST /v1/auth/whatsapp/start with your app API key to get a waLink. The user sends the pre-filled LOGIN message on WhatsApp. Listen via SSE on GET /v1/auth/whatsapp/events/:sessionId or poll GET /status until you receive verificationToken, then POST /v1/auth/verify-token on your backend. Full guide: /developers/login-with-whatsapp. Example repo: github.com/GetMesslo/nextjs-whatsapp-login-demo.
- Are there official SDKs for Login with WhatsApp?
- Yes. @getmesslo/messlo-node-sdk provides backend helpers and Next.js/Express route adapters. @getmesslo/messlo-whatsapp-login provides a React hook and UI components for your frontend (via your proxy routes). See npmjs.com/package/@getmesslo/messlo-node-sdk and npmjs.com/package/@getmesslo/messlo-whatsapp-login.
- Where can LLMs and tools find a summary of this API?
- A machine-readable summary is available at /llms.txt on this site, alongside this HTML documentation page. Install @getmesslo/messlo-mcp in Cursor for natural-language setup (messlo_plan_integration goals: inbound_automation, ecommerce_checkout, industry_pack_onboarding, and more).
- How do I build WhatsApp automation flows via API?
- POST /api/automation with nodes, connections, and triggers (typically message_received). GET /api/automation/node-types for the full node catalog. Use PATCH /api/automation/:flowId/toggle to activate. Cursor users can use messlo_compose_automation_flow or apply an industry pack via POST /api/industry-packs/apply.
- How do I send order confirmations with a dynamic PDF header?
- Create a template with a public header_url sample (document type) via POST /api/template/create, wait for Meta approval, then POST /api/whatsapp/send with messageType template and mediaUrl set to the per-order PDF URL. Alternatively, use POST /api/ecommerce-webhook/create and map-template for Shopify or WooCommerce order webhooks.