> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/rest-api/identity-api/identity-api-reference/onboarding/morphology/document-validation/document-validation-start.md).

# Document validation Start

Start the morphological validation process for identity documents by sending the **document images, country and type** of document to analyze.

### Endpoint

```
POST /verify/documentValidation/start
```

### Headers

| Name          | Type   | Required | Description                                                |
| ------------- | ------ | -------- | ---------------------------------------------------------- |
| **x-api-key** | string | **Yes**  | Access authorization API Key.                              |
| **family**    | string | No       | Value: **Onboarding**. Required with the Tracking service. |

{% hint style="info" %}
All calls to the Endpoints for Tracking with **Identity Platform** must contain the header `family`.
{% endhint %}

### Request body

**Content-Type:** `application/json`

#### Parameters

| Parameter                 | Type   | Required | Description                                                                                                                               |
| ------------------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `country`                 | string | **Yes**  | Country code **ISO 3166-1 alpha-3**.                                                                                                      |
| `idType`                  | string | **Yes**  | Document type provided. Possible values: `PASSPORT`, `DRIVING_LICENSE`, `ID_CARD`, `VISA`                                                 |
| `frontsideImage`          | string | **Yes**  | Image encoded in **Base64**, open or tokenized, on the front side of the document.                                                        |
| `backsideImage`           | string | No       | Image encoded in **Base64**, open or tokenized, on the back side of the document. Optional for single-sided documents such as `PASSPORT`. |
| `merchantIdScanReference` | string | No       | Custom reference for the operation. **Maximum length: 100 characters.**                                                                   |
| `tracking`                | object | No       | Object representing the required tracking information.                                                                                    |
| `tracking.extraData`      | string | No       | Token generated by the SDK Mobile/Web. It contains tokenized tracking information with the Platform.                                      |
| `tracking.operationId`    | string | No       | Operation identifier generated by the SDK Mobile/Web.                                                                                     |

#### Request example

```json
{
  "country": "ESP",
  "idType": "ID_CARD",
  "frontsideImage": "BAMBAQLNHJoWGPjfeuDIzDXdZuP...",
  "backsideImage": "BAMBAQLNHJoWGPjfeuDIzDXdZuP...",
  "merchantIdScanReference": "my-scan-ref-001",
  "tracking": {
    "extraData": "BQABAQG2gBNjuHN4kLmPqYf7R...",
    "operationId": "123e4567-e89b-12d3-a456-426614174000"
  }
}
```

### Responses

#### `200` Success

#### Response parameters

| Parameter       | Type   | Description                                                  |
| --------------- | ------ | ------------------------------------------------------------ |
| `timestamp`     | string | UTC timestamp of the response in format **ISO 8601**.        |
| `scanReference` | string | **Reference number** for each scan.                          |
| `type`          | string | ⚠️ Value **deprecated**. Will be removed in future versions. |

#### Response example

```json
{
  "timestamp": "1970-01-01T00:00:00.000Z",
  "scanReference": "fe294c25-17e1-4d98-a958-710edbf00064",
  "type": "1"
}
```

#### `400` Bad Request

```json
{
  "status": 400,
  "title": "Bad Request",
  "detail": "Invalid request.",
  "type": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400",
  "errors": []
}
```

#### `401` Unauthorized

```json
{
  "message": "Unauthorized"
}
```

#### `403` Forbidden

```json
{
  "Message": "User is not authorized to access this resource with an explicit deny"
}
```

#### `502` Bad Gateway

```json
{
  "status": 502,
  "title": "Bad Gateway",
  "detail": "Server got an invalid response.",
  "type": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502"
}
```

#### `504` Gateway Timeout

```json
{
  "message": "Endpoint request timed out"
}
```
