{
  "schemaVersion": "1.0",
  "item": {
    "slug": "whatsapp-business",
    "name": "WhatsApp Business",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/byungkyu/whatsapp-business",
    "canonicalUrl": "https://clawhub.ai/byungkyu/whatsapp-business",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/whatsapp-business",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=whatsapp-business",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "LICENSE.txt"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/whatsapp-business"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/whatsapp-business",
    "agentPageUrl": "https://openagent3.xyz/skills/whatsapp-business/agent",
    "manifestUrl": "https://openagent3.xyz/skills/whatsapp-business/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/whatsapp-business/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "WhatsApp Business",
        "body": "Access the WhatsApp Business API with managed OAuth authentication. Send messages, manage message templates, handle media, and interact with customers through WhatsApp."
      },
      {
        "title": "Quick Start",
        "body": "# Send a text message\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'messaging_product': 'whatsapp', 'to': '1234567890', 'type': 'text', 'text': {'body': 'Hello from WhatsApp Business!'}}).encode()\nreq = urllib.request.Request('https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Base URL",
        "body": "https://gateway.maton.ai/whatsapp-business/{native-api-path}\n\nReplace {native-api-path} with the actual WhatsApp Business API endpoint path. The gateway proxies requests to graph.facebook.com and automatically injects your OAuth token."
      },
      {
        "title": "Authentication",
        "body": "All requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\""
      },
      {
        "title": "Getting Your API Key",
        "body": "Sign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key"
      },
      {
        "title": "Connection Management",
        "body": "Manage your WhatsApp Business OAuth connections at https://ctrl.maton.ai."
      },
      {
        "title": "List Connections",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=whatsapp-business&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Create Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'whatsapp-business'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Get Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nResponse:\n\n{\n  \"connection\": {\n    \"connection_id\": \"21fd90f9-5935-43cd-b6c8-bde9d915ca80\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"whatsapp-business\",\n    \"metadata\": {}\n  }\n}\n\nOpen the returned url in a browser to complete OAuth authorization."
      },
      {
        "title": "Delete Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Specifying Connection",
        "body": "If you have multiple WhatsApp Business connections, specify which one to use with the Maton-Connection header:\n\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'messaging_product': 'whatsapp', 'to': '1234567890', 'type': 'text', 'text': {'body': 'Hello!'}}).encode()\nreq = urllib.request.Request('https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nIf omitted, the gateway uses the default (oldest) active connection."
      },
      {
        "title": "Messages",
        "body": "Send Text Message\n\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"recipient_type\": \"individual\",\n  \"to\": \"1234567890\",\n  \"type\": \"text\",\n  \"text\": {\n    \"preview_url\": true,\n    \"body\": \"Hello! Check out https://example.com\"\n  }\n}\n\nSend Template Message\n\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"template\",\n  \"template\": {\n    \"name\": \"hello_world\",\n    \"language\": {\n      \"code\": \"en_US\"\n    },\n    \"components\": [\n      {\n        \"type\": \"body\",\n        \"parameters\": [\n          {\"type\": \"text\", \"text\": \"John\"}\n        ]\n      }\n    ]\n  }\n}\n\nSend Image Message\n\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"image\",\n  \"image\": {\n    \"link\": \"https://example.com/image.jpg\",\n    \"caption\": \"Check out this image!\"\n  }\n}\n\nSend Document Message\n\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"document\",\n  \"document\": {\n    \"link\": \"https://example.com/document.pdf\",\n    \"caption\": \"Here's the document\",\n    \"filename\": \"report.pdf\"\n  }\n}\n\nSend Video Message\n\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"video\",\n  \"video\": {\n    \"link\": \"https://example.com/video.mp4\",\n    \"caption\": \"Watch this video\"\n  }\n}\n\nSend Audio Message\n\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"audio\",\n  \"audio\": {\n    \"link\": \"https://example.com/audio.mp3\"\n  }\n}\n\nSend Location Message\n\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"location\",\n  \"location\": {\n    \"latitude\": 37.7749,\n    \"longitude\": -122.4194,\n    \"name\": \"San Francisco\",\n    \"address\": \"San Francisco, CA, USA\"\n  }\n}\n\nSend Contact Message\n\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"contacts\",\n  \"contacts\": [\n    {\n      \"name\": {\n        \"formatted_name\": \"John Doe\",\n        \"first_name\": \"John\",\n        \"last_name\": \"Doe\"\n      },\n      \"phones\": [\n        {\"phone\": \"+1234567890\", \"type\": \"MOBILE\"}\n      ]\n    }\n  ]\n}\n\nSend Interactive Button Message\n\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"interactive\",\n  \"interactive\": {\n    \"type\": \"button\",\n    \"body\": {\n      \"text\": \"Would you like to proceed?\"\n    },\n    \"action\": {\n      \"buttons\": [\n        {\"type\": \"reply\", \"reply\": {\"id\": \"yes\", \"title\": \"Yes\"}},\n        {\"type\": \"reply\", \"reply\": {\"id\": \"no\", \"title\": \"No\"}}\n      ]\n    }\n  }\n}\n\nSend Interactive List Message\n\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"interactive\",\n  \"interactive\": {\n    \"type\": \"list\",\n    \"header\": {\"type\": \"text\", \"text\": \"Select an option\"},\n    \"body\": {\"text\": \"Choose from the list below\"},\n    \"action\": {\n      \"button\": \"View Options\",\n      \"sections\": [\n        {\n          \"title\": \"Products\",\n          \"rows\": [\n            {\"id\": \"prod1\", \"title\": \"Product 1\", \"description\": \"First product\"},\n            {\"id\": \"prod2\", \"title\": \"Product 2\", \"description\": \"Second product\"}\n          ]\n        }\n      ]\n    }\n  }\n}\n\nMark Message as Read\n\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"status\": \"read\",\n  \"message_id\": \"wamid.xxxxx\"\n}"
      },
      {
        "title": "Media",
        "body": "Upload Media\n\nPOST /whatsapp-business/v21.0/{phone_number_id}/media\nContent-Type: multipart/form-data\n\nfile=@/path/to/file.jpg\ntype=image/jpeg\nmessaging_product=whatsapp\n\nGet Media URL\n\nGET /whatsapp-business/v21.0/{media_id}\n\nDelete Media\n\nDELETE /whatsapp-business/v21.0/{media_id}"
      },
      {
        "title": "Message Templates",
        "body": "List Templates\n\nGET /whatsapp-business/v21.0/{whatsapp_business_account_id}/message_templates\n\nQuery parameters:\n\nlimit - Number of templates to return\nstatus - Filter by status: APPROVED, PENDING, REJECTED\n\nCreate Template\n\nPOST /whatsapp-business/v21.0/{whatsapp_business_account_id}/message_templates\nContent-Type: application/json\n\n{\n  \"name\": \"order_confirmation\",\n  \"language\": \"en_US\",\n  \"category\": \"UTILITY\",\n  \"components\": [\n    {\n      \"type\": \"HEADER\",\n      \"format\": \"TEXT\",\n      \"text\": \"Order Confirmation\"\n    },\n    {\n      \"type\": \"BODY\",\n      \"text\": \"Hi {{1}}, your order #{{2}} has been confirmed!\"\n    },\n    {\n      \"type\": \"FOOTER\",\n      \"text\": \"Thank you for your purchase\"\n    }\n  ]\n}\n\nTemplate categories: AUTHENTICATION, MARKETING, UTILITY\n\nDelete Template\n\nDELETE /whatsapp-business/v21.0/{whatsapp_business_account_id}/message_templates?name=template_name"
      },
      {
        "title": "Phone Numbers",
        "body": "Get Phone Number\n\nGET /whatsapp-business/v21.0/{phone_number_id}\n\nList Phone Numbers\n\nGET /whatsapp-business/v21.0/{whatsapp_business_account_id}/phone_numbers"
      },
      {
        "title": "Business Profile",
        "body": "Get Business Profile\n\nGET /whatsapp-business/v21.0/{phone_number_id}/whatsapp_business_profile?fields=about,address,description,email,profile_picture_url,websites,vertical\n\nUpdate Business Profile\n\nPOST /whatsapp-business/v21.0/{phone_number_id}/whatsapp_business_profile\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"about\": \"Your trusted partner\",\n  \"address\": \"123 Business St\",\n  \"description\": \"We provide excellent services\",\n  \"email\": \"contact@example.com\",\n  \"websites\": [\"https://example.com\"],\n  \"vertical\": \"RETAIL\"\n}"
      },
      {
        "title": "JavaScript",
        "body": "const headers = {\n  'Authorization': `Bearer ${process.env.MATON_API_KEY}`,\n  'Content-Type': 'application/json'\n};\n\n// Send text message\nawait fetch(\n  'https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages',\n  {\n    method: 'POST',\n    headers,\n    body: JSON.stringify({\n      messaging_product: 'whatsapp',\n      to: '1234567890',\n      type: 'text',\n      text: { body: 'Hello from WhatsApp!' }\n    })\n  }\n);\n\n// Send template message\nawait fetch(\n  'https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages',\n  {\n    method: 'POST',\n    headers,\n    body: JSON.stringify({\n      messaging_product: 'whatsapp',\n      to: '1234567890',\n      type: 'template',\n      template: {\n        name: 'hello_world',\n        language: { code: 'en_US' }\n      }\n    })\n  }\n);"
      },
      {
        "title": "Python",
        "body": "import os\nimport requests\n\nheaders = {\n    'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}',\n    'Content-Type': 'application/json'\n}\n\n# Send text message\nresponse = requests.post(\n    'https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages',\n    headers=headers,\n    json={\n        'messaging_product': 'whatsapp',\n        'to': '1234567890',\n        'type': 'text',\n        'text': {'body': 'Hello from WhatsApp!'}\n    }\n)\n\n# Send template message\nresponse = requests.post(\n    'https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages',\n    headers=headers,\n    json={\n        'messaging_product': 'whatsapp',\n        'to': '1234567890',\n        'type': 'template',\n        'template': {\n            'name': 'hello_world',\n            'language': {'code': 'en_US'}\n        }\n    }\n)"
      },
      {
        "title": "Notes",
        "body": "Phone numbers must be in international format without + or leading zeros (e.g., 1234567890)\nmessaging_product must always be set to whatsapp\nTemplate messages are required for initiating conversations (24-hour messaging window)\nMedia files must be publicly accessible URLs or uploaded via the Media API\nInteractive messages support up to 3 buttons or 10 list items\nMessage IDs (wamid) are used to track message status and replies\nAPI version v21.0 is current; check Meta docs for latest version\nIMPORTANT: When using curl commands, use curl -g when URLs contain brackets (fields[], sort[], records[]) to disable glob parsing\nIMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments. You may get \"Invalid API key\" errors when piping."
      },
      {
        "title": "Error Handling",
        "body": "StatusMeaning400Missing WhatsApp Business connection or invalid request401Invalid or missing Maton API key404Phone number or resource not found429Rate limited (10 req/sec per account)4xx/5xxPassthrough error from WhatsApp Business API\n\nCommon error codes from WhatsApp:\n\n131030 - Phone number not registered\n131031 - Message failed to send\n132000 - Template not found or not approved\n133010 - Phone number rate limit reached"
      },
      {
        "title": "Troubleshooting: API Key Issues",
        "body": "Check that the MATON_API_KEY environment variable is set:\n\necho $MATON_API_KEY\n\nVerify the API key is valid by listing connections:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Troubleshooting: Invalid App Name",
        "body": "Ensure your URL path starts with whatsapp-business. For example:\n\nCorrect: https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages\nIncorrect: https://gateway.maton.ai/v21.0/PHONE_NUMBER_ID/messages"
      },
      {
        "title": "Resources",
        "body": "WhatsApp Business API Overview\nSend Messages\nMessage Templates\nMedia\nPhone Numbers\nBusiness Profiles\nWebhooks\nError Codes\nMaton Community\nMaton Support"
      }
    ],
    "body": "WhatsApp Business\n\nAccess the WhatsApp Business API with managed OAuth authentication. Send messages, manage message templates, handle media, and interact with customers through WhatsApp.\n\nQuick Start\n# Send a text message\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'messaging_product': 'whatsapp', 'to': '1234567890', 'type': 'text', 'text': {'body': 'Hello from WhatsApp Business!'}}).encode()\nreq = urllib.request.Request('https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nBase URL\nhttps://gateway.maton.ai/whatsapp-business/{native-api-path}\n\n\nReplace {native-api-path} with the actual WhatsApp Business API endpoint path. The gateway proxies requests to graph.facebook.com and automatically injects your OAuth token.\n\nAuthentication\n\nAll requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n\nGetting Your API Key\nSign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key\nConnection Management\n\nManage your WhatsApp Business OAuth connections at https://ctrl.maton.ai.\n\nList Connections\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=whatsapp-business&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nCreate Connection\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'whatsapp-business'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nGet Connection\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nResponse:\n\n{\n  \"connection\": {\n    \"connection_id\": \"21fd90f9-5935-43cd-b6c8-bde9d915ca80\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"whatsapp-business\",\n    \"metadata\": {}\n  }\n}\n\n\nOpen the returned url in a browser to complete OAuth authorization.\n\nDelete Connection\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nSpecifying Connection\n\nIf you have multiple WhatsApp Business connections, specify which one to use with the Maton-Connection header:\n\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'messaging_product': 'whatsapp', 'to': '1234567890', 'type': 'text', 'text': {'body': 'Hello!'}}).encode()\nreq = urllib.request.Request('https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nIf omitted, the gateway uses the default (oldest) active connection.\n\nAPI Reference\nMessages\nSend Text Message\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"recipient_type\": \"individual\",\n  \"to\": \"1234567890\",\n  \"type\": \"text\",\n  \"text\": {\n    \"preview_url\": true,\n    \"body\": \"Hello! Check out https://example.com\"\n  }\n}\n\nSend Template Message\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"template\",\n  \"template\": {\n    \"name\": \"hello_world\",\n    \"language\": {\n      \"code\": \"en_US\"\n    },\n    \"components\": [\n      {\n        \"type\": \"body\",\n        \"parameters\": [\n          {\"type\": \"text\", \"text\": \"John\"}\n        ]\n      }\n    ]\n  }\n}\n\nSend Image Message\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"image\",\n  \"image\": {\n    \"link\": \"https://example.com/image.jpg\",\n    \"caption\": \"Check out this image!\"\n  }\n}\n\nSend Document Message\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"document\",\n  \"document\": {\n    \"link\": \"https://example.com/document.pdf\",\n    \"caption\": \"Here's the document\",\n    \"filename\": \"report.pdf\"\n  }\n}\n\nSend Video Message\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"video\",\n  \"video\": {\n    \"link\": \"https://example.com/video.mp4\",\n    \"caption\": \"Watch this video\"\n  }\n}\n\nSend Audio Message\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"audio\",\n  \"audio\": {\n    \"link\": \"https://example.com/audio.mp3\"\n  }\n}\n\nSend Location Message\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"location\",\n  \"location\": {\n    \"latitude\": 37.7749,\n    \"longitude\": -122.4194,\n    \"name\": \"San Francisco\",\n    \"address\": \"San Francisco, CA, USA\"\n  }\n}\n\nSend Contact Message\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"contacts\",\n  \"contacts\": [\n    {\n      \"name\": {\n        \"formatted_name\": \"John Doe\",\n        \"first_name\": \"John\",\n        \"last_name\": \"Doe\"\n      },\n      \"phones\": [\n        {\"phone\": \"+1234567890\", \"type\": \"MOBILE\"}\n      ]\n    }\n  ]\n}\n\nSend Interactive Button Message\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"interactive\",\n  \"interactive\": {\n    \"type\": \"button\",\n    \"body\": {\n      \"text\": \"Would you like to proceed?\"\n    },\n    \"action\": {\n      \"buttons\": [\n        {\"type\": \"reply\", \"reply\": {\"id\": \"yes\", \"title\": \"Yes\"}},\n        {\"type\": \"reply\", \"reply\": {\"id\": \"no\", \"title\": \"No\"}}\n      ]\n    }\n  }\n}\n\nSend Interactive List Message\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"1234567890\",\n  \"type\": \"interactive\",\n  \"interactive\": {\n    \"type\": \"list\",\n    \"header\": {\"type\": \"text\", \"text\": \"Select an option\"},\n    \"body\": {\"text\": \"Choose from the list below\"},\n    \"action\": {\n      \"button\": \"View Options\",\n      \"sections\": [\n        {\n          \"title\": \"Products\",\n          \"rows\": [\n            {\"id\": \"prod1\", \"title\": \"Product 1\", \"description\": \"First product\"},\n            {\"id\": \"prod2\", \"title\": \"Product 2\", \"description\": \"Second product\"}\n          ]\n        }\n      ]\n    }\n  }\n}\n\nMark Message as Read\nPOST /whatsapp-business/v21.0/{phone_number_id}/messages\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"status\": \"read\",\n  \"message_id\": \"wamid.xxxxx\"\n}\n\nMedia\nUpload Media\nPOST /whatsapp-business/v21.0/{phone_number_id}/media\nContent-Type: multipart/form-data\n\nfile=@/path/to/file.jpg\ntype=image/jpeg\nmessaging_product=whatsapp\n\nGet Media URL\nGET /whatsapp-business/v21.0/{media_id}\n\nDelete Media\nDELETE /whatsapp-business/v21.0/{media_id}\n\nMessage Templates\nList Templates\nGET /whatsapp-business/v21.0/{whatsapp_business_account_id}/message_templates\n\n\nQuery parameters:\n\nlimit - Number of templates to return\nstatus - Filter by status: APPROVED, PENDING, REJECTED\nCreate Template\nPOST /whatsapp-business/v21.0/{whatsapp_business_account_id}/message_templates\nContent-Type: application/json\n\n{\n  \"name\": \"order_confirmation\",\n  \"language\": \"en_US\",\n  \"category\": \"UTILITY\",\n  \"components\": [\n    {\n      \"type\": \"HEADER\",\n      \"format\": \"TEXT\",\n      \"text\": \"Order Confirmation\"\n    },\n    {\n      \"type\": \"BODY\",\n      \"text\": \"Hi {{1}}, your order #{{2}} has been confirmed!\"\n    },\n    {\n      \"type\": \"FOOTER\",\n      \"text\": \"Thank you for your purchase\"\n    }\n  ]\n}\n\n\nTemplate categories: AUTHENTICATION, MARKETING, UTILITY\n\nDelete Template\nDELETE /whatsapp-business/v21.0/{whatsapp_business_account_id}/message_templates?name=template_name\n\nPhone Numbers\nGet Phone Number\nGET /whatsapp-business/v21.0/{phone_number_id}\n\nList Phone Numbers\nGET /whatsapp-business/v21.0/{whatsapp_business_account_id}/phone_numbers\n\nBusiness Profile\nGet Business Profile\nGET /whatsapp-business/v21.0/{phone_number_id}/whatsapp_business_profile?fields=about,address,description,email,profile_picture_url,websites,vertical\n\nUpdate Business Profile\nPOST /whatsapp-business/v21.0/{phone_number_id}/whatsapp_business_profile\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"about\": \"Your trusted partner\",\n  \"address\": \"123 Business St\",\n  \"description\": \"We provide excellent services\",\n  \"email\": \"contact@example.com\",\n  \"websites\": [\"https://example.com\"],\n  \"vertical\": \"RETAIL\"\n}\n\nCode Examples\nJavaScript\nconst headers = {\n  'Authorization': `Bearer ${process.env.MATON_API_KEY}`,\n  'Content-Type': 'application/json'\n};\n\n// Send text message\nawait fetch(\n  'https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages',\n  {\n    method: 'POST',\n    headers,\n    body: JSON.stringify({\n      messaging_product: 'whatsapp',\n      to: '1234567890',\n      type: 'text',\n      text: { body: 'Hello from WhatsApp!' }\n    })\n  }\n);\n\n// Send template message\nawait fetch(\n  'https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages',\n  {\n    method: 'POST',\n    headers,\n    body: JSON.stringify({\n      messaging_product: 'whatsapp',\n      to: '1234567890',\n      type: 'template',\n      template: {\n        name: 'hello_world',\n        language: { code: 'en_US' }\n      }\n    })\n  }\n);\n\nPython\nimport os\nimport requests\n\nheaders = {\n    'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}',\n    'Content-Type': 'application/json'\n}\n\n# Send text message\nresponse = requests.post(\n    'https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages',\n    headers=headers,\n    json={\n        'messaging_product': 'whatsapp',\n        'to': '1234567890',\n        'type': 'text',\n        'text': {'body': 'Hello from WhatsApp!'}\n    }\n)\n\n# Send template message\nresponse = requests.post(\n    'https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages',\n    headers=headers,\n    json={\n        'messaging_product': 'whatsapp',\n        'to': '1234567890',\n        'type': 'template',\n        'template': {\n            'name': 'hello_world',\n            'language': {'code': 'en_US'}\n        }\n    }\n)\n\nNotes\nPhone numbers must be in international format without + or leading zeros (e.g., 1234567890)\nmessaging_product must always be set to whatsapp\nTemplate messages are required for initiating conversations (24-hour messaging window)\nMedia files must be publicly accessible URLs or uploaded via the Media API\nInteractive messages support up to 3 buttons or 10 list items\nMessage IDs (wamid) are used to track message status and replies\nAPI version v21.0 is current; check Meta docs for latest version\nIMPORTANT: When using curl commands, use curl -g when URLs contain brackets (fields[], sort[], records[]) to disable glob parsing\nIMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments. You may get \"Invalid API key\" errors when piping.\nError Handling\nStatus\tMeaning\n400\tMissing WhatsApp Business connection or invalid request\n401\tInvalid or missing Maton API key\n404\tPhone number or resource not found\n429\tRate limited (10 req/sec per account)\n4xx/5xx\tPassthrough error from WhatsApp Business API\n\nCommon error codes from WhatsApp:\n\n131030 - Phone number not registered\n131031 - Message failed to send\n132000 - Template not found or not approved\n133010 - Phone number rate limit reached\nTroubleshooting: API Key Issues\nCheck that the MATON_API_KEY environment variable is set:\necho $MATON_API_KEY\n\nVerify the API key is valid by listing connections:\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nTroubleshooting: Invalid App Name\nEnsure your URL path starts with whatsapp-business. For example:\nCorrect: https://gateway.maton.ai/whatsapp-business/v21.0/PHONE_NUMBER_ID/messages\nIncorrect: https://gateway.maton.ai/v21.0/PHONE_NUMBER_ID/messages\nResources\nWhatsApp Business API Overview\nSend Messages\nMessage Templates\nMedia\nPhone Numbers\nBusiness Profiles\nWebhooks\nError Codes\nMaton Community\nMaton Support"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/byungkyu/whatsapp-business",
    "publisherUrl": "https://clawhub.ai/byungkyu/whatsapp-business",
    "owner": "byungkyu",
    "version": "1.0.3",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/whatsapp-business",
    "downloadUrl": "https://openagent3.xyz/downloads/whatsapp-business",
    "agentUrl": "https://openagent3.xyz/skills/whatsapp-business/agent",
    "manifestUrl": "https://openagent3.xyz/skills/whatsapp-business/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/whatsapp-business/agent.md"
  }
}