whatsapp-cloud-api

Official WhatsApp Cloud API reference for building messaging integrations. Covers sending messages (text, media, templates, interactive), receiving webhooks, conversation lifecycle, phone number management, and error handling. Use when building WhatsApp integrations, sending messages, processing webhooks, or working with the Meta WhatsApp Business Platform API.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "whatsapp-cloud-api" with this command: npx skills add bellopushon/whatsapp-cloud-api/bellopushon-whatsapp-cloud-api-whatsapp-cloud-api

WhatsApp Cloud API

When to Use

Activate this skill when:

  • Building or modifying WhatsApp messaging features
  • Sending messages (text, media, templates, interactive)
  • Processing incoming webhooks from WhatsApp
  • Working with template messages or conversation windows
  • Handling phone number formatting (E.164)
  • Debugging WhatsApp API errors or status updates
  • Implementing message status tracking (sent, delivered, read)

Quick Reference

ItemValue
Base URLhttps://graph.facebook.com/v21.0
Send MessagePOST /{phone-number-id}/messages
Upload MediaPOST /{phone-number-id}/media
AuthAuthorization: Bearer {access-token}
Required Field"messaging_product": "whatsapp"
Phone FormatE.164: +{country}{number} (e.g., +18091234567)
Rate Limit80 messages/second (Cloud API)

Core API — Send Message

All messages go through a single endpoint:

POST https://graph.facebook.com/v21.0/{phone-number-id}/messages
Authorization: Bearer {access-token}
Content-Type: application/json

Response:

{
  "messaging_product": "whatsapp",
  "contacts": [{ "input": "+16505555555", "wa_id": "16505555555" }],
  "messages": [{ "id": "wamid.HBgL..." }]
}

Message Types

Typetype FieldDetails
TexttextPlain text, max 4096 chars, supports URL preview
ImageimageJPEG/PNG, max 5MB, optional caption
VideovideoMP4, max 16MB, optional caption
AudioaudioAAC/MP3/OGG, max 16MB
DocumentdocumentAny format, max 100MB, optional filename
StickerstickerWebP, static 100KB / animated 500KB
Locationlocationlatitude, longitude, name, address
ContactscontactsStructured contact cards
ReactionreactionEmoji reaction to a message
InteractiveinteractiveButtons, lists, products
TemplatetemplatePre-approved message templates

For full specs and code examples, see references/MESSAGING.md.

Webhooks

Your server receives POST requests for incoming messages and status updates.

Incoming message structure:

{
  "object": "whatsapp_business_account",
  "entry": [{
    "changes": [{
      "value": {
        "messaging_product": "whatsapp",
        "metadata": { "phone_number_id": "ID", "display_phone_number": "NUM" },
        "contacts": [{ "profile": { "name": "John" }, "wa_id": "16315551234" }],
        "messages": [{
          "from": "16315551234",
          "id": "wamid.ABC...",
          "timestamp": "1683229471",
          "type": "text",
          "text": { "body": "Hello" }
        }]
      },
      "field": "messages"
    }]
  }]
}

Status update types: sentdeliveredread | failed

For webhook verification, payload parsing, and all status types, see references/WEBHOOKS.md.

Conversation Window

  • When a customer messages you, a 24-hour service window opens
  • Inside the window: send any message type freely (service messages are FREE)
  • Outside the window: only template messages can be sent (paid per message)
  • No API endpoint to "close" a conversation — windows expire automatically
  • Template messages open their own 24h window per category (marketing, utility, auth)

For full lifecycle, pricing, and category rules, see references/CONVERSATIONS.md.

Common Patterns

Send a text message

{
  "messaging_product": "whatsapp",
  "to": "+18091234567",
  "type": "text",
  "text": { "body": "Hello! How can we help you?" }
}

Send a template message

{
  "messaging_product": "whatsapp",
  "to": "+18091234567",
  "type": "template",
  "template": {
    "name": "hello_world",
    "language": { "code": "en_US" }
  }
}

Mark a message as read

{
  "messaging_product": "whatsapp",
  "status": "read",
  "message_id": "wamid.HBgL..."
}

Error Handling

CodeErrorAction
131030Recipient not on WhatsAppValidate number before sending
131047Re-engagement requiredSend a template message first
131050User stopped marketing messagesRespect opt-out, send only service/utility
131056Pair rate limit hitSlow down, implement backoff
130429Rate limit exceededQueue messages, max 80/sec

For full error reference and retry strategies, see references/ERROR-CODES.md.

Best Practices

  1. Always use E.164 phone format+{country}{number}, no spaces or dashes
  2. Verify webhooks — Respond to GET challenge with hub.challenge value
  3. Return 200 immediately on webhook POST — process asynchronously
  4. Store wamid IDs — Needed for replies, reactions, and read receipts
  5. Use template messages to re-engage after the 24h window expires
  6. Handle idempotency — Webhook may deliver the same event multiple times
  7. Check wa_id vs input — The API normalizes phone numbers; wa_id is canonical
  8. Rate limit awareness — 80 msg/sec for Cloud API; implement queue + backoff

References

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

whatsapp-cloud-api

No summary provided by upstream source.

Repository SourceNeeds Review
General

Xiaohongshu Crawler

爬取小红书内容,支持登录搜索、笔记详情获取、用户主页信息及热门笔记,无需登录部分功能可用。

Registry SourceRecently Updated
General

TAPD

当用户需要查询、修改 TAPD 项目中需求、缺陷、任务等信息时,如修改状态、添加评论等,通过调用 TAPD MCP 提供相应的服务。当用户要求时,通过 send_qiwei_message 发送消息到企业微信。

Registry SourceRecently Updated
General

Roast Generator

吐槽生成器。温和吐槽、毒舌模式、朋友互怼、名人吐槽、自嘲、Battle模式。Roast generator with gentle, savage modes. 吐槽、毒舌、搞笑。

Registry SourceRecently Updated