# /register\_face

#### Endpoint

```http
https://be.progeny.tech/api/v3/services/register_face/
```

#### Purpose

Allows you to connect to the Liveness service, using the provider configured in the **Progeny Console**, to register a face image in database.

If the image passes the liveness check, the result is a UUID.

If the image does not contain a face, only contains a partial face, or if the quality of the image is too low, we will return  an error code, for example `FACE_TOO_SMALL` . See our image requirements above for more information.

{% hint style="info" %}
Please refer to the section on [images](https://docs.progeny.tech/overview#a-quick-word-about-images) for guidance before posting.  For the best results, we recommend a maximum height of 1080px.
{% endhint %}

#### Sample request and response

## Get a task Id

<mark style="color:green;">`POST`</mark> `https://be.progeny.tech/api/v3/services/register_face`

#### Request Body

| Name                                    | Type    | Description                                                                                       |
| --------------------------------------- | ------- | ------------------------------------------------------------------------------------------------- |
| image<mark style="color:red;">\*</mark> | String  | The file path to an image of the user's face in PNG, JPEG, or JPG file format                     |
| extend\_data                            | Boolean | Set to true to retrieve the original response from the 3rd-party provider of the Liveness service |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "id": "58bf8a18-b10b-409d-91d6-fdd358408dff"
}
```

{% endtab %}

{% tab title="400: Bad Request Image is missing or not in the correct format" %}

```javascript
    "image": [
        "The submitted data was not a file. Check the encoding type on the form."
    ]
}
```

{% endtab %}
{% endtabs %}

## Get UUID

<mark style="color:blue;">`GET`</mark> `https://be.progeny.tech/api/v3/services/task/?id={{task_id}}`

#### Path Parameters

| Name                                 | Type   | Description                                     |
| ------------------------------------ | ------ | ----------------------------------------------- |
| id<mark style="color:red;">\*</mark> | String | The task Id you obtained from your POST request |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "id": 2170,
    "status": "SUCCESS",
    "result": {
        "status": 200,
        "data": {
            "uuid": "d3da2b7a-b062-11ec-b3b9-0242ac190002"
        }
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Image does not meet requirements" %}

```javascript
{
    "id": 2165,
    "status": "SUCCESS",
    "result": {
        "data": {
            "liveness": {
                "result": false,
                "error": "Interpupillary distance is too small",
                "error_code": "FACE_TOO_SMALL"
            }
        },
        "status": 400,
        "issues": {
            "FACE_TOO_SMALL": "Interpupillary distance is too small"
        }
    }
}
```

{% endtab %}
{% endtabs %}

##
