Skip to Content

Media

Three upload paths and two fetch paths.

WhatEndpoint
Upload a file → get a media-id for /messagesPOST /{PHONE_NUMBER_ID}/media
Upload a file → get a handle for templates / FlowsPOST /{PHONE_NUMBER_ID}/media_handle
Fetch media URL by media_id from an inbound messageGET /{PHONE_NUMBER_ID}/media/{MEDIA_ID}
Fetch media bytes from a known media URLGET /{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-data

Form fields

FieldNotes
messaging_productwhatsapp
typeMIME type, e.g. image/png, application/pdf, video/mp4, audio/aac
fileThe 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-data

Form fields

FieldNotes
messaging_productwhatsapp
typeMIME type
fileThe 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

TypeMax sizeNotes
Image5 MBimage/jpeg, image/png
Video16 MBvideo/mp4, video/3gpp
Audio16 MBaudio/aac, audio/mp4, audio/mpeg, audio/amr, audio/ogg
Document100 MBapplication/pdf, application/vnd.ms-*, common office formats
Sticker100 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"