Media
Three upload paths and two fetch paths.
| What | Endpoint |
|---|---|
Upload a file → get a media-id for /messages | POST /{PHONE_NUMBER_ID}/media |
| Upload a file → get a handle for templates / Flows | POST /{PHONE_NUMBER_ID}/media_handle |
Fetch media URL by media_id from an inbound message | GET /{PHONE_NUMBER_ID}/media/{MEDIA_ID} |
| Fetch media bytes from a known media URL | GET /{PHONE_NUMBER_ID}/media?url=… |
1. Create Media ID (for sending media files)
POST /api/v25.0/{PHONE_NUMBER_ID}/media
Authorization: Bearer pk_live_<your-key>
Content-Type: multipart/form-dataForm fields
| Field | Notes |
|---|---|
messaging_product | whatsapp |
type | MIME type, e.g. image/png, application/pdf, video/mp4, audio/aac |
file | The file binary |
Response — 200
{ "id": "1234567890" }The returned id is the media-id you reference in subsequent
Send Messages calls:
{
"messaging_product": "whatsapp",
"to": "+919999999999",
"type": "image",
"image": { "id": "1234567890" }
}Media IDs are valid for 30 days. After that, re-upload.
2. Create Media Handle (for templates & Flows)
Header images / videos used inside message templates and inside Flow JSON need a handle, not a media-id. Same upload shape as above, different endpoint:
POST /api/v25.0/{PHONE_NUMBER_ID}/media_handle
Authorization: Bearer pk_live_<your-key>
Content-Type: multipart/form-dataForm fields
| Field | Notes |
|---|---|
messaging_product | whatsapp |
type | MIME type |
file | The file binary |
Response — 200
{ "h": "4::aW1hZ2UvcG5n:ARZ..." }The h value is the handle string — paste it into template
component definitions (example.header_handle) or Flow JSON image
nodes. Handles do not expire while the parent template / flow exists.
3. Get Media URL from media-id (received in webhook)
When you receive an inbound image / audio / video / document
message, the webhook payload includes a media_id. Use it to fetch a
temporary download URL:
GET /api/v25.0/{PHONE_NUMBER_ID}/media/{MEDIA_ID}
Authorization: Bearer pk_live_<your-key>Response — 200
{
"url": "https://lookaside.fbsbx.com/whatsapp_business/attachments/…",
"mime_type": "image/jpeg",
"sha256": "…",
"file_size": 102342,
"id": "1234567890",
"messaging_product":"whatsapp"
}The url is short-lived (typically 5-minute TTL) and pre-signed.
Download immediately and persist on your side if you need long-term
storage.
4. Get media bytes from a known URL
GET /api/v25.0/{PHONE_NUMBER_ID}/media?url={MEDIA_URL}
Authorization: Bearer pk_live_<your-key>Use this when you already have the url (from step 3) and want to
proxy the binary fetch through Splashify rather than hitting the
short-lived URL directly.
Constraints
| Type | Max size | Notes |
|---|---|---|
| Image | 5 MB | image/jpeg, image/png |
| Video | 16 MB | video/mp4, video/3gpp |
| Audio | 16 MB | audio/aac, audio/mp4, audio/mpeg, audio/amr, audio/ogg |
| Document | 100 MB | application/pdf, application/vnd.ms-*, common office formats |
| Sticker | 100 KB (static) / 500 KB (animated) | image/webp |
Errors
Same matrix as Phone Number Details.
cURL — upload + fetch
# Upload (media-id, valid 30d)
curl -X POST \
"https://api.splashifypro.com/api/v25.0/$PHONE_NUMBER_ID/media" \
-H "Authorization: Bearer $SPLASHIFY_API_KEY" \
-F "messaging_product=whatsapp" \
-F "type=image/png" \
-F "file=@/path/to/image.png"
# Upload (handle, for templates / Flows)
curl -X POST \
"https://api.splashifypro.com/api/v25.0/$PHONE_NUMBER_ID/media_handle" \
-H "Authorization: Bearer $SPLASHIFY_API_KEY" \
-F "messaging_product=whatsapp" \
-F "type=image/png" \
-F "file=@/path/to/banner.png"
# Fetch URL from inbound media-id
curl -X GET \
"https://api.splashifypro.com/api/v25.0/$PHONE_NUMBER_ID/media/$MEDIA_ID" \
-H "Authorization: Bearer $SPLASHIFY_API_KEY"