# Passport

### Extract passport details

{% hint style="info" %}
**Good to know:** This API method allows you to extract the details from an international passport as JSON.
{% endhint %}

## Extract passport details

<mark style="color:green;">`POST`</mark> `https://api.usetani.com/api/v0/passport_analyze`

Creates a new person.

#### Headers

| Name                                         | Type   | Description                       |
| -------------------------------------------- | ------ | --------------------------------- |
| x-api-key<mark style="color:red;">\*</mark>  | string | Your API key                      |
| x-group-id<mark style="color:red;">\*</mark> | string | Your group ID from the dashboard. |

#### Request Body

| Name                                    | Type   | Description                     |
| --------------------------------------- | ------ | ------------------------------- |
| image<mark style="color:red;">\*</mark> | string | Form-data image of the passport |

{% tabs %}
{% tab title="200 Passport analyzed successfully" %}
```javascript
{
    "message":"Data extracted successfully",
    "result": {
        "passport_number": "string",
        "date_of_birth": "string",
        "date_of_expiry": "string",
        "surname": "string",
        "given_names": "string",
    }
}
```
{% endtab %}

{% tab title="401 Unauthorized" %}
```javascript
{
    "detail": "API key/Group Id is missing"
}
```
{% endtab %}

{% tab title="500: Internal Server Error Server error" %}
```javascript
{
    // Response
}
```
{% endtab %}

{% tab title="400: Bad Request No passport recognized" %}
```javascript
{
    detail: "Could not extract data from image, please confirm that the image is a passport."
}
```
{% endtab %}
{% endtabs %}
