Audio messages are sent as voice notes in WhatsApp, displayed with a playable waveform in the chat interface.
Endpoint
Headers
Device identifier for multi-device support. Required when multiple devices are registered.
Must be
multipart/form-data for file uploads.Request Body (multipart/form-data)
Phone number with country code and WhatsApp suffix.Format:
{country_code}{phone_number}@s.whatsapp.netExample: [email protected]Audio file to upload. Supports common audio formats (MP3, OGG, AAC, WAV, M4A, OPUS).
Either
audio (file upload) or audio_url must be provided, but not both.URL of the audio file to send. The API will download and send the audio from this URL.Example:
"https://example.com/audio.mp3"Either
audio (file upload) or audio_url must be provided, but not both.Mark the message as forwarded.
Disappearing message duration in seconds.Common values:
86400- 24 hours604800- 7 days7776000- 90 days
Response
Response status code. Returns
"SUCCESS" on successful send.Human-readable response message.
Code Examples
Response Example
Audio Format Support
Supported Formats
- MP3 (.mp3) - Most common, widely supported
- OGG (.ogg) - Opus codec, high quality
- AAC (.aac, .m4a) - Good quality, smaller file size
- WAV (.wav) - Uncompressed, large file size
- AMR (.amr) - Low bitrate, voice optimized
- OPUS (.opus) - Modern, efficient codec
Recommended Settings
- Format: OGG Opus or MP3
- Bitrate: 32-64 kbps for voice notes, 128-192 kbps for music
- Sample Rate: 16 kHz for voice, 44.1 kHz for music
- Channels: Mono for voice notes, Stereo for music
File Size Limits
- Maximum file size: 16MB
- Recommended: Under 5MB for reliable delivery
- Maximum duration: ~30 minutes (depends on bitrate)
Use Cases
Voice Notes
Send recorded voice messages for personal communication:Audio Content Distribution
Share podcast episodes, music, or audio announcements:Automated Voice Notifications
Send pre-recorded voice notifications or alerts:Best Practices
-
Optimize Audio Files
- Use appropriate bitrates (32-64 kbps for voice)
- Convert to OGG Opus for best compression
- Keep voice notes under 3 minutes for better UX
-
Choose the Right Format
- Voice notes: OGG Opus or AMR
- Music/Podcasts: MP3 or AAC
- High quality needs: WAV (but compress if possible)
-
File Naming
- Use descriptive file names
- Include timestamps for recordings
- Avoid special characters
-
URL-Based Sending
- Ensure URLs are publicly accessible
- Use HTTPS for security
- Verify audio format before sending
-
Error Handling
- Check file size before upload
- Implement retry logic for network failures
- Validate audio format on client side
Audio Processing
The API automatically processes audio files:- Format Conversion: Converts to WhatsApp-compatible formats
- Bitrate Optimization: Adjusts bitrate for optimal delivery
- Metadata Stripping: Removes unnecessary metadata to reduce file size
- Waveform Generation: Creates visual waveform for WhatsApp display
Processing time varies based on audio duration and file size. Large files may take longer to process before sending.
Error Responses
Common causes:
- Invalid phone number format
- Missing both
audioandaudio_url - Providing both
audioandaudio_url - Unsupported audio format
- File too large (>16MB)
Common causes:
- Device not connected
- Failed to download audio from URL
- Audio processing/conversion error
- Network connectivity issues
Related Endpoints
- Send Video - Send video messages
- Send File - Send document files
- Send Image - Send image messages
- Download Media - Download media from messages
