# Verify International Passport

## Passport Verification

<mark style="color:green;">`POST`</mark> `{{baseurl}}/v2/api/identity/ke/passport`

#### Headers

| Name                                    | Type   | Description      |
| --------------------------------------- | ------ | ---------------- |
| token<mark style="color:red;">\*</mark> | String | API secret token |

#### Request Body

| Name                                               | Type    | Description                                                                      |
| -------------------------------------------------- | ------- | -------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark>               | String  | Candidates passport number                                                       |
| isSubjectConsent<mark style="color:red;">\*</mark> | Boolean | Indicate subject has given consent. <mark style="color:red;">Must be true</mark> |
| validations                                        | Object  | Validation object                                                                |
| data                                               | Object  | Validation data object                                                           |
| lastName                                           | String  | lastname to compare against ID                                                   |
| firstName                                          | String  | first name to compare against ID                                                 |
| dateOfBirth                                        | String  | date of birth to compare against ID                                              |
| selfie                                             | Object  | selfie validation object                                                         |
| image                                              | String  | Base64 or URL of selfie image to compare against ID                              |
| metadata                                           | Object  | Metadata object. Any valid object can be passed here. It gets returned as is.    |

### <mark style="color:purple;">Passport Verification</mark>

Passport verification is used to verify that a provided Kenyan International Passport number exists in the database. It shows the full information of the <mark style="color:orange;">**Passport holder**</mark>;

{% tabs %}
{% tab title="Passport Verification Sample Request" %}

```json
{
    "id": "AK1367466",
    "metadata": {
        "requestId": "1209348756"
},
    "isSubjectConsent": true
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Passport Verification Sample Response" %}

```json
{
    "success": true,
    "statusCode": 200,
    "message": "success",
    "data": {
        "id": "62b511caf1d35a61f7ba4de6",
        "parentId": null,
        "status": "found",
        "reason": null,
        "dataValidation": false,
        "selfieValidation": false,
        "firstName": "KARBOH",
        "middleName": null,
        "lastName": "ZEBOCK",
        "fullName": "KARBOH ZEBOCK",
        "image": null,
        "nationality": "KENYAN",
        "dateOfBirth": null,
        "isConsent": true,
        "idNumber": "AK0167656",
        "businessId": "6222a5ea3e7a41c29c030fac",
        "type": "kePassport",
        "gender": "male",
        "requestedAt": "2022-06-24T01:22:18.710Z",
        "requestedById": "6222a5ea3e7a41c29c030fad",
        "country": "KE",
        "createdAt": "2022-06-24T01:22:18.728Z",
        "lastModifiedAt": "2022-06-24T01:22:18.728Z",
        "requestedBy": {
            "firstName": "API",
            "lastName": "User",
            "middleName": "",
            "id": "6222a5ea3e7a41c29c030fad"
        }
    },
    "links": []
}
```

{% endtab %}
{% endtabs %}

### <mark style="color:purple;">Passport Facial Matching</mark>

Passport Facial Matching is used to verify that a Passport is valid and also that image provided matches the image in the database. This includes a confidence score of the facial matching.

{% tabs %}
{% tab title="Passport Facial Matching Sample Request" %}

```json
{
    "id": "AK0167656",
    "isSubjectConsent": true,
    "validations": {
        "selfie": {
            "image": "https://cdn.youverify.co/1627394241627-dvahka4o4vDxfvQUJgZFo.jpg"
        }
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Passport Facial Matching Sample Response" %}

```json
{
    "success": true,
    "statusCode": 200,
    "message": "success",
    "data": {
        "id": "62b511faf1d35a9100ba4dea",
        "validations": {
            "selfie": {
                "selfieVerification": {
                    "confidenceLevel": -1,
                    "threshold": 80,
                    "match": false,
                    "image": null
                }
            },
            "validationMessages": "No date of birth from data source, No Photo from data source"
        },
        "parentId": null,
        "status": "found",
        "reason": null,
        "dataValidation": false,
        "selfieValidation": true,
        "firstName": "KOECH",
        "middleName": null,
        "lastName": "ZADDOCK",
        "fullName": "KOECH ZADDOCK",
        "image": null,
        "nationality": "KENYAN",
        "dateOfBirth": null,
        "isConsent": true,
        "idNumber": "AK0167656",
        "businessId": "6222a5ea3e7a41c29c030fac",
        "type": "kePassport",
        "gender": "male",
        "requestedAt": "2022-06-24T01:23:07.013Z",
        "requestedById": "6222a5ea3e7a41c29c030fad",
        "country": "KE",
        "createdAt": "2022-06-24T01:23:07.030Z",
        "lastModifiedAt": "2022-06-24T01:23:07.030Z",
        "requestedBy": {
            "firstName": "API",
            "lastName": "User",
            "middleName": "",
            "id": "6222a5ea3e7a41c29c030fad"
        }
    },
    "links": []
}
```

{% endtab %}
{% endtabs %}

### <mark style="color:purple;">Passport Validation</mark>

Passport Validation is used to verify a Passport and compare given data parameters against the data present in the government database. For example, a first name and last name can be provided and this will validate as true or false as to whether it matches with the names in the database or not.

{% tabs %}
{% tab title="Passport Validation Sample Request" %}

```json
{
    "id": "AK0167656",
    "isSubjectConsent": true,
    "validations": {
        "data": {
            "lastName": "ZADDOCK",
            "firstName": "KOECH",
            "dateOfBirth": "1980-09-08"
        }
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Passport Validation Sample Response" %}

```json
{
    "success": true,
    "statusCode": 200,
    "message": "success",
    "data": {
        "id": "62b5120bf1d35a1c73ba4dee",
        "validations": {
            "data": {
                "lastName": {
                    "validated": true,
                    "value": "ZADDOCK"
                },
                "firstName": {
                    "validated": true,
                    "value": "KOECH"
                }
            },
            "validationMessages": "No date of birth from data source, No Photo from data source"
        },
        "parentId": null,
        "status": "found",
        "reason": null,
        "dataValidation": true,
        "selfieValidation": false,
        "firstName": "KOECH",
        "middleName": null,
        "lastName": "ZADDOCK",
        "fullName": "KOECH ZADDOCK",
        "image": null,
        "nationality": "KENYAN",
        "dateOfBirth": null,
        "isConsent": true,
        "idNumber": "AK0167656",
        "businessId": "6222a5ea3e7a41c29c030fac",
        "type": "kePassport",
        "gender": "male",
        "requestedAt": "2022-06-24T01:23:23.431Z",
        "requestedById": "6222a5ea3e7a41c29c030fad",
        "country": "KE",
        "createdAt": "2022-06-24T01:23:23.443Z",
        "lastModifiedAt": "2022-06-24T01:23:23.443Z",
        "requestedBy": {
            "firstName": "API",
            "lastName": "User",
            "middleName": "",
            "id": "6222a5ea3e7a41c29c030fad"
        }
    },
    "links": []
}
```

{% endtab %}
{% endtabs %}

### <mark style="color:purple;">Passport Full Sample Request</mark>

This is a sample request that contains all the parameters as described above, all in one call.

{% tabs %}
{% tab title="Full Sample Request:" %}

```json
{
    "id": "AK0167656",
    "metadata": {
        "requestId": "1209348756"
},
    "isSubjectConsent": true,
    "validations": {
        "data": {
            "lastName": "ZADDOCK",
            "firstName": "KOECH",
            "dateOfBirth": "1980-09-08"
        },
        "selfie": {
            "image": "https://cdn.youverify.co/1627394241627-dvahka4o4vDxfvQUJgZFo.jpg"
        }
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Found Response:" %}

```json
{
        "success": true,
        "statusCode": 200,
        "message": "success",
        "data": {
            "id": "62b09202cb518575d6b38d9f",
            "validations": {
                "data": {
                    "lastName": {
                        "validated": true,
                        "value": "ZADDOCK"
                    },
                    "firstName": {
                        "validated": true,
                        "value": "KOECH"
                    }
                },
                "selfie": {
                    "selfieVerification": {
                        "confidenceLevel": -1,
                        "threshold": 80,
                        "match": false,
                        "image": null
                    }
                },
                "validationMessages": "No date of birth from data source, No Photo from data source"
            },
            "parentId": null,
            "status": "found",
            "reason": null,
            "dataValidation": true,
            "selfieValidation": true,
            "firstName": "KOECH",
            "middleName": null,
            "lastName": "ZADDOCK",
            "fullName": "KOECH ZADDOCK",
            "image": null,
            "nationality": "KENYAN",
            "dateOfBirth": null,
            "isConsent": true,
            "idNumber": "AK0167656",
            "businessId": "61d880f1e8e15aaf24558f1a",
            "type": "kePassport",
            "gender": "male",
            "requestedAt": "2022-06-20T15:28:02.972Z",
            "requestedById": "61d880f2e8e15aaf24558f9b",
            "country": "KE",
            "createdAt": "2022-06-20T15:28:03.125Z",
            "lastModifiedAt": "2022-06-20T15:28:03.125Z",
            "requestedBy": {
                "firstName": "Famous",
                "lastName": "Ehichioya",
                "middleName": "Prior",
                "id": "61d880f2e8e15aaf24558f9b"
            }
        },
        "links": []
    }
```

{% endtab %}

{% tab title="Not Found Response:" %}

```json
{
        "success": true,
        "statusCode": 200,
        "message": "success",
        "data": {
            "id": "62b093f6a12f007af8d851ab",
            "validations": {
                "data": {
                    "lastName": {
                        "validated": false,
                        "value": "ZADDOCK"
                    },
                    "dateOfBirth": {
                        "validated": false,
                        "value": "1980-09-08"
                    },
                    "firstName": {
                        "validated": false,
                        "value": "KOECH"
                    }
                },
                "selfie": {
                    "selfieVerification": {
                        "confidenceLevel": -1,
                        "threshold": 80,
                        "match": false,
                        "image": "https://cdn.youverify.co/1627394241627-dvahka4o4vDxfvQUJgZFo.jpg"
                    }
                },
                "validationMessages": ""
            },
            "parentId": null,
            "status": "not_found",
            "reason": "Person Not Found",
            "dataValidation": true,
            "selfieValidation": true,
            "firstName": null,
            "middleName": null,
            "lastName": null,
            "fullName": null,
            "image": null,
            "nationality": null,
            "dateOfBirth": null,
            "isConsent": true,
            "idNumber": "AK01676560",
            "businessId": "61d880f1e8e15aaf24558f1a",
            "type": "kePassport",
            "gender": "",
            "requestedAt": "2022-06-20T15:36:25.487Z",
            "requestedById": "61d880f2e8e15aaf24558f9b",
            "country": "KE",
            "createdAt": "2022-06-20T15:36:25.716Z",
            "lastModifiedAt": "2022-06-20T15:36:25.716Z",
            "requestedBy": {
                "firstName": "Famous",
                "lastName": "Ehichioya",
                "middleName": "Prior",
                "id": "61d880f2e8e15aaf24558f9b"
            }
        },
        "links": []
    }
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Error Response" %}

```json
{
  "success": false,
  "statusCode": 404,
  "message": "You have attempted to get a resource that does not exist.",
  "name": "ResourceNotFoundError",
  "data": {}
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.youverify.co/know-your-customer-services-kyc/id-data-matching-eidv/kenya/verify-international-passport.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
