---
title: "Uploads the given media for use when sending WhatsApp messages."
method: POST
path: "/whatsapp/v1/media"
tags: ["Media"]
---

# Uploads the given media for use when sending WhatsApp messages.

`POST /whatsapp/v1/media`

## Request

- Base URL: `https://rest.smsportal.com`
- URL: `https://rest.smsportal.com/whatsapp/v1/media`
- Auth: HTTP basic

Example request:
            
    POST /whatsapp/v1/media
    Content-Type: multipart/form-data; boundary=----FormBoundary
            
    ------FormBoundary
    Content-Disposition: form-data; name="businessPhoneNumberId"
            
    1234567890
    ------FormBoundary
    Content-Disposition: form-data; name="file"; filename="image.jpg"
    Content-Type: image/jpeg
            
    <binary file content>
    ------FormBoundary--

## Request body `multipart/form-data`

- object
  - `File` string, binary
  - `BusinessPhoneNumberId` string

## Response `200`

The media upload was successful

- MediaUploadResponse
  - `errorCode` string, nullable, required
  - `errorDetail` string, nullable, required
  - `mediaStatus` 0 | 1 | 2 | 3 | 4 | 5
  - `id` integer

## Other responses

- `400`: The media upload request was invalid, see the ErrorDetail
- `401`: The request was not properly authorized
- `413`: The request exceeded the size limit
- `429`: Too many upload requests, rate limit exceeded
- `500`: Something unexpected went wrong, please try again

---

[API](https://skmtc.dev/smsportal/apis/smsportal-whatsapp-api.md) - [All operations](https://skmtc.dev/smsportal/apis/smsportal-whatsapp-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smsportal/apis/smsportal-whatsapp-api/revisions/d90371930885?raw)
