# OCR Invoice Job Page API

API for managing individual pages within OCR invoice jobs

**Version:** 1.0.0

## Overview

### Base URLs

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

- **Staging server**: `https://staging.sv.api.repzo.me`

### API Categories

- **OCR Invoice Job Page**: Operations related to individual pages within OCR invoice jobs

## Authentication

This API uses the following authentication methods:

- **ApiKeyAuth**

## Endpoints

### `/ocr-invoice-job-page`

#### GET /ocr-invoice-job-page

**Summary:** Get all OCR invoice job pages

**Description:** Retrieve a list of all OCR invoice job pages with optional filtering and pagination

**Tags:** OCR Invoice Job Page

##### Parameters

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

| `limit` | query | integer | No | Maximum number of records to return |

| `offset` | query | integer | No | Number of records to skip for pagination |

| `sort` | query | string | No | Field to sort by |

| `order` | query | string | No | Sort order (asc or desc) |

| `filter` | query | string | No | Filter conditions in JSON format |

| `search` | query | string | No | Search term for text fields |

##### Responses

**200** - List of OCR invoice job pages retrieved successfully

Content-Type: `application/json`

**400** - Bad request

**401** - Unauthorized

**500** - Internal server error

---

#### POST /ocr-invoice-job-page

**Summary:** Create a new OCR invoice job page

**Description:** Create a new OCR invoice job page with the provided data

**Tags:** OCR Invoice Job Page

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**201** - OCR invoice job page created successfully

Content-Type: `application/json`

**400** - Bad request

**401** - Unauthorized

**500** - Internal server error

---

### `/ocr-invoice-job-page/{id}`

#### GET /ocr-invoice-job-page/{id}

**Summary:** Get OCR invoice job page by ID

**Description:** Retrieve a specific OCR invoice job page by its ID

**Tags:** OCR Invoice Job Page

##### Parameters

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

| `id` | path | string | Yes | OCR invoice job page ID |

##### Responses

**200** - OCR invoice job page retrieved successfully

Content-Type: `application/json`

**404** - OCR invoice job page not found

**401** - Unauthorized

**500** - Internal server error

---

#### PUT /ocr-invoice-job-page/{id}

**Summary:** Update OCR invoice job page

**Description:** Update an existing OCR invoice job page with new data

**Tags:** OCR Invoice Job Page

##### Parameters

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

| `id` | path | string | Yes | OCR invoice job page ID |

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - OCR invoice job page updated successfully

Content-Type: `application/json`

**400** - Bad request

**404** - OCR invoice job page not found

**401** - Unauthorized

**500** - Internal server error

---

#### DELETE /ocr-invoice-job-page/{id}

**Summary:** Delete OCR invoice job page

**Description:** Delete an existing OCR invoice job page

**Tags:** OCR Invoice Job Page

##### Parameters

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

| `id` | path | string | Yes | OCR invoice job page ID |

##### Responses

**200** - OCR invoice job page deleted successfully

Content-Type: `application/json`

**404** - OCR invoice job page not found

**401** - Unauthorized

**500** - Internal server error

---

### `/ocr-invoice-job-page/{id}/process`

#### POST /ocr-invoice-job-page/{id}/process

**Summary:** Process OCR invoice job page

**Description:** Start processing a specific page of an OCR invoice job

**Tags:** OCR Invoice Job Page

##### Parameters

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

| `id` | path | string | Yes | OCR invoice job page ID |

##### Responses

**200** - OCR invoice job page processing started

Content-Type: `application/json`

**404** - OCR invoice job page not found

**401** - Unauthorized

**500** - Internal server error

---

## Data Models

### OcrInvoiceJobPage

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

| `_id` | string | No | Unique identifier for the OCR invoice job page |

| `job` | string | Yes | OCR invoice job ID this page belongs to |

| `pageNumber` | integer | Yes | Page number within the document |

| `pageUrl` | string | Yes | URL of the page image |

| `status` | string | No | Processing status of this page |

| `pageType` | string | No | Type of page content |

| `imageProperties` | object | No | No description |

| `preprocessing` | object | No | No description |

| `ocrResults` | object | No | No description |

| `extractedFields` | object | No | Fields extracted from this page |

| `tableData` | array | No | No description |

| `processingTime` | number | No | Processing time for this page in seconds |

| `startedAt` | string | No | When page processing started |

| `completedAt` | string | No | When page processing completed |

| `errorLog` | string | No | Error log if processing failed |

| `retryCount` | integer | No | Number of retry attempts |

| `qualityScore` | number | No | Quality score of the page |

| `annotations` | array | No | No description |

| `metadata` | object | No | Additional metadata |

| `createdAt` | string | No | Record creation timestamp |

| `updatedAt` | string | No | Record last update timestamp |

### OcrInvoiceJobPageInput

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

| `job` | string | Yes | OCR invoice job ID this page belongs to |

| `pageNumber` | integer | Yes | Page number within the document |

| `pageUrl` | string | Yes | URL of the page image |

| `pageType` | string | No | Type of page content |

| `imageProperties` | object | No | No description |

| `annotations` | array | No | No description |

| `metadata` | object | No | Additional metadata |

## TypeScript Usage

See [ocr-invoice-job-page-examples.md](./ocr-invoice-job-page-examples.md) for detailed TypeScript usage examples.
