WhatsApp Media API

Upload, retrieve, and delete media files

Operations 3

POST /{phone-number-id}/media WhatsApp Upload Media #
GET /{media-id} WhatsApp Get Media URL #
DELETE /{media-id} WhatsApp Delete Media #

Documentation

Specifications

Schemas & Data

Other Resources

🔗
Reference
https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages
🔗
Pricing
https://developers.facebook.com/docs/whatsapp/pricing
🔗
StatusPage
https://metastatus.com/
🔗
ChangeLog
https://developers.facebook.com/docs/whatsapp/cloud-api/changelog
🔗
ErrorCodes
https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes
🔗
PostmanCollection
https://www.postman.com/meta/whatsapp-business-platform/collection/wlk6lh4/whatsapp-cloud-api
🔗
Node.js SDK
https://github.com/WhatsApp/WhatsApp-Nodejs-SDK
🔗
Sandbox
https://business.whatsapp.com/developers/developer-hub
🔗
Migration Guide
https://developers.facebook.com/docs/whatsapp/cloud-api/migrate-to-cloud-api
🔗
Media Reference
https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media
🔗
Phone Numbers Reference
https://developers.facebook.com/docs/whatsapp/cloud-api/reference/phone-numbers
🔗
Business Profiles Reference
https://developers.facebook.com/docs/whatsapp/cloud-api/reference/business-profiles
🔗
Two-Step Verification
https://developers.facebook.com/docs/whatsapp/cloud-api/reference/two-step-verification
🔗
Versioning
https://developers.facebook.com/docs/graph-api/guides/versioning
🔗
PostmanCollection
https://www.postman.com/meta/whatsapp-business-platform/collection/3kru5r6/whatsapp-business-management-api
🔗
Reference
https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates
🔗
ChangeLog
https://developers.facebook.com/docs/whatsapp/business-management-api/changelog

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/whatsapp-media-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

whatsapp-media-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: WhatsApp Business Management Analytics Media API
  description: The WhatsApp Business Management API enables programmatic management of WhatsApp Business Accounts, phone numbers, message templates, analytics, user assignments, product catalogs, and webhook subscriptions through the Meta Graph API.
  version: '21.0'
  contact:
    name: Meta Platform Support
    url: https://developers.facebook.com/support/
  termsOfService: https://www.whatsapp.com/legal/business-terms
servers:
- url: https://graph.facebook.com/v21.0
  description: Meta Graph API Production Server
security:
- bearerAuth: []
tags:
- name: Media
  description: Upload, retrieve, and delete media files
paths:
  /{phone-number-id}/media:
    post:
      operationId: uploadMedia
      summary: WhatsApp Upload Media
      description: Uploads media to WhatsApp servers. Returns a media ID that can be used when sending media messages. Uploaded media persists for 30 days.
      tags:
      - Media
      parameters:
      - $ref: '#/components/parameters/PhoneNumberId'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - file
              - type
              - messaging_product
              properties:
                file:
                  type: string
                  format: binary
                  description: The media file to upload
                type:
                  type: string
                  description: MIME type of the file
                  examples:
                  - image/jpeg
                  - video/mp4
                  - application/pdf
                messaging_product:
                  type: string
                  enum:
                  - whatsapp
      responses:
        '200':
          description: Media uploaded successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Media ID for use in messages
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{media-id}:
    get:
      operationId: getMediaUrl
      summary: WhatsApp Get Media URL
      description: Retrieves a temporary download URL for a media file. The URL expires after 5 minutes. To download the file, make a GET request to the returned URL with the same Bearer token.
      tags:
      - Media
      parameters:
      - $ref: '#/components/parameters/MediaId'
      responses:
        '200':
          description: Media URL retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      operationId: deleteMedia
      summary: WhatsApp Delete Media
      description: Deletes a media file from WhatsApp servers.
      tags:
      - Media
      parameters:
      - $ref: '#/components/parameters/MediaId'
      responses:
        '200':
          description: Media deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    MediaResponse:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: Temporary download URL (expires in 5 minutes)
          example: https://example.com/image.jpg
        mime_type:
          type: string
          example: text
        sha256:
          type: string
          example: example_value
        file_size:
          type: integer
          example: 42
        id:
          type: string
          example: wamid.abc123
        messaging_product:
          type: string
          example: example_value
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
  parameters:
    PhoneNumberId:
      name: phone-number-id
      in: path
      required: true
      description: Phone Number ID from the WhatsApp Business Account
      schema:
        type: string
    MediaId:
      name: media-id
      in: path
      required: true
      description: Media ID returned from upload or webhook
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: System User Token with whatsapp_business_management permission
externalDocs:
  description: WhatsApp Business Management API Documentation
  url: https://developers.facebook.com/docs/whatsapp/business-management-api