Overview
GOWA WhatsApp API can be configured using three methods with the following priority order:Setup
Using .env File
.env file should be placed in the src/ directory alongside the binary.
Using Environment Variables
Set variables in your shell or systemd service file:Using CLI Flags
Override any setting directly:Application Settings
Server Configuration
HTTP server port.CLI Flag:
--portHost address to bind the server. Use
0.0.0.0 for all interfaces or 127.0.0.1 for localhost only.CLI Flag: --hostEnable debug logging for detailed request/response logs.CLI Flag:
--debugDevice name displayed in WhatsApp’s “Linked Devices” section.CLI Flag:
--osAuthentication
Basic authentication credentials (comma-separated for multiple users).Format:
username:password,username2:password2CLI Flag: --basic-auth or -bDeployment
Base path for subpath deployment (e.g.,
/gowa).CLI Flag: --base-pathTrusted proxy IP ranges for reverse proxy deployments (CIDR notation).
Database Settings
Database connection URI. Supports SQLite (file) and PostgreSQL.SQLite (default):PostgreSQL:
Database URI for encryption keys storage (in-memory by default).
WhatsApp Settings
Auto-Reply & Auto-Read
Automatically reply to all incoming messages with this text.CLI Flag:
--autoreplyAutomatically mark incoming messages as read.CLI Flag:
--auto-mark-readAutomatically download media from incoming messages to
statics/media/.CLI Flag: --auto-download-mediaCall Handling
Automatically reject incoming WhatsApp calls.CLI Flag:
--auto-reject-callCall rejection events are still sent to webhooks with
auto_rejected: true flag.Presence Settings
Presence status to set when connecting to WhatsApp.Options:
available— Mark as online (suppresses phone notifications)unavailable— Register pushname without going online (default, preserves phone notifications)none— Skip presence entirely (pushname won’t be registered)
--presence-on-connectAccount Validation
Validate recipient phone numbers are registered on WhatsApp before sending.
Chat Storage
Enable local chat and message storage for reply functionality.
Webhook Configuration
Webhook URL(s) for receiving events (comma-separated for multiple webhooks).CLI Flag:
--webhook or -wSecret key for HMAC signature verification.CLI Flag:
--webhook-secretComma-separated list of events to forward. If empty, all events are forwarded.CLI Flag:
--webhook-eventsAvailable events: message, message.reaction, message.revoked, message.edited, message.ack, message.deleted, group.participants, group.joined, newsletter.joined, newsletter.left, newsletter.message, newsletter.mute, call.offerInclude outgoing messages (sent by you) in webhook events.
Skip TLS certificate verification for webhooks (insecure).CLI Flag:
--webhook-insecure-skip-verifyChatwoot Integration
Enable Chatwoot CRM integration.
Chatwoot instance URL.
Chatwoot API access token.
Chatwoot account ID.
Chatwoot inbox ID for WhatsApp channel.
WhatsApp device ID for multi-device Chatwoot setup.
Enable message history sync to Chatwoot.
Number of days of message history to import.
For complete Chatwoot integration guide, see Chatwoot Integration Documentation.
Docker Configuration
Docker Compose Example
Docker Run Example
Complete Configuration Example
Configuration Best Practices
Use .env in Development
Keep configuration in
.env file for easy local development.Use Environment Variables in Production
Set environment variables in systemd service files or container orchestration.
Never Commit Secrets
Add
.env to .gitignore. Use .env.example as template.Use CLI Flags for Overrides
Override specific settings temporarily without changing configuration files.
Troubleshooting
Configuration Not Applied
Configuration Not Applied
Problem: Changes in
.env file not taking effect.Solution:- Ensure
.envfile is in thesrc/directory next to the binary - Restart the application after changing configuration
- Check for environment variables overriding
.envvalues - Enable
--debug=trueto see loaded configuration
Webhook Not Working
Webhook Not Working
Problem: Webhook events not being received.Solution:
- Verify
WHATSAPP_WEBHOOKURL is publicly accessible - Check webhook endpoint returns HTTP 200
- Enable debug mode:
APP_DEBUG=true - Check webhook secret matches on both ends
- Test with webhook.site first
Database Connection Failed
Database Connection Failed
Problem: Cannot connect to database.Solution:
- Ensure
storages/directory exists and is writable - For PostgreSQL, verify connection string format
- Check database user has proper permissions
- Enable debug logging to see full error
See Also
- Sending Messages — Message sending configuration
- Receiving Messages — Webhook and auto-reply setup
- Media Handling — Media processing settings
- GitHub README — Additional configuration details
