communication
WhatsApp Business CLI for Headless Automation
Use the WhatsApp Business CLI for headless automation with headless JSON commands, schema discovery, credentials, and permission controls.
6 functions 4 read 2 write Bearer token auth
WhatsApp Business CLI for Headless Automation
Use KosmoKrator as a non-interactive integration runtime for local automations and wrappers.
Use headless automation when another tool needs a stable local command surface. The WhatsApp Business CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# WhatsApp Business CLI for Headless Automation
kosmokrator integrations:configure whatsapp --set access_token="$WHATSAPP_ACCESS_TOKEN" --set phone_number_id="$WHATSAPP_PHONE_NUMBER_ID" --enable --read allow --write ask --json
kosmo integrations:call whatsapp.whatsapp_send_message '{"to":"example_to","body":"example_body","preview_url":true}' --json Discovery Before Execution
Agents and scripts can inspect WhatsApp Business docs and schemas before choosing a function.
kosmo integrations:docs whatsapp --json
kosmo integrations:docs whatsapp.whatsapp_send_message --json
kosmo integrations:schema whatsapp.whatsapp_send_message --json
kosmo integrations:search "WhatsApp Business" --json
kosmo integrations:list --json Useful WhatsApp Business CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
whatsapp.whatsapp_send_message | Write | to, body, preview_url | Send a text message to a WhatsApp recipient. Use this for replying within an existing 24-hour customer service window. For new conversations, use the send_template tool instead. |
whatsapp.whatsapp_get_message | Read | message_id | Retrieve a specific WhatsApp message by its ID. Returns the message content, status (sent, delivered, read), and timestamps. |
whatsapp.whatsapp_list_templates | Read | limit, after | List approved WhatsApp message templates. Templates are required to initiate new conversations outside the 24-hour service window. |
whatsapp.whatsapp_list_contacts | Read | limit, after | List WhatsApp contacts for the business phone number. Returns WhatsApp IDs and profile names. |
whatsapp.whatsapp_send_template | Write | to, template_name, language, components | Send a template-based WhatsApp message. Use this to initiate new conversations outside the 24-hour window. The template must be pre-approved in the WhatsApp Business Manager. |
whatsapp.whatsapp_get_current_user | Read | none | Get the authenticated WhatsApp Business user info — name, email, and business ID. Useful for verifying which account is connected. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.