Introduction
The GOWA WhatsApp API is a RESTful HTTP API built on the WhatsApp Web Multi-Device protocol. It provides comprehensive functionality for sending messages, managing groups, handling contacts, and more.Base URL
The default base URL for local development is:APP_HOST- Host address to bind the server (default:0.0.0.0)APP_PORT- Application port (default:3000)
Subpath Deployment
If you need to deploy the API under a specific path (e.g.,/gowa/api), use the APP_BASE_PATH environment variable or --base-path flag:
OpenAPI Specification
The complete API specification is available in OpenAPI 3.0 format:- Version: 8.3.0
- Specification File: openapi.yaml
- Visualize: Use Swagger Editor to view the interactive documentation
- Generate Clients: Use openapi-generator to generate HTTP clients in your preferred language
API Versioning
The API follows semantic versioning. The current major version is v8, which introduced multi-device support. Breaking changes are documented in the project README under “Breaking Changes”.Version 8 Major Changes
- Multi-device support: Manage multiple WhatsApp accounts simultaneously
- Device scoping: All device-scoped endpoints require device identification
- New device management endpoints:
/devicesfor CRUD operations - Enhanced webhook payloads: All events include
device_idfield
Common Patterns
Request Format
All API requests use standard HTTP methods:GET- Retrieve resourcesPOST- Create resources or perform actionsDELETE- Remove resources
Response Format
All responses follow a consistent JSON structure:Success Response Fields
status(integer) - HTTP status codecode(string) - Application-specific status code (e.g.,SUCCESS)message(string) - Human-readable messageresults(object) - Response data payload
Phone Number Format
WhatsApp uses JID (Jabber ID) format for phone numbers:- Individual chats:
{country_code}{number}@s.whatsapp.net- Example:
[email protected]
- Example:
- Group chats:
{group_id}@g.us- Example:
[email protected]
- Example:
- Newsletter channels:
{newsletter_id}@newsletter- Example:
120363144038483540@newsletter
- Example:
Always include the full JID format when specifying phone numbers or chat identifiers in API requests.
Pagination
List endpoints support pagination usinglimit and offset query parameters:
Media Handling
Media uploads usemultipart/form-data encoding:
Optional Features
Many endpoints support optional features through boolean flags:- Disappearing messages:
durationparameter (in seconds)86400- 24 hours604800- 7 days7776000- 90 days
- Forwarded messages:
is_forwardedboolean flag - View once media:
view_onceboolean flag (images/videos) - Media compression:
compressboolean flag
Rate Limiting
Protocol Foundation
This API is built on the whatsmeow library, which implements the WhatsApp Web Multi-Device protocol. Some limitations are inherited from WhatsApp’s protocol:- User groups list is capped at 500 groups (WhatsApp protocol limitation)
- Some operations require the device to be connected and logged in
- Media processing requires FFmpeg and libwebp
Next Steps
Authentication
Learn how to authenticate API requests
Device Scoping
Understand multi-device management
Error Handling
Handle errors gracefully
Endpoints
Explore available endpoints
