# Workorder Portal API

API for managing workorder portal operations

**Version:** 1.0.0

## Overview

### Base URLs

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

### API Categories

- **Workorder Portal**: Workorder portal management operations

## Authentication

This API uses the following authentication methods:

- **ApiKeyAuth**

## Endpoints

### `/workorder-portal`

#### GET /workorder-portal

**Summary:** Get workorder portal entries

**Description:** Retrieve workorder portal entries with optional filtering and pagination

**Tags:** Workorder Portal

##### 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 |

| `status` | query | string | No | Filter by status |

| `workorder` | query | string | No | Filter by workorder ID |

| `client` | query | string | No | Filter by client 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-portal

**Summary:** Create a new workorder portal entry

**Description:** Create a new workorder portal entry

**Tags:** Workorder Portal

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**201** - Workorder portal entry created successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**422** - No description

**500** - No description

---

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

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

**Summary:** Get workorder portal entry by ID

**Description:** Retrieve a specific workorder portal entry by its ID

**Tags:** Workorder Portal

##### Parameters

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

| `id` | path | string | Yes | Workorder portal entry 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-portal/{id}

**Summary:** Update workorder portal entry

**Description:** Update an existing workorder portal entry

**Tags:** Workorder Portal

##### Parameters

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

| `id` | path | string | Yes | Workorder portal entry ID |

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Workorder portal entry 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-portal/{id}

**Summary:** Delete workorder portal entry

**Description:** Delete a workorder portal entry by ID

**Tags:** Workorder Portal

##### Parameters

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

| `id` | path | string | Yes | Workorder portal entry ID |

##### Responses

**200** - Workorder portal entry deleted successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

### `/workorder-portal/{id}/status`

#### PATCH /workorder-portal/{id}/status

**Summary:** Update workorder portal status

**Description:** Update the status of a workorder portal entry

**Tags:** Workorder Portal

##### Parameters

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

| `id` | path | string | Yes | Workorder portal entry ID |

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Status updated successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

## Data Models

### WorkorderPortal

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

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

| `workorder` | string | Yes | Workorder ID reference |

| `client` | string | Yes | Client ID reference |

| `portal_access_code` | string | Yes | Unique access code for portal |

| `status` | string | Yes | Current status |

| `access_level` | string | No | Level of access granted |

| `allowed_actions` | array | No | Actions allowed for this portal access |

| `expiry_date` | string | No | When portal access expires |

| `last_accessed` | string | No | Last time portal was accessed |

| `access_count` | integer | No | Number of times portal was accessed |

| `notifications` | object | No | No description |

| `portal_settings` | object | No | No description |

| `custom_branding` | object | No | No description |

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

| `disabled` | boolean | No | Whether portal access is disabled |

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

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

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

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

### CreateWorkorderPortalRequest

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

| `workorder` | string | Yes | Workorder ID reference |

| `client` | string | Yes | Client ID reference |

| `access_level` | string | No | Level of access granted |

| `allowed_actions` | array | No | Actions allowed for this portal access |

| `expiry_date` | string | No | When portal access expires |

| `notifications` | object | No | No description |

| `portal_settings` | object | No | No description |

| `custom_branding` | object | No | No description |

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

| `disabled` | boolean | No | Whether portal access is disabled |

### UpdateWorkorderPortalRequest

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

| `status` | string | No | Current status |

| `access_level` | string | No | Level of access granted |

| `allowed_actions` | array | No | No description |

| `expiry_date` | string | No | When portal access expires |

| `notifications` | object | No | No description |

| `portal_settings` | object | No | No description |

| `custom_branding` | object | No | No description |

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

| `disabled` | boolean | No | Whether portal access 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-portal-examples.md](./workorder-portal-examples.md) for detailed TypeScript usage examples.
