DocumentationValidate phone number

Validate phone number

Normalize a Kenyan phone number and identify its issuing network. Always free.

Base URLhttps://api.dehashit.com/api/v1/

Validate phone number

POST/api/v1/validations/phone-validation/

Validate a phone number and identify its issuing network operator. Always free. Supports Kenya (country_code: "254"). Non-Kenyan country codes return 404.

Validation checks number format, not whether the number is active or reachable. Carrier is based on the original numbering prefix and does not account for number portability; an unassigned prefix returns carrier: "unknown".

Body parameters

NameTypeRequiredDescription
phone_numberstringrequiredNational or international format: 712345678, 0712345678, 254712345678, +254712345678, or 00254712345678. Spaces, dashes, and brackets are ignored. The response uses the normalized 254 format.
country_codestringrequiredUse the string "254". Other numeric country codes return 404; a nonnumeric code returns 400.

Request

curl -X POST https://api.dehashit.com/api/v1/validations/phone-validation/ \
  -H "X-Api-Key: dh_live_..." -H "Content-Type: application/json" \
  -d '{"phone_number": "712345678", "country_code": "254"}'

Response

{
  "status": true,
  "status_code": 0,
  "message": "Data found.",
  "data": {
    "phone_number": "254712345678",
    "country": "Kenya",
    "carrier": "Safaricom",
    "valid": true,
    "type": "mobile"
  }
}

Need a hand with your integration? Contact support.