Skip to main content

Identity API Reference

Complete reference for the AfriRoute Identity API. All endpoints are rooted at the production base URL and authenticated with a bearer token.

๐ŸŒ Base URL & Authenticationโ€‹

Base URLhttps://api.afriroute.ai
Sandboxhttps://sandbox.api.afriroute.ai
Auth headerAuthorization: Bearer $AFRIROUTE_API_KEY
Content typeapplication/json
curl https://api.afriroute.ai/api/v1/identity/verification/ver_abc123xyz \
-H "Authorization: Bearer $AFRIROUTE_API_KEY"

๐Ÿ“ก Endpointsโ€‹

MethodPathDescription
POST/v1/identity/verify-idFull ID verification (OCR + authenticity + optional face/liveness)
POST/v1/identity/scan-documentOCR data extraction only
POST/v1/identity/face-matchCompare two faces
POST/v1/identity/livenessPassive or active liveness check
POST/v1/identity/risk-scoreCompute a fraud risk score
POST/v1/identity/phone/send-otpSend a phone-verification OTP
POST/v1/identity/phone/verify-otpVerify a phone OTP
GET/v1/identity/verification/:idRetrieve a verification result
GET/v1/identity/audit/:idRetrieve a verification audit log

Per-endpoint parameters are documented on each feature page; this reference summarizes shared objects and conventions.

๐Ÿงฉ Shared Objectsโ€‹

risk_assessmentโ€‹

FieldTypeDescription
risk_scoreinteger0โ€“100 composite risk
risk_levelstringlow, medium, high, very_high
flagsarrayMachine-readable risk flags

face_matchโ€‹

FieldTypeDescription
matchbooleanWhether the faces matched
confidencenumberMatch confidence, 0โ€“100
similarity_scorenumberRaw similarity, 0โ€“1

livenessโ€‹

FieldTypeDescription
passedbooleanWhether the subject is live
confidencenumberLiveness confidence, 0โ€“100
methodstringpassive or active

๐Ÿ” Get Verificationโ€‹

GET /v1/identity/verification/:verification_id
{
"verification_id": "ver_abc123xyz",
"status": "verified",
"checks_performed": ["document_verification", "face_match", "liveness_detection"],
"results": {
"document_authentic": true,
"face_match": true,
"liveness_passed": true,
"overall_risk": "low"
},
"created_at": "2026-05-10T14:30:00Z",
"completed_at": "2026-05-10T14:30:45Z"
}

๐Ÿ“Š Status Valuesโ€‹

StatusMeaning
verifiedAll requested checks passed
pendingStill processing or awaiting manual review
rejectedOne or more checks failed
expiredDocument past its expiry date

โšก Rate Limitsโ€‹

PlanIdentity requests / min
Free10
Starter60
Growth300
EnterpriseCustom

Rate-limit headers (X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset) are returned on every response. See retry logic for backoff guidance.

โš ๏ธ Error Formatโ€‹

{
"success": false,
"error": {
"code": "IMAGE_QUALITY_LOW",
"message": "The document image is too blurry to process",
"request_id": "req_xyz789",
"timestamp": "2026-05-10T14:30:00Z"
}
}

Common identity error codes: INVALID_DOCUMENT_TYPE, IMAGE_QUALITY_LOW, NO_FACE_DETECTED, FACE_MISMATCH, LIVENESS_FAILED, OTP_EXPIRED, REGISTRY_UNAVAILABLE. The full catalog lives in the error code reference.


Last Updated: May 2026 | Need help? [email protected]