Create Category

Create a new category to organize knowledge items.

Endpoint

POST /v1/workspaces/{workspaceId}/category

Request

curl -X POST \
  'https://api.sharely.ai/v1/workspaces/{workspaceId}/category' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'organizationid: your-organization-id' \
  -d '{
    "name": "Product Documentation",
    "description": "All product-related docs",
    "parentId": null,
    "metadata": {
      "color": "blue",
      "icon": "book"
    }
  }'

Body Parameters

ParameterTypeRequiredDescription
namestringYesCategory name
descriptionstringNoCategory description
parentIdstring (UUID)NoParent category ID for hierarchical structure
metadataobjectNoCustom metadata fields

Response

{
  "id": "category-uuid",
  "workspaceId": "workspace-uuid",
  "name": "Product Documentation",
  "description": "All product-related docs",
  "parentId": null,
  "metadata": {
    "color": "blue",
    "icon": "book"
  },
  "createdAt": "2024-11-14T15:30:00Z",
  "updatedAt": "2024-11-14T15:30:00Z"
}

Related Endpoints