WhatsApp API Platform
Media

Upload Media

POST
/api/v1/media/upload

Upload a media file to the WhatsApp media library. The uploaded media can then be used in messages by referencing its id.

Supported file types and size limits:

TypeFormatsMax Size
ImagePNG, JPG, JPEG5 MB
VideoMP416 MB
AudioOGG, MP3, M4A, WEBM16 MB
DocumentPDF100 MB

Authorization

ApiKeyAuth
X-API-Key<token>

API key from your dashboard (Settings > API Keys)

In: header

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://loading/api/v1/media/upload" \  -F file="string"
{
  "success": true,
  "data": {
    "id": "clx9media123abc",
    "media_id": "clx9media123abc",
    "name": "product-photo.jpg",
    "mime_type": "image/png",
    "size": 245760
  }
}
{
  "success": false,
  "message": "to field is required"
}
{
  "success": false,
  "message": "user not authenticated"
}
{
  "success": false,
  "message": "internal server error"
}