# Workorder Category API

API for managing workorder categories

**Version:** 1.0.0

## Overview

### Base URLs

- **Production server**: `https://api.repzo.me/v1`

### API Categories

- **Workorder Category**: Workorder category management operations

## Authentication

This API uses the following authentication methods:

- **ApiKeyAuth**

## Endpoints

### `/workorder-category`

#### GET /workorder-category

**Summary:** Get all workorder categories

**Description:** Retrieve a list of all workorder categories with optional filtering and pagination

**Tags:** Workorder Category

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `page` | query | integer | No | Page number for pagination |

| `per_page` | query | integer | No | Number of items per page |

| `sort` | query | string | No | Sort field |

| `company_namespace` | query | array | No | Company namespace for filtering |

| `disabled` | query | boolean | No | Filter by disabled status |

| `parent_category` | query | string | No | Filter by parent category ID |

| `_id` | query | array | No | Filter by ID |

##### Responses

**200** - Successful response

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**500** - No description

---

#### POST /workorder-category

**Summary:** Create a new workorder category

**Description:** Create a new workorder category

**Tags:** Workorder Category

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**201** - Workorder category created successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**422** - No description

**500** - No description

---

### `/workorder-category/{id}`

#### GET /workorder-category/{id}

**Summary:** Get workorder category by ID

**Description:** Retrieve a specific workorder category by its ID

**Tags:** Workorder Category

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `id` | path | string | Yes | Workorder category ID |

##### Responses

**200** - Successful response

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

#### PATCH /workorder-category/{id}

**Summary:** Update workorder category

**Description:** Update an existing workorder category

**Tags:** Workorder Category

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `id` | path | string | Yes | Workorder category ID |

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Workorder category updated successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**422** - No description

**500** - No description

---

#### DELETE /workorder-category/{id}

**Summary:** Delete workorder category

**Description:** Delete a workorder category by ID

**Tags:** Workorder Category

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `id` | path | string | Yes | Workorder category ID |

##### Responses

**200** - Workorder category deleted successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

### `/workorder-category/remove`

#### POST /workorder-category/remove

**Summary:** Bulk delete workorder categories

**Description:** Delete multiple workorder categories by their IDs

**Tags:** Workorder Category

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Workorder categories deleted successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**500** - No description

---

### `/workorder-category/hierarchy`

#### GET /workorder-category/hierarchy

**Summary:** Get category hierarchy

**Description:** Get workorder categories in hierarchical structure

**Tags:** Workorder Category

##### Responses

**200** - Category hierarchy retrieved successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**500** - No description

---

## Data Models

### WorkorderCategory

| Property | Type | Required | Description |
| -------- | ---- | -------- | ----------- |

| `_id` | string | No | Unique identifier |

| `name` | string | Yes | Category name |

| `description` | string | No | Category description |

| `code` | string | No | Category code for identification |

| `parent_category` | string | No | Parent category ID for hierarchical structure |

| `color` | string | No | Color code for visual identification |

| `icon` | string | No | Icon identifier |

| `priority_level` | integer | No | Default priority level for workorders in this category |

| `estimated_duration` | integer | No | Estimated duration in minutes |

| `required_skills` | array | No | Skills required for this category |

| `default_assignee` | string | No | Default assignee for this category |

| `notification_settings` | object | No | No description |

| `approval_required` | boolean | No | Whether approval is required for workorders in this category |

| `custom_fields` | array | No | Custom fields for this category |

| `sla_settings` | object | No | No description |

| `sort_order` | integer | No | Sort order for display |

| `company_namespace` | array | No | Company namespace |

| `disabled` | boolean | No | Whether the category is disabled |

| `createdAt` | string | No | Creation timestamp |

| `modifiedAt` | string | No | Last modification timestamp |

| `SVClient` | integer | No | Client version |

| `__v` | integer | No | Document version |

### WorkorderCategoryHierarchy

| Property | Type | Required | Description |
| -------- | ---- | -------- | ----------- |

| `_id` | string | No | Category ID |

| `name` | string | No | Category name |

| `description` | string | No | Category description |

| `code` | string | No | Category code |

| `color` | string | No | Color code |

| `icon` | string | No | Icon identifier |

| `children` | array | No | Child categories |

| `workorder_count` | integer | No | Number of workorders in this category |

### CreateWorkorderCategoryRequest

| Property | Type | Required | Description |
| -------- | ---- | -------- | ----------- |

| `name` | string | Yes | Category name |

| `description` | string | No | Category description |

| `code` | string | No | Category code for identification |

| `parent_category` | string | No | Parent category ID for hierarchical structure |

| `color` | string | No | Color code for visual identification |

| `icon` | string | No | Icon identifier |

| `priority_level` | integer | No | Default priority level for workorders in this category |

| `estimated_duration` | integer | No | Estimated duration in minutes |

| `required_skills` | array | No | Skills required for this category |

| `default_assignee` | string | No | Default assignee for this category |

| `notification_settings` | object | No | No description |

| `approval_required` | boolean | No | Whether approval is required for workorders in this category |

| `custom_fields` | array | No | No description |

| `sla_settings` | object | No | No description |

| `sort_order` | integer | No | Sort order for display |

| `company_namespace` | array | No | Company namespace |

| `disabled` | boolean | No | Whether the category is disabled |

### UpdateWorkorderCategoryRequest

| Property | Type | Required | Description |
| -------- | ---- | -------- | ----------- |

| `name` | string | No | Category name |

| `description` | string | No | Category description |

| `code` | string | No | Category code for identification |

| `parent_category` | string | No | Parent category ID for hierarchical structure |

| `color` | string | No | Color code for visual identification |

| `icon` | string | No | Icon identifier |

| `priority_level` | integer | No | Default priority level for workorders in this category |

| `estimated_duration` | integer | No | Estimated duration in minutes |

| `required_skills` | array | No | Skills required for this category |

| `default_assignee` | string | No | Default assignee for this category |

| `notification_settings` | object | No | No description |

| `approval_required` | boolean | No | Whether approval is required for workorders in this category |

| `custom_fields` | array | No | No description |

| `sla_settings` | object | No | No description |

| `sort_order` | integer | No | Sort order for display |

| `company_namespace` | array | No | Company namespace |

| `disabled` | boolean | No | Whether the category is disabled |

### PagingInfo

| Property | Type | Required | Description |
| -------- | ---- | -------- | ----------- |

| `total` | integer | No | Total number of items |

| `page` | integer | No | Current page number |

| `per_page` | integer | No | Items per page |

| `pages` | integer | No | Total number of pages |

## TypeScript Usage

See [workorder-category-examples.md](./workorder-category-examples.md) for detailed TypeScript usage examples.
