> For the complete documentation index, see [llms.txt](https://docs.uqudo.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uqudo.com/docs/kyc/uqudo-api/scan.md).

# Scan API

The following API allows uploading the front and back image of the document using multipart form data.

JPEG, PNG and PDF are supported. Max file size allowed is 5MB for each file. Although we recommend uploading smaller files to avoid affecting performances.

A picture size of \~500KB with a resolution of 1080x1920 can work perfectly fine. High resolution pictures don’t improve the quality of the result and are not needed. If you need to accept a bigger file you need to decrease the size at your end before calling this API.

**Note**: When a PDF file is used you have two choices for a two page document: you can send front and back in separate files or you can send a single PDF with both images. The system will assume that the first image is the front page of the document.

**Note**: Utilize this API within your backend and do not make direct calls within your frontend application.

## Endpoint URL

POST *\<Api base url>*/api/v1/scan

The *\<Api base url>* is listed in the Customer Portal under Development > Credentials.

## Headers

| Name          | Value                  | Required |
| ------------- | ---------------------- | -------- |
| Content-Type  | multipart/form-data    | true     |
| Authorization | Bearer \<access token> | true     |

## Query Parameters

| Name                    | Value                                                                                                                                                         | Required |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| disableExpiryValidation | <p>(true or false)</p><p>Default value: <strong>false</strong></p><p>If true disables document expiry validation</p>                                          | false    |
| exportFaceImage         | <p>(true or false)</p><p>Default value: <strong>true</strong></p><p>Enable or disable face detection in the document. If not needed it should be disabled</p> | false    |

## Payload (multipart/form-data)

The payload contains the following parts:

| Name         | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Required                                 |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| documentType | <p><a href="/pages/JKmgKHlU0ufXEZajaWWS">USA\_DL</a></p><p><a href="/pages/6SDzc2a5FWGhN7PaxcB7">UAE\_ID</a></p><p><a href="/pages/bAcDaexX97oCznrIsYxf">UAE\_ID\_DIGITAL</a></p><p><a href="/pages/WFnCyq8TxcDYPTxBTMnt">UAE\_DL</a></p><p><a href="/pages/VvjbOwgux94r4X9jd9PU">UAE\_VL</a></p><p><a href="/pages/dv55Q60gBRGFpITc5oJp">UAE\_VISA</a></p><p><a href="/pages/jJ2AeW8dXCmn0v6aTNV0">UAE\_EVISA</a><br><a href="/pages/5RyOV7o8f33CuJY96lwu">UAE\_ID\_APPLICATION\_FORM</a></p><p><a href="/pages/OWVan40szzOSPb7TCqhq">OMN\_ID</a></p><p><a href="/pages/qkbfyZumRFPYjCX3rRBV">PASSPORT</a></p><p><a href="/pages/wuQvz2M6pO10l5FLbF6R">PAK\_ID</a></p><p><a href="/pages/bWWqivmpOVYzFo93PqGk">SAU\_ID</a></p><p><a href="/pages/Xj9Oy1bXdJHCUHyuwJPg">SAU\_DL</a></p><p><a href="/pages/4Uaqv3xkZu8u5zH53184">BHR\_ID</a></p><p><a href="/pages/g2KjFaJomtRc2tJTQg9b">KWT\_ID</a></p><p><a href="/pages/cjUokVkYDbDkvnvMnx4r">GENERIC\_ID</a></p><p><a href="/pages/KYH2wXAQXTsF8mvps7na">QAT\_ID</a></p><p><a href="/pages/scyqRTEjs79SFMdf1N5z">QAT\_DL</a><br><a href="/pages/vMW2nxj2kAo2DGyOGqac">QAT\_VL</a></p><p><a href="/pages/pbuKQAqk3NMPXnIIby1Z">NLD\_DL</a></p><p><a href="/pages/jCYgiyVXcA7NLaUq6dtE">GHA\_ID</a></p><p><a href="/pages/j5FE9Y8PGttyvz4af3A1">GHA\_DL</a></p><p><a href="/pages/FzZErYslg2sS3MwkeIwU">GHA\_VOTER\_ID</a></p><p><a href="/pages/g1GcXwWqeMF9zYUca5fU">GHA\_SSNIT</a></p><p><a href="/pages/Qe8OwHfgSJNFghc22qwr">NGA\_DL</a></p><p><a href="/pages/7IfazYm3UZ1qZw0AFjLM">NGA\_VOTER\_ID</a></p><p><a href="/pages/qL5gdXMffobot0dvW79A">NGA\_NIN</a></p><p><a href="/pages/HcTS0mtoea6oChADYOud">RWA\_ID</a></p><p><a href="/pages/uARiIZ5qwTd3c7MrYrmJ">IND\_ID</a></p><p><a href="/pages/Qb0uCAY1eLKLkiLw3puG">KEN\_ID</a></p><p><a href="/pages/8lFIIzqkOf31VWco5pDt">EGY\_ID</a></p><p><a href="/pages/bxiwPAEwiLkjyYncrfIz">SEN\_ID</a></p><p><a href="/pages/EAn0ZBeu1miiXrAzuxsg">UGA\_ID</a></p><p><a href="/pages/Wmz5JLGTlx9etNhpPVt4">UGA\_VOTER\_ID</a></p><p><a href="/pages/9yCpDDMryGxNoJHn4tiS">ZAF\_ID</a></p><p><a href="/pages/xiC0ha6kQCNXAiH4OjzU">ZAF\_DL</a></p><p><a href="/pages/FCgoFkgb6qk33aV7AZMP">GBR\_DL</a></p><p><a href="/pages/OoRNY61kY5EYLfPy9pId">SDN\_ID</a></p><p><a href="/pages/vZuQgY58mGwvgqkgf2h4">SDN\_DL</a></p><p><a href="/pages/NKA3H77Vj76FBRdtdfxN">SDN\_VL</a></p><p><a href="/pages/jBI7J4f5XE0pfaZRUOTv">DZA\_ID</a></p><p><a href="/pages/WBokW4Cu6dzF3bZ2n0Xg">TUR\_ID</a></p><p><a href="/pages/GoW9c8xGk8cozs18rh4W">GBR\_ID</a></p><p><a href="/pages/AGd1p8dySofAkTqBqjwR">COD\_DL</a></p><p><a href="/pages/ySjTije0uMAPIAfsP7r4">COD\_VOTER\_ID</a></p><p><a href="/pages/9cMhzLum5uunZEDgTXFD">OMN\_DL</a></p><p><a href="/pages/UdNmFgad3wazEFfEF1Lk">OMN\_VL</a></p><p><a href="/pages/aeCuvFEf3bW6GCBMWJcY">PHL\_DL</a></p><p><a href="/pages/e3uDqN2mkACjyuT0GjeI">BHR\_DL</a></p><p><a href="/pages/CqnlI2XKSj2xvVl6c6BM">RSL\_ID</a></p><p><a href="/pages/53F3byXwx1cgxpna2Uj5">IND\_PAN</a></p><p><a href="/pages/aGrbfxLT8q8xwKTSUIku">MRZ</a></p><p><a href="/pages/tGjtANUJmqZIc9mIK6Oz">LBN\_ID</a></p><p><a href="/pages/OvP88RftOKgusRIg2Jv1">LBN\_DL</a></p><p><a href="/pages/HqMPzCnVfF0By3Wrvw1z">IRQ\_ID</a><br><a href="/pages/NUZNoegfclzxS6rc9cdY">TUN\_ID</a><br><a href="/pages/dvrSFBJC3VM5BoDpbaXN">SOM\_ID</a><br><a href="/pages/k57WxXOfndvU1eXLPftv">BHR\_VL</a><br><a href="/pages/c0GfXlGOo94QK78DTHJx">JOR\_ID</a><br><a href="/pages/t46bdwtpeJFIUVQirxAf">JOR\_VL</a><br><a href="/pages/7BFKXIPYGP503ZZnLsMA">SAU\_VL</a><br><a href="/pages/UlnBKOjhrs6waCNeRKvY">MAR\_ID</a><br><a href="/pages/dILMeciQEGaY6UF8EhAT">IDN\_ID</a><br><a href="/pages/ulVbcgOkAM7RvrDYmhjF">SYR\_ID</a><br><a href="/pages/wlRzR1TDjaYeyMl2A0IK">YEM\_ID</a></p> | true                                     |
| frontImage   | Binary image of the front page of the document                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | true                                     |
| backImage    | Binary image of the back page of the document                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | False (required for a two side document) |

## Response Status

| Status code | Status Message         | Description                                                                                             |
| ----------- | ---------------------- | ------------------------------------------------------------------------------------------------------- |
| 200         | OK                     | Successful operation. See [2.7. Response Body for Status Code 200](broken://pages/7L0V6e1eCVuySN0LZos4) |
| 400         | Bad Request            | See [2.6. Response Body for Status Code 400](broken://pages/7L0V6e1eCVuySN0LZos4)                       |
| 401         | Unauthorized           | Access token missing, invalid or expired                                                                |
| 403         | Forbidden              | Access token not allowed to access a certain API or functionality                                       |
| 413         | Payload Too Large      |                                                                                                         |
| 415         | Unsupported Media Type |                                                                                                         |
| 500         | Internal Server Error  | Unexpected error                                                                                        |

## Response Body for Status Code 400

| Property | Values                                | Description                                                                                        |
| -------- | ------------------------------------- | -------------------------------------------------------------------------------------------------- |
| error    | INVALID\_INPUT                        | Missing required input or invalid format                                                           |
|          | SCAN\_DOCUMENT\_NOT\_RECOGNIZED       | Document type not recognized. Scanning failed or document type doesn’t match the provided document |
|          | SCAN\_DOCUMENT\_EXPIRED               | Document is expired                                                                                |
|          | SCAN\_DOCUMENT\_FRONT\_BACK\_MISMATCH | Front and back pages don't belong to the same document. Not supported for every document type      |
| message  | Description of the error              |                                                                                                    |

## Response Body for Status Code 200 (application/json)

The API returns a JSON object with the following structure:

```
{
  "front": {},
  "back": {}
}
```

## Sample Request using curl

```
$ curl -v \
-H 'Authorization: Bearer token' \
https://example.com/api/v1/scan \
-F documentType=UAE_ID \
-F frontImage=@/front.jpg \
-F backImage=@/back.jpg
```

Please note that “<https://example.com”> needs to be replaced with the api server base url.

\#Sample Response Body

Below an example of UAE\_ID scan process response body:

```
{
  "front": {
    "fullName": "Mario Casola",
    "identityNumber": "784-19XX-XXXXXXX-9",
    "nationality": "Italy",
    "faceImage": "<base64 encoded face image>"
  },
  "back": {
    "secondaryId": "MARIO",
    "primaryId": "CASOLA",
    "dateOfBirth": "800825",
    "dateOfExpiry": "200306",
    "documentNumber": "0880XXX20",
    "serialNumber": "0B800029B46XXXXX",
    "nationality": "ITA",
    "issuer": "ARE",
    "sex": "M",
    "documentCode": "IL",
    "mrzText": "ILARE0880XXX20378419XXXXXXXXX9\n8008253M2003061ITA<<<<<<<<<<<9\nCASOLA<<MARIO<<<<<<<<<<<<<<<<<\n",
    "mrzVerified": true,
    "opt1": "78419XXXXXXXXX9",
    "opt2": "<<<<<<<<<<<"
  }
}
```
