AmpleTrails, Gurugram · since 2012 +91 93154 41053 WhatsApp info@ampletrails.com Developer guide · Guides
Products
Identity verificationBusiness verification (KYB)Bank, income & creditFace match & OCRVideo KYC, eSign & flowsCompliance & riskPayouts & messagingAll 52 APIs
Use cases
Customer onboarding (KYC)Merchant & seller onboarding (KYB)Vendor & supplier verificationEmployee background checksGig and field worker onboardingLoan underwritingPayout and refund validationDuplicate and synthetic identity detection
Industries
Fintech & Digital LendingBanks & NBFCsInsuranceBroking, Mutual Funds & WealthCrypto & VDA PlatformsReal-money GamingE-commerce & MarketplacesStaffing, Gig & HRTelecomMobility & LogisticsReal Estate & RentalsB2B & Procurement
Resources
GuidesGlossaryFAQSecurity & data
DevelopersPricingAbout
Theme
Get API keysCall +91 93154 41053

Aadhaar Masking API

Send an image or PDF page of an Aadhaar card. We find the Aadhaar number wherever it appears, black out the first eight digits (and the QR if you want), and send the image back.

Identity document · sample NameRAVI KUMAR NumberABCDE1234F Matches the record Name match96 / 100 PAN statusOperative Aadhaar linkLinked
Source
Our own OCR and image processing on the image you send. Nothing is looked up at UIDAI.
Turnaround
Real time, typically one to three seconds per image
Endpoint
POST /v1/aadhaar/mask
Who can use it
Any business that collects Aadhaar images. No consent step is needed for masking itself, but you still need consent to have collected the image.

Overview

If you collect Aadhaar card images, UIDAI rules say you can't keep the full number visible. This API finds the number on the front and back of the card, including the second copy printed near the address, and masks the first eight digits. Old files can be cleaned in bulk too.

Good to know

Very blurred, cropped or heavily angled photos can hide the number from detection. Check aadhaar_found and send the user back to re-upload if it is false.

What you get

  • Finds every copyAadhaar letters and e-Aadhaar PDFs print the number in more than one place. We count and mask each occurrence.
  • QR masking optionThe QR holds the full number too. Turn on mask_qr and we blur it.
  • Bulk clean-upHave years of unmasked scans in storage? Send them through in batches and replace the originals.
  • Image stays usableName, photo and address remain readable, so your operations team can still use the document.

Request

POST https://api.ampletrails.com/v1/aadhaar/mask

FieldTypeStatusDescription
image_base64stringRequiredFront or back image of the Aadhaar card (JPG, PNG or PDF page), base64 encoded
mask_qrbooleanOptionalAlso blur the QR code on the card (default true)
output_formatstringOptionalFormat of the masked image: jpg or png

Response

Fields inside data. Every response also carries status, request_id and, on errors, message. See error codes.

FieldMeaningExample
masked_image_base64The masked image, base64 encoded/9j/4AAQSkZJRg...
aadhaar_foundWhether an Aadhaar number was detected on the imagetrue
masked_numberThe number as now visible on the imageXXXX XXXX 4321
occurrences_maskedHow many places the number was masked2
qr_maskedWhether the QR code was maskedtrue
sideDetected side of the card: front or backfront

Example

curl -X POST https://api.ampletrails.com/v1/aadhaar/mask \
  -H "Authorization: Bearer $AMPLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image_base64": "/9j/4AAQSkZJRg...", "mask_qr": true, "output_format": "jpg", "consent": "Y"}'
Response · 200 OK
{
  "status": "success",
  "request_id": "req_7f3a9c21e4",
  "data": {
    "masked_image_base64": "/9j/4AAQSkZJRg...",
    "aadhaar_found": true,
    "masked_number": "XXXX XXXX 4321",
    "occurrences_masked": 2,
    "qr_masked": true,
    "side": "front"
  }
}

Example data. The exact field list for your account comes with your sandbox documentation.

Use cases

Lenders and NBFCs

Mask every uploaded Aadhaar before it lands in the loan file or DMS.

HR and payroll

Employee records often hold full Aadhaar scans from years ago. Clean them in one pass.

Visitor and access logs

Reception desks that photograph IDs can mask them on capture instead of storing raw images.

Questions about this API

Is masking enough to comply with Aadhaar rules?

It covers the storage rule for images. You still need consent to collect the card and a lawful purpose for keeping it.

Do you keep a copy of the unmasked image?

No. The image is processed in memory and discarded after we return the masked version.

Does it work on e-Aadhaar PDFs?

Yes. Send each page as an image or the PDF page itself; the number appears several times on e-Aadhaar and all of them are masked.

What about the VID on the card?

The 16-digit Virtual ID is not covered by the masking rule, but we can mask it too if your policy wants that. Ask us to switch it on for your account.

Try the Aadhaar Masking API

Sandbox keys, the full field reference and a Postman collection, usually within a working day.