{"id":279,"date":"2026-10-25T13:05:09","date_gmt":"2026-10-25T13:05:09","guid":{"rendered":"https:\/\/vectalk.com.br\/blog\/send-whatsapp-message-api-examples\/"},"modified":"2026-10-25T13:05:12","modified_gmt":"2026-10-25T13:05:12","slug":"send-whatsapp-message-api-examples","status":"publish","type":"post","link":"https:\/\/vectalk.com.br\/blog\/en\/send-whatsapp-message-api-examples\/","title":{"rendered":"How to send a message with the WhatsApp Business API: cURL, Node.js and Python examples"},"content":{"rendered":"\n<p><em>Updated on October 25, 2026<\/em><\/p>\n\n\n\n<p>To send a message with the official WhatsApp Business API, make a <code>POST<\/code> to <code>https:\/\/graph.facebook.com\/v26.0\/&lt;PHONE_NUMBER_ID&gt;\/messages<\/code> with your token in the <code>Authorization<\/code> header and a JSON body containing <code>messaging_product<\/code>, <code>to<\/code>, <code>type<\/code> and the content. Free-form text can only be sent inside the 24-hour window opened by the customer; outside it, you need an approved template. A 200 response means Meta accepted the request, and delivery is confirmed later by webhook.<\/p>\n\n\n\n<p>Below are copy-paste examples for text and template messages in cURL, Node.js and Python, the same call through Vectalk, and a table of the errors that show up most on a first send.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What you need first<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <strong>Phone Number ID<\/strong> of the sending number. It&#8217;s not the number itself; it&#8217;s the ID Meta generates for it. See the <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-glossary\/\">API glossary<\/a>.<\/li>\n\n\n<li>An <strong>access token<\/strong> with the <code>whatsapp_business_messaging<\/code> permission. For production, use a system user token, as in <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-permanent-access-token\/\">permanent token<\/a>.<\/li>\n\n\n<li>The <strong>recipient&#8217;s number<\/strong> with <code>+<\/code> and the country code, for example <code>+5584999999999<\/code>.<\/li>\n\n\n<li>An <strong>approved template<\/strong>, if the customer hasn&#8217;t written in the last 24 hours.<\/li>\n\n<\/ul>\n\n\n\n<p>On number format: the <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/messages\/send-messages\" target=\"_blank\" rel=\"noreferrer noopener\">send messages documentation<\/a> recommends always including the <code>+<\/code> and the country code. Without the <code>+<\/code>, Meta prepends your business number&#8217;s country code, which can send the message to the wrong person. The same page notes that for Brazil and Mexico, the API may adjust the number&#8217;s prefix, and that this is expected behavior.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Payload structure<\/h2>\n\n\n\n<p>Every send uses the same endpoint. What changes is <code>type<\/code> and the object with the same name:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Field<\/th><th>Required<\/th><th>Value<\/th><\/tr><\/thead><tbody><tr><td><code>messaging_product<\/code><\/td><td>Yes<\/td><td>Always <code>\"whatsapp\"<\/code><\/td><\/tr><tr><td><code>recipient_type<\/code><\/td><td>No<\/td><td><code>\"individual\"<\/code> (default) or <code>\"group\"<\/code><\/td><\/tr><tr><td><code>to<\/code><\/td><td>Yes<\/td><td>Recipient&#8217;s number, ideally with <code>+<\/code><\/td><\/tr><tr><td><code>type<\/code><\/td><td>Yes<\/td><td><code>text<\/code>, <code>template<\/code>, <code>image<\/code>, <code>document<\/code>, <code>interactive<\/code>, etc.<\/td><\/tr><tr><td><code>&lt;type&gt;<\/code><\/td><td>Yes<\/td><td>Object with the content, e.g. <code>text: { body }<\/code><\/td><\/tr><tr><td><code>context.message_id<\/code><\/td><td>No<\/td><td><code>wamid<\/code> of a customer message, to reply quoting it<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Sending text<\/h2>\n\n\n\n<p>A text message is a service message: it only works while the customer service window is open. The body accepts up to 4,096 characters, and <code>preview_url: true<\/code> asks WhatsApp to render a preview of the first link (<a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/messages\/text-messages\" target=\"_blank\" rel=\"noreferrer noopener\">text messages<\/a>).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">cURL<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl 'https:\/\/graph.facebook.com\/v26.0\/YOUR_PHONE_NUMBER_ID\/messages' \\\n  -H 'Content-Type: application\/json' \\\n  -H 'Authorization: Bearer YOUR_TOKEN' \\\n  -d '{\n    \"messaging_product\": \"whatsapp\",\n    \"recipient_type\": \"individual\",\n    \"to\": \"+15551234567\",\n    \"type\": \"text\",\n    \"text\": {\n      \"preview_url\": true,\n      \"body\": \"Your order has shipped. Track it at https:\/\/example.com\/track\/123\"\n    }\n  }'<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Node.js (18 or later)<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-js\">const PHONE_NUMBER_ID = process.env.WA_PHONE_NUMBER_ID;\nconst TOKEN = process.env.WA_TOKEN;\n\nasync function sendText(to, text) {\n  const r = await fetch(`https:\/\/graph.facebook.com\/v26.0\/${PHONE_NUMBER_ID}\/messages`, {\n    method: 'POST',\n    headers: { Authorization: `Bearer ${TOKEN}`, 'Content-Type': 'application\/json' },\n    body: JSON.stringify({\n      messaging_product: 'whatsapp',\n      to,\n      type: 'text',\n      text: { body: text },\n    }),\n  });\n  const body = await r.json();\n  if (!r.ok) throw new Error(`${body.error?.code}: ${body.error?.message}`);\n  return body.messages[0].id; \/\/ wamid\n}\n\nsendText('+15551234567', 'Hi! We got your message.').then(console.log);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Python<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-python\">import os\nimport requests\n\nPHONE_NUMBER_ID = os.environ[\"WA_PHONE_NUMBER_ID\"]\nTOKEN = os.environ[\"WA_TOKEN\"]\n\ndef send_text(to: str, text: str) -&gt; str:\n    r = requests.post(\n        f\"https:\/\/graph.facebook.com\/v26.0\/{PHONE_NUMBER_ID}\/messages\",\n        headers={\"Authorization\": f\"Bearer {TOKEN}\"},\n        json={\n            \"messaging_product\": \"whatsapp\",\n            \"to\": to,\n            \"type\": \"text\",\n            \"text\": {\"body\": text},\n        },\n        timeout=15,\n    )\n    body = r.json()\n    if not r.ok:\n        raise RuntimeError(f\"{body['error']['code']}: {body['error']['message']}\")\n    return body[\"messages\"][0][\"id\"]  # wamid\n\nprint(send_text(\"+15551234567\", \"Hi! We got your message.\"))<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Sending a template<\/h2>\n\n\n\n<p>Templates are what let you start a conversation. The template must have <code>APPROVED<\/code> status, and you pass the exact name and language code it was created with. Its category (marketing, utility or authentication) was set at creation and determines the price; see <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-template-categories\/\">template categories<\/a>.<\/p>\n\n\n\n<p>Say you have a utility template <code>order_confirmation<\/code> with the body &#8220;Hi {{1}}! Your order {{2}} is confirmed.&#8221;:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">cURL<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl 'https:\/\/graph.facebook.com\/v26.0\/YOUR_PHONE_NUMBER_ID\/messages' \\\n  -H 'Content-Type: application\/json' \\\n  -H 'Authorization: Bearer YOUR_TOKEN' \\\n  -d '{\n    \"messaging_product\": \"whatsapp\",\n    \"to\": \"+15551234567\",\n    \"type\": \"template\",\n    \"template\": {\n      \"name\": \"order_confirmation\",\n      \"language\": { \"code\": \"en_US\" },\n      \"components\": [\n        {\n          \"type\": \"body\",\n          \"parameters\": [\n            { \"type\": \"text\", \"text\": \"Maria\" },\n            { \"type\": \"text\", \"text\": \"#12345\" }\n          ]\n        }\n      ]\n    }\n  }'<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Node.js<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-js\">async function sendTemplate(to, name, variables, language = 'en_US') {\n  const r = await fetch(`https:\/\/graph.facebook.com\/v26.0\/${PHONE_NUMBER_ID}\/messages`, {\n    method: 'POST',\n    headers: { Authorization: `Bearer ${TOKEN}`, 'Content-Type': 'application\/json' },\n    body: JSON.stringify({\n      messaging_product: 'whatsapp',\n      to,\n      type: 'template',\n      template: {\n        name,\n        language: { code: language },\n        components: [\n          { type: 'body', parameters: variables.map((v) =&gt; ({ type: 'text', text: v })) },\n        ],\n      },\n    }),\n  });\n  const body = await r.json();\n  if (!r.ok) throw new Error(`${body.error?.code}: ${body.error?.message}`);\n  return body.messages[0].id;\n}\n\nsendTemplate('+15551234567', 'order_confirmation', ['Maria', '#12345']).then(console.log);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Python<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-python\">def send_template(to: str, name: str, variables: list[str], language: str = \"en_US\") -&gt; str:\n    r = requests.post(\n        f\"https:\/\/graph.facebook.com\/v26.0\/{PHONE_NUMBER_ID}\/messages\",\n        headers={\"Authorization\": f\"Bearer {TOKEN}\"},\n        json={\n            \"messaging_product\": \"whatsapp\",\n            \"to\": to,\n            \"type\": \"template\",\n            \"template\": {\n                \"name\": name,\n                \"language\": {\"code\": language},\n                \"components\": [\n                    {\"type\": \"body\", \"parameters\": [{\"type\": \"text\", \"text\": v} for v in variables]}\n                ],\n            },\n        },\n        timeout=15,\n    )\n    body = r.json()\n    if not r.ok:\n        raise RuntimeError(f\"{body['error']['code']}: {body['error']['message']}\")\n    return body[\"messages\"][0][\"id\"]\n\nprint(send_template(\"+15551234567\", \"order_confirmation\", [\"Maria\", \"#12345\"]))<\/code><\/pre>\n\n\n\n<p>If the template was created with <strong>named parameters<\/strong> (<code>{{customer_name}}<\/code>), each parameter also carries <code>parameter_name<\/code>, and order no longer matters (<a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/templates\/overview\" target=\"_blank\" rel=\"noreferrer noopener\">templates<\/a>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-json\">{ \"type\": \"text\", \"parameter_name\": \"customer_name\", \"text\": \"Maria\" }<\/code><\/pre>\n\n\n\n<p>For templates with an image, document or video header, add a <code>header<\/code> component with the file. Sending media is covered in <a href=\"https:\/\/vectalk.com.br\/blog\/en\/send-media-whatsapp-api\/\">how to send images, PDFs, audio and video<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What the API returns<\/h2>\n\n\n\n<p>When Meta accepts the request, you get:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-json\">{\n  \"messaging_product\": \"whatsapp\",\n  \"contacts\": [{ \"input\": \"+15551234567\", \"wa_id\": \"15551234567\" }],\n  \"messages\": [{ \"id\": \"wamid.HBgLMTU1NTEyMzQ1NjcVAgARGBI...\" }]\n}<\/code><\/pre>\n\n\n\n<p>Three things to keep in mind:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Store the <code>wamid<\/code>.<\/strong> It&#8217;s what shows up in the <code>sent<\/code>, <code>delivered<\/code>, <code>read<\/code> and <code>failed<\/code> status webhooks. See <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-message-status-webhook\/\">message statuses via webhook<\/a>.<\/li>\n\n\n<li><strong>200 is not delivery.<\/strong> Errors such as the per-user marketing limit arrive later, in the webhook, with <code>failed<\/code> status.<\/li>\n\n\n<li><strong>Order isn&#8217;t guaranteed.<\/strong> If you send several messages in a row, Meta doesn&#8217;t guarantee they arrive in request order. To enforce a sequence, wait for one message&#8217;s <code>delivered<\/code> status before sending the next.<\/li>\n\n<\/ol>\n\n\n\n<p>Meta keeps trying to deliver a message for up to 30 days (10 minutes for authentication templates). If no <code>delivered<\/code> status arrives in that time, treat the message as dropped.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Most common errors on a first send<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Code<\/th><th>What it means<\/th><th>How to fix it<\/th><\/tr><\/thead><tbody><tr><td><code>131047<\/code><\/td><td>More than 24 hours since the customer&#8217;s last message<\/td><td>Send a template instead<\/td><\/tr><tr><td><code>132001<\/code><\/td><td>Template doesn&#8217;t exist in that language or isn&#8217;t approved<\/td><td>Check the name, language code and status<\/td><\/tr><tr><td><code>132000<\/code><\/td><td>Number of variables doesn&#8217;t match the template<\/td><td>Send one value per variable<\/td><\/tr><tr><td><code>132012<\/code><\/td><td>Variables in the wrong format<\/td><td>Use the template&#8217;s format (positional or named)<\/td><\/tr><tr><td><code>131026<\/code><\/td><td>Message undeliverable (no WhatsApp, old app version, terms not accepted)<\/td><td>Confirm the number with the customer<\/td><\/tr><tr><td><code>130429<\/code><\/td><td>Messages-per-second limit reached<\/td><td>Slow down and retry with exponential backoff<\/td><\/tr><tr><td><code>131056<\/code><\/td><td>Too many messages to the same recipient in a short time<\/td><td>Wait before messaging that number again<\/td><\/tr><tr><td><code>133010<\/code><\/td><td>Business number not registered on the platform<\/td><td>Register the number<\/td><\/tr><tr><td><code>190<\/code><\/td><td>Expired token<\/td><td>Generate a new system user token<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Source: <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/support\/error-codes\" target=\"_blank\" rel=\"noreferrer noopener\">Meta error codes<\/a>. The full list, with causes and fixes, is in <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-error-codes\/\">WhatsApp API errors<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Best practices for your sending code<\/h2>\n\n\n\n<p>The examples above are the minimum to get a message out. In production, a few habits prevent duplicate messages, unnecessary costs and quality problems:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Record each send before calling the API.<\/strong> Store the request with an internal ID and save the <code>wamid<\/code> after the response. If the process crashes midway, you know what already went out and won&#8217;t resend it.<\/li>\n\n\n<li><strong>Only retry what&#8217;s worth retrying.<\/strong> Retry with backoff on <code>130429<\/code>, <code>131056<\/code> and network or HTTP 5xx failures. Parameter errors (<code>132000<\/code>, <code>132012<\/code>) and template errors (<code>132001<\/code>) won&#8217;t improve on retry: fix the payload.<\/li>\n\n\n<li><strong>Respect the per-user marketing limit.<\/strong> Meta advises waiting at least 24 hours before resending a template that came back with <code>131049<\/code>.<\/li>\n\n\n<li><strong>Set timeouts on calls.<\/strong> A request without a timeout can stall your whole queue if the network hiccups.<\/li>\n\n\n<li><strong>Keep the token secret.<\/strong> Read it from an environment variable or a secrets manager and never ship it to the front end or commit it.<\/li>\n\n\n<li><strong>Validate numbers up front.<\/strong> Normalize numbers to international format with <code>+<\/code> when you collect them, not at send time.<\/li>\n\n\n<li><strong>Mark as read.<\/strong> When you process a customer message, you can mark it as read through the API, which shows them the two blue ticks.<\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">The same send through Vectalk<\/h2>\n\n\n\n<p>Vectalk is a proxy for the official WhatsApp Cloud API. Payloads are identical to Meta&#8217;s; only the base URL and token change, per the <a href=\"https:\/\/docs.vectalk.com.br\/introduction\">documentation introduction<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><\/th><th>Meta (direct)<\/th><th>Vectalk<\/th><\/tr><\/thead><tbody><tr><td>Send URL<\/td><td><code>https:\/\/graph.facebook.com\/v26.0\/&lt;PHONE_NUMBER_ID&gt;\/messages<\/code><\/td><td><code>https:\/\/apis.vectalk.com.br\/api\/messages<\/code><\/td><\/tr><tr><td>Token<\/td><td>Meta token (system user)<\/td><td>Token generated in Vectalk<\/td><\/tr><tr><td>Phone Number ID<\/td><td>In the URL<\/td><td>Resolved by an instance token, or in the body with an organization token<\/td><\/tr><tr><td>Payload and response<\/td><td>Meta&#8217;s format<\/td><td>Identical<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>With an <strong>instance token<\/strong>, the number is resolved automatically:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -X POST https:\/\/apis.vectalk.com.br\/api\/messages \\\n  -H \"Authorization: Bearer YOUR_VECTALK_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\n    \"messaging_product\": \"whatsapp\",\n    \"to\": \"15551234567\",\n    \"type\": \"template\",\n    \"template\": {\n      \"name\": \"order_confirmation\",\n      \"language\": { \"code\": \"en_US\" },\n      \"components\": [\n        { \"type\": \"body\", \"parameters\": [\n          { \"type\": \"text\", \"text\": \"Maria\" },\n          { \"type\": \"text\", \"text\": \"#12345\" }\n        ] }\n      ]\n    }\n  }'<\/code><\/pre>\n\n\n\n<p>With an <strong>organization token<\/strong>, which reaches all your instances, include <code>phone_number_id<\/code> in the body:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-python\">import os\nimport requests\n\nr = requests.post(\n    \"https:\/\/apis.vectalk.com.br\/api\/messages\",\n    headers={\"Authorization\": f\"Bearer {os.environ['VECTALK_TOKEN']}\"},\n    json={\n        \"messaging_product\": \"whatsapp\",\n        \"phone_number_id\": \"1234567890\",\n        \"to\": \"15551234567\",\n        \"type\": \"text\",\n        \"text\": {\"body\": \"Hi! We got your message.\"},\n    },\n    timeout=15,\n)\nprint(r.json()[\"messages\"][0][\"id\"])<\/code><\/pre>\n\n\n\n<p>Each message type is documented under <a href=\"https:\/\/docs.vectalk.com.br\/api-reference\/messages\/send\">Messages<\/a>, and the token types under <a href=\"https:\/\/docs.vectalk.com.br\/authentication\">Authentication<\/a>. To get your token, <a href=\"https:\/\/apps.vectalk.com.br\/register\">create your account<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Can I send text to someone who has never messaged me?<\/h3>\n\n\n\n<p>No. Outside the 24-hour window, including for people who never wrote to you, only approved templates can be sent. The API returns error <code>131047<\/code> if you try free-form text. And under WhatsApp policy, the person must have opted in.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The API returned 200 but the message never arrived. Why?<\/h3>\n\n\n\n<p>A 200 only confirms Meta accepted the request. Delivery is reported in the status webhook. If it comes back <code>failed<\/code>, the error code explains why, such as <code>131049<\/code> (per-user marketing limit) or <code>131026<\/code> (number without WhatsApp).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Which Graph API version should I use?<\/h3>\n\n\n\n<p>The examples in Meta&#8217;s current documentation use v26.0. Pin the version in your URL and check Meta&#8217;s changelog before upgrading, since each version has a deprecation date.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I message many contacts at once?<\/h3>\n\n\n\n<p>There&#8217;s no batch send endpoint: each message is its own call. Control your sending rate, stay within your portfolio&#8217;s messaging limit and handle error <code>130429<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I reply quoting the customer&#8217;s message?<\/h3>\n\n\n\n<p>Add <code>\"context\": { \"message_id\": \"&lt;wamid of the customer's message&gt;\" }<\/code> to the payload. The reply shows up in WhatsApp as a quote of the original message.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Official sources consulted on October 25, 2026:<\/strong> <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/messages\/send-messages\" target=\"_blank\" rel=\"noreferrer noopener\">Send messages (service messages)<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/messages\/text-messages\" target=\"_blank\" rel=\"noreferrer noopener\">Text messages<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/templates\/overview\" target=\"_blank\" rel=\"noreferrer noopener\">Templates<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/support\/error-codes\" target=\"_blank\" rel=\"noreferrer noopener\">Error codes<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/webhooks\/reference\/messages\/status\" target=\"_blank\" rel=\"noreferrer noopener\">Status webhook<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/access-tokens\" target=\"_blank\" rel=\"noreferrer noopener\">Access tokens<\/a>, Vectalk documentation: <a href=\"https:\/\/docs.vectalk.com.br\/introduction\">introduction<\/a>, <a href=\"https:\/\/docs.vectalk.com.br\/api-reference\/messages\/send\">messages<\/a> and <a href=\"https:\/\/docs.vectalk.com.br\/authentication\">authentication<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ready-to-use examples for sending text and template messages with the official WhatsApp Business API in cURL, Node.js and Python, directly or via Vectalk.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-279","post","type-post","status-publish","format-standard","hentry","category-blog"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Send WhatsApp Messages via API: Code Examples | Vectalk<\/title>\n<meta name=\"description\" content=\"How to send a WhatsApp message via the API: payload, text and template examples in cURL, Node.js and Python, the response, wamid and common errors.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vectalk.com.br\/blog\/en\/send-whatsapp-message-api-examples\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Send WhatsApp Messages via API: Code Examples | Vectalk\" \/>\n<meta property=\"og:description\" content=\"How to send a WhatsApp message via the API: payload, text and template examples in cURL, Node.js and Python, the response, wamid and common errors.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vectalk.com.br\/blog\/en\/send-whatsapp-message-api-examples\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog Vectalk\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-25T13:05:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-25T13:05:12+00:00\" \/>\n<meta name=\"author\" content=\"wanderleyfcunha\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"wanderleyfcunha\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/send-whatsapp-message-api-examples\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/send-whatsapp-message-api-examples\\\/\"},\"author\":{\"name\":\"wanderleyfcunha\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/#\\\/schema\\\/person\\\/ff36ecd9d8257856f227f8e5d639db2b\"},\"headline\":\"How to send a message with the WhatsApp Business API: cURL, Node.js and Python examples\",\"datePublished\":\"2026-10-25T13:05:09+00:00\",\"dateModified\":\"2026-10-25T13:05:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/send-whatsapp-message-api-examples\\\/\"},\"wordCount\":1236,\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/send-whatsapp-message-api-examples\\\/\",\"url\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/send-whatsapp-message-api-examples\\\/\",\"name\":\"Send WhatsApp Messages via API: Code Examples | Vectalk\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/#website\"},\"datePublished\":\"2026-10-25T13:05:09+00:00\",\"dateModified\":\"2026-10-25T13:05:12+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/#\\\/schema\\\/person\\\/ff36ecd9d8257856f227f8e5d639db2b\"},\"description\":\"How to send a WhatsApp message via the API: payload, text and template examples in cURL, Node.js and Python, the response, wamid and common errors.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/send-whatsapp-message-api-examples\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/send-whatsapp-message-api-examples\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/send-whatsapp-message-api-examples\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to send a message with the WhatsApp Business API: cURL, Node.js and Python examples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/\",\"name\":\"Blog Vectalk\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/#\\\/schema\\\/person\\\/ff36ecd9d8257856f227f8e5d639db2b\",\"name\":\"wanderleyfcunha\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/21c37077f1731eb558973f27a7b647d55f72fde5200a843ac5f5345b247ea725?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/21c37077f1731eb558973f27a7b647d55f72fde5200a843ac5f5345b247ea725?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/21c37077f1731eb558973f27a7b647d55f72fde5200a843ac5f5345b247ea725?s=96&d=mm&r=g\",\"caption\":\"wanderleyfcunha\"},\"sameAs\":[\"https:\\\/\\\/vectalk.com.br\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Send WhatsApp Messages via API: Code Examples | Vectalk","description":"How to send a WhatsApp message via the API: payload, text and template examples in cURL, Node.js and Python, the response, wamid and common errors.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vectalk.com.br\/blog\/en\/send-whatsapp-message-api-examples\/","og_locale":"en_US","og_type":"article","og_title":"Send WhatsApp Messages via API: Code Examples | Vectalk","og_description":"How to send a WhatsApp message via the API: payload, text and template examples in cURL, Node.js and Python, the response, wamid and common errors.","og_url":"https:\/\/vectalk.com.br\/blog\/en\/send-whatsapp-message-api-examples\/","og_site_name":"Blog Vectalk","article_published_time":"2026-10-25T13:05:09+00:00","article_modified_time":"2026-10-25T13:05:12+00:00","author":"wanderleyfcunha","twitter_card":"summary_large_image","twitter_misc":{"Written by":"wanderleyfcunha","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vectalk.com.br\/blog\/en\/send-whatsapp-message-api-examples\/#article","isPartOf":{"@id":"https:\/\/vectalk.com.br\/blog\/en\/send-whatsapp-message-api-examples\/"},"author":{"name":"wanderleyfcunha","@id":"https:\/\/vectalk.com.br\/blog\/#\/schema\/person\/ff36ecd9d8257856f227f8e5d639db2b"},"headline":"How to send a message with the WhatsApp Business API: cURL, Node.js and Python examples","datePublished":"2026-10-25T13:05:09+00:00","dateModified":"2026-10-25T13:05:12+00:00","mainEntityOfPage":{"@id":"https:\/\/vectalk.com.br\/blog\/en\/send-whatsapp-message-api-examples\/"},"wordCount":1236,"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/vectalk.com.br\/blog\/en\/send-whatsapp-message-api-examples\/","url":"https:\/\/vectalk.com.br\/blog\/en\/send-whatsapp-message-api-examples\/","name":"Send WhatsApp Messages via API: Code Examples | Vectalk","isPartOf":{"@id":"https:\/\/vectalk.com.br\/blog\/#website"},"datePublished":"2026-10-25T13:05:09+00:00","dateModified":"2026-10-25T13:05:12+00:00","author":{"@id":"https:\/\/vectalk.com.br\/blog\/#\/schema\/person\/ff36ecd9d8257856f227f8e5d639db2b"},"description":"How to send a WhatsApp message via the API: payload, text and template examples in cURL, Node.js and Python, the response, wamid and common errors.","breadcrumb":{"@id":"https:\/\/vectalk.com.br\/blog\/en\/send-whatsapp-message-api-examples\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vectalk.com.br\/blog\/en\/send-whatsapp-message-api-examples\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vectalk.com.br\/blog\/en\/send-whatsapp-message-api-examples\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vectalk.com.br\/blog\/"},{"@type":"ListItem","position":2,"name":"How to send a message with the WhatsApp Business API: cURL, Node.js and Python examples"}]},{"@type":"WebSite","@id":"https:\/\/vectalk.com.br\/blog\/#website","url":"https:\/\/vectalk.com.br\/blog\/","name":"Blog Vectalk","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vectalk.com.br\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/vectalk.com.br\/blog\/#\/schema\/person\/ff36ecd9d8257856f227f8e5d639db2b","name":"wanderleyfcunha","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/21c37077f1731eb558973f27a7b647d55f72fde5200a843ac5f5345b247ea725?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/21c37077f1731eb558973f27a7b647d55f72fde5200a843ac5f5345b247ea725?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/21c37077f1731eb558973f27a7b647d55f72fde5200a843ac5f5345b247ea725?s=96&d=mm&r=g","caption":"wanderleyfcunha"},"sameAs":["https:\/\/vectalk.com.br\/blog"]}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/posts\/279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/comments?post=279"}],"version-history":[{"count":1,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/posts\/279\/revisions"}],"predecessor-version":[{"id":282,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/posts\/279\/revisions\/282"}],"wp:attachment":[{"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/media?parent=279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/categories?post=279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/tags?post=279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}