---
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 | Default: `1.0` |

## 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?imageType=%3CimageType%3E \
  -H "x-api-key: <YOUR_API_KEY>" \
  -H "X-Incode-Hardware-Id: <YOUR_INCODE_HARDWARE_ID>" \
  -H "api-version: 1.0" \
  -H "Content-Type: application/json"
```

### Node

```js
const res = await fetch("https://demo-api.incodesmile.com/omni/process/face-vs-second-id?imageType=%3CimageType%3E", {
  method: "POST",
  headers: {
      "x-api-key": "<YOUR_API_KEY>",
      "X-Incode-Hardware-Id": "<YOUR_INCODE_HARDWARE_ID>",
      "api-version": "1.0",
      "Content-Type": "application/json",
  },
});
const data = await res.json();
```

### Python

```python
import requests

headers = {
    "x-api-key": "<YOUR_API_KEY>",
    "X-Incode-Hardware-Id": "<YOUR_INCODE_HARDWARE_ID>",
    "api-version": "1.0",
    "Content-Type": "application/json",
}
res = requests.post("https://demo-api.incodesmile.com/omni/process/face-vs-second-id?imageType=%3CimageType%3E", headers=headers)
data = res.json()
```

### Java

```java
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://demo-api.incodesmile.com/omni/process/face-vs-second-id?imageType=%3CimageType%3E"))
    .header("x-api-key", "<YOUR_API_KEY>")
    .header("X-Incode-Hardware-Id", "<YOUR_INCODE_HARDWARE_ID>")
    .header("api-version", "1.0")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> res = HttpClient.newHttpClient()
    .send(req, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```
require "net/http"
require "json"

uri = URI("https://demo-api.incodesmile.com/omni/process/face-vs-second-id?imageType=%3CimageType%3E")
req = Net::HTTP::Post.new(uri)
req["x-api-key"] = "<YOUR_API_KEY>"
req["X-Incode-Hardware-Id"] = "<YOUR_INCODE_HARDWARE_ID>"
req["api-version"] = "1.0"
req["Content-Type"] = "application/json"

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
```

### PHP

```
$ch = curl_init("https://demo-api.incodesmile.com/omni/process/face-vs-second-id?imageType=%3CimageType%3E");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "x-api-key: <YOUR_API_KEY>",
    "X-Incode-Hardware-Id: <YOUR_INCODE_HARDWARE_ID>",
    "api-version: 1.0",
    "Content-Type: application/json",
]);

$data = json_decode(curl_exec($ch), true);
curl_close($ch);
```

### Example response

```json
{
  "confidence": 0,
  "existingUser": true,
  "existingInterviewId": "string",
  "existingExternalId": "string",
  "nameMatched": true
}
```
