# Update category

_Cms / Categories_

`PUT /cms/categories/{bucketId}`

## Parameters

- `id` (number, required) — The unique identifier of the category to update
- `name` (string, required) — The name of the category
- `slug` (string, required) — The URL-friendly identifier for the category
- `section` (number, required) — The section the category belongs to 1-pages, 2-contents
- `imageUrl` (string, optional) — The URL of the category image

## Responses

### `200` — Category updated successfully

Type: `GenericResultResponse<boolean>`



## Code Examples

### curl

```curl
curl --request PUT \
 --url https://apis-spb.konso.io/cms/categories/{bucketId} \
 --header 'Content-Type: application/json' \
 --header 'x-api-key: {your-api-key}' \
 --data '{
 "id": 123456,
 "name": "Updated Category",
 "slug": "updated-category",
 "section": 1,
 "imageUrl": "https://example.com/updated-image.jpg"
 }'
```

### javascript

```js
const options = {
 method: 'PUT',
 headers: {
 'Content-Type': 'application/json',
 'x-api-key': '{your-api-key}'
 },
 body: JSON.stringify({
 id: 123456,
 name: 'Updated Category',
 slug: 'updated-category',
 section: 1,
 imageUrl: 'https://example.com/updated-image.jpg'
 })
};

fetch('https://apis-spb.konso.io/cms/categories/{bucketId}', options)
 .then(response => response.json())
 .then(response => console.log(response))
 .catch(err => console.error(err));
```

### Request Body Example

```json
{
  "id": 12345,
  "name": "Example Name",
  "slug": "example-string",
  "section": 42,
  "imageUrl": "example-string"
}
```

### Response Example (200)

```json
{
 "result": true
}
```
