---
title: "Update/create an asset family"
method: PATCH
path: "/api/rest/v1/asset-families/{code}"
tags: ["Asset family"]
---

# Update/create an asset family

`PATCH /api/rest/v1/asset-families/{code}`

This endpoint allows you to update a given asset family. Note that if the asset family does not already exist, it creates it.

## Path parameters

- `code` string, required

## Request body

- object
  - `code` string, required — Asset family code
  - `labels` object — Asset family labels for each locale
    - `localeCode` string — Asset family label for the locale `localeCode`
  - `attribute_as_main_media` string — Attribute code that is used as the main media of the asset family.
  - `naming_convention` object — The naming convention ran over the asset code or the main media filename upon each asset creation, in order to automatically set several values in asset attributes. To learn more and see the format of this property, take a look at <a href='/concepts/asset-manager.html#focus-on-the-naming-convention'>here</a>.
    - `source` object — The string on which the naming convention should be applied. More details <a href='/concepts/asset-manager.html#source'>here</a>.
    - `pattern` string — The regular expression that should be applied on the source. More details <a href='/concepts/asset-manager.html#pattern'>here</a>.
    - `abort_asset_creation_on_error` boolean — Whether the asset should be created if the naming convention failed to apply. More details <a href='/concepts/asset-manager.html#abort-asset-creation-on-error'>here</a>.
  - `product_link_rules` object[] — The rules that will be run after the asset creation, in order to automatically link the assets of this family to a set of products. To understand the format of this property, see <a href='/concepts/asset-manager.html#focus-on-the-product-link-rule'>here</a>.
    - `product_selections` object[] — The product selection to which the assets of the asset family to be automatically linked. More details <a href='/concepts/asset-manager.html#product-selection'>here</a>.
      - `field` string, required
      - `operator` string, required
      - `value` string, required
      - `locale` string
      - `channel` string
    - `assign_assets_to` object[] — The product value in which your assets will be assigned. More details <a href='/concepts/asset-manager.html#product-value-assignment'>here</a>.
      - `attribute` string, required
      - `locale` string
      - `channel` string
      - `mode` string, required
  - `transformations` object[] — The transformations to perform on source files in order to generate new files into your asset attributes (only available since v4.0). To understand the format of this property, see <a href='/concepts/asset-manager.html#focus-on-the-transformations'>here</a>.
    - `label` string, required — The name of the transformation
    - `filename_suffix` string — The suffix that will be appended to the source filename to generate the target filename. More details <a href='/concepts/asset-manager.html#target-filename'>here</a>.
    - `filename_prefix` string — The prefix that will be prepended to the source filename to generate the target filename. More details <a href='/concepts/asset-manager.html#target-filename'>here</a>.
    - `source` object, required — The attribute value in which is stored the media file you want to use as the source file for your transformation. More details <a href='/concepts/asset-manager.html#source-file'>here</a>.
      - `attribute` string, required
      - `channel` string, required
      - `locale` string, required
    - `target` object, required — The attribute value in which the PIM will generate the new transformed file, aka the target file. More details <a href='/concepts/asset-manager.html#target-file'>here</a>.
      - `attribute` string, required
      - `channel` string, required
      - `locale` string, required
    - `operations` object, required — The transformations that should be applied to your source file to generate the target file. More details <a href='/concepts/asset-manager.html#transformation-operations'>here</a>.
      - `type` string
      - `parameters` object
        - `colorspace` string
        - `width` integer
        - `height` integer
        - `ratio` integer
        - `resolution-unit` string
        - `resolution-x` integer
        - `resolution-y` integer
        - `quality` integer

## Response `201`

Created

## Other responses

- `204` — No content to return
- `401` — Authentication required
- `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)
