---
title: Aadhaar Masking API
slug: v2-apis/aadhaar-masking-api
description: Learn how to mask your Aadhaar number in e-Aadhaar with this comprehensive document. Find guidelines on using the API for masking, including input guidelines for image size and format. Discover code examples for generating a masked Aadhaar card image usin
createdAt: 2022-09-14T11:14:38.000Z
---

## Introduction

The Aadhaar masking option allows you to mask Aadhaar number in e-Aadhaar. Masked Aadhaar number implies replacing of first 8 digits of the Aadhaar number with a white stripe.

The Mask UID service generates an image of the Aadhaar card where the unique identification number or UID is hidden so that it cannot be viewed.

Masking becomes important in cases where just the Aadhaar Card details are required but the number needs to be hidden.  &#x20;

## How to call the API

Before going for Masking, you first need to create an Identity object. For best results, please make sure that the image you use fits tightly in camera view and is horizontally aligned. Each image/pdf/tiff should be less than 2MB and an expired image should not be uploaded.

## API Input Guidelines

- The Image should be of good quality.
- Image should be less than 2MB in size.
- API accepts Image, pdf's and URLs.

## Step 1: Hit Identities API

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://preproduction.signzy.tech/api/v2/patrons/<Patron> Id>/identities",
  "name": "Identity Request",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "kind": "required",
        "name": "Authorization",
        "type": "string",
        "children": [],
        "description": "Contains the id parameter returned from the login step"
      },
      {
        "kind": "required",
        "name": "Content-Type",
        "type": "string",
        "children": [],
        "description": "Application/JSON"
      }
    ],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "type",
        "type": "string",
        "children": [],
        "description": "type of document"
      },
      {
        "kind": "required",
        "name": "email",
        "type": "string",
        "children": [],
        "description": "mail Id of person"
      },
      {
        "kind": "required",
        "name": "callbackUrl",
        "type": "string",
        "children": [],
        "description": "URL where response will be posted"
      },
      {
        "kind": "required",
        "name": "images",
        "type": "string",
        "children": [],
        "description": "URL of the image to be masked"
      },
      {
        "kind": "required",
        "name": "type",
        "type": "string",
        "children": [],
        "description": "type of document"
      },
      {
        "kind": "required",
        "name": "email",
        "type": "string",
        "children": [],
        "description": "mail id of person"
      },
      {
        "kind": "required",
        "name": "callbackUrl",
        "type": "string",
        "children": [],
        "description": "URL where response will be posted"
      },
      {
        "kind": "required",
        "name": "images",
        "type": "string",
        "children": [],
        "description": "It is url of the image to be "
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "b8A71Ch8FpbUHqoxk__1W",
        "code": "{\n    \"type\": \"aadhaar\",\n    \"email\": \"ankur.rand@signzy.com\",\n    \"callbackUrl\": \"<https://www.w3schools.com\",>\n    \"images\": [\n        \"<https://preproduction-persist.signzy.tech/api/files/28575821/download/e1421811d1ec4a48923f15fc4931bbc9e4cafb4a0bd14cbe9cd5d099927773f7.jpeg\",>\n        \"<https://preproduction-persist.signzy.tech/api/files/28575895/download/854e140a5d1e45578edaff77c3177064c9d3b82bc2464dcab5a3e2a88348f445.jpeg\">\n    ],\n    \"accessToken\": \"<Access Token>\",\n    \"autoRecognition\": [],\n    \"verification\": [],\n    \"forgeryCheck\": [],\n    \"id\": \"<Id>\",\n    \"patronId\": \"<Patron Id>\"\n}",
        "language": "200",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "b8A71Ch8FpbUHqoxk__1W"
  },
  "examples": {
    "languages": [
      {
        "id": "kfRv8Bc-HCVeTxcsuYGnt",
        "code": "curl --location --request POST '<https://signzy.tech/api/v2/patrons/<Patron> Id>/identities' \\\n--header 'Accept: application/json, text/plain, */*' \\\n--header 'Authorization: <Auth key>' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"type\": \"aadhaar\",\n    \"email\": \"<email Id>\",\n    \"callbackUrl\": \"<https://www.w3schools.com\",>\n    \"images\": [<Images Url>]\n}'",
        "language": "curl",
        "customLabel": "Preproduction"
      },
      {
        "id": "vS3Q_JpCB4zcwYr7d5uh9",
        "code": "curl --location --request POST '<https://signzy.tech/api/v2/patrons/<Patron> Id>/identities' \\\n--header 'Accept: application/json, text/plain, */*' \\\n--header 'Authorization: <Auth key>' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"type\": \"aadhaar\",\n    \"email\": \"<email Id>\",\n    \"callbackUrl\": \"<https://www.w3schools.com\",>\n    \"images\": [<Images Url>]\n}'",
        "language": "curl",
        "customLabel": "Production"
      }
    ],
    "selectedLanguageId": "kfRv8Bc-HCVeTxcsuYGnt"
  },
  "description": "Creating Identity card object",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

### Identity Response Parameters

| **Parameters Name** | **Description**                                                                  |
| ------------------- | -------------------------------------------------------------------------------- |
| type                | type of document                                                                 |
| email               | mail Id of person                                                                |
| callbackUrl         | URL where response will be posted                                                |
| images              | It is the url of images                                                          |
| accessToken         | Contains the access token that was received from identity requestautorecognition |
| autoRecognition     | AutoRecognition                                                                  |
| verification        | It verifies                                                                      |
| forgeryCheck        | It checks for forgery occurances                                                 |
| id                  | Contains the Identity object id                                                  |
| patronId            | Unique Patron ID                                                                 |

## Step 2: Hit Snoops API and receives a response

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://preproduction.signzy.tech/api/v2/snoops",
  "name": "Snoop request",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "kind": "required",
        "name": "content-Type",
        "type": "string",
        "children": [],
        "description": "Application/json"
      }
    ],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "service",
        "type": "string",
        "description": "Type of Signzy service - “Identity”"
      },
      {
        "kind": "required",
        "name": "itemId",
        "type": "string",
        "children": [],
        "description": "Contains the identity item id"
      },
      {
        "kind": "required",
        "name": "accessToken",
        "type": "string",
        "children": [],
        "description": "Contains the access token that was received from identity request"
      },
      {
        "kind": "required",
        "name": "task",
        "type": "string",
        "children": [],
        "description": "Task- Aadhaar Masker"
      },
      {
        "kind": "required",
        "name": "essentials",
        "type": "Object",
        "children": [
          {
            "kind": "required",
            "name": "essentials.url",
            "type": "string",
            "description": "URL of the image of aadhaar to be masked"
          }
        ],
        "description": "Contains essential input data"
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "lUplEMmSwiael_lnPl95r",
        "code": "{\n   \"service\":\"Identity\",\n   \"itemId\":\"<Identity-Id>\",\n   \"task\":\"aadhaarMasker\",\n   \"essentials\":{\n      \"url\":\"<https://preproduction-persist.signzy.tech/api/files/28604967/download/f1c02c244a3a464ca181bd6b5954dfc0782678f12ea44211b05fb4168144d9e8.jpeg\">\n   },\n   \"accessToken\":\"<Access Token>\",\n   \"id\":\"<ID>\",\n   \"response\":{\n      \"urls\":[\n         \"<https://preproduction-persist.signzy.tech/api/files/28604967/download/f1c02c244a3a464ca181bd6b5954dfc0782678f12ea44211b05fb4168144d9e8.jpeg\">\n      ],\n      \"id\":2604,\n      \"callOcrOnFallback\":[\n         null\n      ],\n      \"instance\":{\n         \"id\":\"6153b780f0e8db4b7xxxxx\",\n         \"callbackUrl\":\"<https://www.w3schools.com\">\n      },\n      \"result\":{\n         \"isMasked\":\"yes\",\n         \"maskedImages\":[\n            \"<https://persist.signzy.tech/api/files/216990453/download/8127946a089c4d4eb98caeb81273760c8d1eaa77fc644ddd8196deca637xxxx.jpeg\">\n         ]\n      }\n   }\n}",
        "language": "200",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "lUplEMmSwiael_lnPl95r"
  },
  "examples": {
    "languages": [
      {
        "id": "Ox-uOf5XVL4JRvPiB1ue6",
        "code": "curl --location --request POST 'https://signzy.tech/api/v2/snoops' \\\r\n--header 'Content-Type: application/json;charset=UTF-8' \\\r\n--data-raw '{\r\n    \"service\": \"Identity\",\r\n    \"itemId\": \"<Item ID>\",\r\n    \"accessToken\": \"<Access Token>\",\r\n    \"task\": \"aadhaarMasker\",\r\n    \"essentials\": {\r\n        \"url\": \"<URL of aadhaar to be masked>\"\r\n    }\r\n}'",
        "language": "curl",
        "customLabel": "Preproduction"
      },
      {
        "id": "4L9noCH7fBwZD8n27Bsd8",
        "code": "curl --location --request POST 'https://signzy.tech/api/v2/snoops' \\\r\n--header 'Content-Type: application/json;charset=UTF-8' \\\r\n--data-raw '{\r\n    \"service\": \"Identity\",\r\n    \"itemId\": \"<Item ID>\",\r\n    \"accessToken\": \"<Access Token>\",\r\n    \"task\": \"aadhaarMasker\",\r\n    \"essentials\": {\r\n        \"url\": \"<URL of aadhaar to be masked>\"\r\n    }\r\n}'",
        "language": "curl",
        "customLabel": "Production"
      }
    ],
    "selectedLanguageId": "4L9noCH7fBwZD8n27Bsd8"
  },
  "description": "Performing autoRecognition & verification",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

### Response Parameters

| **Parameter Name**         | **Description**                                                      |
| -------------------------- | -------------------------------------------------------------------- |
| service                    | The type of Signzy service - “identity extraction”.                  |
| itemId                     | This parameter contains the identity item id.                        |
| task                       | The type of task performed - “aadhaarMasker”.                        |
| essentials                 | Contains the essential output data.                                  |
| essentials.url             | Contains the URL of the uploaded image.                              |
| accessToken                | Contains the access token that was received from identity request    |
| Id                         | Contains the patron Id of the snoop request                          |
| response.url               | This parameter contains the output files                             |
| response.id                | Unique Response ID                                                   |
| response.callOcrOnFallback | Calling OCR on Call back                                             |
| instance.id                | Unique Instance ID                                                   |
| instance.callbackUrl       | It contains the call back url where result will be posted            |
| result                     | This parameter holds the masked images of the Aadhaar card.          |
| result.isMasked            | It shows whether the masking result is a yes or no                   |
| result.maskedImages        | The masked image URL of the Aadhaar card is shown by this parameter. |

:::hint{type="info"}
### Getting help

Please feel free to contact us if you have any questions, require clarification, or have ideas for how to make the documents or any of our services better.


You can reach out to us at [help@signzy.com](#).
:::

