Renames a category of materials, products or resources. Only the name changes; the items stay in the category.

```
v1/categories/edit.php
```

## Parameters

| Field | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Whose category: "materials", "products" or "resources" |
| category_id | int | Yes | Category ID |
| name | string | Yes | New name |

## Example request

```
{
    "type": "materials",
    "category_id": 14,
    "name": "Solid wood"
}
```

## Example response

```
{
    "success": true
}
```

## Errors

| Error | Reason |
|---|---|
| No type in input | type is missing |
| Invalid type value. Must be one of: materials, products, resources | Invalid type |
| No category_id in input | category_id is missing (same for name) |
| Category not found or access denied | There is no category with that ID among the categories of this type |
| Name must not be empty | Empty name |
| Name must be a string | name is not a string |
| name is too long: maximum 200 characters | Name longer than 200 characters |
