Nilinde
Nilinde Hub API

Safaricom mobile number checks: who a number is registered to, recent SIM swaps and how long a number has been on the network. Numbers on other networks can't be checked.


Phone number ownership (Safaricom)

POST
https://restapi.nilinde.com
/v1/verifications/phone.ownership
Bearer

Checks with Safaricom whether a Safaricom mobile number is registered to the holder of the given ID. Safaricom answers only yes or no (matched); no subscriber details are returned. Numbers on other networks, or ported away from Safaricom, can't be checked.

Price: set by your bundle; one charge per call. "Not found" answers (result.found: false) are charged. Source failures return 502 and are refunded.

Try it: press Test on the request panel, choose ApiKey under Authentication and paste your test key (kept for this browser session). Use Example loads a scenario for each outcome. Test keys return sandbox sample data, free.

Phone number ownership (Safaricom) › Headers

Idempotency-Key
​string · maxLength: 255

Makes retries safe: a repeat with the same key and body returns the original verification without charging again. Up to 255 characters.

Phone number ownership (Safaricom) › Request Body

phoneNumber
​string · required

Safaricom mobile number, in any common form: 0712345678, 254712345678 or +254 712 345 678.

Example: 0712345678
idNumber
​string · pattern: ^[A-Z0-9]{4,20}$ · required

The ID the number should be registered to.

Example: 12345678
idType
​string · enum

Kind of document idNumber belongs to.

Enum values:
NATIONAL_ID
MILITARY_ID
PASSPORT
Default: NATIONAL_ID

Phone number ownership (Safaricom) › Responses

Verification completed; see result.

One verification. Returned by every verification API, by `GET /v1/verifications/{id}`, and in webhooks.
id
​string · required

Unique id; use it to fetch the verification again.

api
​string · required

The verification API that was called, e.g. identity.national-id.

status
​string · enum · required

COMPLETED includes "not found" answers; FAILED means the source failed and the charge was refunded.

Enum values:
PENDING
COMPLETED
FAILED
environment
​string · enum · required

TEST for test keys (sandbox data), LIVE for live keys.

Enum values:
LIVE
TEST
​object | null · required

The answer, specific to each API (see its examples). Always has found: false when the source holds no record.

error
​object | null · required

Set when status is FAILED.

cost
​string · required

Amount charged in KES, as a decimal string. "0" for test keys and failed verifications.

createdAt
​string · date-time · required
latencyMs
​integer | null

Time the source took to answer, in milliseconds.

completedAt
​string | null · date-time

Last SIM swap (Safaricom)

POST
https://restapi.nilinde.com
/v1/verifications/phone.sim-swap
Bearer

When the SIM behind a Safaricom number was last swapped. Safaricom only looks back about three months: lastSwapDate is null when there was no swap in that window. daysSinceSwap helps flag recent swaps, a common sign of account takeover.

Price: set by your bundle; one charge per call. "Not found" answers (result.found: false) are charged. Source failures return 502 and are refunded.

Try it: press Test on the request panel, choose ApiKey under Authentication and paste your test key (kept for this browser session). Use Example loads a scenario for each outcome. Test keys return sandbox sample data, free.

Last SIM swap (Safaricom) › Headers

Idempotency-Key
​string · maxLength: 255

Makes retries safe: a repeat with the same key and body returns the original verification without charging again. Up to 255 characters.

Last SIM swap (Safaricom) › Request Body

phoneNumber
​string · required

Safaricom mobile number, in any common form: 0712345678, 254712345678 or +254 712 345 678.

Example: 0712345678

Last SIM swap (Safaricom) › Responses

Verification completed; see result.

One verification. Returned by every verification API, by `GET /v1/verifications/{id}`, and in webhooks.
id
​string · required

Unique id; use it to fetch the verification again.

api
​string · required

The verification API that was called, e.g. identity.national-id.

status
​string · enum · required

COMPLETED includes "not found" answers; FAILED means the source failed and the charge was refunded.

Enum values:
PENDING
COMPLETED
FAILED
environment
​string · enum · required

TEST for test keys (sandbox data), LIVE for live keys.

Enum values:
LIVE
TEST
​object | null · required

The answer, specific to each API (see its examples). Always has found: false when the source holds no record.

error
​object | null · required

Set when status is FAILED.

cost
​string · required

Amount charged in KES, as a decimal string. "0" for test keys and failed verifications.

createdAt
​string · date-time · required
latencyMs
​integer | null

Time the source took to answer, in milliseconds.

completedAt
​string | null · date-time

Age on network (Safaricom)

POST
https://restapi.nilinde.com
/v1/verifications/phone.age-on-network
Bearer

When a Safaricom number was registered on the network. Safaricom only looks back so far: registeredOn is null (olderThanLookback: true) for numbers registered before that. A very new number is a common fraud signal.

Price: set by your bundle; one charge per call. "Not found" answers (result.found: false) are charged. Source failures return 502 and are refunded.

Try it: press Test on the request panel, choose ApiKey under Authentication and paste your test key (kept for this browser session). Use Example loads a scenario for each outcome. Test keys return sandbox sample data, free.

Age on network (Safaricom) › Headers

Idempotency-Key
​string · maxLength: 255

Makes retries safe: a repeat with the same key and body returns the original verification without charging again. Up to 255 characters.

Age on network (Safaricom) › Request Body

phoneNumber
​string · required

Safaricom mobile number, in any common form: 0712345678, 254712345678 or +254 712 345 678.

Example: 0712345678

Age on network (Safaricom) › Responses

Verification completed; see result.

One verification. Returned by every verification API, by `GET /v1/verifications/{id}`, and in webhooks.
id
​string · required

Unique id; use it to fetch the verification again.

api
​string · required

The verification API that was called, e.g. identity.national-id.

status
​string · enum · required

COMPLETED includes "not found" answers; FAILED means the source failed and the charge was refunded.

Enum values:
PENDING
COMPLETED
FAILED
environment
​string · enum · required

TEST for test keys (sandbox data), LIVE for live keys.

Enum values:
LIVE
TEST
​object | null · required

The answer, specific to each API (see its examples). Always has found: false when the source holds no record.

error
​object | null · required

Set when status is FAILED.

cost
​string · required

Amount charged in KES, as a decimal string. "0" for test keys and failed verifications.

createdAt
​string · date-time · required
latencyMs
​integer | null

Time the source took to answer, in milliseconds.

completedAt
​string | null · date-time