---
title: "Create a media resource"
method: POST
path: "/v1/media"
tags: ["Media Files"]
---

# Create a media resource

`POST /v1/media`

## Request

- Base URL: `https://api.dexatel.com`
- URL: `https://api.dexatel.com/v1/media`
- Auth: API key in header `X-Dexatel-Key`

## Request body

- MediaPostRequestWrapperDto
  - `data` object, required
    - `file_name` string, required: The name of the media file
    - `type` 'image' | 'video' | 'document', required: The format of the media file
    - `directory` 'temp' | 'perm', required: The directory setting determines how long files are stored. If set to TEMP, files are available for 3 months, while if set to PERM, files are available indefinitely
    - `content_type` string: Content type of the media file

## Response `201`

OK

- MediaPostResponseWrapperDto
  - `data` object
    - `id` string, uuid: The unique identifier assigned to a media file
    - `account_id` string, uuid: The unique identifier of the account
    - `file_name` string: The name of the media file
    - `status` 'pending' | 'uploaded' | 'in_use': The current state of a media file
    - `directory` 'temp' | 'perm': The directory setting determines how long files are stored. If set to TEMP, files are available for 3 months, while if set to PERM, files are available indefinitely
    - `type` 'image' | 'video' | 'document': The format of the media file
    - `content_type` string: Content type of the media file
    - `get_url` string: The URL used to get the media
    - `create_date` string, date-time: Creation date of the media file in UTC, formatted as yyyy-mm-dd hh:mm:ss
    - `update_date` string, date-time: Update date of the media file in UTC, formatted as yyyy-mm-dd hh:mm:ss
    - `put_url` string: The URL to upload the media file
    - `delete_url` string: The URL to delete the media file
    - `links` object
      - `self` string: URL of the requested resource
      - `account` string: URL of the account

## Other responses

- `400`: **Bad Request:** Code Message Description 7702 'data.file\_name' is required 7703 'data.file\_name' is too long File name must be at most 500 characters 7705 'data.directory' is invalid, accepted values (temp, perm) 7706 'data.type' is invalid, accepted values (image, video, document)

---

[API](https://skmtc.dev/dexatel/apis/miscellaneous.md) - [All operations](https://skmtc.dev/dexatel/apis/miscellaneous/llms.txt) - [OpenAPI document](https://skmtc.dev/dexatel/apis/miscellaneous/revisions/44500422bb80?raw)
