> For the complete documentation index, see [llms.txt](https://docs.amala.cloud/amalacloud-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amala.cloud/amalacloud-api-docs/business/id-verification-history.md).

# ID Verification History

The Verification History API allows service providers to retrieve a paginated list of all past verification requests regardless of the type of verification.

### Base URL

```
https://acs-uat-verifications.amala.cloud/
```

### Endpoint

```swift
POST https://acs-uat-verifications.amala.cloud/verification/api/v1/history/svp
```

### Request Headers

| Header          | Type               | Description                                        |
| --------------- | ------------------ | -------------------------------------------------- |
| `Content-Type`  | `application/json` | Specifies that the request body is in JSON format. |
| `Authorization` | `Bearer <token>`   | API Key or Bearer Token for authentication.        |

### Request Parameters

#### Query Parameters

| Parameter    | Type    | Required | Default | Description                  |
| ------------ | ------- | -------- | ------- | ---------------------------- |
| `pageNumber` | integer | ❌        | `1`     | The page number to retrieve. |
| `pageSize`   | integer | ❌        | `20`    | Number of records per page.  |

### Request Body

The request body should contain **filtering options** for retrieving history.

#### Example Request

```json
{
  "pageNumber": 1,
  "pageSize": 20,
  "startDate": "2024-01-01T00:00:00.000Z",
  "endDate": "2024-01-31T23:59:59.000Z",
  "status": "Completed",
  "verificationType": "DriverLicense",
  "duration": "LastMonth",
  "serviceProviderCode": "SPC001"
}
```

#### Request Body Schema

#### Request Body Schema

| Field                 | Type              | Required | Description                                                             |
| --------------------- | ----------------- | -------- | ----------------------------------------------------------------------- |
| `pageNumber`          | integer           | ❌        | The page number to retrieve.                                            |
| `pageSize`            | integer           | ❌        | The number of records per page.                                         |
| `startDate`           | string (ISO 8601) | ✅        | The start date for filtering history.                                   |
| `endDate`             | string (ISO 8601) | ✅        | The end date for filtering history.                                     |
| `status`              | string            | ❌        | The status of the verification (e.g., "Completed", "Pending").          |
| `verificationType`    | string            | ❌        | The type of verification performed (e.g., "DriverLicense", "Passport"). |
| `duration`            | string            | ❌        | The time range for filtering results (e.g., "LastMonth").               |
| `serviceProviderCode` | string            | ✅        | Code identifying the service provider.                                  |

### Responses

#### Success Response (200 OK)

If the request is successful, the API returns **paginated verification history**.

```json
{
  "apiVersion": "1.0",
  "success": true,
  "code": "00",
  "message": "Request successful",
  "requestId": "REQ-789456",
  "data": {
    "result": [
      {
        "id": "VH123456",
        "name": "John Doe",
        "email": "john.doe@email.com",
        "verificationType": "DriverLicense",
        "transactionId": "TXN-987654",
        "initiatedBy": "admin",
        "dateChecked": "2024-01-05T14:30:00.000Z",
        "status": "Completed",
        "response": "Match Found"
      }
    ],
    "pageNumber": 1,
    "pageSize": 20,
    "totalCount": 150,
    "totalPages": 8,
    "hasPreviousPage": false,
    "hasNextPage": true,
    "links": {
      "firstPage": "/verification/api/v1/history/svp?page=1",
      "currentPage": "/verification/api/v1/history/svp?page=1",
      "nextPage": "/verification/api/v1/history/svp?page=2",
      "lastPage": "/verification/api/v1/history/svp?page=8"
    }
  }
}

```

#### Error Responses

| Status Code | Description                      | Example Response                                                                   |
| ----------- | -------------------------------- | ---------------------------------------------------------------------------------- |
| `400`       | Bad Request (Invalid Parameters) | `{ "success": false, "message": "Invalid parameters.", "code": "400" }`            |
| `401`       | Unauthorized (Invalid API Key)   | `{ "success": false, "message": "Unauthorized access.", "code": "401" }`           |
| `404`       | Not Found (No history found)     | `{ "success": false, "message": "No verification history found.", "code": "404" }` |
| `500`       | Internal Server Error            | `{ "success": false, "message": "Something went wrong.", "code": "500" }`          |

### Usage Example (cURL)

```bash
curl -X POST "https://acs-uat-verifications.amala.cloud/verification/api/v1/history/svp?pageNumber=1&pageSize=20" \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
           "startDate": "2024-01-01T00:00:00.000Z",
           "endDate": "2024-01-31T23:59:59.000Z",
           "status": "Completed",
           "verificationType": "DriverLicense",
           "duration": "LastMonth",
           "serviceProviderCode": "SPC001"
         }'

```
