Getting Started
OpenKYC Africa provides AI-powered identity verification for African businesses. Our API lets you verify users through document verification, face matching, and liveness detection.
Base URL
Mini App URL
Users complete verification through our Telegram Mini App:
Authentication
Authenticate API requests by including your API key in the header:
You can also pass it as a query parameter:
Integration Flow
Here's how a typical integration works:
Example Integration (Python)
Sessions
Create Session
Create a new KYC verification session. The session ID is used to track the user through the verification process.
| Parameter | Type | Required | Description |
|---|---|---|---|
telegram_id |
string | Required | User's Telegram ID or your unique user identifier |
username |
string | Optional | User's Telegram username (without @) |
first_name |
string | Optional | User's first name |
last_name |
string | Optional | User's last name |
email |
string | Optional | User's email address |
phone |
string | Optional | User's phone number |
country_code |
string | Optional | ISO 3166-1 alpha-2 country code (e.g., "ZW", "ZA") |
webhook_url |
string | Optional | URL to receive webhook notifications when KYC status changes |
callback_url |
string | Optional | URL to redirect user after completing KYC |
external_user_id |
string | Optional | Your internal user ID for reference |
metadata |
object | Optional | Custom metadata to store with the session |
Response
Get Session Status
Check the current status of a verification session.
Response
Session Status Values
| Status | Description |
|---|---|
pending | Session created, waiting for user to start |
in_progress | User is completing verification steps |
pending_review | Documents submitted, awaiting review |
approved | Verification successful |
rejected | Verification failed |
expired | Session expired (24 hours) |
Document Upload
Upload Document
Upload a verification document. Documents should be sent as base64-encoded images or multipart form data.
Document Types
| Type | Description |
|---|---|
selfie | User's selfie photo |
liveness | Liveness check video/image |
id_front | Front of ID document |
id_back | Back of ID document |
address | Proof of address document |
Verification
Trigger Verification
Trigger AI verification after all required documents are uploaded. This runs face matching, liveness detection, document OCR, and fraud checks.
Response
User Data
Get User
Get user information and verification status by Telegram ID.
Webhooks
Webhooks notify your server in real-time when verification status changes. Configure your webhook_url when creating a session.
Webhook Events
| Event | Description |
|---|---|
verification.approved | User successfully verified |
verification.rejected | Verification failed |
verification.completed | Verification process finished (check status for result) |
fraud.detected | Fraud detected during verification |
Webhook Payload
Webhook Headers
| Header | Description |
|---|---|
Content-Type | application/json |
X-KYC-Event | The event type (e.g., verification.approved) |
X-KYC-Signature | HMAC-SHA256 signature for verification |
X-KYC-Timestamp | Timestamp of the webhook |
Webhook Security
Verify webhook authenticity using the X-KYC-Signature header:
Error Handling
The API returns standard HTTP status codes with JSON error details:
| Code | Meaning | Description |
|---|---|---|
200 | Success | Request completed successfully |
400 | Bad Request | Invalid parameters - check the error message |
401 | Unauthorized | Invalid or missing API key |
403 | Forbidden | User or IP blocked (fraud detection) |
404 | Not Found | Session or resource not found |
429 | Rate Limited | Too many requests - slow down |
500 | Server Error | Internal error - contact support |
Error Response Format
Testing
Use these endpoints to test your integration:
GET https://api.openkyc.africa/health - Returns {"status": "healthy"} if API is running.
Test Flow
- Create a test session with your API key
- Open the
mini_app_urlin a browser - Complete the verification steps
- Check your webhook endpoint receives the notification
- Query the session status to confirm