### Run WAHA with Apps Enabled Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/apps/mcp/index.md Run WAHA with Apps enabled and mount the sessions folder. This is the minimum setup to get started; see the Install & Update guide for production configuration. ```bash docker run -it \ -e WAHA_APPS_ENABLED=True \ -e WAHA_API_KEY=yoursecretkey \ -v ./sessions:/app/.sessions \ -p 3000:3000 \ devlikeapro/waha ``` -------------------------------- ### Metadata example Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/events/index.md Shows how to include metadata in the session start request. The same metadata is echoed back in the webhook payload. ```jsonc { "event": "message", "session": "default", // 'metadata' provided when you created the session "metadata": { "user.id": "123", "user.email": "email@example.com" }, ... } ``` -------------------------------- ### Run WAHA with Docker (development) Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/install/index.md The basic docker run command from the Quick Start guide. This is suitable for development purposes only, not for production. ```bash docker run ... devlikeapro/waha ``` -------------------------------- ### Install Docker Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/apps-chatwoot-1-install/index.md Installs Docker and docker-compose-plugin on Ubuntu/Debian. Run as root or with sudo. ```bash # example in ubuntu apt-get update apt-get upgrade curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh apt install docker-compose-plugin ``` -------------------------------- ### Install EasyPanel Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/waha-on-easypanel/index.md Install EasyPanel on a fresh Linux server using this one-line curl command. ```bash curl -sSL https://get.easypanel.io | sh ``` -------------------------------- ### Install Nginx Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/apps-chatwoot-3-https/index.md Installs Nginx on the server to serve as a reverse proxy for Chatwoot. ```bash sudo apt-get install nginx ``` -------------------------------- ### Install WAHA dependencies Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/development/index.md Installs dependencies for the WAHA main repository. Run this after cloning the repositories. ```bash cd ~/devlikeapro/waha yarn install ``` -------------------------------- ### Start Pull Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/apps-chatwoot-5-messages/index.md Starts a new history import from WhatsApp into ChatWoot. ```bash wa/messages pull ``` -------------------------------- ### Docker Compose: mount script and wrap entrypoint to auto-update WhatsApp Web Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/engines/noweb/-env-config.md Docker Compose setup that mounts the fetch-wa-version.js script and overrides the entrypoint to resolve the WAHA_NOWEB_WA_VERSION variable once per container start, falling back to the built-in version if the script fails. No image build is required. ```yaml services: waha: image: devlikeapro/waha volumes: - ./fetch-wa-version.js:/fetch-wa-version.js:ro entrypoint: - /usr/bin/tini - -- - /bin/sh - -c - | export WAHA_NOWEB_WA_VERSION="$${WAHA_NOWEB_WA_VERSION:-$$(node /fetch-wa-version.js)}" exec /entrypoint.sh ``` -------------------------------- ### Run WhatsApp Echo Bot Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/integrations/waha+python/index.md Commands to clone the repository, install dependencies, and run the Flask echo bot. After starting, open http://127.0.0.1:5000/bot to see 'WhatsApp Echo Bot is ready!'. ```bash # Clone the git repository with example git clone https://github.com/devlikeapro/waha.git # Open python example folder cd waha/examples/python # Install requirements python -mpip install -r requirements.txt # Run the bot FLASK_APP=whatsapp_echo_bot.py flask run ``` -------------------------------- ### Start session with POST /api/sessions/{session}/start Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/sessions/index.md Starts a session. This is an idempotent operation; it will start the session only if it is not already running. ```http POST /api/sessions/{session}/start ``` -------------------------------- ### Set environment and start WAHA Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/development/index.md Sets environment variables and starts WAHA locally. The default engine is NOWEB; other options are WEBJS, WPP, and GOWS. After starting, open the dashboard at http://localhost:3000/dashboard and Swagger at http://localhost:3000/. ```bash export DEBUG=1 export WAHA_DEBUG_MODE=True export WAHA_API_KEY=666 export WAHA_DASHBOARD_USERNAME=admin export WAHA_DASHBOARD_PASSWORD=666 export WHATSAPP_SWAGGER_USERNAME=admin export WHATSAPP_SWAGGER_PASSWORD=666 export WHATSAPP_DEFAULT_ENGINE=NOWEB # WEBJS | NOWEB | WPP | GOWS export WAHA_HTTP_STRICT_MODE=1 export WAHA_MEDIA_STORAGE=LOCAL export WHATSAPP_FILES_FOLDER=./.media yarn start ``` -------------------------------- ### content example Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/apps/chatwoot/index.md Example of the `content` variable value, showing a text string with Markdown formatting. ```json "Here's the *bold* text" ``` -------------------------------- ### reply_to field example Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/send-messages/index.md Shows how to add the reply_to field to a request to reply to a specific message. The field is available in all messages. ```json { "chatId": "11111111111@c.us", ... "reply_to": "false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA" } ``` -------------------------------- ### Send Link Custom Preview - Body Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/send-messages/index.md Example request body for the custom link preview API. It specifies the session, chat, text, and custom preview metadata including title, description, and image URL. ```jsonc { "session": "default", "chatId": "11111111111@c.us", "text": "Check this out! https://github.com/", "linkPreviewHighQuality": true, "preview": { "url": "https://github.com/", "title": "Your Title", "description": "Check this out, this is a custom link preview!", "image": { "url": "https://github.com/devlikeapro/waha/raw/core/examples/waha.jpg" } } } ``` -------------------------------- ### Send Buttons - JSON Payload Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/send-messages/index.md Example JSON payload for sending an interactive button message. Includes chatId, header, body, footer, and an array of button objects with types like reply, call, copy, and url. ```json { "chatId": "11111111111@c.us", "header": "How are you?", "headerImage": { "mimetype": "image/jpeg", "filename": "filename.jpg", "url": "https://github.com/devlikeapro/waha/raw/core/examples/waha.jpg" }, "body": "Tell us how are you please 🙏", "footer": "If you have any questions, please send it in the chat", "buttons": [ { "type": "reply", "text": "I am good!" }, { "type": "call", "text": "Call us", "phoneNumber": "+1234567890" }, { "type": "copy", "text": "Copy code", "copyCode": "4321" }, { "type": "url", "text": "How did you do that?", "url": "https://waha.devlike.pro" } ], "session": "default" } ``` -------------------------------- ### Common request fields example Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/send-messages/index.md Shows the common fields used in most WAHA requests: session, chatId, and file. The session field defaults to 'default', chatId is a phone number or group identifier, and file is used for media. ```json { "session": "default", "chatId": "12132132130@c.us", "file": "..." } ``` -------------------------------- ### Serve dashboard build from WAHA Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/development/index.md Build the dashboard and copy it into the WAHA dashboard folders using make dev. ```bash cd ~/devlikeapro/waha-hub/ui make dev # build + copy into the WAHA dashboard folders ``` -------------------------------- ### Install and Configure Nginx as Frontend Proxy Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/waha-on-docker/index.md Install Nginx and create a configuration file for your domain or IP. Replace with your actual domain (lowercase) in the filename and content. ```bash sudo apt-get install nginx cd /etc/nginx/sites-enabled nano .conf ``` -------------------------------- ### Session Me - JavaScript Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/sessions/api-session-me.md JavaScript example using axios to make the GET request. Requires axios to be installed. ```javascript const axios = require('axios'); const url = "http://localhost:3000/api/sessions/default/me"; const headers = { 'X-Api-Key': 'yoursecretkey', 'Accept': 'application/json', }; axios.get(url, { headers }) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` -------------------------------- ### Run documentation dev server Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/development/index.md Install dependencies and run the docs dev server on http://localhost:1313. ```bash cd ~/devlikeapro/waha-docs npm install npm run dev # http://localhost:1313 ``` -------------------------------- ### Get server status: JSON response Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/waha-2024-9/index.md Example JSON response from the server status endpoint, showing the start timestamp and uptime in milliseconds. ```json { "startTimestamp": 1723788847247, "uptime": 3600000 } ``` -------------------------------- ### Run init-waha to generate .env Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/waha-on-docker/index.md Generates a .env file with credentials using the init-waha command. ```bash docker compose run --no-deps -v "$(pwd)":/app/env waha init-waha /app/env ``` -------------------------------- ### Get server version: GET /api/server/version Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/observability/index.md Returns the version of the installed docker image. The response includes version, engine, tier, and browser fields. ```http GET /api/server/version ``` ```json { "version": "2024.2.3", "engine": "NOWEB", "tier": "CORE", "browser": "/usr/bin/google-chrome-stable" } ``` -------------------------------- ### GET /api/server/status Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/waha-2024-9/index.md Returns the server status, start timestamp, and uptime. ```APIDOC ## GET /api/server/status ### Description Returns the server status, start timestamp, and uptime. ### Method GET ### Endpoint /api/server/status ### Parameters No parameters. ### Response #### Success Response (200) - **startTimestamp** (number) - Timestamp when the server started. - **uptime** (number) - Uptime in milliseconds. #### Response Example { "startTimestamp": 1723788847247, "uptime": 3600000 } ``` -------------------------------- ### Get labels API response Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/waha-2024-8/index.md Example JSON response from the Get labels API, showing an array of label objects with id, name, color, and colorHex. ```json [ { "id": "1", "name": "New Client", "color": 1, "colorHex": "#64c4ff" }, ... ] ``` -------------------------------- ### Get all contacts - Response Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/contacts/index.md Example response for the get all contacts endpoint. Contains contact details such as id, number, name, and flags like isMe, isGroup, and isBlocked. ```jsonc [ { "id": "11231231231@c.us", "number": "11231231231", "name": "Contact Name", "pushname": "Pushname", "shortName": "Shortname", "isMe": true, "isGroup": false, "isWAContact": true, "isMyContact": true, "isBlocked": false } ] ``` -------------------------------- ### Install Certbot and Obtain Let's Encrypt Certificate Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/waha-on-docker/index.md Install Certbot and the Nginx plugin, create the webroot directory, and run certbot with webroot authentication. Replace with your actual domain. ```bash apt install certbot apt-get install python3-certbot-nginx mkdir -p /var/www/ssl-proof/waha/.well-known certbot --webroot -w /var/www/ssl-proof/waha/ -d -i nginx ``` -------------------------------- ### Full options example for contacts pull Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/apps-chatwoot-6-contacts/index.md Shows every available flag for `contacts pull` with example values. Adjust numbers to match your environment; use `wa/contacts help` for latest options. ```bash wa/contacts pull --avatar if-missing --groups --lids --no-attributes --batch 50 --progress 50 --delay-contact 250ms --delay-batch 2s --attempts 8 --timeout 15m ``` -------------------------------- ### Get chat presence - Response Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/presence/index.md Example response for the 'GET /api/{session}/presence/{chatId}' endpoint. Shows the presence information for a chat, including participant, last known presence, and last seen timestamp. ```jsonc [ { "id": "2132132130@c.us", "presences": [ { "participant": "2132132130@c.us", "lastKnownPresence": "online", "lastSeen": null } ] }, { "id": "11111111111111111111111@g.us", "presences": [ { "participant": "11111111111111111111111@g.us", "lastKnownPresence": "online", "lastSeen": null }, { "participant": "2132132130@c.us", "lastKnownPresence": "offline", "lastSeen": 1686719326 } ] } ] ``` -------------------------------- ### Run WAHA with local GOWS binary Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/development/index.md Point WAHA at the GOWS binary you just built by setting environment variables and starting WAHA with the GOWS engine. ```bash export WAHA_GOWS_PATH=../gows/bin/gows export WAHA_GOWS_SOCKET=/tmp/gows.sock WHATSAPP_DEFAULT_ENGINE=GOWS yarn start ``` -------------------------------- ### Run docker compose up Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/waha-n8n/index.md Starts the n8n and WAHA containers. Includes commented command to run in background. ```bash docker compose up # to run in background: # docker compose up -d ``` -------------------------------- ### message.ack event payload Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/receive-messages/index.md Example payload for the 'message.ack' event, triggered when the server or recipient gets, reads, or plays the message. ```jsonc { "event": "message.ack", "session": "default", "payload": {} } ``` -------------------------------- ### Get chat picture response Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/chats/index.md Example response containing the picture URL. The `url` field can be `null` if the chat has no picture. ```jsonc { "url": "https://example.com/picture.jpg" } ``` -------------------------------- ### Get server status: HTTP request Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/waha-2024-9/index.md HTTP request to retrieve the server status, including start timestamp and uptime. ```http request GET /api/server/status ``` -------------------------------- ### curl - Get messages with query parameters Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/receive-messages/index.md Example curl command to fetch messages from the history. It uses the same parameters as the 'Get messages from chat' endpoint, including chatId, limit, and session. Note the recommendation to use Events via Webhooks or Websockets to avoid performance issues. ```bash curl -X 'GET' \ 'http://localhost:3000/api/messages?chatId=11111111111%40c.us&limit=1000&session=default' \ -H 'Accept: application/json' ``` -------------------------------- ### Start MongoDB server with Docker Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/storages/index.md Starts a MongoDB container with a persistent volume. Use this before running WAHA with MongoDB storage. ```bash docker run -d -p 27017:27017 --name mongodb -v mongo-data:/data/db mongo ``` -------------------------------- ### Install Coolify Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/waha-on-coolify/index.md Run this command on a clean Ubuntu or Linux-based server with a public IP to install self-hosted Coolify. Requires at least 2 CPU and 2 GB RAM. ```bash curl -fsSL https://cdn.coollabs.io/coolify/install.sh | sudo bash ``` -------------------------------- ### Start Session API - cURL, Python, JavaScript, PHP Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/sessions/api-session-start.md Start a WhatsApp session using the WAHA API endpoint /api/sessions/default/start. The examples show how to send a POST request with the required X-Api-Key header in cURL, Python, JavaScript, and PHP. Replace 'yoursecretkey' with your actual API key. ```bash curl -X 'POST' \ 'http://localhost:3000/api/sessions/default/start' \ -H 'X-Api-Key: yoursecretkey' -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ ``` ```python import requests url = "http://localhost:3000/api/sessions/default/start" headers = { "X-Api-Key": "yoursecretkey", "Content-Type": "application/json", } response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript const axios = require('axios'); const url = "http://localhost:3000/api/sessions/default/start"; const headers = { 'X-Api-Key': 'yoursecretkey', 'Content-Type': 'application/json', }; axios.post(url, {}, { headers }) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` ```php ``` -------------------------------- ### List WhatsApp Channels via HTTP API Source: https://github.com/devlikeapro/waha-docs/blob/main/layouts/index.html Example request to list WhatsApp Channels using the WAHA HTTP API. The request is a GET to the /channels endpoint. ```http GET /api/channels ``` -------------------------------- ### Run WPP with Docker Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/engines/wpp/index.md Starts the WPP engine using Docker, mounting the current directory's .sessions folder and setting the WHATSAPP_DEFAULT_ENGINE environment variable to WPP. ```bash docker run -v `pwd`/.sessions:/app/.sessions -e "WHATSAPP_DEFAULT_ENGINE=WPP" devlikeapro/waha ``` -------------------------------- ### Build and link NOWEB engine Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/development/index.md NOWEB is TypeScript and must be built before WAHA can use it. Install dependencies, build to emit lib/, then link and start WAHA with the NOWEB engine. ```bash cd ~/devlikeapro/noweb yarn install && yarn build # emits lib/ cd ~/devlikeapro/waha yarn link ../noweb WHATSAPP_DEFAULT_ENGINE=NOWEB yarn start ``` -------------------------------- ### event.response.failed event payload Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/event-message/events-event-response-failed.md Example payload of the event.response.failed event. The eventResponse field is null, indicating that the response could not be decrypted. Resend the event message to get a new response. ```jsonc { "id": "evt_00000000000000000000001", "session": "default", "event": "event.response.failed", "payload": { "id": "false_11111111111111111@c.us_58BBBBBBBBBBBBBBBBBBBBBBBB", "timestamp": 1747707858, "from": "11111111111111111@c.us", "participant": null, "fromMe": false, "eventCreationKey": { "id": "false_999999999999@c.us_3EBAAAAAAAAAAAAAAAAAAAAAAAAAA", "to": "me", "from": "999999999999@c.us", "fromMe": false }, "eventResponse": null, // <=== eventResponse will be null in that case "source": "app", "ack": null, "ackName": "UNKNOWN", "replyTo": null, "_data": {...}, } } ``` -------------------------------- ### Session Config with markOnline and store placeholder Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/engines/noweb/index.md Example session configuration for NOWEB showing the markOnline setting (default true) and a placeholder for store configuration. markOnline sends online presence when the session starts. ```json { "name": "default", "config": { "noweb": { "markOnline": false, "store": { ... } } } } ``` -------------------------------- ### Run GOWS with Docker Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/engines/gows/index.md Starts a GOWS container, mounting the local .sessions directory and setting the WHATSAPP_DEFAULT_ENGINE environment variable to GOWS. ```bash docker run -v `pwd`/.sessions:/app/.sessions -e "WHATSAPP_DEFAULT_ENGINE=GOWS" devlikeapro/waha ``` -------------------------------- ### Manual Pause Example Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/apps-chatwoot-5-messages/index.md Pauses queues before pulling large history and restarts them after. Affects all sessions on the same WAHA worker and Redis. If --pause fails, you must manually restart queues with wa/queue start. ```bash # # Send below commands ONE BY ONE # wa/queue stop wa/queue status wa/messages pull 1y --rc wa/queue start wa/queue status ``` -------------------------------- ### POST /api/sessions/start Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/sessions/index.md Starts a new session, creating or updating it as needed. ```APIDOC ## POST /api/sessions/start ### Description Creates (if not exists), updates (if existed before), and starts a new session. Accepts the same configuration as the Create and Update session APIs. ### Method POST ### Endpoint /api/sessions/start ### Parameters #### Request Body - **name** (string) - Required - The session name. - **config** (object) - Optional - Session configuration, including webhooks. - **webhooks** (array) - Optional - List of webhook configurations. - **url** (string) - Required - Webhook URL. - **events** (array of string) - Required - Events to subscribe to (e.g., "message"). ### Request Example { "name": "default", "config": { "webhooks": [ { "url": "https://webhook.site/11111111-1111-1111-1111-11111111", "events": [ "message" ] } ] } } ### Response #### Success Response (200) No response body documented. ``` -------------------------------- ### Command Help Source: https://github.com/devlikeapro/waha-docs/blob/main/content/blog/apps-chatwoot-5-messages/index.md Prints the full list of options for the wa/messages command. ```bash wa/messages help ``` -------------------------------- ### Run WhatsApp Download Files Bot Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/integrations/waha+python/index.md Commands to clone the repository, install dependencies, and run the Flask download files bot. After starting, open http://127.0.0.1:5000/bot to see 'WhatsApp Download Files Bot!'. ```bash # Clone the git repository with example git clone https://github.com/devlikeapro/waha.git # Open python example folder cd waha/examples/python # Install requirements python -mpip install -r requirements.txt # Run the bot FLASK_APP=whatsapp_download_files_bot.py flask run ``` -------------------------------- ### Build GOWS binary Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/development/index.md Build the GOWS Go binary from the WAHA folder. The make target runs `make all` in ../gows and outputs to ../gows/bin/gows. ```bash cd ~/devlikeapro/waha make gows # runs `make all` in ../gows -> ../gows/bin/gows ``` -------------------------------- ### Channel list response Source: https://github.com/devlikeapro/waha-docs/blob/main/content/docs/how-to/channels/index.md Example JSON response for the GET /api/{session}/channels endpoint. Shows channel objects with fields like id, name, description, invite, preview, picture, verified, and role. ```json [ { "id": "111111111111111111@newsletter", "name": "Channel - Owner - Picture", "description": "Hi there, I'm new here", "invite": "https://whatsapp.com/channel/111111111111111111GdZ60l", "preview": "https://mmg.whatsapp.net/m1/v/t24/123", "picture": "https://mmg.whatsapp.net/m1/v/t24/123", "verified": false, "role": "OWNER" }, { "id": "111111111111111111@newsletter", "name": "Channel - Subscriber - No Picture", "description": "", "invite": "https://whatsapp.com/channel/111111111111111111111111", "preview": null, "picture": null, "verified": false, "role": "SUBSCRIBER" } ] ```