---
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`

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.net/akeneo/apis/akeneo-pim-rest-api.md) · [All operations](https://skmtc.net/akeneo/apis/akeneo-pim-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/akeneo/akeneo-pim-rest-api/versions/d8bda9b93b59/schema)
