Skip to main content
POST
/
v2
/
mask
/
aadhaar
curl --request POST \
  --url https://bgv.konnectnxt.com/api/v2/mask/aadhaar \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "document_url": "https://example.com/documents/aadhaar_sample.jpg",
  "consent": "yes",
  "mask_qr": true,
  "mask_all_digits": true,
  "extract_last_four_digits": true
}
'
{
"status": "success",
"code": 200,
"message": "Operation completed successfully",
"data": {
"document_url": "https://storage.example.com/masked_document_abc123.jpg",
"original_document_url": "https://storage.example.com/original_document_xyz456.jpg",
"id_number": "6032",
"id_number_found": true
},
"credits_used": 1,
"credits_remaining": 99
}

Overview

This API masks sensitive information from Aadhaar card images or PDFs to protect privacy while maintaining document usability. Perfect for KYC workflows where you need to collect and store documents securely.

Supported Formats

  • Images: JPG, JPEG, PNG
  • Documents: PDF

Required Information

  • Document URL: Publicly accessible URL of the Aadhaar document
  • Consent: Must be “yes” to proceed with masking

Masking Options

Control exactly what gets masked:
OptionDefaultDescription
mask_qrfalseMask the QR code on the Aadhaar card
mask_all_digitsfalseMask all digits of the Aadhaar number
extract_last_four_digitsfalseExtract only last 4 digits (e.g., returns “6032”)

Common Use Cases

1. Standard KYC Masking

Mask all digits and extract the last 4 for verification:
{
  "document_url": "https://example.com/aadhaar.jpg",
  "consent": "yes",
  "mask_qr": true,
  "mask_all_digits": false,
  "extract_last_four_digits": true
}

2. Complete Privacy

Mask everything without extracting digits:
{
  "document_url": "https://example.com/aadhaar.jpg",
  "consent": "yes",
  "mask_qr": true,
  "mask_all_digits": true,
  "extract_last_four_digits": false
}

Response Data

  • Masked Document URL: Link to the masked version (valid for 30 days)
  • Original Document URL: Link to the secure original (valid for 30 days)
  • Last 4 Digits: Returned if extract_last_four_digits was enabled
  • Detection Status: Indicates if an Aadhaar number was found in the document

Important Notes

  • The document URL must be publicly accessible during processing
  • Consent must be explicitly set to “yes”
  • Poor quality images may fail to process

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 Aadhaar document to be masked. Supports both images (JPG, PNG) and PDF documents.

Required string length: 10 - 2048
Example:

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

User consent for masking the document. Must be 'yes' to proceed with masking.

Available options:
yes,
no
Example:

"yes"

mask_qr
boolean
default:false

Whether to mask the QR code on the Aadhaar card. Set to true to mask, false to keep visible.

Example:

true

mask_all_digits
boolean
default:false

Whether to mask all digits of the Aadhaar number. Set to true to mask all digits, false to keep visible.

Example:

true

extract_last_four_digits
boolean
default:false

Whether to extract and show only the last four digits of Aadhaar number. Set to true to extract last 4 digits (e.g., returns '6032' in id_number field), false to return null.

Example:

true

Response

Aadhaar masked successfully

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"

credits_used
integer
required

Represents the total number of credits used in this request.

Example:

3

credits_left
integer
required

Represents the remaining credits available for use.

Example:

4040

data
object