
   
# Media

## Media Properties

The Media API allows you to create, view, update, and delete individual, or a batch, of Media.

| Properties        | Type    | Description                                   
| ----------------- | ------- | --------------------------------------------- 
| media_id          | integer | Unique identifier of the media                
| media_filename    | string  | Name of the media file                        
| media_filepath    | string  | Full file path of the media                   
| media_src         | string  | Direct URL to access the media source         
| media_size        | integer | Size of the media file in bytes               
| media_type        | string  | MIME type of the media file (e.g., image/png)  
| media_tags        | string  | define media tags 
| media_alt         | string  | Alt text for the media file                   
| media_title       | string  | Title of the media                            
| media_description | string  | Description of the media                      
| created_at        | datetime| Date and time when the media was created      
| updated_at        | datetime| Date and time when the media was last updated  
| created_by        | integer | contains the user_id of user who create media 
 
 
## List All media

```shell
curl -X GET https://vedaay-api.mulika.in/media
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
'{
    "status": "success",
    "message": "1 media files found.",
    "code": 200,
    "pagination": {
        "current_page": 1,
        "per_page": 10,
        "total_records": 86,
        "total_pages": 9
    },
    "data": [
        {
            "media_id": "130",
            "media_filename": "1776772512_bin.mp4",
            "media_src": "https://dev-api.vedaay.mulika.in/media/src/130/1776772512_bin.mp4",
            "media_size": "788493",
            "media_type": "video/mp4",
            "media_tags": "image",
            "media_alt": "new-video-alt",
            "media_title": "new-video-title",
            "media_description": "new-video-description",
            "created_at": "2026-04-21 11:55:12",
            "updated_at": "2026-04-21 11:55:12",
            "created_by": "594"
        }
    ]
}'
```

<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #27cf3d; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /media
</span> 

1. GET /media 
2. GET /media?search=png&search_fields=media_filename,media_type
3. GET /media?include=33,34,35&exclude=36
4. GET /media?status=active
5. GET /media?page=1&per_page=20&orderby=created_at&order=DESC
6. GET /media?fields=media_id,media_filename,media_type,media_size
7. GET /media?filters[media_type]=image/png&filters[media_size]>100000 

 
### Available parameters

| Parameter         | Type     | Description                                                                   |
| ----------------- | -------- | ----------------------------------------------------------------------------- |
| page              | integer  | Current page of the collection. Default is 1.                                 |
| per_page          | integer  | Maximum number of items to be returned in the result set. Default is 10.      |
| search            | string   | Limit results to those matching a string.                                     |
| exclude           | array    | Ensure the result set excludes specific IDs.                                  |
| include           | array    | Limit the result set to specific IDs.                                         | 
| media_id          | integer  | Unique identifier of the media.                                               |

 

## Get Single media


```shell
curl -X GET https://vedaay-api.mulika.in/media/99
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
 '{
    "status": "success",
    "message": "Media retrieved successfully",
    "code": 200,
    "data": [
        {
            "media_id": "130",
            "media_filename": "1776772512_bin.mp4",
            "media_src": "https://dev-api.vedaay.mulika.in/media/src/130/1776772512_bin.mp4",
            "media_size": "788493",
            "media_type": "video/mp4",
            "media_tags": "image",
            "media_alt": "new-video-alt",
            "media_title": "new-video-title",
            "media_description": "new-video-description",
            "created_at": "2026-04-21 11:55:12",
            "updated_at": "2026-04-21 11:55:12",
            "created_by": "594"
        }
    ]
}'
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #27cf3d; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /media/{id}
</span>

### Parameters

| Parameter | Type    | Description       |
| --------- | ------- | ----------------- |
| media_id  | integer | ID of the media   |
 

## Get Single media image


```shell
curl -X GET https://vedaay-api.mulika.in/media/src/99/1770029925_2.2ssimg.png
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE

```

<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #27cf3d; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /media/{id}/media_filename
</span>

### Parameters

| Parameter | Type    | Description       |
| --------- | ------- | ----------------- |
| media_id  | integer | ID of the media   |


## Upload Media

```shell
curl --location 'https://vedaay-api.mulika.in/media' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhb' \
--form 'media_files[]=@"/home/mi97/bin.mp4"' \
--form 'media_alt="new-video-alt"' \
--form 'media_title="new-video-title"' \
--form 'media_description="new-video-description"' \
--form 'media_tags="video"'
 ```
> Responce:

```json
   '{
    "status": "success",
    "message": "1 files uploaded successfully.",
    "code": 200,
    "data": [
        {
            "media_filename": "1776772512_bin.mp4",
            "media_filepath": "/home/mi97/www/api.vedpad.in/writable/uploads/media/1776772512_bin.mp4",
            "media_size": 788493,
            "media_type": "video/mp4",
            "media_tags": "video",
            "media_alt": "new-video-alt",
            "media_title": "new-video-title",
            "media_description": "new-video-description",
            "created_by": "594",
            "created_at": "2026-04-21 11:55:12",
            "updated_at": "2026-04-21 11:55:12",
            "media_id": 130,
            "media_src": "https://dev-api.vedaay.mulika.in/media/src/130/1776772512_bin.mp4"
        }
    ]
}'
```

<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #08c0b7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">POST</span> /media
</span>  

## Update Media
 


```shell
curl -X PUT https://vedaay-api.mulika.in/media/139
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
-d '{
    "media_alt":"pinkflowr",
    "media_title":"purple",
    "media_description":"yelloflr"
    "media_tags": "image",
    }'
```
> Responce:

```json
    '{
    "status": "success",
    "message": "Media updated successfully.",
    "code": 200,
    "data": {
        "media_id": "75",
        "media_filename": "1772262928_Bell-Gif (5).gif",
        "media_src": "https://vedaay-api.mulika.in/media/src/75/1772262928_Bell-Gif%20%285%29.gif",
        "media_size": "492106",
        "media_type": "image/gif",
        "media_alt": "pinkflowr",
        "media_title": "purple",
        "media_description": "yelloflr",
        "created_at": "2026-02-28 07:15:28",
        "updated_at": "2026-02-28 07:43:24",
        "created_by": "107"
    }
}'
```

<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #08c0b7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">PUT</span> /media/{media_id}
</span>  
 
 

## Delete Media

```shell
curl --location --request DELETE 'https://vedaay-api.mulika.in/media/90' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NzAwMjk5NTUsImV4cCI6MTc3MDExNjM1NSwidXNlcl9pZCI6IjIzNyIsInVzZXJuYW1lIjoicGl4ZWwiLCJlbWFpbCI6InBpeGVsQGdtYWlsLmNvbSJ9.MWJyvXIaSZy9-LVfcoy_bPw5y1c2fcvpZ9Akk_CiqfU'
```
> Responce:

```json
{
    "status": "success",
    "message": "Media deleted successfully.",
    "code": 200,
    "data": {
        "deleted_media_id": "90"
    }
}
```

<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #c91c05; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">DELETE</span> /media/{id}
</span> 
 