---
title: Aadhaar UID Masking
slug: v3-gateway/aadhaar-uid-masking
description: Enhance data protection, privacy, and compliance measures with the Aadhaar Masking API. Seamlessly integrate this API into applications to mask Aadhaar numbers and preserve document utility. Supported document types include Aadhaar Letter, eAadhaar, and A
createdAt: 2023-03-23T03:54:49.000Z
---

### Introduction

The Aadhaar masking API provides a simple way to mask the Aadhaar number in Aadhaar documents. This is achieved by replacing the first 8 digits of the Aadhaar number with a white stripe, which effectively hides the unique identification number or UID.

This API enables seamless integration into applications, ensuring the protection of personally identifiable information (PII) while maintaining the utility of Aadhaar documents.

The masked Aadhaar images generated by the API maintain the structural and visual aspects of the original document, making it suitable for display or storage while ensuring compliance with privacy regulations. The API response includes URLs of the masked images, which can be retrieved and used within applications or systems.

By incorporating the Aadhaar Masking API into your applications, you can enhance data protection, privacy, and compliance measures. This is particularly beneficial for applications that handle Aadhaar documents and require secure handling of sensitive information.

![](https://api.archbee.com/api/optimize/w0YdjmC6Uxu0AJ6sPj9OT/llB8EcUIhm4x8UUrRW3-P_all-aadhaar-cards-3.jpg "Masked vs un-masked Aadhaar")

***

### API Details

**Endpoint:**

:::CodeblockTabs
Production Environment

```none
POST https://api.signzy.app/api/v3/aadhaar/maskers
```
:::

:::CodeblockTabs
UAT/Testing environment

```none
POST https://api-preproduction.signzy.app/api/v3/aadhaar/maskers
```
:::

***

**Request body parameters:**

| **Parameter** | **Data Type** | **Description**                                                                                                                                                                                       | **Required** |
| ------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| urls          | Array         | URLs where the document to be masked is hosted. You can use Signzy's Persist API to do the same as well.                                                                                              | Yes          |
| requestType   | Boolean       | Defines whether the document passed in the request should be checked for masking status. Masking status can have one of the following values: M (masked), I (Invalid), P (Partial), and U (Unmasked). | Optional     |

```json
{
    "urls": [
        "https://domain/...hosted_image.../image.jpg"
    ],
    "requestType": true
}
```

***

**Request headers:**

| Name          | Value            | Required | Description                                                                                                |
| ------------- | ---------------- | -------- | ---------------------------------------------------------------------------------------------------------- |
| Content-Type  | application/json | Yes      | An authentication token to authorize the request. Reach out to the Signzy support team to get one created. |
| Authorization | XXXXXXXXXXX      | Yes      | The type of content that the request body contains.                                                        |

***

**Code samples:**

:::CodeblockTabs
```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/aadhaar/maskers' \
--header 'Content-Type: application/json' \
--header 'Authorization: {{kong_access_token}}' \
--data '{
    "urls": [
        "https://domain/...hosted_image.../image.jpg"
    ],
    "requestType": true
}'
```

```nodejs
const axios = require('axios');

let data = JSON.stringify({
  "urls": [
    "https://domain/...hosted_image.../image.jpg"
  ],
  "requestType": true
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api-preproduction.signzy.app/api/v3/aadhaar/maskers',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': '{{kong_access_token}}'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
```

```python
import http.client
import json

conn = http.client.HTTPSConnection("api-preproduction.signzy.app")
payload = json.dumps({
  "urls": [
    "https://domain/...hosted_image.../image.jpg"
  ],
  "requestType": True
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': '{{kong_access_token}}'
}
conn.request("POST", "/api/v3/aadhaar/maskers", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api-preproduction.signzy.app/api/v3/aadhaar/maskers"
  method := "POST"

  payload := strings.NewReader(`{
    "urls": [
        "https://domain/...hosted_image.../image.jpg"
    ],
    "requestType": true
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Authorization", "{{kong_access_token}}")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```
:::

***

**Response body parameters:**

| **Parameter**       | **Data type** | **Description**                                                                                                                                                                                                             |
| ------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| result              | Object        | The response returned by the API.                                                                                                                                                                                           |
| result.isMasked     | String        | Value will define whether the Aadhaar is masked or not. Possible respone values are "yes" or "no".                                                                                                                          |
| result.maskedImages | Array         | Masked document URLs.                                                                                                                                                                                                       |
| result.requestType  | String        | Defines the masking status of the document passed in the request and can have one of the following values: M (masked), I (Invalid), P (Partial), U (Unmasked), and E(failed to identify the status of the document passed). |

:::CodeblockTabs
Success - 200 OK

```json
{
    "result": {
        "isMasked": "yes",
        "maskedImages": [
            "https://domain/...hosted_image.../masked_image.jpg"
        ],
        "requestType": "U"
    }
}
```
:::

***

### Document(to be masked) related Constraints:

- Our API supports masking of the following types of Aadhar documents: **Aadhaar Letter, eAadhaar, and Aadhaar PVC card.**
  -

    ![](https://api.archbee.com/api/optimize/w0YdjmC6Uxu0AJ6sPj9OT/UoicLKIfVKsQC6GdrbYd3_all-aadhaar-cards-3.jpg "Types of Aadhaar documents")
- The document being shared as part of the API payload needs to be **a single page.**
- Size should not exceed **2MB.**
- Supported document types:
  - **Image - JPEG, JPG, PNG and TIFF.**
  - **PDF**
- For best results, please make sure that the image you use **fits tightly in the camera view** and is **horizontally aligned.**
-

  ![](https://api.archbee.com/api/optimize/w0YdjmC6Uxu0AJ6sPj9OT/c1yPTVs1o9U1Ol2FkREl5_all-aadhaar-cards-2-2.jpg)

***

### API Performance&#x20;

| Latency      | Defines the time it takes for a request to travel from one place to another and get a response back. | Approx 3 seconds                          |
| ------------ | ---------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| Success rate | Defines how often the API performs its intended function without any errors or problems.             | 99.9%(Processing valid Aadhaar documents) |

***

**Contact Us for Any Assistance**

If you have any questions or need assistance, please reach out to our customer support team. You can contact us via email at <font color="#2166ae">**help\@signzy.com**</font>. We strive to provide prompt and reliable assistance, ensuring your queries are addressed effectively.

We value your feedback and are committed to making your experience smooth and enjoyable. Our team is dedicated to assisting you with any needs you may have. Thank you for choosing our services. We look forward to helping you!



###



