---
title: "Create a category media file"
method: POST
path: "/api/rest/v1/category-media-files"
tags: ["Category"]
---

# Create a category media file

`POST /api/rest/v1/category-media-files`

## Request

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

This endpoint allows you to create a new media file and associate it to an attribute value of a given enriched category.

## Headers

- `Content-type` string, required

## Request body

- object
  - `category` string: The category to which the media file will be associated. It is a JSON string that follows this format '{"code":"category code", "attribute_code":"attribute code", "channel":"channel code or null", "locale":"locale code or null"}'.
  - `file` string, binary, required: The binary of the file.

## Response `201`

Created

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Access forbidden
- `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)
