## Create a category `POST https://getkollek.com/api/collections/{collection}/categories` Create a category within a collection. **Permissions:** Owners and editors. Viewers get a 404 response. ### Path parameters - `collection` (integer, required): The ID of the collection the category belongs to. ### 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 created category object. ### Example request ```bash curl https://getkollek.com/api/collections/1/categories \ -X POST \ -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: 201` ```json { "data": { "type": "category", "id": "1", "attributes": { "name": "Marvel", "description": "Key issues and full runs from the 1990s Marvel era.", "collection_id": "1", "parent_id": null, "created_at": 1752537600, "updated_at": 1752537600 }, "links": { "self": "https://getkollek.com/api/collections/1/categories/1" } } } ```