---
title: "Update an attribute"
method: PUT
path: "/catalog/attributes/{id}"
tags: ["Admin Catalog: Attributes"]
---

# Update an attribute

`PUT /catalog/attributes/{id}`

## Request

- Base URL: `http://localhost:8000/api/admin`
- URL: `http://localhost:8000/api/admin/catalog/attributes/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-admin-api/docs/catalog/attributes/:id/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates an attribute. The `code` field cannot be changed (returns 422 if a different code is supplied). Changing `type` is refused when product attribute values exist.

## Path parameters

- `id` integer, required

## Request body

- object
  - `code` string, required
  - `admin_name` string, required
  - `type` string, required
  - `is_filterable` boolean
  - `translations` object
  - `options` object[]: Full replacement list. Items with id are updated; without id are inserted; omitted ids are deleted.

## Response `200`

Attribute updated. Returns the full attribute detail.

## Other responses

- `400`: Invalid input
- `404`: Not found
- `422`: Code change refused or type immutable.

---

[API](https://skmtc.dev/bagisto/apis/bagisto-admin-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-admin-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-admin-api/revisions/3198f11be70f?raw)
