# Update Category Attribute

Changes an attribute of the Category 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 category's value whatever else the request
changes. `attributeSet` is for Products and Variants only: Categories refuse it.
A member the `type` does not declare is refused with a 400, and the attribute is left as it
was: `pageTitle` and `fieldSize`, which only a create takes — the place on the form is changed
through the form layout route —, and the members the get attribute route writes back, such as
`identifier` or `kind`.
## Changing the type
Sending another `type` converts the attribute; only the tenant's own attributes can be converted.
What each item keeps depends on the type the attribute ends up as. A value that cannot be carried
across is emptied, never shortened nor coerced; `"deleteExistingValues": true` empties every value
instead.
| Converted into | What each item keeps |
|  --- | --- |
| `shortText`, `longText`, `url` | Text as it is, emptied when longer than the type holds; a `number` as it reads (`12.5`); a `boolean` as `1` or `0`; a `date` as the item stores it, `2026-01-01 10:00:00` (no `T`, no offset); a `checklist` as its options and a `linkItems` as its references, separated by commas; a `table` as its text, when it fits. An `imagePack` and a `file` keep nothing. |
| `number` | A value that reads as a number as a whole; a `boolean` as `1` or `0`. Anything else is emptied, and so is every `date`, `table`, `imagePack` and `file`. |
| `boolean` | Yes when the whole value is a word read as yes (`1`, `y`, `yes`, `si`, `ok`, `true`…), no otherwise; a `number` is yes only when it is `1`. Every `date`, `table`, `imagePack` and `file` is emptied. |
| `date` | A value that reads as a date as a whole. Anything else is emptied, and so is every `number`, `boolean`, `table`, `imagePack` and `file`. |
| `checklist` | Text as it is, emptied when longer than it holds, each comma separating one option from the next (`Rojo, Azul` is tagged with `Rojo` and `Azul`); a `number` as it reads (`12.5`); a `boolean` as `1` or `0`; a `date` as text; a `linkItems` with each reference as an option. Every `table`, `imagePack` and `file` is emptied. |
| `table` | A value that is already a grid, as an item stores one. Anything else is emptied. |
| `linkItems` | Text as it is, emptied when longer than it holds, each stretch between commas read as one reference; a `checklist` with each option as a reference; a `number` as it reads (`12.5`). Every `boolean`, `date`, `table`, `imagePack` and `file` is emptied. |
| `imagePack`, `file` | A value naming, separated by commas, only images — or files — the tenant's library already has, no more than the plan allows per item. Anything else is emptied whole, and so is every `linkItems`, `number`, `boolean`, `date`, `table` and the other of the two. |

## Response
**200 OK** — the attribute as it now stands, under `value`.
## Example

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

Endpoint: PATCH /Metadata/Categories/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 category's value whatever else the request
changes. `attributeSet` is for Products and Variants only: Categories refuse it. A member the `type` does not declare is refused with a 400, and the attribute is left as it
was: `pageTitle` and `fieldSize`, which only a create takes — the place on the form is changed
through the form layout route —, and the members the get attribute route writes back, such as
`identifier` or `kind`.

  - `Changing the type` ()
    Sending another `type` converts the attribute; only the tenant's own attributes can be converted.
What each item keeps depends on the type the attribute ends up as. A value that cannot be carried
across is emptied, never shortened nor coerced; `"deleteExistingValues": true` empties every value
instead. | Converted into | What each item keeps |
|  --- | --- |
| `shortText`, `longText`, `url` | Text as it is, emptied when longer than the type holds; a `number` as it reads (`12.5`); a `boolean` as `1` or `0`; a `date` as the item stores it, `2026-01-01 10:00:00` (no `T`, no offset); a `checklist` as its options and a `linkItems` as its references, separated by commas; a `table` as its text, when it fits. An `imagePack` and a `file` keep nothing. |
| `number` | A value that reads as a number as a whole; a `boolean` as `1` or `0`. Anything else is emptied, and so is every `date`, `table`, `imagePack` and `file`. |
| `boolean` | Yes when the whole value is a word read as yes (`1`, `y`, `yes`, `si`, `ok`, `true`…), no otherwise; a `number` is yes only when it is `1`. Every `date`, `table`, `imagePack` and `file` is emptied. |
| `date` | A value that reads as a date as a whole. Anything else is emptied, and so is every `number`, `boolean`, `table`, `imagePack` and `file`. |
| `checklist` | Text as it is, emptied when longer than it holds, each comma separating one option from the next (`Rojo, Azul` is tagged with `Rojo` and `Azul`); a `number` as it reads (`12.5`); a `boolean` as `1` or `0`; a `date` as text; a `linkItems` with each reference as an option. Every `table`, `imagePack` and `file` is emptied. |
| `table` | A value that is already a grid, as an item stores one. Anything else is emptied. |
| `linkItems` | Text as it is, emptied when longer than it holds, each stretch between commas read as one reference; a `checklist` with each option as a reference; a `number` as it reads (`12.5`). Every `boolean`, `date`, `table`, `imagePack` and `file` is emptied. |
| `imagePack`, `file` | A value naming, separated by commas, only images — or files — the tenant's library already has, no more than the plan allows per item. Anything else is emptied whole, and so is every `linkItems`, `number`, `boolean`, `date`, `table` and the other of the two. |

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

  - `Example` ()
    ```http
PATCH /Metadata/Categories/attributes('cat_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 afterwards: the whole set, in order, with at least one option. Left out
or `null`, it keeps what it offers; mandatory when the attribute is being converted. An
empty list is refused with 400: a list of attributes must offer at least one option. An option
left out stops being offered, and the items tagged with it keep the text they carry.

  - `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 a short text attribute` (unknown)

  - `Asks to change a platform attribute's type (refused with 409)` (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)

  - `An attribute set sent to Categories` (unknown)

  - `fieldSize or pageTitle sent: only a create takes them` (unknown)

  - `A member the change's type does not declare, such as one the read writes back` (unknown)

  - `A type that names no kind of attribute` (unknown)

  - `A value of the wrong kind: true or false sent as text, which is refused rather than read as true` (unknown)

## Response 404 examples:

  - `No attribute has that identifier` (unknown)

## Response 409 examples:

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

