---
title: "Process face vs second id"
url: "https://developer.incode.com/api-reference/process-face-vs-second-id/"
section: "api-reference"
group: "Face capture"
version: "v1.1"
status: "live"
endpoint: "POST /omni/process/face-vs-second-id"
---
# Process face vs second id

`POST /omni/process/face-vs-second-id`

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

**Note**: This endpoint should be called only after [selfie](#/Onboarding/addFaceByThirdParty) and
[front-second-id](#/Onboarding/addFrontSecondIdV2) both are over.

It is validating user's selfie against photo from ID (1:1 recognition). Also, this call validates if user already exists
in the system (1:N recognition).

It is highly recommended that before calling this process-face endpoint, one should first finish following endpoints:
[add-front-secondId](#/Onboarding/addFrontSecondIdV2), [add-back-secondId](#/Onboarding/addBackSecondIdV2) (not required in
case of passports), [process-secondId](#/Onboarding/processSecondId) and [add-selfie](#/Onboarding/addFaceByThirdParty) in order
to get complete result view based on id verification, face recognition and liveness.

## Path & query parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `imageType` | query | string |  | Enum: `selfie`, `videoSelfie` |
| `api-version` | header | string | yes |  |

## Responses

### 200

OK

Response body (`application/json`):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `confidence` | number (float) | yes | Value 0 means that selfie doesn't match face photo from ID. |
| `existingUser` | boolean | yes | Flag indicating if this user already exists in the system. |
| `existingInterviewId` | string |  | Session id where user is approved previously (existingUser=true). |
| `existingExternalId` | string |  | In case the session does have an externalId which can be assigned at start call. |
| `nameMatched` | boolean |  | In case user is approved previously (existingUser=true), flag indicating if names are matching. |

### 400

Bad Request

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/process/face-vs-second-id \
  -H "x-api-key: <YOUR_API_KEY>" \
  -H "api-version: 1.0" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Node

```js
const res = await fetch("https://demo-api.incodesmile.com/omni/process/face-vs-second-id", {
  method: "POST",
  headers: {
      "x-api-key": "<YOUR_API_KEY>",
      "api-version": "1.0",
      "Content-Type": "application/json",
  },
    body: JSON.stringify({}),
});
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/process/face-vs-second-id", headers=headers, json={})
data = res.json()
```

### Java

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

### Example response

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