Skip to main content
POST
/
v2
/
validate
/
document
curl --request POST \
  --url https://bgv.konnectnxt.com/api/v2/validate/document/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "document_url": "https://example.com/documents/pan_card.jpg",
  "doc_type": "ind_pan",
  "detect_face": true,
  "detect_doc_side": true,
  "check_scan": true
}
'
{
"status": "success",
"code": 200,
"message": "Operation completed successfully",
"data": {
"detected_doc_type": "ind_pan",
"detected_doc_side": "front",
"is_readable": true,
"readability_confidence": 95,
"face_detected": true,
"is_scanned": false
},
"credits_used": 5,
"credits_remaining": 95
}

Overview

The Document Validation API performs comprehensive validation of document images to ensure they meet quality standards for verification workflows. It automatically detects document types, checks readability, identifies faces, determines document sides, and detects whether documents are scanned or original.

Key Features

  • Automatic Document Type Detection: Identifies PAN, Aadhaar, Passport, Driving License, Voter ID, and RC
  • Quality Assessment: Evaluates document readability with confidence scores (0-100)
  • Face Detection: Detects presence of faces in documents with photos
  • Side Detection: Identifies front, back, or both sides of documents
  • Scan Detection: Determines if document is scanned copy or original photo
  • Real-time Processing: Typical processing time of 2-5 seconds

Supported Document Types

Document TypeCodeDescription
PAN Cardind_panIndian PAN Card
Aadhaar Cardind_aadhaarIndian Aadhaar Card (front/back)
Voter IDind_voter_idIndian Voter ID (EPIC)
Driving Licenseind_driving_licenseIndian Driving License
Passportind_passportIndian Passport
RCind_rcVehicle Registration Certificate

Technical Specifications

  • Maximum File Size: 3MB
  • Supported Formats: JPG, PNG, PDF
  • Request Timeout: 50 seconds

Required Information

  • document_url: Publicly accessible URL of the document (required)
  • doc_type: Expected document type (optional, improves accuracy)
  • detect_face: Enable face detection (default: true)
  • detect_doc_side: Enable side detection (default: true)
  • check_scan: Enable scan detection (default: true)

Response Fields

Core Validation Results

FieldTypeDescription
detected_doc_typestringAuto-detected document type or “not_detected”
is_readablebooleanWhether document is readable and of sufficient quality
readability_confidenceintegerQuality score (0-100)
face_detectedbooleanWhether a face was found in the document
is_scannedbooleanWhether document appears to be a scanned copy
detected_doc_sidestringDocument side: “front”, “back”, or “both” (if enabled)

Readability Confidence Scores

  • 81-100: Excellent quality - ideal for processing
  • 61-80: Acceptable quality - suitable for most use cases
  • 31-60: Poor quality - may have issues with OCR/verification
  • 0-30: Very poor quality - not recommended for processing

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
document_url
string<uri>
required

Publicly accessible URL of the document image to validate. Must use HTTP or HTTPS protocol. Document should not exceed 3MB.

Maximum string length: 2048
Example:

"https://example.com/documents/pan_card.jpg"

doc_type
enum<string>

Expected document type (optional). When provided, improves accuracy of validation. If omitted, system will auto-detect document type.

Available options:
ind_pan,
ind_aadhaar,
ind_voter_id,
ind_driving_license,
ind_passport
Example:

"ind_pan"

detect_face
boolean
default:true

Enable face detection in the document. Useful for documents that typically contain photos (Aadhaar, Passport, DL).

Example:

true

detect_doc_side
boolean
default:true

Enable document side detection (front/back/both). Helps identify which side of a two-sided document is provided.

Example:

true

check_scan
boolean
default:true

Enable scan detection to determine if document is a scanned copy. Useful for distinguishing between original photos and scanned documents.

Example:

true

Response

Document validation successful

status
enum<string>
required

Overall status of the API

Available options:
success,
error
code
integer
required

HTTP status code

Example:

400

message
string
required

Description of the response or error

Example:

"Invalid request parameters"

data
object
required
credits_used
number<float>

Number of credits consumed for this operation

Required range: x >= 0
Example:

5

credits_remaining
number<float>

Remaining credits in user account after this operation

Required range: x >= 0
Example:

95