Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
gokapso avatar

Integrate Whatsapp

  • 3.1k installs
  • 144 repo stars
  • Updated August 2, 2026
  • gokapso/agent-skills

integrate-whatsapp is an agent skill that connects WhatsApp to a product via Kapso setup links, webhooks, Cloud API messaging, templates, media, and WhatsApp Flows management.

About

integrate-whatsapp is an agent skill for end-to-end WhatsApp integration through Kapso, covering customer onboarding with setup links, connection detection, webhook event routing, and Cloud API messaging for text, templates, media, and interactive messages. The preferred path uses the Kapso CLI with kapso login, kapso setup, and kapso whatsapp numbers resolve before operating on phone_number_id values. Fallback flows document direct Platform API calls with X-API-Key auth, customer and setup_link creation, and embedded signup completion. Webhook guidance distinguishes project-level connection lifecycle events from phone-number scoped whatsapp.message and whatsapp.conversation traffic, with signature verification and payload version v2 recommended. Messaging examples include the @kapso/whatsapp-cloud-api SDK, template create and send scripts, and CLI commands for listing conversations and templates. WhatsApp Flows management covers create, update, publish, data endpoints, and encryption. Developers reach for it when wiring WhatsApp Business onboarding, inbound webhook handlers, outbound transactional or template messaging, and operational tooling around Kapso phone numbers.

  • Documents Kapso CLI onboarding with kapso setup plus fallback Platform API customer and setup_link flows.
  • Separates project webhooks from phone-number webhooks for whatsapp.message and whatsapp.conversation events.
  • Covers SDK and script paths for text, template, media, and interactive WhatsApp Cloud API messaging.
  • Includes WhatsApp Flows lifecycle guidance for create, update, publish, data endpoints, and encryption.
  • Recommends signature verification, payload v2, and phone_number_id resolution before send operations.

Integrate Whatsapp by the numbers

  • 3,095 all-time installs (skills.sh)
  • +75 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #255 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

integrate-whatsapp capabilities & compatibility

Capabilities
customer onboarding via setup links · webhook scope configuration · text and template messaging · media and interactive sends · whatsapp flows management
Use cases
api development · orchestration
Pricing
Bring your own API key
From the docs

What integrate-whatsapp says it does

Connect WhatsApp to your product with Kapso: onboard customers with setup links, detect connections, receive events via webhooks
SKILL.md
npx skills add https://github.com/gokapso/agent-skills --skill integrate-whatsapp

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs3.1k
repo stars144
Security audit2 / 3 scanners passed
Last updatedAugust 2, 2026
Repositorygokapso/agent-skills

How do I onboard WhatsApp numbers, receive message events, and send templates or media through Kapso without mixing project and phone-number webhook scopes?

Integrate WhatsApp end-to-end with Kapso: onboard customers, detect connections, receive webhook events, and send messages, templates, media, and Flows.

Who is it for?

Developers integrating WhatsApp Business messaging, webhooks, and Flows into an app using Kapso CLI or Platform API credentials.

Skip if: Skip when the task is generic chat UI design without Kapso or Meta WhatsApp Cloud API integration.

When should I use this skill?

User asks to connect WhatsApp, create Kapso setup links, configure webhooks, send templates, or manage WhatsApp Flows end-to-end.

What you get

Working Kapso onboarding, scoped webhooks, resolved phone_number_id values, and send or template flows aligned with Kapso CLI and SDK examples.

  • WhatsApp Flow JSON definition
  • routing_model configuration
  • Booking screen layout JSON

By the numbers

  • WhatsApp Flow JSON version 7.3
  • data_api_version 3.0
  • Defines SELECT_DATE and SELECT_SLOT booking screens

Files

SKILL.mdMarkdownGitHub ↗

Integrate WhatsApp

Setup

Preferred path:

  • Kapso CLI installed and authenticated (kapso login)
  • Use kapso status to confirm project access before onboarding or messaging

Fallback path: Env vars:

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

Auth header (direct API calls):

X-API-Key: <api_key>

Install deps (once):

npm i

Connect WhatsApp (setup links)

Preferred onboarding path (CLI):

1. Start onboarding: kapso setup 2. If setup is blocked, resolve context with:

  • kapso projects list
  • kapso projects use <project-id>
  • kapso customers list
  • kapso customers new --name "<customer-name>" --external-id <external-id>
  • kapso setup --customer <customer-id>

3. Complete the hosted onboarding URL 4. Confirm connected numbers: kapso whatsapp numbers list --output json 5. Resolve the exact number you want to operate: kapso whatsapp numbers resolve --phone-number "<display-number>" --output json

Fallback onboarding flow (direct API):

1. Create customer: POST /platform/v1/customers 2. Generate setup link: POST /platform/v1/customers/:id/setup_links 3. Customer completes embedded signup 4. Use phone_number_id to send messages and configure webhooks

Detect connection:

  • Project webhook whatsapp.phone_number.created (recommended)
  • Success redirect URL query params (use for frontend UX)

Recommended Kapso setup-link defaults:

{
  "setup_link": {
    "allowed_connection_types": ["dedicated"],
    "provision_phone_number": true,
    "phone_number_country_isos": ["US"]
  }
}

Notes:

  • kapso setup and kapso whatsapp numbers new use dedicated plus provisioning by default.
  • Keep phone_number_country_isos, phone_number_area_code, language, and redirect URLs as optional overrides.
  • Platform API base: /platform/v1
  • Meta proxy base: /meta/whatsapp/v24.0 (messaging, templates, media)
  • Use phone_number_id as the primary WhatsApp identifier

Receive events (webhooks)

Use webhooks to receive:

  • Project events (connection lifecycle, workflow events)
  • Phone-number events (messages, conversations, delivery status)

Scope rules:

  • Project webhooks: only project-level events (connection lifecycle, workflow events)
  • Phone-number webhooks: only WhatsApp message + conversation events for that phone_number_id
  • WhatsApp message/conversation events (whatsapp.message.*, whatsapp.conversation.*) are phone-number only

Create a webhook:

  • Project-level: node scripts/create.js --scope project --url <https://...> --events <csv>
  • Phone-number: node scripts/create.js --phone-number-id <id> --url <https://...> --events <csv>

Common flags for create/update:

  • --url <https://...> - webhook destination
  • --events <csv|json-array> - event types (Kapso webhooks)
  • --kind <kapso|meta> - Kapso (event-based) vs raw Meta forwarding
  • --payload-version <v1|v2> - payload format (v2 recommended)
  • --buffer-enabled <true|false> - enable buffering for whatsapp.message.received
  • --buffer-window-seconds <n> - 1-60 seconds
  • --max-buffer-size <n> - 1-100
  • --active <true|false> - enable/disable

Test delivery:

node scripts/test.js --webhook-id <id>

Always verify signatures. See:

  • references/webhooks-overview.md
  • references/webhooks-reference.md

Send and read messages

Discover IDs first

Two Meta IDs are needed for different operations:

IDUsed forHow to discover
business_account_id (WABA)Template CRUDkapso whatsapp numbers resolve --phone-number "<display-number>" --output json or node scripts/list-platform-phone-numbers.mjs
phone_number_idSending messages, media uploadkapso whatsapp numbers resolve --phone-number "<display-number>" --output json or node scripts/list-platform-phone-numbers.mjs

Operate with the CLI first

Common commands:

kapso whatsapp numbers list --output json
kapso whatsapp numbers resolve --phone-number "<display-number>" --output json
kapso whatsapp messages send --phone-number-id <PHONE_NUMBER_ID> --to <wa-id> --text "Hello from Kapso"
kapso whatsapp messages list --phone-number-id <PHONE_NUMBER_ID> --limit 50 --output json
kapso whatsapp messages get <MESSAGE_ID> --phone-number-id <PHONE_NUMBER_ID> --output json
kapso whatsapp conversations list --phone-number-id <PHONE_NUMBER_ID> --output json
kapso whatsapp templates list --phone-number-id <PHONE_NUMBER_ID> --output json
kapso whatsapp templates get <TEMPLATE_ID> --phone-number-id <PHONE_NUMBER_ID> --output json

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!
});

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

Preferred path:

  • CLI: kapso whatsapp messages ..., kapso whatsapp conversations ..., kapso whatsapp templates ...

Fallback path:

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

Embed the inbox

Use Platform API inbox embeds when the user wants to place Kapso's inbox inside their own app.

Create:

  • POST /platform/v1/inbox_embeds
  • Envelope: inbox_embed
  • Public scopes: project, customer, phone_number
  • scope_id is blank for project, a customer UUID for customer, and WhatsApp phone_number_id for phone_number
  • Create returns token and embed_url once. Store embed_url; list/get/update omit secrets.

Example:

{
  "inbox_embed": {
    "name": "Support inbox",
    "scope_type": "phone_number",
    "scope_id": "1234567890",
    "allowed_origins": ["https://app.example.com"],
    "default_mode": "system"
  }
}

Manage:

  • GET /platform/v1/inbox_embeds
  • GET /platform/v1/inbox_embeds/:id
  • PATCH /platform/v1/inbox_embeds/:id
  • DELETE /platform/v1/inbox_embeds/:id (revokes)

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)

WhatsApp Flows

Use Flows to build native WhatsApp forms. Read references/whatsapp-flows-spec.md before editing Flow JSON.

Create and publish a flow

1. Create flow: node scripts/create-flow.js --phone-number-id <id> --name <name> 2. Update JSON: node scripts/update-flow-json.js --flow-id <id> --json-file <path> 3. Publish: node scripts/publish-flow.js --flow-id <id> 4. Test: node scripts/send-test-flow.js --phone-number-id <id> --flow-id <id> --to <phone>

Attach a data endpoint (dynamic flows)

1. Set up encryption: node scripts/setup-encryption.js --flow-id <id> 2. Create endpoint: node scripts/set-data-endpoint.js --flow-id <id> --code-file <path> 3. Deploy: node scripts/deploy-data-endpoint.js --flow-id <id> 4. Register: node scripts/register-data-endpoint.js --flow-id <id>

Flow JSON rules

Static flows (no data endpoint):

  • Use version: "7.3"
  • routing_model and data_api_version are optional
  • See assets/sample-flow.json

Dynamic flows (with data endpoint):

  • Use version: "7.3" with data_api_version: "3.0"
  • routing_model is required (defines valid screen transitions)
  • See assets/dynamic-flow.json

Data endpoint rules

Handler signature:

async function handler(request, env) {
  const body = await request.json();
  // body.data_exchange.action: INIT | data_exchange | BACK
  // body.data_exchange.screen: current screen id
  // body.data_exchange.data: user inputs
  return Response.json({
    version: "3.0",
    screen: "NEXT_SCREEN_ID",
    data: { }
  });
}
  • Do not use export or module.exports
  • Completion uses screen: "SUCCESS" with extension_message_response.params
  • Do not include endpoint_uri or data_channel_uri (Kapso injects these)

Troubleshooting

  • Preview shows "flow_token is missing": flow is dynamic without a data endpoint. Attach one and refresh.
  • Encryption setup errors: enable encryption in Settings for the phone number/WABA.
  • OAuthException 139000 (Integrity): WABA must be verified in Meta security center.

Scripts

Webhooks

ScriptPurpose
list.jsList webhooks
get.jsGet webhook details
create.jsCreate a webhook
update.jsUpdate a webhook
delete.jsDelete a webhook
test.jsSend a test event

Messaging and templates

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

Flows

ScriptPurpose
list-flows.jsList all flows
create-flow.jsCreate a new flow
get-flow.jsGet flow details
read-flow-json.jsRead flow JSON
update-flow-json.jsUpdate flow JSON (creates new version)
publish-flow.jsPublish a flow
get-data-endpoint.jsGet data endpoint config
set-data-endpoint.jsCreate/update data endpoint code
deploy-data-endpoint.jsDeploy data endpoint
register-data-endpoint.jsRegister data endpoint with Meta
get-encryption-status.jsCheck encryption status
setup-encryption.jsSet up flow encryption
send-test-flow.jsSend a test flow message
delete-flow.jsDelete a flow
list-flow-responses.jsList stored flow responses
list-function-logs.jsList function logs
list-function-invocations.jsList function invocations

OpenAPI

ScriptPurpose
openapi-explore.mjsExplore OpenAPI (search/op/schema/where)

Examples:

node scripts/openapi-explore.mjs --spec whatsapp search "template"
node scripts/openapi-explore.mjs --spec whatsapp op sendMessage
node scripts/openapi-explore.mjs --spec whatsapp schema TemplateMessage
node scripts/openapi-explore.mjs --spec platform ops --tag "WhatsApp Flows"
node scripts/openapi-explore.mjs --spec platform op setupWhatsappFlowEncryption
node scripts/openapi-explore.mjs --spec platform search "setup link"

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
sample-flow.jsonStatic flow example (no endpoint)
dynamic-flow.jsonDynamic flow example (with endpoint)
webhooks-example.jsonWebhook create/update payload example

References

  • references/getting-started.md - Platform onboarding
  • references/platform-api-reference.md - Full endpoint reference
  • references/setup-links.md - Setup link configuration
  • references/detecting-whatsapp-connection.md - Connection detection methods
  • references/webhooks-overview.md - Webhook types, signature verification, retries
  • references/webhooks-event-types.md - Available events
  • references/webhooks-reference.md - Webhook API and payload notes
  • references/templates-reference.md - Template creation rules, components cheat sheet, send-time components
  • references/whatsapp-api-reference.md - Meta proxy payloads for messages and conversations
  • references/whatsapp-cloud-api-js.md - SDK usage for sending and reading messages
  • references/whatsapp-flows-spec.md - Flow JSON spec

Related skills

  • automate-whatsapp - Workflows, agents, and automations
  • observe-whatsapp - Debugging, logs, health checks

<!-- FILEMAP:BEGIN -->

[integrate-whatsapp file map]|root: .
|.:{package.json,SKILL.md}
|assets:{dynamic-flow.json,sample-flow.json,send-interactive-buttons.json,send-interactive-catalog-message.json,send-interactive-cta-url.json,send-interactive-list.json,send-interactive-location-request.json,send-template-order-status-update.json,template-authentication-otp.json,template-marketing-media-header.json,template-utility-named.json,template-utility-order-status-update.json,webhooks-example.json}
|references:{detecting-whatsapp-connection.md,getting-started.md,platform-api-reference.md,setup-links.md,templates-reference.md,webhooks-event-types.md,webhooks-overview.md,webhooks-reference.md,whatsapp-api-reference.md,whatsapp-cloud-api-js.md,whatsapp-flows-spec.md}
|scripts:{create-flow.js,create-function.js,create-template.mjs,create.js,delete-flow.js,delete.js,deploy-data-endpoint.js,deploy-function.js,get-data-endpoint.js,get-encryption-status.js,get-flow.js,get-function.js,get.js,list-connected-numbers.mjs,list-flow-responses.js,list-flows.js,list-function-invocations.js,list-function-logs.js,list-platform-phone-numbers.mjs,list-templates.mjs,list.js,openapi-explore.mjs,publish-flow.js,read-flow-json.js,register-data-endpoint.js,send-interactive.mjs,send-template.mjs,send-test-flow.js,set-data-endpoint.js,setup-encryption.js,submit-template.mjs,template-status.mjs,test.js,update-flow-json.js,update-function.js,update-template.mjs,update.js,upload-media.mjs,upload-template-header-handle.mjs}
|scripts/lib:{args.mjs,cli.js,env.js,env.mjs,http.js,output.js,output.mjs,request.mjs,run.js,whatsapp-flow.js}
|scripts/lib/webhooks:{args.js,kapso-api.js,webhook.js}

<!-- FILEMAP:END -->

Related skills

Forks & variants (1)

Integrate Whatsapp has 1 known copy in the catalog totaling 254 installs. They canonicalize to this original listing.

FAQ

Which webhook scope receives WhatsApp message events?

whatsapp.message and whatsapp.conversation events are phone-number webhooks only, not project-level webhooks.

What is the preferred Kapso onboarding path?

Authenticate with kapso login, run kapso setup, complete the hosted URL, then list numbers with kapso whatsapp numbers list.

Which identifier is required to send messages?

Resolve and use phone_number_id from kapso whatsapp numbers resolve before sending text, templates, or media.

Is Integrate Whatsapp safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.