Identity/KYC Verification in Kenya
National ID, Driver's Licence & Passport
Verify a Kenyan identity document (National ID, Driver's Licence, or Passport) and retrieve the holder's identity details such as name and date of birth.
Prerequisites
You'll need an API key. See Quickstart or Authentication if you don't have one yet.
Note
Verification endpoints use an API key in the X-API-Key header, not a Bearer token. Verification POST requests also require an Idempotency-Key header.
Supported document types
| Document | idType | Notes |
|---|---|---|
| National ID | national_id | Kenyan national identity card number. Returns split name fields plus date of birth. |
| Driver's Licence | drivers_license | Requires the holder's name (validation.firstName and validation.lastName) alongside the licence number. |
| Passport | passport | Kenyan passport number. |
All three use the same endpoint (POST /verify/identity). Set country to KE and idType to one of the values above.
Make the verification request
National ID
curl -X POST https://api.lira.com/api/v1/verify/identity \
-H "X-API-Key: YOUR_API_KEY" \
-H "Idempotency-Key: YOUR_IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{
"country": "KE",
"idType": "national_id",
"idNumber": "12345678"
}'Driver's Licence
The driver's licence lookup is matched against the holder's name, so validation.firstName and validation.lastName are required.
curl -X POST https://api.lira.com/api/v1/verify/identity \
-H "X-API-Key: YOUR_API_KEY" \
-H "Idempotency-Key: YOUR_IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{
"country": "KE",
"idType": "drivers_license",
"idNumber": "B1234567",
"validation": {
"firstName": "John",
"lastName": "Doe"
}
}'Passport
curl -X POST https://api.lira.com/api/v1/verify/identity \
-H "X-API-Key: YOUR_API_KEY" \
-H "Idempotency-Key: YOUR_IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{
"country": "KE",
"idType": "passport",
"idNumber": "A1234567"
}'Request body fields
| Field | Type | Required | Description |
|---|---|---|---|
country | string | Yes | Always KE. |
idType | string | Yes | One of national_id, drivers_license, passport. |
idNumber | string | Yes | The document number. See format requirements below. |
mode | string | No | sync (default). |
validation | object | Conditional | Required for drivers_license (firstName + lastName). Optional cross-check fields for other types. See below. |
idNumber format requirements
idType | Format |
|---|---|
national_id | Up to 9 digits (e.g. 12345678). |
drivers_license | Alphanumeric licence number (e.g. B1234567). Holder name required. |
passport | 6–12 alphanumeric characters (e.g. A1234567). |
Optional validation (cross-check)
Include a validation object to check whether caller-provided fields match the record. Each submitted field is returned with a boolean match result, and the verification status becomes inconclusive if any field does not match. For drivers_license, firstName and lastName are required inputs rather than optional cross-checks.
| Validation field | Type | Match rule |
|---|---|---|
firstName | string | Case-insensitive, trimmed. |
lastName | string | Case-insensitive, trimmed. |
dateOfBirth | string | Exact match. Format YYYY-MM-DD. |
Note
Cross-check fields are never persisted on the verification record and never logged. They are compared in-memory against the record and only the boolean match result is stored.
Read the result
Successful verification
{
"id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
"status": "success",
"verificationType": "KE_NATIONAL_ID",
"idType": "national_id",
"country": "KE",
"identifier": "12345678",
"verifiedAt": "2026-06-14T10:00:00.000Z",
"origin": "api",
"verified": true,
"firstName": "John",
"lastName": "Doe",
"middleName": "Otieno",
"fullName": "John Otieno Doe",
"dateOfBirth": "1990-03-15",
"gender": "M",
"nationality": "Kenyan",
"validation": null
}Note
Passport and Driver's Licence records usually return a single combined fullName string rather than split firstName / lastName. Always read fullName, and treat the individual name components as optional.
Failed verification
{
"id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
"status": "failed",
"verificationType": "KE_NATIONAL_ID",
"idType": "national_id",
"country": "KE",
"identifier": "00000000",
"verifiedAt": "2026-06-14T10:00:00.000Z",
"origin": "api",
"error": {
"code": "VERIFICATION_FAILED",
"message": "Identity verification failed"
}
}Response fields
| Field | Type | Description |
|---|---|---|
id | string | Unique verification ID. |
status | string | success, inconclusive, failed, or error. |
verificationType | string | One of KE_NATIONAL_ID, KE_DRIVERS_LICENSE, KE_PASSPORT. |
idType | string | The idType you submitted. |
country | string | Always KE. |
identifier | string | The document number you submitted. |
verifiedAt | string | ISO 8601 timestamp. |
origin | string | api (API-key requests) or dashboard (logged-in dashboard requests). |
verified | boolean | true only when status is success. |
fullName | string | Combined name. The primary name field for Passport and Driver's Licence. May be null. |
firstName | string | First name, when the record provides split name fields (National ID). May be null. |
lastName | string | Last name, when available. May be null. |
middleName | string | Middle name. May be null. |
dateOfBirth | string | Date of birth, YYYY-MM-DD. May be null. |
gender | string | M or F. May be null. |
nationality | string | Nationality as recorded. May be null. |
validation | object | Present only when validation was included in the request. Contains per-field match results. |
error | object | Present when status is failed or error. |
Error handling
error.code | Cause | Action |
|---|---|---|
VERIFICATION_FAILED | No matching identity record, or the document could not be verified | Ask the user to check the document number (and name, for a driver's licence) |
INVALID_REQUEST | The document number was rejected (e.g. malformed) | Validate the format client-side before submitting |
PROVIDER_ERROR | The upstream registry returned an unexpected error or is temporarily unavailable | Retry with exponential backoff; surface action.hint if retries are exhausted |
A request that fails schema validation — for example a National ID with more than 9 digits, or a driver's licence missing validation.firstName — returns 422 before any verification is attempted.
For the full error code reference, see Errors.