---
title: "Upload Media File"
method: POST
path: "/orgunit/{orgunitId}/messages/file"
tags: ["Send"]
---

# Upload Media File

`POST /orgunit/{orgunitId}/messages/file`

This function allows you to upload a file to be sent as an MMS or WhatsApp to the user.
The response will include MediaDetails, which will have an object called
mediaPath. The mediaPath object contains an array of details about the
uploaded file such as fileName, extension, fileSaveId, mimetype, and url.

Supported file types: JPG, PNG, GIF, MP4, MP3, PDF

- MMS File size limit(US): 950 KB
- MMS File size limit(Canada): 750 KB
- WhatsApp File size limit: 15 MB

## Path parameters

- `orgunitId` string, required

## Query parameters

- `UsedFor` 'whatsapp'

## Response `202`

Success

- MediaDetailsExternalApiResponseNew
  - `data` MediaDetails
    - `mediaPath` MediaPath[], nullable
      - `fileName` string
      - `extension` string
      - `fileSaveId` string
      - `mimetype` string
      - `url` string
  - `appCode` string, nullable
  - `message` string, nullable
  - `isError` boolean

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/ministrybytext/apis/pbt-api-documentation.md) · [All operations](https://skmtc.net/ministrybytext/apis/pbt-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ministrybytext/pbt-api-documentation/revisions/ca6e9c8f430d/schema)
