API Endpoints
Complete reference for all Jonga OCR API endpoints. Six OCR document endpoints plus utility endpoints for health, tokens, and diagnostics.
Base URL: https://your-domain.vercel.app/api/v1Request Format
OCR endpoints accept images in two formats. Choose whichever is most convenient for your integration.
Option 1: Multipart Form Data
curl -X POST https://your-domain.vercel.app/api/v1/ocr/sa-id-smart-front \
-H "Authorization: Bearer jonga_YOUR_TOKEN" \
-F "image=@./id-front.jpg"Option 2: JSON Body (Base64)
curl -X POST https://your-domain.vercel.app/api/v1/ocr/sa-id-smart-front \
-H "Authorization: Bearer jonga_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"image": "<base64-encoded-image>",
"mediaType": "image/jpeg"
}'Response Envelope
All responses follow a consistent envelope structure.
{
"success": true,
"documentType": "sa-id-smart-front",
"confidence": "high",
"data": {
"surname": "MALUNGANA",
"names": "THEODORE",
"sex": "M",
"dateOfBirth": "1989-10-06",
"idNumber": "8910065781082",
"countryOfBirth": "RSA",
"citizenshipStatus": "Citizen",
"nationality": "RSA"
},
"meta": {
"processedAt": "2026-04-05T10:00:00Z",
"latencyMs": 3200
}
}{
"success": false,
"error": {
"code": "IMAGE_MISSING",
"message": "No image provided"
}
}OCR Endpoints
/api/v1/ocr/sa-id-smart-frontBearer TokenExtract data from the front of a South African Smart ID card. Returns personal information including name, ID number, date of birth, and citizenship status.
Response Fields
surnamestring|nullSurname as printed on the cardnamesstring|nullFirst names as printed on the cardsex"M"|"F"|nullSex of the card holderdateOfBirthstring|nullDate of birth (YYYY-MM-DD format)idNumberstring|nullSA ID number (13 digits)countryOfBirthstring|nullCountry of birth codecitizenshipStatus"Citizen"|"Permanent Resident"|nullCitizenship statusnationalitystring|nullNationality code/api/v1/ocr/sa-id-smart-backBearer TokenExtract data from the back of a South African Smart ID card. Returns the card number and issue date.
Response Fields
cardNumberstring|nullUnique card number printed on the backdateOfIssuestring|nullDate the card was issued (YYYY-MM-DD format)/api/v1/ocr/sa-id-greenbookBearer TokenExtract data from a South African Green Book ID biographical page. Returns personal information and barcode data.
Response Fields
surnamestring|nullSurname of the holdernamesstring|nullFirst names of the holderdateOfBirthstring|nullDate of birth (YYYY-MM-DD format)idNumberstring|nullSA ID number (13 digits)sexstring|nullSex of the holdercitizenshipStatusstring|nullCitizenship statusnationalitystring|nullNationalitycountryOfBirthstring|nullCountry of birthbarcodeDatastring|nullRaw barcode data if readable/api/v1/ocr/passportBearer TokenExtract data from an international passport biographical page from ANY country. ICAO Doc 9303 compliant — uses the standardized Machine Readable Zone (MRZ) for reliable cross-country extraction. Works with passports from all ICAO member states.
Response Fields
documentTypestring|nullDocument type code (e.g., "P", "PP", "PM")issuingCountrystring|nullIssuing country as ISO 3166-1 alpha-3 (e.g., "ZAF", "USA", "GBR")passportNumberstring|nullPassport number (alphanumeric, country-specific length)surnamestring|nullPrimary/family name of the holdergivenNamesstring|nullGiven names of the holdernationalitystring|nullNationality as ISO 3166-1 alpha-3dateOfBirthstring|nullDate of birth (YYYY-MM-DD format)sex"M"|"F"|"X"|nullSex of the holder (X supported for non-binary passports)dateOfExpirystring|nullDate of expiry (YYYY-MM-DD format)personalNumberstring|nullCountry-specific personal identifier (optional)dateOfIssuestring|nullDate of issue (YYYY-MM-DD format)placeOfBirthstring|nullPlace of birth as printedissuingAuthoritystring|nullIssuing authority (e.g., "DHA", "U.S. Department of State")mrzLine1string|nullMRZ line 1 (44 chars, includes < characters)mrzLine2string|nullMRZ line 2 (44 chars, includes < characters)/api/v1/ocr/sa-drivers-frontBearer TokenExtract data from the front of a South African driver's license. Returns personal information, license details, and vehicle codes.
Response Fields
surnamestring|nullSurname of the holderinitialsstring|nullInitials of the holderidNumberstring|nullSA ID number (13 digits)dateOfBirthstring|nullDate of birth (YYYY-MM-DD format)licenseNumberstring|nullLicense numberdateOfIssuestring|nullDate of issue (YYYY-MM-DD format)dateOfExpirystring|nullDate of expiry (YYYY-MM-DD format)vehicleCodesstring[]|nullVehicle category codes (e.g. A1, B, C, EB)pdpExpirystring|nullProfessional driving permit expiry daterestrictionsstring|nullLicense restrictions (e.g. corrective lenses)/api/v1/ocr/sa-drivers-backBearer TokenExtract data from the back of a South African driver's license. Barcode data is encrypted and cannot be decoded.
Response Fields
rawBarcodeDecodednullAlways null — SA license barcodes are encryptedidNumberstring|nullSA ID number (13 digits)licenseNumberstring|nullLicense numbervehicleCodesstring[]|nullVehicle category codesdateOfExpirystring|nullDate of expiry (YYYY-MM-DD format)Utility Endpoints
/api/v1/healthHealth check endpoint. No authentication required. Returns API status, version, database connectivity, and server timestamp.
Response Fields
statusstringAPI status (e.g. "healthy")versionstringAPI version (e.g. "1.0.0")databasestringDatabase connection statustimestampstringServer timestamp (ISO 8601)/api/v1/tokens/meBearer TokenRetrieve metadata about the authenticated token. Returns scopes, usage statistics, and expiration info.
Response Fields
tokenPrefixstringFirst 10 characters of the tokenprojectNamestringProject namescopesstring[]Authorized scopesisActivebooleanWhether the token is activeexpiresAtstring|nullExpiration datecreatedAtstringCreation timestamplastUsedAtstring|nullLast usage timestamprequestCountnumberTotal number of requests madeConfidence Levels
Every OCR response includes a confidence field indicating the quality of the extraction.
Rate Limit Headers
Every OCR response includes rate limit information in the response headers.
X-RateLimit-LimitMaximum number of requests allowed per windowX-RateLimit-RemainingNumber of requests remaining in the current windowX-RateLimit-ResetUnix timestamp when the rate limit window resets