{"id":2183,"date":"2026-11-24T19:30:10","date_gmt":"2026-11-24T19:30:10","guid":{"rendered":"https:\/\/vectalk.com.br\/blog\/whatsapp-api-curl-examples\/"},"modified":"2026-11-24T19:30:14","modified_gmt":"2026-11-24T19:30:14","slug":"whatsapp-api-curl-examples","status":"publish","type":"post","link":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-curl-examples\/","title":{"rendered":"WhatsApp API curl examples: text, templates, media and buttons"},"content":{"rendered":"\n<p><em>Updated on November 24, 2026<\/em><\/p>\n\n\n\n<p>Every send through the WhatsApp Business API is a JSON <code>POST<\/code> to a single messages endpoint: on the Meta Cloud API, <code>https:\/\/graph.facebook.com\/v27.0\/&lt;PHONE_NUMBER_ID&gt;\/messages<\/code>; on Vectalk, <code>https:\/\/apis.vectalk.com.br\/api\/messages<\/code>. The only thing that changes between text, template, image, document or buttons is the <code>type<\/code> field and the object with the same name. Below you will find ready-to-copy curl commands, along with the limits of each type.<\/p>\n\n\n\n<p>This is a cheat sheet for the terminal. If you prefer a graphical interface, see <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-postman\/\">how to test the API in Postman<\/a>; for the same sends in Node.js and Python, see <a href=\"https:\/\/vectalk.com.br\/blog\/en\/send-whatsapp-message-api-examples\/\">sending examples in cURL, Node.js and Python<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setup: environment variables<\/h2>\n\n\n\n<p>Set the variables once and every command below works without edits.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\"># Direct Cloud API (Meta)\nexport WA_URL=\"https:\/\/graph.facebook.com\/v27.0\/YOUR_PHONE_NUMBER_ID\"\nexport WA_TOKEN=\"your_system_user_token\"\nexport TO=\"5511999999999\"\n\n# Or Vectalk (same payloads)\n# export WA_URL=\"https:\/\/apis.vectalk.com.br\/api\"\n# export WA_TOKEN=\"your_vectalk_token\"<\/code><\/pre>\n\n\n\n<p>With these variables, the send endpoint is <code>$WA_URL\/messages<\/code> in both cases. Version <code>v27.0<\/code> is the one used in the current examples on <a href=\"https:\/\/developers.facebook.com\/docs\/whatsapp\/cloud-api\/guides\/send-messages\" target=\"_blank\" rel=\"noreferrer noopener\">Meta&#8217;s send messages page<\/a>. The temporary token from the dashboard expires quickly; for ongoing use, generate a <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-permanent-access-token\/\">permanent token with a system user<\/a>.<\/p>\n\n\n\n<p>About the recipient number: Meta accepts the number with <code>+<\/code> and the country code, and recommends including them. The Vectalk documentation describes the <code>to<\/code> field in E.164 format without the <code>+<\/code> (for example, <code>5511999999999<\/code>). Using digits only, with the country code, works on both.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Plain text<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -sS -X POST \"$WA_URL\/messages\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\n    \"messaging_product\": \"whatsapp\",\n    \"to\": \"'\"$TO\"'\",\n    \"type\": \"text\",\n    \"text\": { \"body\": \"Hi! Your order is out for delivery.\" }\n  }'<\/code><\/pre>\n\n\n\n<p>The body accepts up to 4,096 characters, according to <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/messages\/text-messages\" target=\"_blank\" rel=\"noreferrer noopener\">Meta&#8217;s text messages page<\/a>. Free-form text can only be sent inside the <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-24-hour-customer-service-window\/\">24-hour window<\/a> opened by the customer&#8217;s last message; outside it, Meta returns error <code>131047<\/code> and you need a template.<\/p>\n\n\n\n<p>The <code>'\"$TO\"'<\/code> trick closes the single quote, inserts the variable and reopens the quote. If you prefer, save the JSON to a file and use <code>-d @mensagem.json<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Text with link preview<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -sS -X POST \"$WA_URL\/messages\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\n    \"messaging_product\": \"whatsapp\",\n    \"to\": \"'\"$TO\"'\",\n    \"type\": \"text\",\n    \"text\": {\n      \"preview_url\": true,\n      \"body\": \"Track your order: https:\/\/exemplo.com.br\/pedido\/123\"\n    }\n  }'<\/code><\/pre>\n\n\n\n<p>With <code>preview_url: true<\/code>, WhatsApp shows a preview of the first URL in the text.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Reply quoting a message<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -sS -X POST \"$WA_URL\/messages\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\n    \"messaging_product\": \"whatsapp\",\n    \"to\": \"'\"$TO\"'\",\n    \"context\": { \"message_id\": \"wamid.HBgLNTUxMTk5OTk5OTk5ORUCABIYFjNFQjA...\" },\n    \"type\": \"text\",\n    \"text\": { \"body\": \"About this message: we have already sorted it out.\" }\n  }'<\/code><\/pre>\n\n\n\n<p><code>context.message_id<\/code> is the <code>wamid<\/code> of the message you want to quote. Details and limitations in <a href=\"https:\/\/vectalk.com.br\/blog\/en\/reply-to-specific-message-whatsapp-api\/\">how to reply to a specific message<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Template<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -sS -X POST \"$WA_URL\/messages\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\n    \"messaging_product\": \"whatsapp\",\n    \"to\": \"'\"$TO\"'\",\n    \"type\": \"template\",\n    \"template\": {\n      \"name\": \"confirmacao_pedido\",\n      \"language\": { \"code\": \"pt_BR\" },\n      \"components\": [{\n        \"type\": \"body\",\n        \"parameters\": [\n          { \"type\": \"text\", \"text\": \"Maria\" },\n          { \"type\": \"text\", \"text\": \"#4821\" }\n        ]\n      }]\n    }\n  }'<\/code><\/pre>\n\n\n\n<p>The template must be approved and exist in the language you specify; otherwise Meta returns <code>132001<\/code>. If the number of parameters does not match the template variables, the error is <code>132000<\/code>. Both are in <a href=\"https:\/\/developers.facebook.com\/docs\/whatsapp\/cloud-api\/support\/error-codes\" target=\"_blank\" rel=\"noreferrer noopener\">Meta&#8217;s error code list<\/a>. The structure of the <code>template<\/code> object follows the <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/templates\/overview\" target=\"_blank\" rel=\"noreferrer noopener\">templates overview<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Template with an image header and a dynamic URL button<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -sS -X POST \"$WA_URL\/messages\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\n    \"messaging_product\": \"whatsapp\",\n    \"to\": \"'\"$TO\"'\",\n    \"type\": \"template\",\n    \"template\": {\n      \"name\": \"pedido_enviado\",\n      \"language\": { \"code\": \"pt_BR\" },\n      \"components\": [\n        {\n          \"type\": \"header\",\n          \"parameters\": [\n            { \"type\": \"image\", \"image\": { \"link\": \"https:\/\/exemplo.com.br\/banner.jpg\" } }\n          ]\n        },\n        {\n          \"type\": \"body\",\n          \"parameters\": [{ \"type\": \"text\", \"text\": \"Maria\" }]\n        },\n        {\n          \"type\": \"button\",\n          \"sub_type\": \"url\",\n          \"index\": \"0\",\n          \"parameters\": [{ \"type\": \"text\", \"text\": \"4821\" }]\n        }\n      ]\n    }\n  }'<\/code><\/pre>\n\n\n\n<p>In the URL button, the parameter is only the variable suffix of the URL registered in the template. <code>index<\/code> is the button position, as a string. More details in <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-template-dynamic-url-button\/\">template with a dynamic URL button<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Media<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Image by link<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -sS -X POST \"$WA_URL\/messages\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\n    \"messaging_product\": \"whatsapp\",\n    \"to\": \"'\"$TO\"'\",\n    \"type\": \"image\",\n    \"image\": {\n      \"link\": \"https:\/\/exemplo.com.br\/produto.jpg\",\n      \"caption\": \"Your product has been set aside for you.\"\n    }\n  }'<\/code><\/pre>\n\n\n\n<p><a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/messages\/image-messages\" target=\"_blank\" rel=\"noreferrer noopener\">Meta&#8217;s image messages page<\/a> accepts JPEG, PNG and static WebP up to 5 MB, with a caption of up to 1,024 characters. It also advises against sending by link and recommends uploading the media first and sending it by <code>id<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Media upload and sending by id<\/h3>\n\n\n\n<p>On the Meta Cloud API, the MIME type goes along with the <code>file<\/code> field:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -sS -X POST \"$WA_URL\/media\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -F \"messaging_product=whatsapp\" \\\n  -F \"file=@produto.jpg;type=image\/jpeg\"\n# response: {\"id\":\"1037543291543636\"}<\/code><\/pre>\n\n\n\n<p>On Vectalk, the type goes in a separate <code>type<\/code> field, and the upload requires an instance token:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -sS -X POST \"https:\/\/apis.vectalk.com.br\/api\/media\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -F \"file=@produto.jpg\" \\\n  -F \"type=image\/jpeg\" \\\n  -F \"messaging_product=whatsapp\"<\/code><\/pre>\n\n\n\n<p>Then send it with the <code>id<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -sS -X POST \"$WA_URL\/messages\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\n    \"messaging_product\": \"whatsapp\",\n    \"to\": \"'\"$TO\"'\",\n    \"type\": \"image\",\n    \"image\": { \"id\": \"1037543291543636\", \"caption\": \"Your product has been set aside for you.\" }\n  }'<\/code><\/pre>\n\n\n\n<p>According to <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/business-phone-numbers\/media\" target=\"_blank\" rel=\"noreferrer noopener\">Meta&#8217;s media page<\/a>, media IDs obtained by upload are valid for 30 days. For recurring sends, upload once and reuse the <code>id<\/code> within that period.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Document with a file name<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -sS -X POST \"$WA_URL\/messages\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\n    \"messaging_product\": \"whatsapp\",\n    \"to\": \"'\"$TO\"'\",\n    \"type\": \"document\",\n    \"document\": {\n      \"link\": \"https:\/\/exemplo.com.br\/boletos\/4821.pdf\",\n      \"filename\": \"boleto-pedido-4821.pdf\",\n      \"caption\": \"Here is the payment slip for order #4821.\"\n    }\n  }'<\/code><\/pre>\n\n\n\n<p><code>filename<\/code> (with extension) is the name the customer sees. Documents can be up to 100 MB. (A <em>boleto<\/em> is a Brazilian bank payment slip, a common way to pay for orders in Brazil.) The full guide is in <a href=\"https:\/\/vectalk.com.br\/blog\/en\/send-pdf-document-whatsapp-api\/\">how to send PDFs and documents<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Audio and video<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\"># audio\ncurl -sS -X POST \"$WA_URL\/messages\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\"messaging_product\":\"whatsapp\",\"to\":\"'\"$TO\"'\",\"type\":\"audio\",\"audio\":{\"id\":\"AUDIO_ID\"}}'\n\n# video\ncurl -sS -X POST \"$WA_URL\/messages\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\"messaging_product\":\"whatsapp\",\"to\":\"'\"$TO\"'\",\"type\":\"video\",\"video\":{\"id\":\"VIDEO_ID\",\"caption\":\"See how to assemble it.\"}}'<\/code><\/pre>\n\n\n\n<p>Audio and video can be up to 16 MB; video in MP4 or 3GP, with H.264 and AAC.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Reply buttons<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -sS -X POST \"$WA_URL\/messages\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\n    \"messaging_product\": \"whatsapp\",\n    \"to\": \"'\"$TO\"'\",\n    \"type\": \"interactive\",\n    \"interactive\": {\n      \"type\": \"button\",\n      \"body\": { \"text\": \"Can you confirm your appointment tomorrow at 2 PM?\" },\n      \"footer\": { \"text\": \"Example Clinic\" },\n      \"action\": {\n        \"buttons\": [\n          { \"type\": \"reply\", \"reply\": { \"id\": \"confirmar\", \"title\": \"Confirm\" } },\n          { \"type\": \"reply\", \"reply\": { \"id\": \"remarcar\", \"title\": \"Reschedule\" } }\n        ]\n      }\n    }\n  }'<\/code><\/pre>\n\n\n\n<p>Up to 3 buttons, titles of up to 20 characters, a body of up to 1,024 and a footer of up to 60, according to <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/messages\/interactive-reply-buttons-messages\" target=\"_blank\" rel=\"noreferrer noopener\">Meta&#8217;s reply buttons page<\/a>. When the customer taps one, the webhook arrives with <code>interactive.button_reply.id<\/code>, which you use to decide the next step.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">List<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -sS -X POST \"$WA_URL\/messages\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\n    \"messaging_product\": \"whatsapp\",\n    \"to\": \"'\"$TO\"'\",\n    \"type\": \"interactive\",\n    \"interactive\": {\n      \"type\": \"list\",\n      \"body\": { \"text\": \"Choose the topic of your request:\" },\n      \"action\": {\n        \"button\": \"See options\",\n        \"sections\": [{\n          \"title\": \"Orders\",\n          \"rows\": [\n            { \"id\": \"rastreio\", \"title\": \"Track order\" },\n            { \"id\": \"troca\", \"title\": \"Exchange or return\", \"description\": \"Up to 7 days after delivery\" }\n          ]\n        }]\n      }\n    }\n  }'<\/code><\/pre>\n\n\n\n<p>The limits are on <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/messages\/interactive-list-messages\" target=\"_blank\" rel=\"noreferrer noopener\">Meta&#8217;s list messages page<\/a>: up to 10 sections and up to 10 rows across all of them, button text of up to 20 characters, row titles of up to 24 and descriptions of up to 72. The customer&#8217;s reply arrives in <code>interactive.list_reply.id<\/code>. Other interactive formats are covered in <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-interactive-messages-api\/\">interactive messages<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Mark as read and typing indicator<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -sS -X POST \"$WA_URL\/messages\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\n    \"messaging_product\": \"whatsapp\",\n    \"status\": \"read\",\n    \"message_id\": \"wamid.HBgLNTUxMTk5OTk5OTk5ORUCABIYFjNFQjA...\",\n    \"typing_indicator\": { \"type\": \"text\" }\n  }'<\/code><\/pre>\n\n\n\n<p>Without <code>typing_indicator<\/code>, the command only marks the message as read. With it, the customer also sees &#8220;typing&#8230;&#8221; until you reply or for up to 25 seconds, according to <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/typing-indicators\" target=\"_blank\" rel=\"noreferrer noopener\">Meta&#8217;s typing indicator page<\/a>. The success response is <code>{\"success\": true}<\/code>. More in <a href=\"https:\/\/vectalk.com.br\/blog\/en\/mark-message-as-read-whatsapp-api\/\">how to mark a message as read<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Reading the response and errors<\/h2>\n\n\n\n<p>An accepted send returns the <code>wamid<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-json\">{\n  \"messaging_product\": \"whatsapp\",\n  \"contacts\": [{ \"input\": \"5511999999999\", \"wa_id\": \"5511999999999\" }],\n  \"messages\": [{ \"id\": \"wamid.HBgLNTUxMTk5OTk5OTk5ORUCABIYFjNFQjA...\" }]\n}<\/code><\/pre>\n\n\n\n<p>This means the request was accepted, not that the message was delivered. Delivery comes later, through the <code>sent<\/code>, <code>delivered<\/code>, <code>read<\/code> or <code>failed<\/code> statuses on the webhook (see <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-message-status-webhook\/\">message status via webhook<\/a>).<\/p>\n\n\n\n<p>For scripts, two curl tweaks help:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\">curl -sS -X POST \"$WA_URL\/messages\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d @mensagem.json \\\n  -w '\\nHTTP %{http_code}\\n' | tee resposta.txt\n\n# just the wamid, with jq\njq -r '.messages[0].id' resposta.txt\n# just the error code and message\njq -r '.error | \"\\(.code) \\(.message)\"' resposta.txt<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Code<\/th><th>What it means<\/th><th>What to do<\/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<\/td><\/tr><tr><td><code>132000<\/code><\/td><td>Number of parameters does not match the template<\/td><td>Check the variables<\/td><\/tr><tr><td><code>132001<\/code><\/td><td>Template does not exist in that language or is not approved<\/td><td>Check name, language and status<\/td><\/tr><tr><td><code>131053<\/code><\/td><td>Media upload failed (unsupported type, wrong MIME)<\/td><td>Check format and type<\/td><\/tr><tr><td><code>130429<\/code><\/td><td>Throughput limit reached<\/td><td>Slow down and try again<\/td><\/tr><tr><td><code>190<\/code><\/td><td>Expired token<\/td><td>Generate a new token<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The full list 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\">Extra commands on Vectalk<\/h2>\n\n\n\n<p>Beyond sending, Vectalk documents useful routes for support scripts. All of them use <code>Authorization: Bearer<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"language-bash\"># list templates (instance token; optional filter by name)\ncurl -sS \"https:\/\/apis.vectalk.com.br\/api\/templates?name=confirmacao_pedido\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\"\n\n# list sent messages that failed in a period\ncurl -sS \"https:\/\/apis.vectalk.com.br\/api\/messages?status=failed&amp;direction=outbound&amp;from=2026-11-01&amp;to=2026-11-24\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\"\n\n# register a webhook\ncurl -sS -X POST \"https:\/\/apis.vectalk.com.br\/api\/webhooks\" \\\n  -H \"Authorization: Bearer $WA_TOKEN\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\"instance_id\":\"YOUR_INSTANCE_ID\",\"url\":\"https:\/\/meuapp.com.br\/whatsapp\/webhook\",\"name\":\"Production\"}'<\/code><\/pre>\n\n\n\n<p>The routes are documented in <a href=\"https:\/\/docs.vectalk.com.br\/api-reference\/templates\/list\">list templates<\/a>, <a href=\"https:\/\/docs.vectalk.com.br\/api-reference\/messages\/list\">list messages<\/a> and <a href=\"https:\/\/docs.vectalk.com.br\/concepts\/webhooks\">webhooks<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to do this with Vectalk<\/h2>\n\n\n\n<p>Vectalk is a proxy for the official WhatsApp Cloud API: the payloads in all the examples above are the same; only the URL and the token change. Create the token under <strong>Settings \u2192 API Tokens (Configura\u00e7\u00f5es \u2192 API Tokens)<\/strong> and send to <code>https:\/\/apis.vectalk.com.br\/api\/messages<\/code>, as shown in the <a href=\"https:\/\/docs.vectalk.com.br\/quickstart\">quickstart<\/a>. With an instance token, the <code>phone_number_id<\/code> is resolved automatically; with an organization token, include <code>\"phone_number_id\"<\/code> in the body, as described on the <a href=\"https:\/\/docs.vectalk.com.br\/authentication\">authentication page<\/a>. Media upload and templates require an instance token. To get started, <a href=\"https:\/\/apps.vectalk.com.br\/register\">create your account<\/a>. For the big picture of the API, see the guide to the <a href=\"https:\/\/vectalk.com.br\/blog\/en\/official-whatsapp-api\/\">official WhatsApp API<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Why does curl give me an invalid JSON error?<\/h3>\n\n\n\n<p>It is almost always the quotes. Inside <code>-d '...'<\/code> the message text cannot contain a single quote (as in &#8220;it&#8217;s&#8221;). In those cases, save the JSON to a file and use <code>-d @mensagem.json<\/code>. On Windows (cmd), the quoting rules are different; prefer the file there too.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">curl returned the wamid, but the message never arrived. What now?<\/h3>\n\n\n\n<p>The <code>wamid<\/code> only confirms that the request was accepted. Check the status on the webhook: if it comes back as <code>failed<\/code>, the error code tells you why. The full checklist is in <a href=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-message-not-delivered\/\">message sent but not delivered<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I send to several numbers in a single curl call?<\/h3>\n\n\n\n<p>No. Each call sends to one recipient (or one group). For lists, run a loop that controls the pace and use approved marketing templates with opt-in.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Do I need <code>Content-Type: application\/json<\/code>?<\/h3>\n\n\n\n<p>Yes, for sends with <code>-d<\/code>. For media uploads with <code>-F<\/code>, curl builds the <code>multipart\/form-data<\/code> on its own; do not set the header manually.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I test the webhook with curl?<\/h3>\n\n\n\n<p>Generate the signature with <code>openssl<\/code> and send a sample payload to your local URL. The step-by-step is in <a href=\"https:\/\/vectalk.com.br\/blog\/en\/test-whatsapp-webhook-locally\/\">test the webhook locally<\/a> and in <a href=\"https:\/\/vectalk.com.br\/blog\/en\/test-whatsapp-bot-automated-tests\/\">how to test a WhatsApp bot<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Official sources consulted on November 24, 2026:<\/strong> <a href=\"https:\/\/developers.facebook.com\/docs\/whatsapp\/cloud-api\/guides\/send-messages\" target=\"_blank\" rel=\"noreferrer noopener\">Meta: send messages<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/messages\/text-messages\" target=\"_blank\" rel=\"noreferrer noopener\">Meta: text messages<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/messages\/image-messages\" target=\"_blank\" rel=\"noreferrer noopener\">Meta: image messages<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/messages\/document-messages\" target=\"_blank\" rel=\"noreferrer noopener\">Meta: document messages<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/business-phone-numbers\/media\" target=\"_blank\" rel=\"noreferrer noopener\">Meta: media<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/messages\/interactive-reply-buttons-messages\" target=\"_blank\" rel=\"noreferrer noopener\">Meta: reply buttons<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/messages\/interactive-list-messages\" target=\"_blank\" rel=\"noreferrer noopener\">Meta: list messages<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/messages\/mark-message-as-read\" target=\"_blank\" rel=\"noreferrer noopener\">Meta: mark as read<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/typing-indicators\" target=\"_blank\" rel=\"noreferrer noopener\">Meta: typing indicator<\/a>, <a href=\"https:\/\/developers.facebook.com\/documentation\/business-messaging\/whatsapp\/templates\/overview\" target=\"_blank\" rel=\"noreferrer noopener\">Meta: templates<\/a>, <a href=\"https:\/\/developers.facebook.com\/docs\/whatsapp\/cloud-api\/support\/error-codes\" target=\"_blank\" rel=\"noreferrer noopener\">Meta: error codes<\/a>, <a href=\"https:\/\/docs.vectalk.com.br\/quickstart\">Vectalk: quickstart<\/a>, <a href=\"https:\/\/docs.vectalk.com.br\/authentication\">Vectalk: authentication<\/a>, <a href=\"https:\/\/docs.vectalk.com.br\/api-reference\/media\/upload\">Vectalk: media upload<\/a>, <a href=\"https:\/\/docs.vectalk.com.br\/api-reference\/templates\/list\">Vectalk: list templates<\/a>, <a href=\"https:\/\/docs.vectalk.com.br\/api-reference\/messages\/list\">Vectalk: list messages<\/a>, <a href=\"https:\/\/docs.vectalk.com.br\/concepts\/webhooks\">Vectalk: webhooks<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A cheat sheet of copy-and-paste curl commands: text, template, media, upload, buttons, list and read receipts, on the Meta Cloud API and on 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-2183","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>WhatsApp API curl: Ready-to-Use Examples | Vectalk<\/title>\n<meta name=\"description\" content=\"WhatsApp API curl examples: text, template, image, document, media upload, buttons, list and mark as read, on the Cloud API and on Vectalk.\" \/>\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\/whatsapp-api-curl-examples\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WhatsApp API curl: Ready-to-Use Examples | Vectalk\" \/>\n<meta property=\"og:description\" content=\"WhatsApp API curl examples: text, template, image, document, media upload, buttons, list and mark as read, on the Cloud API and on Vectalk.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-curl-examples\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog Vectalk\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-24T19:30:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-24T19:30:14+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=\"11 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\\\/whatsapp-api-curl-examples\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-api-curl-examples\\\/\"},\"author\":{\"name\":\"wanderleyfcunha\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/#\\\/schema\\\/person\\\/ff36ecd9d8257856f227f8e5d639db2b\"},\"headline\":\"WhatsApp API curl examples: text, templates, media and buttons\",\"datePublished\":\"2026-11-24T19:30:10+00:00\",\"dateModified\":\"2026-11-24T19:30:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-api-curl-examples\\\/\"},\"wordCount\":1229,\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-api-curl-examples\\\/\",\"url\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-api-curl-examples\\\/\",\"name\":\"WhatsApp API curl: Ready-to-Use Examples | Vectalk\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/#website\"},\"datePublished\":\"2026-11-24T19:30:10+00:00\",\"dateModified\":\"2026-11-24T19:30:14+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/#\\\/schema\\\/person\\\/ff36ecd9d8257856f227f8e5d639db2b\"},\"description\":\"WhatsApp API curl examples: text, template, image, document, media upload, buttons, list and mark as read, on the Cloud API and on Vectalk.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-api-curl-examples\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-api-curl-examples\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/en\\\/whatsapp-api-curl-examples\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vectalk.com.br\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WhatsApp API curl examples: text, templates, media and buttons\"}]},{\"@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":"WhatsApp API curl: Ready-to-Use Examples | Vectalk","description":"WhatsApp API curl examples: text, template, image, document, media upload, buttons, list and mark as read, on the Cloud API and on Vectalk.","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\/whatsapp-api-curl-examples\/","og_locale":"en_US","og_type":"article","og_title":"WhatsApp API curl: Ready-to-Use Examples | Vectalk","og_description":"WhatsApp API curl examples: text, template, image, document, media upload, buttons, list and mark as read, on the Cloud API and on Vectalk.","og_url":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-curl-examples\/","og_site_name":"Blog Vectalk","article_published_time":"2026-11-24T19:30:10+00:00","article_modified_time":"2026-11-24T19:30:14+00:00","author":"wanderleyfcunha","twitter_card":"summary_large_image","twitter_misc":{"Written by":"wanderleyfcunha","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-curl-examples\/#article","isPartOf":{"@id":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-curl-examples\/"},"author":{"name":"wanderleyfcunha","@id":"https:\/\/vectalk.com.br\/blog\/#\/schema\/person\/ff36ecd9d8257856f227f8e5d639db2b"},"headline":"WhatsApp API curl examples: text, templates, media and buttons","datePublished":"2026-11-24T19:30:10+00:00","dateModified":"2026-11-24T19:30:14+00:00","mainEntityOfPage":{"@id":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-curl-examples\/"},"wordCount":1229,"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-curl-examples\/","url":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-curl-examples\/","name":"WhatsApp API curl: Ready-to-Use Examples | Vectalk","isPartOf":{"@id":"https:\/\/vectalk.com.br\/blog\/#website"},"datePublished":"2026-11-24T19:30:10+00:00","dateModified":"2026-11-24T19:30:14+00:00","author":{"@id":"https:\/\/vectalk.com.br\/blog\/#\/schema\/person\/ff36ecd9d8257856f227f8e5d639db2b"},"description":"WhatsApp API curl examples: text, template, image, document, media upload, buttons, list and mark as read, on the Cloud API and on Vectalk.","breadcrumb":{"@id":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-curl-examples\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-curl-examples\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vectalk.com.br\/blog\/en\/whatsapp-api-curl-examples\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vectalk.com.br\/blog\/"},{"@type":"ListItem","position":2,"name":"WhatsApp API curl examples: text, templates, media and buttons"}]},{"@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\/2183","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=2183"}],"version-history":[{"count":1,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/posts\/2183\/revisions"}],"predecessor-version":[{"id":2186,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/posts\/2183\/revisions\/2186"}],"wp:attachment":[{"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/media?parent=2183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/categories?post=2183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vectalk.com.br\/blog\/wp-json\/wp\/v2\/tags?post=2183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}