## Update a category `PUT https://getkollek.com/api/collections/{collection}/categories/{category}` Update the name, description and parent of a category. A category cannot be its own parent, nor be nested under one of its own descendants. **Permissions:** Owners and editors. Viewers get a 404 response. ### Path parameters - `collection` (integer, required): The ID of the collection the category belongs to. - `category` (integer, required): The ID of the category. ### Body parameters - `name` (string, required): The name of the category. Maximum 255 characters. - `parent_id` (integer, optional): The ID of the parent category, for nesting. Must belong to the same collection. - `description` (string, optional): What the category holds, shown on the category page. Maximum 255 characters. **Returns:** The updated category object. ### Example request ```bash curl https://getkollek.com/api/collections/1/categories/2 \ -X PUT \ -H "Authorization: Bearer $API_KEY" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "name": "Marvel", "parent_id": "1", "description": "Key issues and full runs from the 1990s Marvel era." }' ``` ### Example response `Status: 200` ```json { "data": { "type": "category", "id": "2", "attributes": { "name": "Spider-Man", "description": null, "collection_id": "1", "parent_id": "1", "created_at": 1752537600, "updated_at": 1752537600 }, "links": { "self": "https://getkollek.com/api/collections/1/categories/2" } } } ```