openapi: 3.2.0 info: title: Akeneo API REFERENCE Product media file API version: 1.0.0 description: 'This is the reference documentation for the Akeneo PIM REST API. It provides detailed information about the available endpoints, request and response formats, and authentication methods. For more information, visit the Akeneo PIM documentation.' license: name: Open Software License 3.0 url: http://opensource.org/licenses/OSL-3.0 contact: name: Akeneo Support url: https://www.akeneo.com/support-help-center/ email: contact@akeneo.com servers: - url: '{your-pim-url}' variables: your-pim-url: default: '' description: 'Set the PIM url you want to target ex: https://my-pim.cloud.akeneo.com or https://localhost:8443' tags: - name: Product media file description: 'A media file is a file that can be attached to a product, product model, category, or asset. It can be an image, a video, a PDF, or any other type of file. Media files are used to enrich the product information and provide additional context to the products.' paths: /api/rest/v1/media-files: get: operationId: get_media_files x-visibility: public summary: Get a list of product media files description: This endpoint allows you to get a list of media files that are used as attribute values in products or product models tags: - Product media file security: - bearerToken: [] parameters: - in: query name: page description: 'Specify which page of results to retrieve when using pagination. It is useful for navigating through large datasets by breaking them into smaller, manageable pages. See [Pagination](https://api.akeneo.com/documentation/pagination.html) section for more details. ' required: false schema: type: integer default: 1 example: 1 - in: query name: limit description: 'Specify the maximum number of results to return per page. It is useful for controlling the amount of data returned in a single request, especially when dealing with large datasets. See [Pagination](https://api.akeneo.com/documentation/pagination.html) section for more details. ' required: false schema: type: integer default: 10 minimum: 1 maximum: 100 example: 100 - in: query name: with_count description: 'Return the count of items in the response. Be careful with that, on a big catalog, it can decrease performance in a significant way. It is useful for understanding the size of the dataset being returned, especially when dealing with large collections. Use it judiciously to avoid performance issues. ' required: false schema: type: boolean default: false example: true responses: '200': description: 'Return media files paginated. The response is paginated and includes links to navigate through the pages. ' content: application/json: schema: title: Media Files type: object allOf: - type: object properties: _links: type: object properties: self: type: object properties: href: type: string description: URI of the current page of resources example: https://demo.akeneo.com/api/rest/v1/categories?page=2&limit=5 first: type: object properties: href: type: string description: URI of the first page of resources example: https://demo.akeneo.com/api/rest/v1/categories?page=1&limit=5 previous: type: object properties: href: type: string description: URI of the previous page of resources example: https://demo.akeneo.com/api/rest/v1/categories?page=1&limit=5 next: type: object properties: href: type: string description: URI of the next page of resources example: https://demo.akeneo.com/api/rest/v1/categories?page=3&limit=5 - type: object properties: current_page: type: integer description: Current page number example: 1 items_count: type: integer description: Total number of items (only if `with_count` parameter is set to true) example: 5 _embedded: type: object properties: items: type: array items: type: object allOf: - type: object properties: _links: type: object properties: self: type: object properties: href: type: string description: URI of the media file example: https://demo.akeneo.com/api/rest/v1/media-files/7/5/8/e/758e39d48ea7b42a55091434fd3d8b6cf3189b7f_10806799_1356.jpg - type: object properties: _links: type: object readOnly: true properties: download: type: object properties: href: type: string description: URI to download the binaries of the media file example: href: https://demo.akeneo.com/api/rest/v1/media-files/7/5/8/e/758e39d48ea7b42a55091434fd3d8b6cf3189b7f_10806799_1356.jpg/download example: download: href: https://demo.akeneo.com/api/rest/v1/media-files/7/5/8/e/758e39d48ea7b42a55091434fd3d8b6cf3189b7f_10806799_1356.jpg/download code: type: string description: Media file code x-immutable: true example: 7/5/8/e/758e39d48ea7b42a55091434fd3d8b6cf3189b7f_10806799_1356.jpg original_filename: type: string description: Original filename of the media file example: 10806799-1356.jpg mime_type: type: string description: Mime type of the media file readOnly: true example: image/jpeg size: type: integer description: Size of the media file readOnly: true example: 16070 extension: type: string description: Extension of the media file readOnly: true example: jpg example: _links: self: href: https://demo.akeneo.com/api/rest/v1/media-files?page=2&limit=4&with_count=true first: href: https://demo.akeneo.com/api/rest/v1/media-files?page=1&limit=4&with_count=true previous: href: https://demo.akeneo.com/api/rest/v1/media-files?page=1&limit=4&with_count=true next: href: https://demo.akeneo.com/api/rest/v1/media-files?page=2&limit=4&with_count=true current_page: 2 items_count: 10 _embedded: items: - _links: self: href: https://demo.akeneo.com/api/rest/v1/media-files/7/5/8/e/758e39d48ea7b42a55091434fd3d8b6cf3189b7f_10806799_1356.jpg/download code: 7/5/8/e/758e39d48ea7b42a55091434fd3d8b6cf3189b7f_10806799_1356.jpg original_filename: 10806799-1356.jpg mime_type: image/jpeg size: 16070 extension: jpg - _links: self: href: https://demo.akeneo.com/api/rest/v1/media-files/d/0/3/2/d032a92d994df3ef67ee6746b7b7a795c2964e7c_10734346_1480.jpg download: href: https://demo.akeneo.com/api/rest/v1/media-files/d/0/3/2/d032a92d994df3ef67ee6746b7b7a795c2964e7c_10734346_1480.jpg/download code: d/0/3/2/d032a92d994df3ef67ee6746b7b7a795c2964e7c_10734346_1480.jpg original_filename: 10734346-1480.jpg mime_type: image/jpeg size: 16454 extension: jpg - _links: self: href: https://demo.akeneo.com/api/rest/v1/media-files/5/1/d/8/51d81dc778ba1501a8f998f3ab5797569f3b9e25_12431976_8797.jpg download: href: https://demo.akeneo.com/api/rest/v1/media-files/5/1/d/8/51d81dc778ba1501a8f998f3ab5797569f3b9e25_12431976_8797.jpg/download code: 5/1/d/8/51d81dc778ba1501a8f998f3ab5797569f3b9e25_12431976_8797.jpg original_filename: 12431976-8797.jpg mime_type: image/jpeg size: 19725 extension: jpg - _links: self: href: https://demo.akeneo.com/api/rest/v1/media-files/0/c/b/0/0cb0c0e115dedba676f8d1ad8343e6207ab54c7b_107406_9841.jpg download: href: https://demo.akeneo.com/api/rest/v1/media-files/0/c/b/0/0cb0c0e115dedba676f8d1ad8343e6207ab54c7b_107406_9841.jpg/download code: 0/c/b/0/0cb0c0e115dedba676f8d1ad8343e6207ab54c7b_107406_9841.jpg original_filename: 107406-9841.jpg mime_type: image/jpeg size: 17639 extension: jpg '401': description: 'This response indicates that authentication is required to access the requested resource. It can be caused by a missing or expired token, or if the provided credentials are invalid. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 401 message: Full authentication is required to access this resource. '403': description: 'This response indicates that the request is not authorized. This can occur when the user lacks the necessary permissions to access a resource or perform an action, or when the request payload is too large for the platform to process. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 403 message: Access forbidden. You are not allowed to list this entity. '406': description: 'This response indicates that the server cannot produce a response matching the list of acceptable values defined in the request''s `Accept` header. It is typically used when the requested resource is not available in the requested format. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 406 message: xxx in `Accept` header is not valid. Only `application/json` is allowed. post: operationId: post_media_file x-visibility: public summary: Create a new product media file description: This endpoint allows you to create a new media file and associate it to an attribute value of a given product or product model tags: - Product media file security: - bearerToken: [] parameters: - in: header name: Content-Type description: 'Equal to ''multipart/form-data'' (with [boundary value](https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2)), no other value allowed. ' required: true schema: type: string example: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW x-form-data: true requestBody: description: Body of the request to create a new media file content: multipart/form-data: schema: oneOf: - type: object properties: product: type: - string - 'null' description: 'The product to which the media file will be associated. It is a JSON string that follows this format ''{"identifier":"product_identifier", "attribute":"attribute_code", "scope":"channel_code","locale":"locale_code"}''. You have to either use this field or the `product_model` field, but not both at the same time. ' example: '{"identifier":"product_identifier", "attribute":"attribute_code", "scope":null,"locale":null}' file: type: string description: The binaries of the file format: binary required: - file - product - type: object properties: product_model: type: - string - 'null' description: 'The product model to which the media file will be associated. It is a JSON string that follows this format: ''{"code":"product_model_code", "attribute":"attribute_code", "scope":"channel_code","locale":"locale_code"}''. You have to either use this field or the `product` field, but not both at the same time. ' example: '{"code":"product_model_code", "attribute":"attribute_code", "scope":null,"locale":null}' file: type: string description: The binaries of the file format: binary required: - file - product_model examples: product: summary: Create a media file for a product value: product: '{"identifier":"product_identifier", "attribute":"attribute_code", "scope":null,"locale":null}' file: '' product_model: summary: Create a media file for a product model value: product_model: '{"code":"product_model_code", "attribute":"attribute_code", "scope":null,"locale":null}' file: '' responses: '201': description: 'This response indicates that the entity was successfully created. The server has fulfilled the request and created a new resource. The response includes a `Location` header that contains the URI of the newly created resource. ' headers: Location: description: URI of the created resource schema: type: string '400': description: 'This response indicates that the server cannot process the request due to a client error, such as malformed request syntax, invalid request message framing, or deceptive request routing. It is typically used when the server cannot understand the request due to invalid JSON or other client-side issues. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 400 message: Invalid JSON message received '401': description: 'This response indicates that authentication is required to access the requested resource. It can be caused by a missing or expired token, or if the provided credentials are invalid. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 401 message: Full authentication is required to access this resource. '403': description: 'This response indicates that the request is not authorized. This can occur when the user lacks the necessary permissions to access a resource or perform an action, or when the request payload is too large for the platform to process. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 403 message: Access forbidden. You are not allowed to list this entity. '415': description: 'This response indicates that the `Content-type` header of the request is not supported by the server. The server expects the `Content-type` header to be `application/json`, and any other value will result in this error. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 415 message: xxx in `Content-type` header is not valid. Only `application/json` is allowed." '422': description: 'This response indicates that the validation of the entity given in the body of the request failed. It occurs when the server understands the request but cannot process it due to validation errors in the provided data. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 422 message: type: string description: Message explaining the error example: Validation failed. errors: type: array description: A list of validation error messages (optional) items: type: object properties: property: type: string description: Name of the invalid property message: type: string description: Human-readable error message attribute: type: - string - 'null' description: Attribute code (if the error is on an attribute) locale: type: - string - 'null' description: Locale code involved in the error, if any scope: type: - string - 'null' description: Channel code involved in the error, if any example: - property: family message: The tshirts family does not exist in your PIM. _links: type: object properties: documentation: type: object properties: href: type: string example: documentation: href: http://api.akeneo.com/api-reference.html example: code: 422 message: Validation failed. errors: - property: family message: The tshirts family does not exist in your PIM. - property: categories message: The "tvs_projectors" category does not exist. - property: associations.SUBSTITUTION.groups message: You should associate existing groups. The "promotion" group does not exist. - property: values message: The "description" attribute requires a channel. attribute: description locale: en_US scope: null - property: values message: The "name" attribute requires a locale. attribute: name locale: null scope: null _links: documentation: href: http://api.akeneo.com/api-reference.html /api/rest/v1/media-files/{code}: get: operationId: get_media_file_information_by_code x-visibility: public summary: Get a product media file description: 'This endpoint allows you to get the information about a given media file that is used as an attribute value of a product or a product model.' tags: - Product media file security: - bearerToken: [] parameters: - in: path name: code description: 'This path parameter is used to specify the unique identifier of the entity you want to retrieve or manipulate. It is essential for identifying the specific entity in the API requests. Ensure that the code is correctly formatted and corresponds to an existing entity in the system. ' required: true schema: type: string example: my_entity_code responses: '200': description: Returns the content of the media file in JSON standard format content: application/json: schema: type: object properties: _links: type: object readOnly: true properties: download: type: object properties: href: type: string description: URI to download the binaries of the media file example: href: https://demo.akeneo.com/api/rest/v1/media-files/7/5/8/e/758e39d48ea7b42a55091434fd3d8b6cf3189b7f_10806799_1356.jpg/download example: download: href: https://demo.akeneo.com/api/rest/v1/media-files/7/5/8/e/758e39d48ea7b42a55091434fd3d8b6cf3189b7f_10806799_1356.jpg/download code: type: string description: Media file code x-immutable: true example: 7/5/8/e/758e39d48ea7b42a55091434fd3d8b6cf3189b7f_10806799_1356.jpg original_filename: type: string description: Original filename of the media file example: 10806799-1356.jpg mime_type: type: string description: Mime type of the media file readOnly: true example: image/jpeg size: type: integer description: Size of the media file readOnly: true example: 16070 extension: type: string description: Extension of the media file readOnly: true example: jpg example: _links: download: href: https://demo.akeneo.com/api/rest/v1/media-files/7/5/8/e/758e39d48ea7b42a55091434fd3d8b6cf3189b7f_10806799_1356.jpg/download code: 7/5/8/e/758e39d48ea7b42a55091434fd3d8b6cf3189b7f_10806799_1356.jpg original_filename: 10806799-1356.jpg mime_type: image/jpeg size: 16070 extension: jpg '401': description: 'This response indicates that authentication is required to access the requested resource. It can be caused by a missing or expired token, or if the provided credentials are invalid. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 401 message: Full authentication is required to access this resource. '403': description: 'This response indicates that the request is not authorized. This can occur when the user lacks the necessary permissions to access a resource or perform an action, or when the request payload is too large for the platform to process. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 403 message: Access forbidden. You are not allowed to list this entity. '404': description: 'This response indicates that the requested resource could not be found on the server. It can occur when the resource code given in the URI does not correspond to any existing PIM resource. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 404 message: Resource `my_resource_code` does not exist. '406': description: 'This response indicates that the server cannot produce a response matching the list of acceptable values defined in the request''s `Accept` header. It is typically used when the requested resource is not available in the requested format. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 406 message: xxx in `Accept` header is not valid. Only `application/json` is allowed. /api/rest/v1/media-files/{code}/download: get: operationId: get_media_file_by_code x-visibility: public summary: Download a product media file description: This endpoint allows you to download a given media file that is used as an attribute value of a product or a product model tags: - Product media file security: - bearerToken: [] parameters: - in: path name: code description: 'This path parameter is used to specify the unique identifier of the entity you want to retrieve or manipulate. It is essential for identifying the specific entity in the API requests. Ensure that the code is correctly formatted and corresponds to an existing entity in the system. ' required: true schema: type: string example: my_entity_code x-content-type: Mime-type of the media file responses: '200': description: Returns the binary of the media file content: image/png: schema: type: string format: binary example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA... image/jpeg: schema: type: string format: binary example: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYa '401': description: 'This response indicates that authentication is required to access the requested resource. It can be caused by a missing or expired token, or if the provided credentials are invalid. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 401 message: Full authentication is required to access this resource. '403': description: 'This response indicates that the request is not authorized. This can occur when the user lacks the necessary permissions to access a resource or perform an action, or when the request payload is too large for the platform to process. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 403 message: Access forbidden. You are not allowed to list this entity. '404': description: 'This response indicates that the requested resource could not be found on the server. It can occur when the resource code given in the URI does not correspond to any existing PIM resource. ' content: application/json: schema: type: object properties: code: type: integer description: HTTP status code example: 401 message: type: string description: Message explaining the error example: Full authentication is required to access this resource. example: code: 404 message: Resource `my_resource_code` does not exist. components: securitySchemes: basicToken: scheme: basic type: http description: 'HTTP Basic authentication using user credentials. [More information here](https://api.akeneo.com/documentation/authentication.html) ' bearerToken: scheme: bearer type: http description: 'Bearer token obtained via the "Password Grant" flow. This token authenticates a user, is valid for one hour, and can be refreshed using a refresh token. [More information here](https://api.akeneo.com/documentation/authentication.html) ' appToken: scheme: bearer type: http description: 'Bearer token for Apps, obtained via the OAuth 2.0 flow. This permanent token allows an application to make requests on behalf of a user. [More information here](https://api.akeneo.com/apps/authentication-and-authorization.html) ' x-provenance: method: harvested publisher: Akeneo source: https://storage.googleapis.com/akecld-prd-pim-saas-shared-openapi-spec/openapi.yaml note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json); stamped by stamp-openapi-provenance.py (roadmap#793)