All REST API endpoints in django-meta-whatsapp use API key authentication. Pass your key in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/rahul-baberwal/django-meta-whatsapp/llms.txt
Use this file to discover all available pages before exploring further.
X-API-Key request header on every call. Keys are generated and managed from the dashboard under Settings → API Keys (/whatsapp/settings/api-keys/).
Generating an API Key
- Open the dashboard at
/whatsapp/ - Navigate to Settings → API Keys → Add Key
- Enter a descriptive name for the key (e.g.
"Production Backend","Mobile App") - Copy the generated key and store it securely
WhatsAppAPIKey model with the following fields:
| Field | Type | Description |
|---|---|---|
name | CharField | Human-readable label for identifying the key |
key | CharField(max_length=64) | UUID-based secret, unique, auto-generated on creation via uuid.uuid4 |
is_active | BooleanField | Keys can be disabled without deleting, preserving audit history |
created_at | DateTimeField | Timestamp when the key was created |
Making Authenticated Requests
Include your API key in theX-API-Key header on every request:
?api_key=your-key. This approach is less secure and should only be used for quick local testing, never in production.
_APIAuth._ok()) accepts either form: it reads request.headers.get("X-API-Key") first, then falls back to request.GET.get("api_key"). The key is validated against active WhatsAppAPIKey records (is_active=True).
API Base URL
All endpoints are mounted under the URL prefix you chose when including the package URLs. Assuming you used:/whatsapp/api/. The full list of available REST endpoints:
| Method | Path | Description |
|---|---|---|
POST | /whatsapp/api/send-message/ | Send a plain text message |
POST | /whatsapp/api/send-location/ | Send a location pin |
POST | /whatsapp/api/send-template/ | Send an approved template message |
GET | /whatsapp/api/chats/ | List recent conversations |
GET | /whatsapp/api/campaigns/ | List recent campaigns |
POST | /whatsapp/api/block/ | Block a contact |
DELETE | /whatsapp/api/unblock/ | Unblock a contact |
GET | /whatsapp/api/blocked/ | List all blocked contacts |
Error Responses
| Status | Meaning |
|---|---|
401 | Missing or invalid API key |
400 | Invalid request body or missing required fields |
200 | Success |
X-API-Key header is absent or the key does not match an active record):
Security Best Practices
- Store keys in environment variables — never commit them to source code
- Create separate keys for each application or environment (production, staging, CI)
- Disable unused keys rather than deleting them, so audit logs remain intact
- Rotate keys immediately if you suspect they have been exposed
Available Endpoints
Messaging API
Send text, location, and template messages via HTTP POST.
Campaigns API
List and monitor bulk campaign status and metrics.
Blocked Users API
Block, unblock, and list blocked WhatsApp contacts.
Python Utility Functions
Call send, campaign, and block helpers directly from Python code.