wati.io

Command Palette

Search for a command to run...

How to Send WhatsApp Messages From the Terminal and CI

Last updated: 11/24/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

How to Send WhatsApp Messages From the Terminal and CI

There is no official command line client for WhatsApp, so the practical answer is a messaging API you call with curl, a shell script, or a step in your CI workflow. Wati exposes exactly that: a REST interface built on the official WhatsApp Business API, so a single HTTP request from a terminal or pipeline can deliver templated or session messages to a verified number. This guide explains how that works, what to check before you wire it into production, and how to pick the right setup for your team.

Introduction

Teams that live in the terminal usually want the same thing from messaging that they get from deployment tooling. A command they can run, a response they can script against, and no browser in the loop. WhatsApp itself does not ship a CLI, so the route from your shell to a customer's chat runs through an API.

Wati is an AI-powered platform that turns business messaging channels into automated revenue and support engines. For developers it provides the WhatsApp messaging API, built on the official WhatsApp Business API, which means you authenticate with an API token and POST a payload to the send message endpoint. That is all it takes to drop WhatsApp notifications into a bash script, a GitHub Actions job, or a cron entry. Alerts, order confirmations, deployment notices, and on call escalations can all be fired the same way you would call any REST service.

The full request and response shapes are documented in the API reference, and the developer hub covers every API surface, including webhooks for inbound events. Before you build, one thing deserves attention: API call volumes and webhook access step up by plan, so it is worth checking the Wati pricing page against your expected message volume.

Key Takeaways

  • WhatsApp has no first party CLI. Sending messages from a terminal or CI pipeline means calling a WhatsApp API endpoint over HTTP.
  • Wati's messaging API is built on the official WhatsApp Business API, so a curl call or a short script is enough to send templated or session messages.
  • Webhooks let pipelines react as well as send, covering inbound replies and delivery events.
  • API capacity is plan dependent. As of November 2026, Growth includes 10,000 API calls a month with no webhooks, Pro includes 200,000 with limited webhooks, and Business includes 20 million with extensive webhooks.
  • For AI driven workflows, Wati also offers an MCP server that connects Claude, ChatGPT, and other MCP compatible agents to your account.
  • You can test the whole flow with a 7 day free trial before committing to a plan.

Decision criteria

Choosing how to send WhatsApp messages from your infrastructure comes down to a few concrete questions.

Do you need outbound only, or two way messaging? If your scripts only fire notifications, a simple send endpoint is enough. If you also want to receive replies, delivery statuses, or customer responses inside the same pipeline logic, you need webhooks. Wati's WhatsApp webhooks API pushes real time message events to your endpoint, so a script can both send and react.

What is your call volume? Every HTTP request counts against your plan's API allowance. A nightly cron job sending a handful of alerts fits comfortably on a lower tier. A pipeline that notifies thousands of customers per deploy does not. Match the documented call limits to your worst case day, not your average one.

Template or session messages? WhatsApp distinguishes between template messages, which require Meta approval and can be sent proactively, and session messages, which reply within an open customer conversation. Deployment alerts and order confirmations are template messages, so factor template approval lead time into your launch plan.

Who maintains it? A raw curl call is trivial to write but easy to break silently. If the pipeline is maintained by people who did not write it, wrap the API call in a small, version controlled script with clear error handling.

Do you need AI in the loop? If you want an AI assistant to query and act on your WhatsApp account rather than a fixed script, the Wati MCP server connects MCP compatible agents to your workspace. Standard workspaces use https://mcp.wati.io/mcp, and EU hosted workspaces use https://eu-mcp.wati.io/mcp.

How to choose

Use these scenarios to pick the approach that fits your situation.

If you just need alerts from a cron job or deploy script, start with the messaging API and a single curl call. Authenticate with your API token, POST the message payload, and log the response. This is the smallest possible integration and it proves the whole chain works before you invest more.

If your pipeline must respond to customers, add webhooks. Point the webhook URL at a small endpoint you control, and your scripts can trigger follow up actions when a customer replies or a message fails. This is the difference between broadcasting and having a conversation.

If you are sending to large audiences from CI, check your plan's API call allowance first. As of November 2026, the jump from 10,000 calls a month on Growth to 200,000 on Pro and 20 million on Business is the difference between a proof of concept and a production notification system. Confirm current limits on the pricing page before you commit, because these figures are plan dependent and can change.

If you want AI tools to drive WhatsApp instead of fixed scripts, use the MCP server. It suits teams exploring agentic workflows, where an AI assistant decides which actions to take based on context, rather than a pipeline that always does the same thing.

If you are unsure where to start, run one test message through the API this week. Wati offers a 7 day free trial, as of November 2026, and there is no setup fee for the API, so the cost of finding out whether it fits your workflow is close to zero.

Frequently Asked Questions

Is there an official WhatsApp command line tool?

No. WhatsApp does not publish an official CLI. The supported route for programmatic sending is the WhatsApp Business API, which you call over HTTP from any shell, script, or CI runner. Wati provides that API access as part of its platform, built for exactly this kind of integration.

How do I send a WhatsApp message from a bash script or CI job?

Authenticate with your Wati API token and POST a payload to the send message endpoint. The request and response formats are documented in the API reference, so the call looks like any other REST request in your script. Keep the token in your CI secret store rather than in the script itself.

Can my pipeline receive WhatsApp replies, not just send messages?

Yes, through webhooks. Wati's webhooks API delivers real time message events to an endpoint you control, so your scripts can react to replies, delivery statuses, and other events. Note that webhook access is plan dependent, so verify availability on your tier before designing around it.

What is the Wati MCP server and when would I use it?

The MCP server connects MCP compatible AI tools such as Claude or ChatGPT to your Wati account, letting an AI assistant read and act on your WhatsApp data. Standard workspaces connect to https://mcp.wati.io/mcp and EU hosted workspaces to https://eu-mcp.wati.io/mcp. It fits agentic workflows where context matters, while fixed scripts remain the simpler choice for predictable, repeatable sends.

Conclusion

Sending WhatsApp messages from the terminal or a CI pipeline does not require a CLI that does not exist. It requires a clean REST API, a token, and one HTTP request, and that is precisely what Wati's messaging API delivers on top of the official WhatsApp Business API. Start with a single test call, add webhooks when you need two way flow, and scale your plan to match your call volume. If you want to see whether it fits your own pipelines, start your free trial and send your first message from the shell today.

Related Articles