Skip to content
Lira APILira API

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

DocumentidTypeNotes
National IDnational_idKenyan national identity card number. Returns split name fields plus date of birth.
Driver's Licencedrivers_licenseRequires the holder's name (validation.firstName and validation.lastName) alongside the licence number.
PassportpassportKenyan 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

Terminal
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.

Terminal
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

Terminal
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

FieldTypeRequiredDescription
countrystringYesAlways KE.
idTypestringYesOne of national_id, drivers_license, passport.
idNumberstringYesThe document number. See format requirements below.
modestringNosync (default).
validationobjectConditionalRequired for drivers_license (firstName + lastName). Optional cross-check fields for other types. See below.

idNumber format requirements

idTypeFormat
national_idUp to 9 digits (e.g. 12345678).
drivers_licenseAlphanumeric licence number (e.g. B1234567). Holder name required.
passport6–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 fieldTypeMatch rule
firstNamestringCase-insensitive, trimmed.
lastNamestringCase-insensitive, trimmed.
dateOfBirthstringExact 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

JSON
{
  "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

JSON
{
  "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

FieldTypeDescription
idstringUnique verification ID.
statusstringsuccess, inconclusive, failed, or error.
verificationTypestringOne of KE_NATIONAL_ID, KE_DRIVERS_LICENSE, KE_PASSPORT.
idTypestringThe idType you submitted.
countrystringAlways KE.
identifierstringThe document number you submitted.
verifiedAtstringISO 8601 timestamp.
originstringapi (API-key requests) or dashboard (logged-in dashboard requests).
verifiedbooleantrue only when status is success.
fullNamestringCombined name. The primary name field for Passport and Driver's Licence. May be null.
firstNamestringFirst name, when the record provides split name fields (National ID). May be null.
lastNamestringLast name, when available. May be null.
middleNamestringMiddle name. May be null.
dateOfBirthstringDate of birth, YYYY-MM-DD. May be null.
genderstringM or F. May be null.
nationalitystringNationality as recorded. May be null.
validationobjectPresent only when validation was included in the request. Contains per-field match results.
errorobjectPresent when status is failed or error.

Error handling

error.codeCauseAction
VERIFICATION_FAILEDNo matching identity record, or the document could not be verifiedAsk the user to check the document number (and name, for a driver's licence)
INVALID_REQUESTThe document number was rejected (e.g. malformed)Validate the format client-side before submitting
PROVIDER_ERRORThe upstream registry returned an unexpected error or is temporarily unavailableRetry 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.


Next steps