--- title: "Category" slug: "server-api-kb-category" updated: 2022-06-16T07:57:00Z published: 2022-06-16T07:57:00Z canonical: "developer.comm100.com/server-api-kb-category" --- > ## Documentation Index > Fetch the complete documentation index at: https://developer.comm100.com/llms.txt > Use this file to discover all available pages before exploring further. # Category ## Category You need the Manage articles permission to manage categorys. - `Categories` - Categories Manage - `GET kb/categories` - [Get the list of Categories](/docs/server-api-kb-category#get-the-list-of-categories) - `GET kb/categories/{id}` - [Get a single Category](/docs/server-api-kb-category#get-a-single-category) - `POST kb/categories` - [Create a new Category](/docs/server-api-kb-category#create-a-new-category) - `PUT kb/categories/{id}` - [Update the Category](/docs/server-api-kb-category#update-the-category) - `DELETE kb/categories/{id}` - [Remove the Category](/docs/server-api-kb-category#remove-the-category) ### Category JSON Format Category is represented as simple flat JSON objects with the following keys: | Name | Type | Description | | --- | --- | --- | | `id` | guid | Id of the category. | | `kbId` | guid | Id of the knowledage base. | | `name` | string | Name of the category. | | `order` | integer | Order of the category. | | `parentId` | guid | Id of the parent category. | | `createdById` | guid | Id of the agent who created the category. | | `createdTime` | datetime | Time when the category was created. | | `modifiedById` | guid | Id of the agent who modified the category. | | `modifiedTime` | timestamp | Time when the category was last modified. | ### Get the list of Categories `GET kb/categories` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `keywords` | string | query | no | Search keywords. | | `kbId` | guid | query | no | Id of the knowledage base. | - #### Response: An array of [Category](/docs/server-api-kb-category#category-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/kb/categories \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` [ { "id": "8a21934a-7def-4064-a211-3cc5295282f9", "kbId": "b2754e68-b380-4a61-9c5b-a9570f1a4fcc", "name": "Support", "order": 8, "parentId": "8a21934a-7def-4064-a211-3cc5295282f9", "createdById": "21b5d834-b98b-48ba-ae45-0d1316cb382f", "createdTime": "2021-04-09T10:38:47.223Z", "modifiedById": "21b5d834-b98b-48ba-ae45-0d1316cb382f", "modifiedTime": "2021-04-09T10:38:47.223Z" } ] ``` ### Get a single Category `GET kb/categories/{id}` - #### Parameters: No Parameters - #### Response: [Category](/docs/server-api-kb-category#category-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/kb/categories/8a21934a-7def-4064-a211-3cc5295282f9 \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` { "id": "8a21934a-7def-4064-a211-3cc5295282f9", "kbId": "b2754e68-b380-4a61-9c5b-a9570f1a4fcc", "name": "Support", "order": 8, "parentId": "8a21934a-7def-4064-a211-3cc5295282f9", "createdById": "21b5d834-b98b-48ba-ae45-0d1316cb382f", "createdTime": "2021-04-09T10:38:47.223Z", "modifiedById": "21b5d834-b98b-48ba-ae45-0d1316cb382f", "modifiedTime": "2021-04-09T10:38:47.223Z" } ``` ### Create a new Category `POST kb/categories` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `kbId` | guid | body | yes | Id of the knowledage base. | | `name` | string | body | yes | Name of the category. | | `order` | integer | body | no | Order of the category. | | `parentId` | guid | body | yes | Id of the parent category. | - #### Response: [Category](/docs/server-api-kb-category#category-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/kb/categories \ -X 'POST' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"kbId":"b2754e68-b380-4a61-9c5b-a9570f1a4fcc","name":"Support","order":8,"parentId":"8a21934a-7def-4064-a211-3cc5295282f9"}' ``` Response: HTTP/1.1 201 Created ``` { "id": "8a21934a-7def-4064-a211-3cc5295282f9", "kbId": "b2754e68-b380-4a61-9c5b-a9570f1a4fcc", "name": "Support", "order": 8, "parentId": "8a21934a-7def-4064-a211-3cc5295282f9", "createdById": "21b5d834-b98b-48ba-ae45-0d1316cb382f", "createdTime": "2021-04-09T10:38:47.223Z", "modifiedById": "21b5d834-b98b-48ba-ae45-0d1316cb382f", "modifiedTime": "2021-04-09T10:38:47.223Z" } ``` ### Update the Category `PUT kb/categories/{id}` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `name` | string | body | yes | Name of the category. | | `order` | integer | body | no | Order of the category. | | `parentId` | guid | body | yes | Id of the parent category. | - #### Response: [Category](/docs/server-api-kb-category#category-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/kb/categories/8a21934a-7def-4064-a211-3cc5295282f9 \ -X 'PUT' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"name":"Support","order":8,"parentId":"8a21934a-7def-4064-a211-3cc5295282f9"}' ``` Response: HTTP/1.1 200 OK ``` { "id": "8a21934a-7def-4064-a211-3cc5295282f9", "kbId": "b2754e68-b380-4a61-9c5b-a9570f1a4fcc", "name": "Support", "order": 8, "parentId": "8a21934a-7def-4064-a211-3cc5295282f9", "createdById": "21b5d834-b98b-48ba-ae45-0d1316cb382f", "createdTime": "2021-04-09T10:38:47.223Z", "modifiedById": "21b5d834-b98b-48ba-ae45-0d1316cb382f", "modifiedTime": "2021-04-09T10:38:47.223Z" } ``` ### Remove the Category `DELETE kb/categories/{id}` - #### Parameters: No Parameters - #### Response: No Content - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/kb/categories/8a21934a-7def-4064-a211-3cc5295282f9 \ -X 'DELETE' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 204 No Content