The inbox is the live chat interface atDocumentation 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.
/whatsapp/inbox/. It shows all conversations across your WhatsApp account, lets you reply with text, images, videos, audio, and documents, and supports reply threading and per-conversation labels. Inbound messages arrive automatically via the webhook and appear instantly — no page refresh required.
Navigating the inbox
| URL | Purpose |
|---|---|
/whatsapp/inbox/ | List of all conversations, ordered by most-recent message |
/whatsapp/inbox/<phone_number>/ | Open the chat thread for a specific contact |
?q=<phone_or_name>— full-text search across phone number and contact name?label=<label_name>— filter conversations that carry a specific label
InboxView and can be combined:
Sending messages
SendMessageView handles POST requests to /whatsapp/inbox/<phone_number>/send/ and automatically detects the message type from the submitted form fields. You can also call the underlying utility functions directly from Python:
send_text_message and send_location_message functions both accept an optional account keyword argument. When omitted, credentials are read from WHATSAPP['ACCESS_TOKEN'] and WHATSAPP['PHONE_NUMBER_ID'] in Django settings.
Reply threading
Any message can be sent as a threaded reply to an earlier message. Pass the Meta message ID (wamid.*) of the message being replied to via the reply_to_id POST parameter in the form, or via the reply_message_id argument in Python:
WhatsAppMessage.reply_to FK and rendered as a quoted message bubble in the UI.
Conversation labels
Each conversation can carry a single label for triage and organisation. Labels are colour-coded and created at/whatsapp/labels/.
To change a conversation’s label, the UI sends an AJAX POST to a URL backed by UpdateConversationLabelView. This view is not wired in the default URL conf — add it to your project’s urlpatterns:
label field (the label name) and returns {"status": "ok"}. Send an empty label field to remove the label.
Labels have a name (unique) and a color — either a Tailwind preset name or a hex code. See the Contacts page for the full list of preset colors.
Message types supported
WhatsAppMessage.TYPE_CHOICES defines every message type the inbox can store and display:
| Type | Description |
|---|---|
text | Plain text message |
image | JPEG, PNG, or WebP image |
video | MP4 video |
audio | OGG Opus or MP3 voice note |
document | PDF, DOCX, XLSX, and other documents |
location | Latitude/longitude pin with optional name and address |
template | An approved WhatsApp template message |
reaction | Emoji reaction to a message |
sticker | Static or animated WhatsApp sticker |
interactive | Button list or product message |
button | Reply from a quick-reply button |
unknown | Unrecognised message type received from Meta |
Media uploads
Upload a file to Meta’s media hosting first, then reference the returnedmedia_id when sending. The upload_media helper handles the multipart upload and normalises MIME types (e.g. it corrects .m4a → audio/mp4 for Meta compatibility):
send_media_message supports media_type values of image, video, audio, and document. Captions are supported for image, video, and document types. The filename argument is only used for document.
Webhook integration
Inbound messages are automatically ingested via the webhook endpoint at/whatsapp/webhook/ and saved as WhatsAppMessage objects with direction="inbound". The inbox UI reflects new messages immediately. See the Webhooks page for setup instructions.