---
agentTools:
  projectIndex: https://docs.decentro.tech/llms.txt
---

# DigiLocker File Data API

> 🙌 Important Note
>
> Please use only **Staging Credentials** on each API Reference page to test the APIs directly from our Documentation.

### API Endpoints

| Environment       | Endpoint                                                       |
| :---------------- | :------------------------------------------------------------- |
| Staging / Sandbox | <https://in.staging.decentro.tech/v2/kyc/digilocker/file/data> |
| Production        | <https://in.decentro.tech/v2/kyc/digilocker/file/data>         |

> 📘 Important Note
>
> Only PAN data can be fetched in JSON format with this API. We are working on other documents as well :)

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Decentro Staging",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://in.staging.decentro.tech"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/v2/kyc/digilocker/file/data": {
      "post": {
        "summary": "DigiLocker File Data API",
        "description": "",
        "operationId": "kyc_api-digilocker-file-data",
        "parameters": [
          {
            "name": "client_id",
            "in": "header",
            "description": "ID/identifier that is provided by Decentro to a specific client and environment. Please note, this may change based on the environment you are on.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_secret",
            "in": "header",
            "description": "The confidential credential provided by Decentro that is associated with the client_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "initiation_decentro_transaction_id",
                  "file_urn",
                  "consent",
                  "consent_purpose",
                  "reference_id"
                ],
                "properties": {
                  "initiation_decentro_transaction_id": {
                    "type": "string"
                  },
                  "file_urn": {
                    "type": "string"
                  },
                  "consent": {
                    "type": "boolean",
                    "description": "true/false based on the consent given by the customer. Mandatory as per regulation.",
                    "default": false
                  },
                  "consent_purpose": {
                    "type": "string",
                    "description": "The purpose of taking this consent from your customer. Mandatory as per regulation. (>20 characters)"
                  },
                  "reference_id": {
                    "type": "string"
                  }
                }
              },
              "examples": {
                "Success": {
                  "value": {
                    "initiation_decentro_transaction_id": "DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
                    "file_urn": "in.gov.pan-PANCR-ABCDE1234F",
                    "consent": true,
                    "consent_purpose": "for bank account purpose",
                    "reference_id": "ABCDEF12345"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Success": {
                    "value": "{\n    \"decentroTxnId\": \"DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n    \"status\": \"SUCCESS\",\n    \"responseCode\": \"S00000\",\n    \"message\": \"File data fetched successfully as JSON from Digilocker\",\n    \"data\": {\n        \"data\": {\n            \"documentIssuer\": \"Income Tax Department\",\n            \"documentName\": \"PAN Card\",\n            \"documentType\": \"PANCR\",\n            \"idNumber\": \"ABCDE1234F\",\n            \"userName\": \"MANISH GUPTA\",\n            \"userDateOfBirth\": \"DD-MM-YYYY\",\n            \"userGender\": \"MALE\",\n            \"documentVerifiedOn\": \"10-05-2023 18:54:22\",\n            \"documentStatus\": \"Active\"\n        },\n        \"initiationDecentroTransactionId\": \"DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"\n    },\n    \"responseKey\": \"success_file_data\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "decentroTxnId": {
                      "type": "string",
                      "example": "DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                    },
                    "status": {
                      "type": "string",
                      "example": "SUCCESS"
                    },
                    "responseCode": {
                      "type": "string",
                      "example": "S00000"
                    },
                    "message": {
                      "type": "string",
                      "example": "File data fetched successfully as JSON from Digilocker"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "documentIssuer": {
                              "type": "string",
                              "example": "Income Tax Department"
                            },
                            "documentName": {
                              "type": "string",
                              "example": "PAN Card"
                            },
                            "documentType": {
                              "type": "string",
                              "example": "PANCR"
                            },
                            "idNumber": {
                              "type": "string",
                              "example": "ABCDE1234F"
                            },
                            "userName": {
                              "type": "string",
                              "example": "MANISH GUPTA"
                            },
                            "userDateOfBirth": {
                              "type": "string",
                              "example": "DD-MM-YYYY"
                            },
                            "userGender": {
                              "type": "string",
                              "example": "MALE"
                            },
                            "documentVerifiedOn": {
                              "type": "string",
                              "example": "10-05-2023 18:54:22"
                            },
                            "documentStatus": {
                              "type": "string",
                              "example": "Active"
                            }
                          }
                        },
                        "initiationDecentroTransactionId": {
                          "type": "string",
                          "example": "DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                        }
                      }
                    },
                    "responseKey": {
                      "type": "string",
                      "example": "success_file_data"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "627cbd56949a61004bbb9c80:64a66494d51a49006d51030b"
}
```