Skip to main content

Send Audio Message

Send audio messages that appear as voice notes in WhatsApp. These are different from regular audio files and display as playable voice messages (PTT - Push-to-Talk) in the chat.

Endpoint

Path Parameters

string
required
The name of your WhatsApp instance that you created

Request Body

This endpoint supports three methods for sending audio:
  1. URL: Provide a direct link to the audio file
  2. Base64: Provide the base64-encoded audio content
  3. File Upload: Use multipart/form-data to upload an audio file
string
required
The recipient’s WhatsApp number in international format (without + symbol)Example: 5511999999999 for a Brazilian number
string
required
The audio content as a URL or base64 string (not required when using file upload)Examples:
  • URL: https://example.com/audio.mp3
  • Base64: data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAA...
integer
Delay before sending the message in millisecondsExample: 1000 for 1 second delay
object
Quote a previous message by providing its key and message object
boolean
Enable audio encoding for better compatibilityDefault: false

Response

object
Message key information
object
The sent message object containing the audio message data
string
Unix timestamp when the message was sent
string
Message status (e.g., “PENDING”, “SENT”)

Code Examples

Advanced Examples

Audio Format Guidelines

For best compatibility with WhatsApp voice messages, use the following formats:
  • Format: MP3, OGG (Opus codec), AAC
  • Sample rate: 16kHz or 48kHz
  • Bitrate: 64kbps - 128kbps
  • Channels: Mono (1 channel)
  • Maximum duration: No hard limit, but shorter is better for voice notes
  • Maximum size: 16MB

Supported Audio Formats

  • MP3 (audio/mpeg)
  • OGG with Opus codec (audio/ogg)
  • M4A/AAC (audio/mp4, audio/aac)
  • WAV (audio/wav) - will be converted
Audio files sent via this endpoint will appear as voice messages (PTT) in WhatsApp, displayed with a play button and waveform. To send regular audio files as documents, use the Send Media endpoint with mediatype: "audio".

PTT vs Regular Audio

Voice Message (PTT) - This Endpoint

  • Appears as a voice message with waveform
  • Plays automatically in sequence
  • Designed for quick voice communication
  • Maximum 16MB file size

Regular Audio File - Send Media Endpoint

  • Appears as an audio file attachment
  • Requires manual play
  • Suitable for music, podcasts, etc.
  • Can be larger files

Error Responses

number
HTTP status code
string
Error description

Common Errors

The audio URL must be publicly accessible. If you’re getting errors, verify that the URL can be accessed without authentication.