Skip to content
Developers

One call in, a masked file and a record out

No SDK to install. Send the file with your key, read the JSON. The same contract on the hosted API and inside your own AWS account.

Quick start

Call it from your server: the API sends no CORS headers, so browser pages cannot call it directly, and your key never reaches a browser.

curl -X POST "https://mask-api.habilelabs.io/aadhaar-masking" \
  -H "aadhaar-masking-key: <your-api-key>" \
  -F "file=@kyc-page.jpg"

What comes back

A signed link to the masked file, valid for an hour, and a per-page record you can store as your audit evidence.

{
  "status": 200,
  "message": "File processed successfully.",
  "fileName": "3f2c…9a.jpg",
  "downloadUrl": "https://files.habilelabs.io/masked-output/…",
  "logs": {
    "Page_1": {
      "is_aadhaar": 1,
      "is_number": 1, "is_number_masked": 1,
      "is_QR": 1,     "is_QR_masked": 1,
      "error_while_processing": 0
    }
  },
  "totalPages": 1, "maskedPages": 1, "unmaskedPages": 0,
  "maskingStatus": true
}
Routes

The whole API

POST /aadhaar-maskingMask a document or a ZIP (multipart field file), or a file in your own storage (JSON body of presigned links). Images and PDFs under the page threshold answer in the same call; longer PDFs and ZIPs answer 202 with a taskId.
POST /aadhaar-masking-excelReplace twelve-digit Aadhaar numbers in Excel cells with XXXXXXXXXXXX.
GET /status/{taskId}Follow a background task; when it is COMPLETED the answer carries a fresh download link.
GET /health{"status": "ok"} while the service is up.
GET /docs, GET /uiThe integration guide and the browser tester.

Three ways to send a file

  • Multipart upload: the file in the request; the answer links the masked copy.
  • Your own storage: a JSON body with a presigned download link and a presigned upload link; the service writes the masked file straight back to you.
  • ZIP archives: up to 500 MB; every supported file inside is masked in place, the folder structure is kept, and a per-file report is included. Entries the service cannot mask are included unchanged and flagged.

Status codes you will see

  • 401 — No API key in the request.
  • 403 — The key is wrong, or on /status the task is not yours.
  • 202 — Accepted for background processing; poll /status/{taskId} every few seconds.
  • 415 / 422 — A type the service does not mask, or a file it cannot open (an encrypted PDF, a truncated download). The message says which.
  • 413 — Over the size limit: 100 MB for a file, 500 MB for a ZIP.
Good to know

Behaviour worth designing for

Download promptly

The link in the answer expires after an hour. Store the file, or the per-page record, on your side.

Poll, don't wait

A long PDF or a ZIP answers 202 at once. Budget about ten seconds a page in the background and poll /status every few seconds.

Usage headers

In the AWS Marketplace edition every answer carries X-Pages-Allowance, X-Pages-Used and X-Contract-Packs, and GET /usage reports the contract year.

Get started

Need a key, or a stack in your account?

Ask for an API key for the hosted service, or deploy the AWS Marketplace edition and run the same calls against your own endpoint.

Or email support@habilelabs.io · Monday to Friday, 10:00–19:00 IST (excluding public holidays)