{"openapi":"3.1.0","info":{"title":"Verity API","version":"1.0.0","description":"Verify Nigerian NIN and BVN records, match a selfie to the ID photo, and send customers hosted verification links, all from your own systems.\n\nThe API is JSON over HTTPS. Every response includes a `requestId` (also in the `X-Request-Id` header); quote it when you contact [support@verity.com.ng](mailto:support@verity.com.ng).\n\n## Getting started\n\n1. [Create a business account](https://verity.com.ng/register) and open **Developers** in your dashboard.\n2. Create a **test key** (`vng_test_…`) straight away, no approval needed. Test keys return sample results and are never charged.\n3. Complete **Business verification**. Once approved, create a **live key** (`vng_live_…`) and fund your wallet.\n\nKeep keys on your server. Never put them in a website or mobile app; for apps, use [verification links](#tag/verification-links).\n\n## Authentication\n\nSend your key as a Bearer token on every request:\n\n```\nAuthorization: Bearer vng_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n```\n\nEach check needs the person's consent under the Nigeria Data Protection Act: send `\"consent\": true` only when they've agreed.\n\n## Test mode\n\nTest keys never reach the identity provider and are never charged. Use these numbers:\n\n| Number | NIN / BVN lookup | Face match and verification links |\n|---|---|---|\n| `10000000001` (NIN), `20000000001` (BVN) | Sample record | Match, score 92.4 |\n| `10000000002` (NIN), `20000000002` (BVN) | Sample record | No match, score 31.8 |\n| Any other number | `404 not_found` | `404 not_found` / session `failed` |\n\nIn test mode any JPEG or PNG works as a selfie. The default pass mark is 80, or the `threshold` you send.\n\n## Billing\n\nLive checks are paid per check from your prepaid Verity wallet. Your prices are on the **Developers** page of your dashboard. A face match (by API or verification link) is one price that includes the NIN or BVN lookup. The fee is reserved when a check starts and refunded automatically if no record is found or the identity service fails. With too little balance, requests fail with `402 insufficient_balance` and nothing is charged.\n\n## Errors\n\nErrors use standard HTTP status codes and a stable `error.code` you can branch on:\n\n| Status | Code | Meaning | Charged? |\n|---|---|---|---|\n| 400 | `invalid_request` | A field is missing or invalid | No |\n| 401 | `unauthorized` | Key missing, invalid or revoked | No |\n| 402 | `insufficient_balance` | Wallet doesn't cover the check | No |\n| 403 | `forbidden` | Account can't use the API, or business not yet verified (live) | No |\n| 403 | `ip_not_allowed` | Request came from an address not on the key's allowlist | No |\n| 404 | `not_found` | No record for that number | No (refunded) |\n| 422 | `consent_required` | `consent` wasn't `true` | No |\n| 422 | `no_photo` | Face match: the record has no photo | No (refunded) |\n| 422 | `face_not_detected` | Face match: no clear face in the selfie. Ask the customer for a new selfie (facing the camera, good light, no cap/glasses/mask) | No (refunded) |\n| 429 | `too_many_attempts` | The same number failed 3 times in 30 minutes; wait, then try with a new selfie or the other ID | No |\n| 429 | `rate_limited` | Too many requests; slow down | No |\n| 502 | `provider_error` | Identity service failed; retry shortly | No (refunded) |\n| 503 | `service_unavailable` | Live verification temporarily unavailable | No |\n\n## Rate limits\n\nEach key can make 60 requests a minute by default; over that you get `429 rate_limited`. Need more? Email [support@verity.com.ng](mailto:support@verity.com.ng) and we'll raise it for your account.\n\n## IP allowlist\n\nOn the **Developers** page, choose **Edit** under **Allowed IPs** for a key and list your servers' addresses (IPv4, IPv6 or IPv4 ranges like `102.89.0.0/16`). Other addresses then get `403 ip_not_allowed`.\n\n## Webhooks\n\nSet a webhook URL on the **Developers** page and we'll POST an event when a verification link finishes. Answer with any `2xx` within 10 seconds; otherwise we retry after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 12 hours. Events can arrive more than once, so use the event `id` to ignore repeats. The events are listed under **Webhooks** in the sidebar.\n\n**Check every event is from us.** `X-Verity-Signature` is `t=<unix seconds>,v1=<hex>`, where `v1` is an HMAC-SHA256 of `<t>.<raw body>` made with your webhook signing secret:\n\n```javascript\nimport crypto from \"node:crypto\";\n\n// Use the raw request body, exactly as received (before JSON parsing).\nexport function verifyVeritySignature(rawBody, header, secret) {\n  const [, t, v1] = header?.match(/^t=(\\d+),v1=([0-9a-f]{64})$/) ?? [];\n  if (!t || Math.abs(Date.now() / 1000 - Number(t)) > 300) return false; // older than 5 minutes\n  const expected = crypto.createHmac(\"sha256\", secret).update(`${t}.${rawBody}`).digest(\"hex\");\n  return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(v1));\n}\n```\n\n```php\nfunction verify_verity_signature(string $rawBody, ?string $header, string $secret): bool {\n    if (!$header || !preg_match('/^t=(\\d+),v1=([0-9a-f]{64})$/', $header, $m)) return false;\n    if (abs(time() - (int) $m[1]) > 300) return false; // older than 5 minutes\n    return hash_equals(hash_hmac('sha256', $m[1] . '.' . $rawBody, $secret), $m[2]);\n}\n```\n\n```python\nimport hashlib, hmac, re, time\n\ndef verify_verity_signature(raw_body: bytes, header: str, secret: str) -> bool:\n    m = re.fullmatch(r\"t=(\\d+),v1=([0-9a-f]{64})\", header or \"\")\n    if not m or abs(time.time() - int(m[1])) > 300:\n        return False\n    expected = hmac.new(secret.encode(), m[1].encode() + b\".\" + raw_body, hashlib.sha256).hexdigest()\n    return hmac.compare_digest(expected, m[2])\n```\n\n## Data retention\n\nChecks stay in your verification history. ID photos and selfies are deleted after 30 days; the rest of the record (name, date of birth, score) stays. Store what you need longer in your own systems. See our [Data Processing Agreement](https://verity.com.ng/dpa).","contact":{"name":"Verity support","email":"support@verity.com.ng","url":"https://verity.com.ng"},"termsOfService":"https://verity.com.ng/terms"},"servers":[{"url":"https://verity.com.ng/api/v1","description":"Production (test and live keys)"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Identity lookups","description":"Look up a NIN or BVN and get the identity record back in the same response."},{"name":"Face match","description":"Compare a selfie with the photo on a NIN or BVN record. Use this when you capture the selfie yourself."},{"name":"Verification links","description":"For onboarding in your own app or website, let Verity take the selfie. Your server creates a session and gets a link to a Verity page; your customer opens it, agrees to the check and takes a live selfie with their front camera. We compare it with their NIN or BVN photo, send the result to your webhook, and take the customer back to your `redirectUrl`. No Verity account or SDK needed.\n\nWhen the customer finishes, the page posts a message to the app hosting it (React Native WebView `onMessage`, or `window.parent` for an iframe): `{ \"type\": \"verity.session.finished\", \"sessionId\", \"status\", \"reference\" }`. Use it to close the WebView, then read the result from your server. Never trust the message alone for approval decisions.\n\nLinks are valid for 60 minutes and can be used once. Nothing is charged when a link is created; the face match price is charged when the comparison runs.\n\n**React Native / Expo:** open the link in a WebView with camera access (iOS: `NSCameraUsageDescription`; Android: `CAMERA` permission):\n\n```jsx\nimport { WebView } from \"react-native-webview\";\n\n// url comes from your server (session.url). Never call the Verity API from the app.\nexport function VerifyIdentity({ url, onDone }) {\n  return (\n    <WebView\n      source={{ uri: url }}\n      mediaCapturePermissionGrantType=\"grant\"\n      allowsInlineMediaPlayback\n      mediaPlaybackRequiresUserAction={false}\n      // Fired the moment the check finishes: { type, sessionId, status, reference }.\n      // Close the WebView, then ask your server for the result (GET /sessions/{id} or your webhook).\n      onMessage={(event) => {\n        const message = JSON.parse(event.nativeEvent.data);\n        if (message.type === \"verity.session.finished\") onDone(message.sessionId);\n      }}\n      // Or, if you set a redirectUrl, catch it instead:\n      onShouldStartLoadWithRequest={(request) => {\n        if (request.url.startsWith(\"yourapp://kyc/done\")) {\n          onDone(new URL(request.url).searchParams.get(\"session_id\"));\n          return false;\n        }\n        return true;\n      }}\n    />\n  );\n}\n```"}],"paths":{"/verify/nin":{"post":{"tags":["Identity lookups"],"operationId":"verifyNin","summary":"Verify a NIN","description":"Looks up a National Identification Number and returns the identity record it belongs to. Live checks are charged per check; refunded if no record is found.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["nin","consent"],"properties":{"nin":{"type":"string","pattern":"^\\d{11}$","description":"The 11-digit NIN.","example":"10000000001"},"consent":{"type":"boolean","const":true,"description":"The person agreed to this check."}}},"example":{"nin":"10000000001","consent":true}}}},"responses":{"200":{"description":"Record found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyResponse"},"example":{"status":"verified","mode":"test","type":"NIN","reference":"test_5f1c9a0e2b7d43aa91c2","charged":{"amount":0,"currency":"NGN"},"data":{"idNumber":"10000000001","firstName":"Ada","middleName":"Test","lastName":"Okafor","fullName":"Ada Test Okafor","dateOfBirth":"1994-03-12","gender":"Female","phone":"08000000000","photo":null},"requestId":"req_5f1c9a0e2b7d43aa91c2e8f0"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/InsufficientBalance"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No record for that number (refunded)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No record found for this NIN. You were not charged."},"requestId":"req_9b2e41d0c3a84f17b6aa0c51"}}}},"422":{"$ref":"#/components/responses/ConsentRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/ProviderError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/verify/bvn":{"post":{"tags":["Identity lookups"],"operationId":"verifyBvn","summary":"Verify a BVN","description":"Looks up a Bank Verification Number and returns the identity record it belongs to. Live checks are charged per check; refunded if no record is found.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["bvn","consent"],"properties":{"bvn":{"type":"string","pattern":"^\\d{11}$","description":"The 11-digit BVN.","example":"20000000001"},"consent":{"type":"boolean","const":true,"description":"The person agreed to this check."}}},"example":{"bvn":"20000000001","consent":true}}}},"responses":{"200":{"description":"Record found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyResponse"},"example":{"status":"verified","mode":"test","type":"BVN","reference":"test_5f1c9a0e2b7d43aa91c2","charged":{"amount":0,"currency":"NGN"},"data":{"idNumber":"20000000001","firstName":"Ada","middleName":"Test","lastName":"Okafor","fullName":"Ada Test Okafor","dateOfBirth":"1994-03-12","gender":"Female","phone":"08000000000","photo":null},"requestId":"req_5f1c9a0e2b7d43aa91c2e8f0"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/InsufficientBalance"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No record for that number (refunded)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No record found for this BVN. You were not charged."},"requestId":"req_9b2e41d0c3a84f17b6aa0c51"}}}},"422":{"$ref":"#/components/responses/ConsentRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/ProviderError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/verify/face":{"post":{"tags":["Face match"],"operationId":"faceMatch","summary":"Match a selfie to a NIN or BVN","description":"Looks up the NIN or BVN and compares the photo on the record with the selfie. A completed comparison returns `200` whether or not the faces match, and is charged either way. If the record has no photo you get `422 no_photo` and aren't charged.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["idType","idNumber","selfie","consent"],"properties":{"idType":{"type":"string","enum":["nin","bvn"],"description":"Which ID's photo to compare with."},"idNumber":{"type":"string","pattern":"^\\d{11}$","example":"10000000001"},"selfie":{"type":"string","description":"Base64 JPEG or PNG of the person's face (a `data:image/jpeg;base64,` prefix is fine). Up to 5 MB; about 640 pixels wide works best."},"threshold":{"type":"number","minimum":0,"maximum":100,"description":"Your pass mark. `face.match` is true when the score is at or above it. Leave it out to use the provider's."},"consent":{"type":"boolean","const":true}}},"example":{"idType":"nin","idNumber":"10000000001","selfie":"/9j/4AAQSkZJRgABAQAAAQABAAD…","threshold":60,"consent":true}}}},"responses":{"200":{"description":"Comparison completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FaceMatchResponse"},"example":{"status":"completed","mode":"test","type":"FACE","idType":"NIN","reference":"test_8d3e0b1f6a2c47e9b5d1","charged":{"amount":0,"currency":"NGN"},"face":{"match":true,"score":92.4,"threshold":60,"thresholdSource":"request"},"data":{"idNumber":"10000000001","firstName":"Ada","middleName":"Test","lastName":"Okafor","fullName":"Ada Test Okafor","dateOfBirth":"1994-03-12","gender":"Female","phone":"08000000000","photo":null},"requestId":"req_1a7c3e9f0b2d48c6a5e1f7d3"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/InsufficientBalance"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"No record for that number (refunded)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No record found for this NIN. You were not charged."},"requestId":"req_9b2e41d0c3a84f17b6aa0c51"}}}},"422":{"description":"No consent, or the record has no photo (refunded)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"no_photo","message":"This NIN record has no photo to compare with. You were not charged."},"requestId":"req_9b2e41d0c3a84f17b6aa0c51"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/ProviderError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/sessions":{"post":{"tags":["Verification links"],"operationId":"createSession","summary":"Create a verification link","description":"Creates a one-time link (valid 60 minutes) to Verity's hosted selfie page. Open `url` for your customer. A live session needs enough wallet balance for one face match when you create it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["idType","idNumber","consent"],"properties":{"idType":{"type":"string","enum":["nin","bvn"]},"idNumber":{"type":"string","pattern":"^\\d{11}$","description":"The customer's NIN or BVN."},"threshold":{"type":"number","minimum":0,"maximum":100,"description":"Your pass mark, as for face match."},"reference":{"type":"string","maxLength":100,"description":"Your own ID for this customer or attempt. Sent back in webhooks and the redirect."},"redirectUrl":{"type":"string","description":"Where to send the customer when they finish: an `https://` URL or an app link like `yourapp://kyc/done`. We add `session_id`, `status` and `reference` to it."},"consent":{"type":"boolean","const":true}}},"example":{"idType":"nin","idNumber":"10000000001","threshold":60,"reference":"user_8213","redirectUrl":"yourapp://kyc/done","consent":true}}}},"responses":{"201":{"description":"Session created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"},"example":{"id":"cmv5c5xwy000158jzrb7rxh8f","object":"verification_session","status":"pending","mode":"live","idType":"NIN","idNumber":"100*****001","reference":"user_8213","url":"https://verity.com.ng/v/2PQXhNaTwPij6w1FrJ2jUflxOaVvPiUH","expiresAt":"2026-10-13T11:17:06.030Z","completedAt":null,"face":null,"data":null,"failure":null,"checkReference":null,"requestId":"req_04c775d0efeee7b19fc94bc1"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/InsufficientBalance"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ConsentRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/sessions/{id}":{"get":{"tags":["Verification links"],"operationId":"getSession","summary":"Get a verification session","description":"Returns the session's status, and `face` and `data` once it's completed. Here `data.photo` includes the ID photo (base64 JPEG) for 30 days; webhooks and redirects never include photos.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"cmv5c5xwy000158jzrb7rxh8f"}],"responses":{"200":{"description":"The session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"},"example":{"id":"cmv5c5xwy000158jzrb7rxh8f","object":"verification_session","status":"completed","mode":"live","idType":"NIN","idNumber":"100*****001","reference":"user_8213","url":null,"expiresAt":"2026-10-13T11:17:06.030Z","completedAt":"2026-10-13T10:21:44.512Z","face":{"match":true,"score":92.4,"threshold":60,"thresholdSource":"request"},"data":{"idNumber":"100*****001","firstName":"Ada","middleName":"Test","lastName":"Okafor","fullName":"Ada Test Okafor","dateOfBirth":"1994-03-12","gender":"Female","phone":"08000000000","photo":"/9j/4AAQSkZJRgABAQAAAQABAAD…"},"failure":null,"checkReference":"cmv5c7a1b000358jz9k2d4e6f","requestId":"req_7d1e0c3a9b2f48e6a1c5d7f9"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No session with that id on your account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No verification session with that id belongs to your account."},"requestId":"req_9b2e41d0c3a84f17b6aa0c51"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"webhooks":{"verification.completed":{"post":{"summary":"Verification completed","description":"The customer submitted a selfie and the comparison ran. Decide with `data.face.match`.\n\nSigned with `X-Verity-Signature` (see **Webhooks** in the introduction). Answer with any 2xx.","parameters":[{"name":"X-Verity-Event","in":"header","required":true,"schema":{"type":"string","example":"verification.completed"}},{"name":"X-Verity-Delivery","in":"header","required":true,"description":"The event id; the same on every retry.","schema":{"type":"string","example":"evt_8393f4212579170190796915"}},{"name":"X-Verity-Signature","in":"header","required":true,"schema":{"type":"string","example":"t=1791814640,v1=5d1f0c…"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"},"example":{"id":"evt_8393f4212579170190796915","event":"verification.completed","createdAt":"2026-10-13T10:21:44.900Z","data":{"id":"cmv5c5xwy000158jzrb7rxh8f","object":"verification_session","status":"completed","mode":"live","idType":"NIN","idNumber":"100*****001","reference":"user_8213","url":null,"expiresAt":"2026-10-13T11:17:06.030Z","completedAt":"2026-10-13T10:21:44.512Z","face":{"match":true,"score":92.4,"threshold":60,"thresholdSource":"request"},"data":{"idNumber":"100*****001","firstName":"Ada","middleName":"Test","lastName":"Okafor","fullName":"Ada Test Okafor","dateOfBirth":"1994-03-12","gender":"Female","phone":"08000000000"},"failure":null,"checkReference":"cmv5c7a1b000358jz9k2d4e6f"}}}}},"responses":{"200":{"description":"Any 2xx tells us you received it."}}}},"verification.failed":{"post":{"summary":"Verification failed","description":"The check couldn't be done; see `data.failure.code` (`not_found`, `no_photo`, `insufficient_balance` or `provider_error`).\n\nSigned with `X-Verity-Signature` (see **Webhooks** in the introduction). Answer with any 2xx.","parameters":[{"name":"X-Verity-Event","in":"header","required":true,"schema":{"type":"string","example":"verification.failed"}},{"name":"X-Verity-Delivery","in":"header","required":true,"description":"The event id; the same on every retry.","schema":{"type":"string","example":"evt_8393f4212579170190796915"}},{"name":"X-Verity-Signature","in":"header","required":true,"schema":{"type":"string","example":"t=1791814640,v1=5d1f0c…"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"},"example":{"id":"evt_8393f4212579170190796915","event":"verification.failed","createdAt":"2026-10-13T10:21:44.900Z","data":{"id":"cmv5c5xwy000158jzrb7rxh8f","object":"verification_session","status":"failed","mode":"live","idType":"NIN","idNumber":"100*****001","reference":"user_8213","url":null,"expiresAt":"2026-10-13T11:17:06.030Z","completedAt":"2026-10-13T10:21:44.512Z","face":null,"data":null,"failure":{"code":"not_found","message":"No record was found for this ID number. You were not charged."},"checkReference":null}}}}},"responses":{"200":{"description":"Any 2xx tells us you received it."}}}},"verification.expired":{"post":{"summary":"Verification expired","description":"The customer didn't finish within 60 minutes.\n\nSigned with `X-Verity-Signature` (see **Webhooks** in the introduction). Answer with any 2xx.","parameters":[{"name":"X-Verity-Event","in":"header","required":true,"schema":{"type":"string","example":"verification.expired"}},{"name":"X-Verity-Delivery","in":"header","required":true,"description":"The event id; the same on every retry.","schema":{"type":"string","example":"evt_8393f4212579170190796915"}},{"name":"X-Verity-Signature","in":"header","required":true,"schema":{"type":"string","example":"t=1791814640,v1=5d1f0c…"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"},"example":{"id":"evt_8393f4212579170190796915","event":"verification.expired","createdAt":"2026-10-13T10:21:44.900Z","data":{"id":"cmv5c5xwy000158jzrb7rxh8f","object":"verification_session","status":"expired","mode":"live","idType":"NIN","idNumber":"100*****001","reference":"user_8213","url":null,"expiresAt":"2026-10-13T11:17:06.030Z","completedAt":"2026-10-13T10:21:44.512Z","face":null,"data":null,"failure":null,"checkReference":null}}}}},"responses":{"200":{"description":"Any 2xx tells us you received it."}}}},"webhook.test":{"post":{"summary":"Test event","description":"Sent when you press **Send test event** on the Developers page.\n\nSigned with `X-Verity-Signature` (see **Webhooks** in the introduction). Answer with any 2xx.","parameters":[{"name":"X-Verity-Event","in":"header","required":true,"schema":{"type":"string","example":"webhook.test"}},{"name":"X-Verity-Delivery","in":"header","required":true,"description":"The event id; the same on every retry.","schema":{"type":"string","example":"evt_8393f4212579170190796915"}},{"name":"X-Verity-Signature","in":"header","required":true,"schema":{"type":"string","example":"t=1791814640,v1=5d1f0c…"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"},"example":{"id":"evt_8393f4212579170190796915","event":"webhook.test","createdAt":"2026-10-13T10:21:44.900Z","data":{"message":"This is a test event from Verity. If you can read it, your webhook works."}}}}},"responses":{"200":{"description":"Any 2xx tells us you received it."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your API key: `vng_test_…` for test mode, `vng_live_…` for live checks."}},"schemas":{"IdentityRecord":{"type":"object","description":"The identity record. Fields the source doesn't provide are `null`.","properties":{"idNumber":{"type":"string","example":"10000000001"},"firstName":{"type":"string","example":"Ada"},"middleName":{"type":["string","null"],"example":"Test"},"lastName":{"type":"string","example":"Okafor"},"fullName":{"type":"string","example":"Ada Test Okafor"},"dateOfBirth":{"type":["string","null"],"format":"date","example":"1994-03-12"},"gender":{"type":["string","null"],"example":"Female"},"phone":{"type":["string","null"],"example":"08000000000"},"photo":{"type":["string","null"],"description":"Base64 JPEG of the ID photo, when the record has one (kept by Verity for 30 days)."}},"required":["idNumber","firstName","lastName","fullName"]},"Charged":{"type":"object","properties":{"amount":{"type":"number","description":"Naira charged. Always 0 in test mode.","example":0},"currency":{"type":"string","const":"NGN"}}},"FaceResult":{"type":"object","properties":{"match":{"type":"boolean","description":"True if `score` meets `threshold`."},"score":{"type":["number","null"],"minimum":0,"maximum":100,"description":"Similarity from 0 to 100."},"threshold":{"type":["number","null"],"description":"The pass mark used."},"thresholdSource":{"type":"string","enum":["request","provider"],"description":"`request` if you sent `threshold`, otherwise `provider`."}}},"VerifyResponse":{"type":"object","properties":{"status":{"type":"string","const":"verified"},"mode":{"type":"string","enum":["test","live"]},"type":{"type":"string","enum":["NIN","BVN"]},"reference":{"type":"string","description":"Verity's reference for the check. Live references appear in your verification history."},"charged":{"$ref":"#/components/schemas/Charged"},"data":{"$ref":"#/components/schemas/IdentityRecord"},"requestId":{"type":"string"}}},"FaceMatchResponse":{"type":"object","properties":{"status":{"type":"string","const":"completed"},"mode":{"type":"string","enum":["test","live"]},"type":{"type":"string","const":"FACE"},"idType":{"type":"string","enum":["NIN","BVN"]},"reference":{"type":"string"},"charged":{"$ref":"#/components/schemas/Charged"},"face":{"$ref":"#/components/schemas/FaceResult"},"data":{"$ref":"#/components/schemas/IdentityRecord"},"requestId":{"type":"string"}}},"Session":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"verification_session"},"status":{"type":"string","enum":["pending","completed","failed","expired"]},"mode":{"type":"string","enum":["test","live"]},"idType":{"type":"string","enum":["NIN","BVN"]},"idNumber":{"type":"string","description":"Masked, e.g. 100*****001."},"reference":{"type":["string","null"]},"url":{"type":["string","null"],"description":"The link to open for your customer, while the session is pending."},"expiresAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"face":{"oneOf":[{"$ref":"#/components/schemas/FaceResult"},{"type":"null"}]},"data":{"type":["object","null"],"description":"The identity record once completed (ID number masked)."},"failure":{"type":["object","null"],"properties":{"code":{"type":"string","enum":["not_found","no_photo","insufficient_balance","provider_error"]},"message":{"type":"string"}}},"checkReference":{"type":["string","null"],"description":"The check in your verification history."}}},"WebhookEvent":{"type":"object","properties":{"id":{"type":"string","description":"Unique event id; use it to ignore repeats."},"event":{"type":"string","enum":["verification.completed","verification.failed","verification.expired","webhook.test"]},"createdAt":{"type":"string","format":"date-time"},"data":{"description":"For verification events, the session (see Session). Never includes photos."}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"requestId":{"type":"string"}}}},"responses":{"InvalidRequest":{"description":"A field is missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"Send \"nin\" as an 11-digit string."},"requestId":"req_9b2e41d0c3a84f17b6aa0c51"}}}},"Unauthorized":{"description":"Key missing, invalid or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"This API key is invalid or has been revoked."},"requestId":"req_9b2e41d0c3a84f17b6aa0c51"}}}},"InsufficientBalance":{"description":"Wallet doesn't cover the check","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_balance","message":"Your Verity wallet doesn't cover this check. Top up from the dashboard."},"requestId":"req_9b2e41d0c3a84f17b6aa0c51"}}}},"Forbidden":{"description":"Not allowed: business not verified, account suspended, or IP not on the key's allowlist (ip_not_allowed)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden","message":"Your business hasn't been verified yet. Complete Business verification in your Verity dashboard to use live keys."},"requestId":"req_9b2e41d0c3a84f17b6aa0c51"}}}},"ConsentRequired":{"description":"Consent wasn't confirmed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"consent_required","message":"Set \"consent\": true to confirm the person agreed to this check."},"requestId":"req_9b2e41d0c3a84f17b6aa0c51"}}}},"RateLimited":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests. The limit is 60 per minute per key."},"requestId":"req_9b2e41d0c3a84f17b6aa0c51"}}}},"ProviderError":{"description":"Identity service failed (refunded)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"provider_error","message":"The identity service couldn't complete the check. You were not charged; try again."},"requestId":"req_9b2e41d0c3a84f17b6aa0c51"}}}},"ServiceUnavailable":{"description":"Live verification temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"Live verification is not available right now. Try again later."},"requestId":"req_9b2e41d0c3a84f17b6aa0c51"}}}}}}}