---
title: Update
slug: klevu-magento-v4/attribute-update
docTags: 
createdAt: 2024-08-06T14:19:22.175Z
---

:::hint{type="warning"}
Attribute update does not send any data to Klevu.

Its only purpose is to update the attributes in `klevu_indexing_attribute` database table and calculate their `next_action`
:::

Attribute Update triggers Attribute Discovery for a selection of entity IDs.
Various plugins and observers trigger an attribute update, e.g. when an attribute is saved.

Attribute update will:

- add any missing attributes and determine if those [attributes are indexable](https://docs.klevu.com/klevu-magento-v4/attribute-is-indexable-determiner).
- set any of the passed attribute IDs which are no longer indexable, but were previously registered, to have a `next_action` of `Delete`.
- set any of the passed attribute IDs that have become indexable to have a `next_action` of `Add`.
- set the `next_action` for the passed attribute IDs to `Update` if they are indexable.

Attribute update will **NOT**:

- send any data to Klevu.

Attribute update is triggered:

- via plugins
- via observers
- via CLI

`\Klevu\Indexing\Service\AttributeUpdateOrchestratorService` responsible for attribute update. All the above methods of triggering attribute update use this service.

### CLI

`klevu:indexing:attribute-update`

The update can also be triggered via CLI and has 1 required parameter and 2 optional parameters&#x20;

- `attribute-ids` - comma-separated list of attribute IDs to update
- `api-keys` - \[optional] comma-separated list of API keys to update
- `attribute-types` - \[optional] comma-separated list of  attribute types to update, options:
  - `KLEVU_PRODUCT`&#x20;
  - `KLEVU_CATEGORY`

e.g

```shell
bin/magento klevu:indexing:attribute-update \
    --attribute-ids="1,2,3" \
    --attribute-types="KLEVU_PRODUCT" \
    --api-keys="klevu-example-js-api-key" 

```

