DigilockerAccess Token

DigiLocker Access Token — Complete Authorization

Exchange the authorization code for a DigiLocker access token. Required to fetch user documents after consent is granted.

curl -X POST "https://production.deepvue.tech/v1/kyc/digilocker/access-token" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "client-id: YOUR_API_KEY" \
  -d '{
  "consent": "example_string",
  "purpose": "example_string",
  "initial_deepvue_transaction_id": "example_string",
  "digilocker_code": "example_string"
}'
{
  "code": 200,
  "timestamp": 1766069383550,
  "transaction_id": "b07f6adc78b2467d9813980ce7baafea",
  "sub_code": "SUCCESS",
  "message": "Access Token generated successfully from Digilocker.",
  "data": {
    "expires_in": 3600,
    "consent_valid_till": "1768674599",
    "digilockerid": "2d6275fa-3b64",
    "name": "John Doe",
    "dob": "19011994",
    "gender": "M",
    "eaadhaar": "Y",
    "mobile": "9191993245"
  }
}
POST
/v1/kyc/digilocker/access-token
POST
API Key (header: x-api-key)
x-api-keystring
Required

The CLIENT_SECRET provided to you. This header parameter is required for authentication purposes.

The CLIENT_SECRET provided to you. This header parameter is required for authentication purposes.
API Key (header: client-id)
client-idstring
Required

The CLIENT_ID provided to you. This header parameter is required for authentication purposes.

The CLIENT_ID provided to you. This header parameter is required for authentication purposes.
Content-Typestring
Required

The media type of the request body

Options: application/json
purposestring
Required

Indicates the purpose of the request for accessing the Digilocker API.

initial_deepvue_transaction_idstring
Required

Represents the unique identifier associated with the initial DeepVue transaction.

digilocker_codestring
Required

Specifies the code required for accessing Digilocker services.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
x-api-keystring
Required

API Key for authentication. The CLIENT_SECRET provided to you. This header parameter is required for authentication purposes.

header
client-idstring
Required

API Key for authentication. The CLIENT_ID provided to you. This header parameter is required for authentication purposes.

Body

application/json
purposestring
Required

Indicates the purpose of the request for accessing the Digilocker API.

initial_deepvue_transaction_idstring
Required

Represents the unique identifier associated with the initial DeepVue transaction.

digilocker_codestring
Required

Specifies the code required for accessing Digilocker services.

Responses

codeinteger
timestampinteger
transaction_idstring
sub_codestring
messagestring
dataobject

Upon successful authentication, the response includes user information such as DigiLocker ID, name, date of birth, gender, e-Aadhaar availability, mobile number, and consent expiration timestamp. Access tokens remain active for 3600 seconds (one hour).