curl --request POST \
--url https://api.sandbox.co.in/kyc/digilocker/sessions/init \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"@entity": "in.co.sandbox.kyc.digilocker.session.request",
"flow": "signin",
"doc_types": [
"aadhaar",
"pan"
],
"redirect_url": "https://sandbox.co.in"
}
'{
"code": 200,
"timestamp": 1751975600361,
"data": {
"@entity": "in.co.sandbox.kyc.digilocker.session.response",
"authorization_url": "https://digilocker.meripehchaan.gov.in/public/oauth2/1/authorize?response_type=code&client_id=IW55C7A3B0&state=e385432b-575c-4b6f-8928-79136dbc0d4f%7Cf1bd0342-cc1d-4051-8301-e8ee17e3a3c3%7Chttps%3A%2F%2Fdeveloper.sandbox.co.in%2F&code_verifier=ADlMHKsr~L8YIwLoIOGgwwRQoouE-m~Z9yu0KWstrsKrdAtUY2IkmOoDWZNn80_G&code_challenge=pnowXsaM5mBqNR3NfSfsaLBC2JYjoy2eRLOwKNVjFY8&code_challenge_method=S256&scope=files.issueddocs&redirect_uri=https%3A%2F%2Fdeveloper.sandbox.co.in%2F&pla=Y&dl_flow=signup&plsignup=Y&amr=driving_license%2Baadhaar%2Bpan%2Bemail%2Busername%2Bmobile%2Bother&verified_mobile=9004813042&req_doctype=PANCR%2CADHAR%2CDRVLC&consent_valid_till=1752061999",
"session_id": "f1bd0342-cc1d-4051-8301-e8ee17e3a3c3"
},
"transaction_id": "a11c4e00-fae1-4092-a55f-b4f0be92ffeb"
}The Initiate Session API returns a DigiLocker link that the user is redirected to, where they can provide consent for the requested documents.
curl --request POST \
--url https://api.sandbox.co.in/kyc/digilocker/sessions/init \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"@entity": "in.co.sandbox.kyc.digilocker.session.request",
"flow": "signin",
"doc_types": [
"aadhaar",
"pan"
],
"redirect_url": "https://sandbox.co.in"
}
'{
"code": 200,
"timestamp": 1751975600361,
"data": {
"@entity": "in.co.sandbox.kyc.digilocker.session.response",
"authorization_url": "https://digilocker.meripehchaan.gov.in/public/oauth2/1/authorize?response_type=code&client_id=IW55C7A3B0&state=e385432b-575c-4b6f-8928-79136dbc0d4f%7Cf1bd0342-cc1d-4051-8301-e8ee17e3a3c3%7Chttps%3A%2F%2Fdeveloper.sandbox.co.in%2F&code_verifier=ADlMHKsr~L8YIwLoIOGgwwRQoouE-m~Z9yu0KWstrsKrdAtUY2IkmOoDWZNn80_G&code_challenge=pnowXsaM5mBqNR3NfSfsaLBC2JYjoy2eRLOwKNVjFY8&code_challenge_method=S256&scope=files.issueddocs&redirect_uri=https%3A%2F%2Fdeveloper.sandbox.co.in%2F&pla=Y&dl_flow=signup&plsignup=Y&amr=driving_license%2Baadhaar%2Bpan%2Bemail%2Busername%2Bmobile%2Bother&verified_mobile=9004813042&req_doctype=PANCR%2CADHAR%2CDRVLC&consent_valid_till=1752061999",
"session_id": "f1bd0342-cc1d-4051-8301-e8ee17e3a3c3"
},
"transaction_id": "a11c4e00-fae1-4092-a55f-b4f0be92ffeb"
}JWT access token
API key for identification
"in.co.sandbox.kyc.digilocker.session.request"Indicates whether the user is signing in or signing up on DigiLocker
signin, signup Documents you need consent for.
aadhaar, pan, driving_license The URL to redirect the user post consent is received
Was this page helpful?