---
title: "Create a new media file for a reference entity or a record"
method: POST
path: "/api/rest/v1/reference-entities-media-files"
tags: ["Reference entity media file"]
---

# Create a new media file for a reference entity or a record

`POST /api/rest/v1/reference-entities-media-files`

## Request

- Base URL: `http://demo.akeneo.com`
- URL: `http://demo.akeneo.com/api/rest/v1/reference-entities-media-files`
- Auth: none declared. Required headers: `Content-type`

This endpoint allows you to create a new media file and associate it to the image of a reference entity, or to the main image or to an attribute value of a record.

## Headers

- `Content-type` string, required

## Request body

- object
  - `file` string, binary, required: The binary of the media file

## Response `201`

Created

## Other responses

- `401`: Authentication required
- `415`: Unsupported Media type
- `422`: Unprocessable entity

---

[API](https://skmtc.dev/akeneo/apis/akeneo-pim-rest-api.md) - [All operations](https://skmtc.dev/akeneo/apis/akeneo-pim-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/akeneo/apis/akeneo-pim-rest-api/revisions/d8bda9b93b59?raw)
