> For the complete documentation index, see [llms.txt](https://docs.taqnyat.sa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.taqnyat.sa/api-reference/media/upload-media.md).

# Upload Media

Use this endpoint to upload a media file for use in WhatsApp messages.

### Endpoint

```
POST /media/
```

Full URL:

```
https://api.taqnyat.sa/wa/v2/media/
```

### Authentication

Include your API token in the `Authorization` header:

```
Authorization: <YOUR_TOKEN>
```

### Request Format

This endpoint uses `multipart/form-data`.

### Request Parameters

| Parameter           | Type   | Required | Description                                          |
| ------------------- | ------ | -------- | ---------------------------------------------------- |
| `file`              | File   | Yes      | The media file to upload.                            |
| `type`              | String | Yes      | MIME type of the uploaded file, such as `image/png`. |
| `messaging_product` | String | Yes      | Must be `whatsapp`.                                  |

### Example Request

```bash
curl --location 'https://api.taqnyat.sa/wa/v2/media/' \
--header 'Authorization: 8d18d2f9045b7145ff81***********' \
--form 'file=@"/C:/Users/q.Abdulqader/Downloads/Group 205 (1).png"' \
--form 'type="image/png"' \
--form 'messaging_product="whatsapp"'
```

### Example Form Data

```
file: <MEDIA_FILE>type: image/pngmessaging_product: whatsapp
```

### Media Type

The `type` parameter should contain the MIME type of the uploaded file.

Examples:

```
image/pngimage/jpegvideo/mp4application/pdfaudio/mpeg
```

Use the MIME type that matches the actual uploaded file.

### Messaging Product

For WhatsApp media uploads, set:

```
messaging_product: whatsapp
```

### Response

The exact response should be documented using the response returned by the production API.

The response is expected to provide the identifier required to reference the uploaded media in subsequent API operations.

> Add the actual Postman response here once available rather than using an assumed response structure.

### Notes

* Use `multipart/form-data`, not JSON.
* `file`, `type`, and `messaging_product` are required in the Postman request you shared.
* The `type` value should match the MIME type of the uploaded file.
* Set `messaging_product` to `whatsapp`.
* Store the returned media identifier if the uploaded file will be referenced later.
