# Workorder Portal Link API

API for managing workorder portal links

**Version:** 1.0.0

## Overview

### Base URLs

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

### API Categories

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

## Authentication

This API uses the following authentication methods:

- **ApiKeyAuth**

## Endpoints

### `/workorder-portal-link`

#### GET /workorder-portal-link

**Summary:** Get all workorder portal links

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

**Tags:** Workorder Portal Link

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

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

| `is_active` | query | boolean | No | Filter by active status |

| `link_type` | query | string | No | Filter by link type |

| `_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-link

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

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

**Tags:** Workorder Portal Link

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**201** - Workorder portal link created successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**422** - No description

**500** - No description

---

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

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

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

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

**Tags:** Workorder Portal Link

##### Parameters

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

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

**Summary:** Update workorder portal link

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

**Tags:** Workorder Portal Link

##### Parameters

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

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

##### Request Body

**Content Types:**

- `application/json`

##### Responses

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

**Summary:** Delete workorder portal link

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

**Tags:** Workorder Portal Link

##### Parameters

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

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

##### Responses

**200** - Workorder portal link deleted successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

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

#### POST /workorder-portal-link/{id}/regenerate

**Summary:** Regenerate portal link

**Description:** Regenerate the portal link URL and access token

**Tags:** Workorder Portal Link

##### Parameters

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

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

##### Responses

**200** - Portal link regenerated successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

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

#### POST /workorder-portal-link/{id}/activate

**Summary:** Activate portal link

**Description:** Activate a workorder portal link

**Tags:** Workorder Portal Link

##### Parameters

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

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

##### Responses

**200** - Portal link activated successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

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

#### POST /workorder-portal-link/{id}/deactivate

**Summary:** Deactivate portal link

**Description:** Deactivate a workorder portal link

**Tags:** Workorder Portal Link

##### Parameters

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

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

##### Responses

**200** - Portal link deactivated successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

## Data Models

### WorkorderPortalLink

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

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

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

| `link_token` | string | Yes | Unique token for the portal link |

| `full_url` | string | No | Complete portal link URL |

| `link_type` | string | Yes | Type of portal link |

| `permissions` | object | No | No description |

| `access_restrictions` | object | No | No description |

| `expiry_date` | string | No | When the portal link expires |

| `is_active` | boolean | No | Whether the portal link is active |

| `usage_stats` | object | No | No description |

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

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

| `metadata` | object | No | No description |

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

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

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

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

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

### CreateWorkorderPortalLinkRequest

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

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

| `link_type` | string | No | Type of portal link |

| `permissions` | object | No | No description |

| `access_restrictions` | object | No | No description |

| `expiry_date` | string | No | When the portal link expires |

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

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

| `metadata` | object | No | No description |

| `is_active` | boolean | No | Whether the portal link is active |

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

### UpdateWorkorderPortalLinkRequest

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

| `link_type` | string | No | Type of portal link |

| `permissions` | object | No | No description |

| `access_restrictions` | object | No | No description |

| `expiry_date` | string | No | When the portal link expires |

| `is_active` | boolean | No | Whether the portal link is active |

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

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

| `metadata` | object | No | No description |

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

### 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-link-examples.md](./workorder-portal-link-examples.md) for detailed TypeScript usage examples.
