Verify end-user identities (KYC) and corporate records (KYB) programmatically using Nyota ID's B2B REST API.
Fund your workspace wallet via M-PESA or Card on Nyota Accounts. Charges are debited on-demand per verification.
Navigate to Identity API & Keys in your Nyota Workspace settings and create a secret key (`ny_live_...`).
Call our REST API to create a session, then redirect your end-user to `https://verify.nyotaimara.com/session/[sessionId]`.
KES 150 / verification
Includes ID OCR scan, passive 3D liveness check, and facial matching.
KES 500 / verification
Includes KRA PIN validation, certificate of incorporation checks, and director cross-matching.
Call our M2M REST endpoint from your backend to initiate a session, then redirect your user to the returned launcher URL:
// 1. Initiate Verification Session (Server-Side)
const response = await fetch("https://api.nyotaimara.com/v1/verify/sessions", {
method: "POST",
headers: {
"x-nyota-api-key": "ny_live_your_secret_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
type: "kyc", // "kyc" (KSh 150) | "kyb" (KSh 500)
externalEndUserId: "user_customer_987", // Your internal user ID
appName: "Your App Name", // Displayed to end-user
callbackUrl: "https://yourapp.com/api/kyc-callback"
}),
});
const { data } = await response.json();
// Returns: { "sessionId": "sess_889900", "verificationUrl": "https://verify.nyotaimara.com/session/sess_889900" }
// 2. Redirect User or Open Modal
window.location.href = data.verificationUrl;When a verification completes, Nyota ID posts a signed JSON payload to your callbackUrl.
Every webhook includes an X-Nyota-Signature header generated via HMAC-SHA256. Verify this signature in your callback endpoint:
// Incoming Webhook Verification (Node.js / Express)
const signature = req.headers["x-nyota-signature"];
const expectedSignature = crypto
.createHmac("sha256", process.env.NYOTA_WEBHOOK_SECRET)
.update(JSON.stringify(req.body))
.digest("hex");
if (signature === expectedSignature) {
// Webhook is authentic and verified!
const { externalEndUserId, status } = req.body;
if (status === "approved") {
// Unlock user features in your database
}
}