mcpField
W
whatsapp-messaging

whatsapp-messaging

github.com/gokapsoOther19497 installsUpdated 3w ago
Repository

About whatsapp-messaging

A skill for developers working with WhatsApp messaging through Kapso. It covers sending messages, managing templates, uploading media, and reading inbox data, with examples using an SDK and scripts.

Key features

  1. 01Send text, template, and interactive messages
  2. 02Create, update, and check template status
  3. 03Upload message media
  4. 04Query messages and conversations
  5. 05Use an SDK or scripts

Use cases

  1. 01Send an order-status template notification
  2. 02Send an interactive message within a session window
  3. 03Read WhatsApp inbox messages and conversations

MCP support

The README does not describe a relationship to MCP.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/gokapso/agent-skills --skill whatsapp-messaging

After installing, type/whatsapp-messagingin Claude Code to confirm it loaded.

Details

From the project README

WhatsApp Messaging

When to use

Use this skill when working with WhatsApp messaging via Kapso: sending messages, creating/managing templates, uploading media, or reading inbox history.

Setup

Env vars:

  • KAPSO_API_BASE_URL (host only, no /platform/v1)
  • KAPSO_API_KEY
  • META_GRAPH_VERSION (optional, default v24.0)

Discover IDs first

Two Meta IDs are needed for different operations:

IDUsed forHow to discover
business_account_id (WABA)Template CRUDnode scripts/list-platform-phone-numbers.mjs
phone_number_idSending messages, media uploadnode scripts/list-platform-phone-numbers.mjs

SDK setup

Install:

npm install @kapso/whatsapp-cloud-api

Create client:

import { WhatsAppClient } from "@kapso/whatsapp-cloud-api";

const client = new WhatsAppClient({
  baseUrl: "https://api.kapso.ai/meta/whatsapp",
  kapsoApiKey: process.env.KAPSO_API_KEY!
});

How to

Send a text message

Via SDK:

await client.messages.sendText({
  phoneNumberId: "<PHONE_NUMBER_ID>",
  to: "+15551234567",
  body: "Hello from Kapso"
});
Send a template message
  1. Discover IDs: node scripts/list-platform-phone-numbers.mjs
  2. Draft template payload from assets/template-utility-order-status-update.json
  3. Create: node scripts/create-template.mjs --business-account-id <WABA_ID> --file <payload.json>
  4. Check status: node scripts/template-status.mjs --business-account-id <WABA_ID> --name <name>
  5. Send: node scripts/send-template.mjs --phone-number-id <ID> --file <send-payload.json>
Send an interactive message

Interactive messages require an active 24-hour session window. For outbound notifications outside the window, use templates.

  1. Discover phone_number_id
  2. Pick payload from assets/send-interactive-*.json
  3. Send: node scripts/send-interactive.mjs --phone-number-id <ID> --file <payload.json>
Read inbox data

Use Meta proxy or SDK:

  • Proxy: GET /{phone_number_id}/messages, GET /{phone_number_id}/conversations
  • SDK: client.messages.query(), client.conversations.list()

Template rules

Creation:

  • Use parameter_format: "NAMED" with {{param_name}} (preferred over positional)
  • Include examples when using variables in HEADER/BODY
  • Use language (not language_code)
  • Don't interleave QUICK_REPLY with URL/PHONE_NUMBER buttons
  • URL button variables must be at the end of the URL and use positional {{1}}

Send-time:

  • For NAMED templates, include parameter_name in header/body params
  • URL buttons need a button component with sub_type: "url" and index
  • Media headers use either id or link (never both)

Scripts

ScriptPurposeRequired ID
list-platform-phone-numbers.mjsDiscover business_account_id + phone_number_id—
list-connected-numbers.mjsList WABA phone numbersbusiness_account_id
list-templates.mjsList templates (with filters)business_account_id
template-status.mjsCheck single template statusbusiness_account_id
create-template.mjsCreate a templatebusiness_account_id
update-template.mjsUpdate existing templatebusiness_account_id
send-template.mjsSend template messagephone_number_id
send-interactive.mjsSend interactive messagephone_number_id
upload-media.mjsUpload media for send-time headersphone_number_id

Assets

FileDescription
template-utility-order-status-update.jsonUTILITY template with named params + URL button
send-template-order-status-update.jsonSend-time payload for order_status_update
template-utility-named.jsonUTILITY template showing button ordering rules
template-marketing-media-header.jsonMARKETING template with IMAGE header
template-authentication-otp.jsonAUTHENTICATION OTP template (COPY_CODE)
send-interactive-buttons.jsonInteractive button message
send-interactive-list.jsonInteractive list message
send-interactive-cta-url.jsonInteractive CTA URL message
send-interactive-location-request.jsonLocation request message
send-interactive-catalog-message.jsonCatalog message

References

Related skills

  • kapso-automation - Workflow automation
  • whatsapp-flows - WhatsApp Flows
  • kapso-api - Platform API and customers

Comments

Markdown supported