---
title: "Add front side of Second ID"
url: "https://developer.incode.com/api-reference/add-front-second-id-v2/"
section: "api-reference"
group: "Id capture"
version: "v1.1"
status: "live"
endpoint: "POST /omni/add/front-second-id/v2"
---
# Add front side of Second ID

`POST /omni/add/front-second-id/v2`

Base URL: `https://demo-api.incodesmile.com` — Incode demo environment

This endpoint is used for storing front side of second id for further processing

## Path & query parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `onlyFront` | query | boolean |  | Flag stating if document is one-sided (like Passport). Default value is false, in case it is not sent. |
| `api-version` | header | string | yes |  |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `base64Image` | string |  | Image in base64 format. One of base64Image or imageUrl is required |
| `imageUrl` | string |  | URL of the image. One of base64Image or imageUrl is required |

## Responses

### 200

OK

Response body (`application/json`):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `correctSharpness` | boolean |  | It's true if the sharpness of the ID meets the requirements. |
| `correctGlare` | boolean |  | It's true if the glare of the ID meets the requirements. |
| `horizontalResolution` | integer (int32) |  | Value is based on the resolution of the cropped photo. Low value means after performing the crop we have a bad quality of image. We recommend to retry capture if value is below 155. |
| `shadowConfidence` | number (float) |  | Value 0 means it is no shadow on the image and image quality is good, while value 1 represents bad quality of image with a lot of shadow. We recommend to retry capture if value is 1. |
| `classification` | boolean |  | If true, server classified image as a front side of an id. If false, server failed to classify image as valid front side of an id or passport and other parameters can be ignored. |
| `readability` | boolean |  | If true, server can properly read ID. If false server failed to read some key places of the ID. |
| `typeOfId` | string |  | Enum: `Unknown`, `Passport`, `Visa`, `DriversLicense`, `IdentificationCard`, `Permit`, `Currency`, `ResidenceDocument`, `TravelDocument`, `BirthCertificate`, `VehicleRegistration`, `Other`, `WeaponLicense`, `TribalIdentification`, `VoterIdentification`, `Military`, `TaxIdentification`, `FederalID`, `MedicalCard` |
| `issueYear` | integer (int32) |  | Issue year of the ID. |
| `issueName` | string |  | Description of the ID. Could contain country code, state, type of ID, subtype of ID. |
| `curpCheck` | boolean |  | Only for Mexican IDs. Flag stating if curp was properly read. |
| `sessionStatus` | string |  | Session Status Enum: `Alive`, `Closed`, `Deleted` |
| `countryCode` | string |  | Valid ISO alpha-2 or alpha-3 code of the ID issuing country. |
| `state` | string |  | Issuing state of the ID. |
| `failReason` | string |  | Classification fail reason Enum: `UNKNOWN_DOCUMENT_TYPE`, `WRONG_DOCUMENT_SIDE`, `WRONG_ONE_SIDED_DOCUMENT`, `UNFOLDED_DOCUMENT_PAGE_MISMATCH`, `WRONG_UNFOLDED_DOCUMENT`, `DOCUMENT_NOT_READABLE`, `UNABLE_TO_ALIGN_DOCUMENT`, `ID_TYPE_UNACCEPTABLE`, `UNEXPECTED_ERROR_OCCURRED`, `DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED` |
| `skipBackIdCapture` | boolean |  | Flag that signals if back id capture should be skipped or not. |
| `forceFrontIdCapture` | boolean |  | Flag that signals if front id capture must be executed after back. |
| `showMandatoryConsent` | boolean |  | Render mandatory consent page based on this parameter value. |
| `regulationType` | string |  | Regulation type for the mandatory consent (only if showMandatoryConsent set to true). |
| `skipGlareFront` | boolean |  | Flag that signals if front side glare should be ignored. |
| `skipGlareBack` | boolean |  | Flag that signals if back side glare should be ignored. |
| `documentIsOnTheEdge` | boolean |  | Flag that signals if document is on the edge on the full frame image. |
| `acceptedDocuments` | array[string] |  | List of accepted documents for that particular country in case of ID_TYPE_UNACCEPTABLE failReason. |
| `imageRedacted` | boolean |  | Flag that signals if image was redacted as part of the ID capture. |
| `idFaceExtractionSkipped` | boolean |  | True when biometric face extraction from the front ID was skipped because the client passed extractIdFace=false. While this flag is true, face-match flows that require an ID-side template cannot run; the flag is cleared on a subsequent add/front-id call where extractIdFace is true (or omitted). |
| `captureAttemptsLimit` | CaptureAttemptsLimitDto |  | Checked only if configured in the session flow. |
| `captureAttemptsLimit.max` | integer (int32) |  | Maximum number of attempts to capture a photo. |
| `captureAttemptsLimit.remaining` | integer (int32) |  | Number of remaining attempts to capture a photo. |
| `idQualityAttemptApproved` | boolean |  | ID quality check result based on ML readability estimation. True if perFieldReadability >= 0.38, false otherwise. Only available for Mexican documents when feature is enabled. |
| `isDocumentExpired` | boolean |  | Flag indicating if the document side is expired. |
| `attemptId` | string |  | Created attempt id. |

### 400

Custom error statuses: - 4019: Face not found - 1003: Face cropping failure

Response body (`application/json`):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `timestamp` | integer (int64) |  | UTC timestamp in milliseconds |
| `status` | integer (int32) |  | Custom error code or HTTP status code |
| `error` | string |  | HTTP status error |
| `message` | string |  | Custom error message |
| `path` | string |  | Endpoint path |
| `details` | object |  | Custom error details |

## Code samples

Generated from this endpoint's method, path, and the conventional Incode headers. The base URL is the Incode demo environment; replace `<YOUR_API_KEY>` with a key for your region.

### cURL

```bash
curl -X POST https://demo-api.incodesmile.com/omni/add/front-second-id/v2 \
  -H "x-api-key: <YOUR_API_KEY>" \
  -H "api-version: 1.0" \
  -H "Content-Type: application/json" \
  -d '{
    "base64Image": "",
    "imageUrl": ""
  }'
```

### Node

```js
const res = await fetch("https://demo-api.incodesmile.com/omni/add/front-second-id/v2", {
  method: "POST",
  headers: {
      "x-api-key": "<YOUR_API_KEY>",
      "api-version": "1.0",
      "Content-Type": "application/json",
  },
    body: JSON.stringify({
      "base64Image": "",
      "imageUrl": ""
    }),
});
const data = await res.json();
```

### Python

```python
import requests

headers = {
    "x-api-key": "<YOUR_API_KEY>",
    "api-version": "1.0",
    "Content-Type": "application/json",
}
res = requests.post("https://demo-api.incodesmile.com/omni/add/front-second-id/v2", headers=headers, json={
  "base64Image": "",
  "imageUrl": ""
})
data = res.json()
```

### Java

```java
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://demo-api.incodesmile.com/omni/add/front-second-id/v2"))
    .header("x-api-key", "<YOUR_API_KEY>")
    .header("api-version", "1.0")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"base64Image\": \"\",\n  \"imageUrl\": \"\"\n}"))
    .build();
HttpResponse<String> res = HttpClient.newHttpClient()
    .send(req, HttpResponse.BodyHandlers.ofString());
```

### Example response

```json
{
  "success": true,
  "status": "OK"
}
```
