---
title: Face Extraction API
slug: v2-apis/LRZ7-face-extraction-api
description: Learn how to extract a face from a driver's license using our KYC API. This document provides sample cURL commands and lists required and optional input parameters. It also includes a sample response with output parameters. Additionally, discover how to u
createdAt: 2022-09-15T07:43:09.000Z
---

## Introduction

This API is used to extract the face from the DL. The extracted image can than be used to verify the peron during the kyc.

## How to call the API&#x20;

Before going for Auto reading calls, you first need to create an Identity object. Need to pass accessToken and itemid obtained from identity call along with other input parameters

## API Input Guidelines

Need to put URL of the Front Side Image of the driving licence.

## Step 1: Hit Identities API

### Sample cURL

::::Tabs
:::Tab{title="Preproduction"}
```curl
curl --location --request POST 'https://preproduction.signzy.tech/api/v2/patrons/..patronId../identities' \
--header 'Authorization: <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "drivingLicence",
    "email": "<email Id>",
    "callbackUrl": "<Call back Url>",
    "images": [<images Url>]
}'
```
:::

:::Tab{title="Production"}
```curl
curl --location --request POST 'https://signzy.tech/api/v2/patrons/..patronId../identities' \
--header 'Authorization: <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "drivingLicence",
    "email": "<email Id>",
    "callbackUrl": "<Call back Url>",
    "images": [<images Url>]
}'
```
:::
::::

### Input Parameters

| **Parameter Name** | **Required/Optional** | **Description**                                        |
| ------------------ | --------------------- | ------------------------------------------------------ |
| Authorization      | Required              | Contains the id parameter returned from the login step |
| Content-Type       | Required              | application/json                                       |
| type               | Required              | Type of identity                                       |
| email              | Required              | e-mail ID                                              |
| callbackurl        | Required              | URL where response will be posted                      |
| images             | Required              | Front image of driving licence                         |

***

### Sample Response&#x20;

```json
{
    "type": "drivingLicence",
    "email": "ankur.rand@signzy.com",
    "callbackUrl": "https://www.w3schools.com",
    "images": [],
    "accessToken": " ",
    "autoRecognition": [],
    "verification": [],
    "forgeryCheck": [],
    "id": "633124060b9e46d4a042xxxx",
    "patronId": "6319d81fa341350e79xxxx"
}
```

### Response Parameter

| **Parameter Name** | **Description**                        |
| ------------------ | -------------------------------------- |
| type               | Type of identity                       |
| email              | e-mail ID                              |
| callbackUrl        | URL where response will be posted      |
| images             | Front image of driving licence         |
| accessToken        | This is provided by identities API     |
| autoRecognition    | Auto recognises text from upload image |
| verification       | verification is done                   |
| forgeryCheck       | Forgery check is done                  |
| id                 | Unique user id                         |
| patronId           | Unique patron id                       |

## Step 2: Hit Snoops API and receives a response

### Sample CURL

::::Tabs
:::Tab{title="Preproduction"}
```curl
curl --location --request POST 'https://preproduction.signzy.tech/api/v2/snoops' \
--header 'content-type: application/json' \
--header 'Authorization: <token>' \
--data-raw '{
    "service": "Identity",
    "itemId": "",
    "accessToken": "",
    "task": "faceExtraction",
    "essentials": {
        "url": " "
    }
}'
```
:::

:::Tab{title="Production"}
```curl
curl --location --request POST 'https://signzy.tech/api/v2/snoops' \
--header 'content-type: application/json' \
--header 'Authorization: <token>' \
--data-raw '{
    "service": "Identity",
    "itemId": "",
    "accessToken": "",
    "task": "faceExtraction",
    "essentials": {
        "url": " "
    }
}'
```
:::
::::

### Input Parameters

| **Parameter Name** | **Required/Optional** | **Description**                            |
| ------------------ | --------------------- | ------------------------------------------ |
| Content-Type       | Required              | application/json                           |
| service            | Required              | Type of Signzy service - “identity”        |
| itemId             | Required              | Contains the identity item id              |
| accessToken        | Required              | This is provided by the identities API     |
| task               | Required              | task should be faceExtraction for this API |
| essentials.Url     | Required              | URL of the image                           |

### Sample API Response

```json
{
    "service": "Identity",
    "itemId": "",
    "task": "faceExtraction",
    "essentials": {
        "url": "frontimage.jpg"
    },
    "accessToken": "",
    "id": "",
    "response": {
        "url": "frontImage.jpg",
        "ttl": "10 mins",
        "id": 23,
        "result": {
            "cropped": "croppedimage.png"
        }
    }
}
    
```

### Output Parameters

| **Parameter Name** | **Description**                                                   |
| ------------------ | ----------------------------------------------------------------- |
| service            | Type of Signzy service - “identity”                               |
| itemId             | Contains the identity item id                                     |
| task               | The type of task performed - “Auto Recognition”                   |
| essentials.url     | URL of the input image                                            |
| accessToken        | Contains the access token that was received from identity request |
| id                 | Contains the unique Id                                            |
| response.url       | URL where response will be posted                                 |
| response.ttl       | Time to live (validity of the file)                               |
| response.id        | Unique ID of the image                                            |
| result.cropped     | Contains Cropped front Image                                      |

:::hint{type="info"}
### Getting help

Please feel free to contact us if you have any questions, require clarification, or have ideas for how to make the documents or any of our services better.


You can reach out to us at [help@signzy.com](mailto\:help@signzy.com).
:::

