WhatsApp Business
The robomotion whatsapp CLI connects to the WhatsApp Business API for messaging operations. It sends text messages, images, documents, and template messages; manages contacts; and handles interactive message types.
When to use
- Send text, image, document, or video messages via WhatsApp
- Send template messages for notifications and alerts
- Manage contacts and conversation threads
Prerequisites
robomotionCLI installed- Package installed:
robomotion install whatsapp - WhatsApp Business API credentials configured via Robomotion vault
IMPORTANT: Session Mode Required for Multi-Step Operations
Each CLI command runs as a separate process — connection IDs from connect do NOT persist across calls.
You MUST use --session on connect and pass --session-id to all subsequent commands.
Workflow
- Install (once):
robomotion install whatsapp - Connect with session:
robomotion whatsapp connect --session --output json # → {"outClientId":"<client-id>","session_id":"<session-id>"} - Use the returned
client-idandsession-idin all subsequent commands:robomotion whatsapp send_message --client-id "<client-id>" --to <phone> --text <text> --session-id "<session-id>" --output json - Disconnect when done:
robomotion whatsapp disconnect --client-id "<client-id>" --session-id "<session-id>" --output json
Always append --output json to get structured JSON results.
Commands Reference
robomotion whatsapp receive_events --127-0-0-1 --3000 [--/webhook] [--verify-token] --output jsonReceive incoming WhatsApp messages via webhookrobomotion whatsapp send_text_message --phone-number-id --to-phone-number --message-text [--21-0] --output jsonSend a text message via WhatsApp Business Cloud APIrobomotion whatsapp send_template_message --phone-number-id --to-phone-number --template-name --template-params [--21-0] [--en-us] [--none] [--header-value] [--button-params] --output jsonSend an approved template message via WhatsApp Business Cloud APIrobomotion whatsapp send_image_message --phone-number-id --to-phone-number --image-url [--21-0] [--caption] --output jsonSend an image via WhatsApp Business Cloud APIrobomotion whatsapp send_video_message --phone-number-id --to-phone-number --video-url [--21-0] [--caption] --output jsonSend a video via WhatsApp Business Cloud APIrobomotion whatsapp send_document_message --phone-number-id --to-phone-number --document-url [--21-0] [--caption] [--filename] --output jsonSend a document via WhatsApp Business Cloud APIrobomotion whatsapp send_audio_message --phone-number-id --to-phone-number --audio-url [--21-0] --output jsonSend an audio file via WhatsApp Business Cloud APIrobomotion whatsapp send_location_message --phone-number-id --to-phone-number --latitude --longitude [--21-0] [--location-name] [--address] --output jsonSend a location via WhatsApp Business Cloud APIrobomotion whatsapp send_contact_message --phone-number-id --to-phone-number --contacts [--21-0] --output jsonSend contact information via WhatsApp Business Cloud APIrobomotion whatsapp send_reply_buttons --phone-number-id --to-phone-number --body-text --buttons [--21-0] [--header-text] [--footer-text] --output jsonSend interactive reply buttons via WhatsApp Business Cloud APIrobomotion whatsapp send_list_message --phone-number-id --to-phone-number --body-text --button-text --sections [--21-0] [--header-text] [--footer-text] --output jsonSend an interactive list message via WhatsApp Business Cloud APIrobomotion whatsapp mark_as_read --phone-number-id --message-id [--21-0] --output jsonMark a WhatsApp message as readrobomotion whatsapp get_media_url --media-id [--21-0] --output jsonGet the download URL for a WhatsApp media filerobomotion whatsapp upload_media --phone-number-id --file-path --mime-type [--21-0] --output jsonUpload a media file to WhatsApp servers
Environment
- ROBOMOTION_API_TOKEN (if vault credentials are needed)