# Update Product Attribute

Changes an attribute of the Product definition, the tenant's own or the platform's. A patch:
every field left out, or sent as `null`, is one the attribute keeps.
## Request Body
The body is the change. Its `type` is the kind the attribute ends up as — the one it has, or
the one it is converted into — with the same fields as on create: a short text attribute
renamed is sent with `"type": "shortText"`. A list sent replaces the whole list; an empty
`linkingPattern` clears the pattern.
Every attribute takes `title`, `isFormReadonly`, `titleTranslations` (the whole set) and
`deleteExistingValues`, which empties every product's value whatever else the request
changes.
`attributeSet` chooses the form the change is made from: its `id` names the attribute set
(left out, the default form), and `addToEveryAttributeSet` places the attribute on every form
that does not show it yet.
## Response
**200 OK** — the attribute as it now stands, under `value`.
## Example

```http
PATCH /Metadata/Products/attributes('prod_boxmaterial') HTTP/1.1
X-API-KEY: your-api-key-here
Content-Type: application/json
            
{ "type": "shortText", "title": "Case material" }
```

Endpoint: PATCH /Metadata/Products/attributes('{attributeId}')
Version: 2.0.0

## Description:

  - `Request Body` ()
    The body is the change. Its `type` is the kind the attribute ends up as — the one it has, or
the one it is converted into — with the same fields as on create: a short text attribute
renamed is sent with `"type": "shortText"`. A list sent replaces the whole list; an empty
`linkingPattern` clears the pattern. Every attribute takes `title`, `isFormReadonly`, `titleTranslations` (the whole set) and
`deleteExistingValues`, which empties every product's value whatever else the request
changes. `attributeSet` chooses the form the change is made from: its `id` names the attribute set
(left out, the default form), and `addToEveryAttributeSet` places the attribute on every form
that does not show it yet.

  - `Response` ()
    **200 OK** — the attribute as it now stands, under `value`.

  - `Example` ()
    ```http
PATCH /Metadata/Products/attributes('prod_boxmaterial') HTTP/1.1
X-API-KEY: your-api-key-here
Content-Type: application/json
            
{ "type": "shortText", "title": "Case material" }
```

## Path parameters:

  - `attributeId` (string, required)
    The identifier of the attribute to change

## Header parameters:

  - `X-API-KEY` (string)
    Tenant's API key (required)

## Request body:

  - `application/json` (unknown)
    The change to make

## Request fields (application/json):

  - `type` (string, required)
    Enum: "shortText", "longText", "number", "boolean", "url", "date", "table", "checklist", "imagePack", "file", "linkItems"

  - `title` (string)
    The new title. The identifier never follows it.

  - `isFormReadonly` (boolean)

  - `titleTranslations` (array)
    What it is called in the tenant's other languages — the whole set, replacing the one it has:
a language left out is one it ends up with no title in.

  - `titleTranslations.language` (string)

  - `titleTranslations.text` (string)

  - `deleteExistingValues` (boolean)
    Whether every item's value is emptied, whatever else the request changes. Left out, each value
is carried across a change of type or of localization where the new shape can hold it.

  - `attributeSet` (object)
    Which form of an entity with one per attribute set (Products, Variants) a request is made from.

  - `attributeSet.id` (integer)
    The attribute set whose form is selected. Left out, the default form: it belongs to no attribute
set. A sent value is read as given, `0` included, and refused when it names no attribute set.

  - `attributeSet.addToEveryAttributeSet` (boolean)
    Whether every other form of the entity receives the attribute too, under the page of the same title
as the one it is on in the selected form.

  - `isLocalized` (boolean)

  - `templates` (array)
    The tables items start from, the whole set. Left out, the attribute keeps what it starts from;
empty, it starts from no table in any language.

  - `templates.language` (string)

  - `templates.rows` (array)

  - `isSingleSelect` (boolean)

  - `options` (array)
    The options it offers, the whole set. Left out, it keeps what it offers; empty, it offers
nothing.

  - `options.identifier` (string)

  - `options.translations` (array)

  - `requiredVariants` (array)
    What is to be different about the platform's three. Left out, or empty, none changes.

  - `requiredVariants.code` (string)

  - `requiredVariants.quality` (integer)

  - `requiredVariants.fit` (string)
    Enum: "cropToFill", "fitInside"

  - `requiredVariants.title` (string)

  - `requiredVariants.outputFormat` (string)
    Enum: "mostSuitable", "jpg", "png", "gif", "webp"

  - `additionalVariants` (array)
    The tenant's own variants, the whole set: each keeps the variant whose code it names, or is a
new one without a code. Left out, every one is kept; empty, every one is removed.

  - `additionalVariants.code` (string)

  - `additionalVariants.title` (string)

  - `additionalVariants.width` (integer)

  - `additionalVariants.height` (integer)

  - `additionalVariants.quality` (integer)

  - `additionalVariants.fit` (string)
    Enum: "cropToFill", "fitInside"

  - `additionalVariants.outputFormat` (string)
    Enum: "mostSuitable", "jpg", "png", "gif", "webp"

  - `linkingPattern` (string)
    The formula images are linked by. Left out, it is kept; empty, it is cleared.

  - `linkingPattern` (string)
    The formula files are linked by. Left out, it is kept; empty, it is cleared.

  - `targetEntityIdentifier` (string)

  - `itemLimit` (integer)
    How many items one item may link. `0` is no limit.

  - `pickerDisplayAttributes` (array)
    The picker's columns, the whole list. Empty shows the target's reference alone.

  - `labelAttributes` (array)
    The label's attributes, the whole list. Empty shows the target's reference alone.

  - `type` (string)
    Enum: "longText"

  - `type` (string)
    Enum: "number"

  - `type` (string)
    Enum: "boolean"

  - `type` (string)
    Enum: "url"

  - `type` (string)
    Enum: "date"

  - `type` (string)
    Enum: "table"

  - `type` (string)
    Enum: "checklist"

  - `type` (string)
    Enum: "imagePack"

  - `type` (string)
    Enum: "file"

  - `type` (string)
    Enum: "linkItems"

## Request examples:

  - `Renames an attribute and adds it to the form of every attribute set, where the form of set 7 places it` (unknown)

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `@readLink` (string)

  - `@editLink` (string)

  - `@etag` (string)

  - `@navigationLinks` (array)

  - `@navigationLinks.uri` (string)

  - `@associationLinks` (array)

  - `@associationLinks.uri` (string)

  - `@context` (string)

  - `value` (any)

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `validationFailures` (object)

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `message` (string)

  - `request_id` (string)

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `message` (string)

  - `request_id` (string)

## Response 404:

  - `404` (unknown)
    Not Found

## Response 409:

  - `409` (unknown)
    Conflict

## Response 409 fields (application/json):

  - `error` (string)

## Response 500:

  - `500` (unknown)
    Internal Server Error

## Response 500 fields (application/json):

  - `error` (string)

  - `details` (any)

## Response 200 examples:

  - `The attribute as it now stands` (unknown)

## Response 400 examples:

  - `No body was sent` (unknown)

## Response 404 examples:

  - `No attribute has that identifier` (unknown)

## Response 409 examples:

  - `A platform attribute's type cannot change` (unknown)

