SendZen API Documentation
Home
Getting StartedChangelog
Home
Getting StartedChangelog
Visit Website
Sign In
Create an account
  1. Media
  • Start Guide
    • Getting Started
    • API Reference
  • Messages
    • Template Messages
      • Send Text Message
      • Send Interactive Message
      • Send Media Message
    • Session Messages
      • Send Text Message
      • Send Image Message
      • Send Video Message
      • Send Audio Message
      • Send Document Message
      • Send Interactive Reply Message
    • Incoming Messages
      • Received Text Message
      • Received Message with Reaction
      • Received Media Message with Image
      • Received Callback from a Quick Reply Button Click
    • Other
      • Message Status & Typing Indicator
  • Template
    • List Templates
      GET
    • Create Template
      POST
    • Delete Template
      DELETE
    • Upload Media
      POST
  • Partner
    • Integration Guide - Option 1
    • Integration Guide - Option 2
  • Project
    • Create Project
      POST
    • List Projects
      GET
    • Update Project
      PUT
    • Retrieve Project
      GET
  • WABA
    • List WABA
      GET
    • Retrieve WABA Details from Meta
      GET
    • Retrieve WhatsApp Business Profile Detail
      GET
    • Update WhatsApp Business Profile
      POST
    • Upload WhatsApp Business Profile
      POST
  • Activity Logs
    • All Event Logs
      GET
    • Incoming Message Logs
      GET
    • Message Status Logs
      GET
    • Other Event Logs
      GET
    • Multiple Event Types
      GET
  • Knowledge Base
    • Programming Languages
      • Python
      • Node.js
      • PHP
      • Laravel
      • Java
      • C# .NET
    • Product
      • Changelog
  • Webhook
    • /v1/webhook/config
    • /v1/webhook/config
    • /v1/webhook/config/{projectId}
    • /v1/webhook/details/{webhookId}
    • /v1/webhook/config/{webhookId}
    • /v1/webhook/config/{webhookId}
  • Media
    • Download Media
      GET
  • Schemas
    • Schemas
      • Template Message
      • 401/403 Message Response
      • AccountLoginRequest
      • APIKeyDto
      • ReadTypingIndicatorRequest
      • AccountRegisterRequest
      • TypingIndicator
      • PartnerConfigDto
      • LoginResponse
      • PartnerInfoDto
      • WABASignUp
      • OrderCheckoutDto
      • OrderDto
      • OrderStatusEnum
      • PaymentGatewayDto
    • Knowledge Base
    • Address
    • Account
    • Webhook
    • CommonResponse
    • AccountDetailDto
    • WebhookConfigDto
    • CreateOrUpdateProjectRequest
    • Contact
    • WebhookConfiguration
    • Error
    • ContactName
    • Button
    • WebhookLogDto
    • ErrorResponse
    • CarouselCard
    • Email
    • ClientData
    • Component
    • ProjectDetailDto
    • ProjectWABADetail
    • Interactive
    • WABADetail
    • InteractiveAction
    • WABADto
    • InteractiveBody
    • CreateTemplateRequest
    • InteractiveButton
    • InteractiveFooter
    • CreateWebhookConfigRequest
    • InteractiveHeader
    • InteractiveMedia
    • Example
    • InteractiveProductItem
    • InteractiveProductSection
    • InteractiveReply
    • InteractiveRow
    • InteractiveSection
    • Location
    • Media
    • MessageRequest
    • MessageResponse
    • MessageTemplate
    • Organization
    • LimitedTimeOffer
    • Phone
    • Reaction
    • Response
    • TemplateAction
    • NamedParameter
    • TemplateButtons
    • TemplateCarousel
    • TemplateComponent
    • TemplateCurrency
    • PaginatedWebhookLogsResponse
    • TemplateDateTime
    • PartnerClientSession
    • TemplateLimitedTimeOffer
    • PartnerClientSessionDto
    • TemplateMedia
    • TemplateParameter
    • TemplateProductItem
    • TemplateSection
    • TemplateTapTargetConfiguration
    • SupportedApp
    • Text
    • Url
    • WhatsAppBusinessProfile
    • UploadMedia
  1. Media

Download Media

GET
https://api.sendzen.io/v1/{phoneNumberId}/media
Download media files received through incoming WhatsApp messages.
When a customer sends an image, video, document, audio file, or sticker, the incoming webhook contains a direct media URL from Meta. Use this endpoint to securely retrieve the media file through SendZen.
SendZen handles the required Meta authentication internally, so you do not need to provide or manage a Meta access token.

How it works#

1.
Receive an incoming WhatsApp webhook containing media.
2.
Get the media URL from the webhook payload.
3.
Pass the media URL to the url query parameter.
4.
Send your SendZen API key in the Authorization header.
5.
The API returns the raw binary content of the media file.
Note
Pass the exact media URL received in the incoming webhook payload.
The url query parameter must be URL-encoded when making the request.

Example Request#

The following example downloads the media and saves it to a local file:
Replace:
{phoneNumberId} with the WhatsApp Phone Number ID associated with your SendZen account.
<SENDZEN_API_KEY> with your SendZen API key.
The example url with the exact media URL received in the webhook.
The --data-urlencode option automatically URL-encodes the media URL before adding it to the request query string.
The --output downloaded_media option saves the returned binary response to a local file instead of printing it to the terminal.

Example with a URL-encoded media URL#

You can also provide the encoded media URL directly:

Response#

A successful request returns the raw binary content of the media file.
The response Content-Type matches the type of media being downloaded. For example:
MediaContent-Type
JPEG imageimage/jpeg
PNG imageimage/png
MP4 videovideo/mp4
PDF documentapplication/pdf
AudioAppropriate audio MIME type
Important
This endpoint does not return a JSON response on success. The response body contains the actual file bytes.

Authentication#

Send your SendZen API key as a Bearer token:
You do not need to provide a Meta or WhatsApp access token.
SendZen automatically handles Meta Bearer Token authentication internally using the stored credentials associated with the provided phoneNumberId.

Error Responses#

Status CodeDescription
400 Bad RequestInvalid phoneNumberId or malformed media URL.
401 UnauthorizedMissing or invalid SendZen API key.
404 Not FoundWABA account or media file could not be found.
500 Internal Server ErrorAn unexpected error occurred while processing the request.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params

Query Params

Responses

🟢200Success
application/octet-stream
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.sendzen.io/v1/1075755758965317/media?url=https%3A%2F%2Flookaside.fbsbx.com%2Fwhatsapp_business%2Fattachments%2F%3Fmid%3D45346...' \
--header 'Authorization: Bearer <token>'
Modified at 2026-09-11 05:49:05
Previous
/v1/webhook/config/{webhookId}
Next
Template Message
Built with