WhaBuzz docs
Guides

Media

Upload media for sending and download inbound media by id. WhaBuzz never stores your bytes.

WhaBuzz never stores media. Uploads stream to Meta; downloads stream from Meta.

#Upload

POST /v1/media is multipart/form-data with file, type (the file's MIME type) and from (your phone_number_id).

curl -X POST https://api.whabuzz.com/v1/media \
  -H "Authorization: Bearer $WHABUZZ_KEY" \
  -F from=1013622581841046 -F type=image/jpeg -F file=@invoice.jpg
# {"id":"1479537139182721"}
bash

Use the id in a message: {"type":"image","image":{"id":"1479537139182721"}}. Meta's size and type limits apply and its errors pass through.

#Download inbound media

Inbound events carry a media id, not bytes. GET /v1/media/{media_id}?from=<phone_number_id> resolves Meta's temporary URL and streams the bytes back with the right content-type. Fetch promptly: Meta expires media about 30 days after receipt, and WhaBuzz caches only the resolved URL (a few minutes), never the file.

#Delete

DELETE /v1/media/{media_id} deletes an upload from Meta.

#Template header media

Template header images, videos and documents use a different, resumable upload that produces a handle (not a media id). See POST /v1/templates/media-handle and Templates.

This page as Markdown: /guides/media.md. All docs in one file: /llms-full.txt.