# Verify Identity Number

## Identity Verification

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

#### 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 id number                                                                                            |
| isSubjectConsent<mark style="color:red;">\*</mark> | Boolean | Indicate subject has given consent. <mark style="color:red;">Must be true</mark>                                |
| idType<mark style="color:red;">\*</mark>           | Object  | Candidates id type, this can be one of the following <mark style="color:red;">`national-id and passport`</mark> |
| metadata                                           | Object  | Metadata object. Any valid object can be passed here. It gets returned as is.                                   |

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

This is used to verify that the Kenyan identity number provided exists in the database. It shows **non-account information** available for a given identity. The identity number can be for a <mark style="color:orange;">**Passport**</mark>, <mark style="color:orange;">**National ID**</mark>**,&#x20;**<mark style="color:orange;">**Service ID**</mark>**, or&#x20;**<mark style="color:orange;">**Alien ID**</mark>**.**

### <mark style="color:purple;">Identity Number Found Sample</mark>

This contains request and response samples of a **valid and existing identity numbe**r and the owner's information

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

```json
{
    "id": "1234567",
    "idType": "national-id",
    "isSubjectConsent": true
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "success": true,
    "statusCode": 200,
    "message": "success",
    "data": {
        "id": "64eed6026b1a9b8f72c2925e",
        "parentId": null,
        "status": "found",
        "reason": null,
        "dataValidation": false,
        "selfieValidation": false,
        "dateOfBirth": "1999-12-31T21:00:00Z",
        "identityType": "national-id",
        "isConsent": true,
        "idNumber": "1234567",
        "businessId": "628b38f03ae28a14f52d4bf7",
        "firstName": "John",
        "middleName": "M",
        "lastName": "Doe",
        "fullName": "John M Doe",
        "gender": "Male",
        "maritalStatus": "Married",
        "email": "skkariuki@kcbgroup.com",
        "homeTelephoneNumber": "+8761234567",
        "mobileTelephoneNumber": "254723818284",
        "workTelephoneNumber": "040-3203308",
        "employmentName": "Teachers Service Commission.",
        "lastEmployment": "NotSpecified",
        "mainAddress": {
            "address": "NYAHURURU  KCC",
            "country": "KE",
            "town": "Nyahururu"
        },
        "secondaryAddress": {
            "address": "NAKURU-CENTRE",
            "country": "KE",
            "town": "NYAHURURU",
            "postalCode": "20300"
        },
        "contractSummary": {
            "closedContracts": "2",
            "openContracts": "10"
        },
        "inquiries": {
            "numberOfInquiriesLast12Months": "89",
            "numberOfInquiriesLast1Month": "6",
            "numberOfInquiriesLast24Months": "355",
            "numberOfInquiriesLast3Months": "12",
            "numberOfInquiriesLast6Months": "27"
        },
        "type": "keCreditInfo",
        "allValidationPassed": true,
        "requestedAt": "2023-08-30T05:39:15.781Z",
        "requestedById": "628b38f03ae28a5a122d4bf3",
        "country": "KE",
        "createdAt": "2023-08-30T05:39:15.974Z",
        "lastModifiedAt": "2023-08-30T05:39:15.974Z",
        "metadata": {},
        "requestedBy": {
            "firstName": "API",
            "lastName": "User",
            "middleName": "",
            "id": "628b38f03ae28a5a122d4bf3"
        }
    },
    "links": []
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Not Found Sample Response" %}

```json
{
    "success": true,
    "statusCode": 200,
    "message": "success",
    "data": {
        "id": "64db6940563aa72892176950",
        "parentId": null,
        "status": "not_found",
        "reason": "Person Not Found",
        "dataValidation": false,
        "selfieValidation": false,
        "dateOfBirth": null,
        "identityType": "national-id",
        "isConsent": true,
        "idNumber": "00000000",
        "businessId": "628b38f03ae28a14f52d4bf7",
        "email":null,
        "homeTelephoneNumber": null,
        "mobileTelephoneNumber": null,
        "workTelephoneNumber": null,
        "type": "keCreditInfoPhone",
        "allValidationPassed": true,
        "requestedAt": "2023-08-15T12:02:09.602Z",
        "requestedById": "628b38f03ae28a5a122d4bf3",
        "country": "KE",
        "createdAt": "2023-08-15T12:02:09.767Z",
        "lastModifiedAt": "2023-08-15T12:02:09.767Z",
        "metadata": {},
        "requestedBy": {
            "firstName": "Onyeka",
            "lastName": "Ijeh",
            "middleName": "",
            "id": "628b38f13ae28a7b742d4bf9"
        }
    },
    "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 %}
