DocumentationLook up hashed MSISDN

Look up hashed MSISDN

Resolve a supported Kenyan phone-number hash. Only successful matches are billed.

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

Look up hashed MSISDN

POST/api/v1/msisdn/decrypt/

Look up a phone-number hash from an M-Pesa transaction callback. Billable on match only (KES 0.10 per match). Unmatched hashes (404), validation errors (400), rate limits (429), and service outages (503) are free.

Note: The endpoint path keeps the historic /decrypt/ name so existing M-Pesa integrations can adopt it without changes. Submit a supported M-Pesa phone-number hash to retrieve the matching phone number when available.

To safely handle network retries, send an Idempotency-Key header (up to 128 characters). Choose a unique key for each logical lookup, such as your payment ID, and keep that key and hash unchanged for every retry. A successful match is returned again without a second charge; using its key with another hash returns 422 idempotency_key_reused. Failed lookups do not consume the key. Replace the example key payment-order-123 in your integration.

Body parameters

NameTypeRequiredDescription
msisdn_hashstringrequired64-character hexadecimal hash from the M-Pesa callback.

Request

curl -X POST https://api.dehashit.com/api/v1/msisdn/decrypt/ \
  -H "X-Api-Key: dh_live_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: payment-order-123" \
  -d '{"msisdn_hash": "7132104d6aae9c3fac82095a42c2817952bca48e09d98d5bf4ac08218982fb90"}'

Response

{
  "status": true,
  "status_code": 0,
  "message": "Data found",
  "data": {
    "msisdn": "254712345678",
    "country": "Kenya",
    "carrier": "Safaricom"
  }
}

Need a hand with your integration? Contact support.