Videos can be sent either by uploading a file or providing a URL. The API supports automatic compression and ephemeral view-once videos.
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]Optional caption text for the video. Supports up to 3000 characters.Example:
"ini contoh caption video"Video file to upload. Supports common video formats (MP4, AVI, MOV, MKV, WebM).
Either
video (file upload) or video_url must be provided, but not both.URL of the video to send. The API will download and send the video from this URL.Example:
"https://example.com/sample.mp4"Either
video (file upload) or video_url must be provided, but not both.Enable view-once mode. The video can only be viewed once by the recipient and will disappear after being opened.
Compress the video before sending to reduce file size. Highly recommended for large videos.
Compression may reduce video quality but significantly improves delivery speed and reduces bandwidth usage.
Disappearing message duration in seconds.Common values:
86400- 24 hours604800- 7 days7776000- 90 days
Mark the message as forwarded.
Response
Response status code. Returns
"SUCCESS" on successful send.Human-readable response message.
Code Examples
Response Example
Features
Video Compression
Enable compression to reduce file size while maintaining acceptable quality:- Reduces file size by 50-80%
- Faster upload and delivery
- Better for recipients with limited bandwidth
- Reduces server storage costs
- Resolution: Scaled to max 1280x720 (HD)
- Bitrate: Optimized for mobile viewing
- Format: Converted to H.264/MP4 if needed
View Once Videos
Send ephemeral videos that can only be viewed once:- Recipient can watch video only once
- Video disappears after being played
- Sender is notified when video is opened
- Cannot be forwarded or saved
- Screenshot attempts may be detected on supported devices
URL-Based Video Sending
Send videos directly from URLs:- CDN-hosted videos
- Cloud storage integration
- Dynamic video generation
- Third-party video platforms
Video Requirements
Supported Formats
- MP4 (.mp4) - Recommended, best compatibility
- AVI (.avi) - Common format
- MOV (.mov) - Apple format
- MKV (.mkv) - High quality container
- WebM (.webm) - Web format
- 3GP (.3gp) - Mobile format
Recommended Codec
- Video: H.264 (AVC)
- Audio: AAC
- Container: MP4
File Size Limits
- Maximum file size: 16MB (compressed)
- Maximum file size: 64MB (uncompressed, before API processing)
- Recommended: Under 10MB for reliable delivery
- With compression: Can handle larger source files
Video Specifications
Resolution:- Minimum: 144p (256x144)
- Maximum: 1080p (1920x1080)
- Recommended: 720p (1280x720)
- Maximum: ~90 seconds for best delivery
- Longer videos: Use compression or split into parts
- No technical limit on duration
- Recommended: 16:9 (landscape) or 9:16 (portrait)
- Square videos: 1:1
- All aspect ratios supported
- Recommended: 24-30 FPS
- Maximum: 60 FPS
- Lower frame rates acceptable for certain content
Best Practices
-
Always Use Compression for Large Files
-
Optimize Before Upload
- Pre-encode videos in H.264/MP4
- Use 720p resolution for balance of quality/size
- Trim unnecessary content
- Adjust bitrate to 1-2 Mbps
-
Caption Guidelines
- Keep captions concise and relevant
- Use captions to provide context
- Support emoji in captions
-
Choose the Right Method
- Local files: Use file upload
- Cloud-hosted: Use
video_url - Automated systems: Use
video_urlwith CDN
-
Handle Long Processing Times
- Large videos take time to process
- Implement timeout handling (>60 seconds)
- Consider background job processing
- Notify users of upload progress
-
View Once for Sensitive Content
- Private or confidential videos
- Time-sensitive content
- One-time instructions or codes
Video Processing
The API automatically processes videos:Without Compression
- Format validation
- Codec compatibility check
- Thumbnail generation
- Metadata extraction
With Compression
- Resolution scaling (max 720p)
- Bitrate optimization
- Codec conversion to H.264
- Audio normalization
- File size reduction
Video processing is CPU-intensive. Processing time increases with video duration and resolution. Large videos may take 30-60+ seconds to process.
Use Cases
Marketing & Promotions
Product Demonstrations
Tutorial Content
Personal Video Messages
Error Responses
Common causes:
- Invalid phone number format
- Missing both
videoandvideo_url - Providing both
videoandvideo_url - Unsupported video format
- File too large (>64MB before compression)
- Invalid video codec
Common causes:
- Device not connected
- Failed to download video from URL
- Video processing/compression error
- FFmpeg not installed or configured
- Insufficient disk space
- Network timeout during upload
Troubleshooting
Video Upload Fails
- Check file size (must be under 64MB)
- Verify video format is supported
- Try enabling compression
- Check device connection status
- Verify FFmpeg is installed on server
Long Processing Time
- Enable compression to speed up processing
- Reduce video resolution before upload
- Use shorter videos (under 60 seconds)
- Check server CPU/memory resources
Quality Issues
- Disable compression for high-quality needs
- Pre-encode video in H.264 at desired quality
- Use higher bitrate in source video
- Avoid re-compressing already compressed videos
Related Endpoints
- Send Image - Send image messages
- Send Audio - Send audio messages
- Send File - Send document files
- Download Media - Download media from messages
