Skip to main content

Documentation 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.

The campaigns API provides a read endpoint for retrieving campaign status and metrics. Campaign creation and execution are handled through the dashboard UI or by calling run_campaign() / run_campaign_async() from Python code. See Python Utility Functions for the programmatic API and Campaigns for the full campaign creation guide.

GET /whatsapp/api/campaigns/

Retrieve the 50 most recent campaigns ordered by creation date (newest first). Requires the X-API-Key header — see Authentication.

Example

curl https://yourdomain.com/whatsapp/api/campaigns/ \
  -H "X-API-Key: your-key"

Success Response

{
  "campaigns": [
    {
      "id": 3,
      "name": "Black Friday Promo",
      "status": "completed",
      "sent_count": 1850,
      "failed_count": 12,
      "created_at": "2024-11-29T08:00:00Z"
    }
  ]
}

Response Fields

campaigns
array
List of up to 50 campaign objects, sorted descending by created_at.

Campaign Statuses

StatusMeaning
draftCreated in the dashboard but not yet queued or sent
scheduledQueued for a future send time via scheduled_at
runningCurrently dispatching messages to recipients
completedAll send attempts have been made (check failed_count for partial failures)
failedThe campaign could not start, typically due to a configuration error
pausedTemporarily halted mid-send; can be resumed

Creating and Running Campaigns

Campaign creation and triggering are handled outside the REST API. You have two options: Dashboard UI: Navigate to /whatsapp/campaigns/Add Campaign, configure your template, audience, and optional schedule, then click Run. Python code: Call the utility function directly from your application logic or a Celery task:
from django_meta_whatsapp.utils import run_campaign_async

result = run_campaign_async(campaign_id=3)
# result: {"queued": True} when a task queue is configured,
#         or {"sent": 1850, "failed": 12} for synchronous execution
See Python Utility Functions for full parameter documentation and Campaigns for the campaign creation guide including audience providers, CSV uploads, and parameter mappings.

Build docs developers (and LLMs) love