The WhatsApp channel runs on Baileys Web. This page covers media handling rules for send, gateway, and agent replies.

For inline audio and video in the Control UI and native apps, including portable formats, byte limits, and lazy transcoding, see Media playback.

Goals

CLI Surface

apus message send --target <dest> --media <path-or-url> [--message <caption>]

Message tool attachment metadata

For buffer attachments, contentType takes precedence over mimeType; a data URL's MIME type is used only when neither is supplied. For reply, sendAttachment, upload-file, and setGroupIcon, top-level MIME metadata also takes precedence over the selected attachments[] entry. Hydration carries that choice as contentType and uses it to infer a missing filename. Explicit filenames are preserved. This metadata precedence does not change MIME detection when media bytes are loaded or staged.

WhatsApp Web channel behavior

The 16MB audio/video and 100MB document figures above are the shared per-kind media defaults used when no explicit byte cap is passed. WhatsApp sends set an explicit cap from channels.whatsapp.mediaMaxMb (default 50MB), which applies uniformly across kinds for that account.

Auto-Reply Pipeline

Generated attachments stay separate from later tool-error warnings. Image references in errors or reasoning do not select or discard generated attachments.

When a channel converts Markdown image links into attachments, image syntax inside code blocks or inline code, and escaped image syntax, stays in the text. Inline image destinations retain their URL punctuation.

Inbound Media To Commands

Limits and errors

Outbound send caps (WhatsApp web send)

Media understanding caps (transcription/description)

Image description checks the source byte cap before resizing. Recognized images are then prepared for the selected model's declared image limits; each fallback starts from the same normalized original. Models without declared image limits keep those normalized bytes. agents.defaults.imageQuality remains an image-tool setting and does not change media-understanding preparation.

Notes for Tests

Related