curl --request POST \
--url https://api.casparser.in/v1/kyc/digilocker/result/{session_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"fetch_documents": [
"pan",
"driving_licence"
],
"include_documents": true
}
'import requests
url = "https://api.casparser.in/v1/kyc/digilocker/result/{session_id}"
payload = {
"fetch_documents": ["pan", "driving_licence"],
"include_documents": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fetch_documents: ['pan', 'driving_licence'], include_documents: true})
};
fetch('https://api.casparser.in/v1/kyc/digilocker/result/{session_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.casparser.in/v1/kyc/digilocker/result/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fetch_documents' => [
'pan',
'driving_licence'
],
'include_documents' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.casparser.in/v1/kyc/digilocker/result/{session_id}"
payload := strings.NewReader("{\n \"fetch_documents\": [\n \"pan\",\n \"driving_licence\"\n ],\n \"include_documents\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.casparser.in/v1/kyc/digilocker/result/{session_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fetch_documents\": [\n \"pan\",\n \"driving_licence\"\n ],\n \"include_documents\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casparser.in/v1/kyc/digilocker/result/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fetch_documents\": [\n \"pan\",\n \"driving_licence\"\n ],\n \"include_documents\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"identity": {
"name": "Anjali Sharma",
"dob": "1990-05-16",
"gender": "F",
"email": "anjali@example.com",
"mobile": "98XXXXXX10",
"digilocker_id": "rahul22031995",
"username": "rahul22031995",
"care_of": "S/O Rajesh Sharma",
"address": "<string>",
"verified": {
"pan": "ABCDE1234F",
"aadhaar": "XXXXXXXX1234",
"driving_licence": "KA01-20110012345"
}
},
"consent": {
"purpose": "KYC for loan account opening",
"consented_at": "2026-05-30T22:37:17+00:00"
},
"consented_documents": [
"pan",
"driving_licence"
],
"documents": [
{
"name": "PAN Verification Record",
"type": "file",
"doctype": "PANCR",
"issuer": "Income Tax Department",
"issuerid": "in.gov.pan",
"uri": "in.gov.pan-PANCR-xxxxxxxxxxxx",
"mime": [
"application/pdf",
"application/xml"
],
"date": "2024-09-19"
}
],
"fetched": {
"pan": {
"pan": "ABCPD1234E",
"name": "RAHUL SHARMA",
"father_name": null,
"dob": "22-03-1995",
"gender": "MALE",
"status": "A",
"verified_on": "31-05-2026 03:55:02",
"signature": {
"signature_present": true,
"certificate": {
"subject": "C=IN,O=DIGITAL INDIA CORPORATION,CN=DS DIGITAL INDIA CORPORATION",
"issuer": "<string>",
"valid_from": "2023-11-07T05:31:56Z",
"valid_until": "2023-11-07T05:31:56Z",
"serial_number": "<string>"
}
}
},
"aadhaar": {
"name": "Anjali Sharma",
"dob": "16-05-1990",
"gender": "F",
"care_of": "S/O Rajesh Sharma",
"address": "12, MG Road, Indiranagar, Bengaluru, Karnataka, 560038, India",
"photo_base64": "<string>",
"masked_aadhaar": "XXXXXXXX1234",
"session_id": "<string>"
},
"driving_licence": {
"dl_number": "KA0120190008989",
"name": "Rahul Sharma",
"father_name": "Suresh Sharma",
"dob": "1995-03-22",
"gender": "M",
"status": "A",
"issued_at": "RTO, Bengaluru",
"issue_date": "2023-12-25",
"valid_from": "2023-12-25",
"expiry_date": "2023-12-25",
"present_address": "<string>",
"permanent_address": "<string>",
"categories": [
{
"code": "<string>",
"abbreviation": "<string>",
"description": "<string>",
"issue_date": "2023-12-25"
}
],
"signature": {
"signature_present": true,
"certificate": {
"subject": "C=IN,O=DIGITAL INDIA CORPORATION,CN=DS DIGITAL INDIA CORPORATION",
"issuer": "<string>",
"valid_from": "2023-11-07T05:31:56Z",
"valid_until": "2023-11-07T05:31:56Z",
"serial_number": "<string>"
}
}
}
},
"errors": {}
}{
"status": "failed",
"msg": "Authentication failed: API key is missing. Please provide a valid API key in the x-api-key header."
}DigiLocker aggregate (one-call convenience)
Return everything available for a DigiLocker session in a single call.
Each section is independent: if one is unavailable (e.g. the investor
didn’t consent to it), it’s reported under errors and the rest of the
response still succeeds.
identity— verified identity, when requested viadocuments(free).documents— list of the investor’s documents (free). Setinclude_documents: falseto skip.fetched— for each document infetch_documents, the parsed document data.
Credits: 0.25 per call, regardless of how many documents are fetched or whether identity is returned.
curl --request POST \
--url https://api.casparser.in/v1/kyc/digilocker/result/{session_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"fetch_documents": [
"pan",
"driving_licence"
],
"include_documents": true
}
'import requests
url = "https://api.casparser.in/v1/kyc/digilocker/result/{session_id}"
payload = {
"fetch_documents": ["pan", "driving_licence"],
"include_documents": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fetch_documents: ['pan', 'driving_licence'], include_documents: true})
};
fetch('https://api.casparser.in/v1/kyc/digilocker/result/{session_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.casparser.in/v1/kyc/digilocker/result/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fetch_documents' => [
'pan',
'driving_licence'
],
'include_documents' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.casparser.in/v1/kyc/digilocker/result/{session_id}"
payload := strings.NewReader("{\n \"fetch_documents\": [\n \"pan\",\n \"driving_licence\"\n ],\n \"include_documents\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.casparser.in/v1/kyc/digilocker/result/{session_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fetch_documents\": [\n \"pan\",\n \"driving_licence\"\n ],\n \"include_documents\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casparser.in/v1/kyc/digilocker/result/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fetch_documents\": [\n \"pan\",\n \"driving_licence\"\n ],\n \"include_documents\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"identity": {
"name": "Anjali Sharma",
"dob": "1990-05-16",
"gender": "F",
"email": "anjali@example.com",
"mobile": "98XXXXXX10",
"digilocker_id": "rahul22031995",
"username": "rahul22031995",
"care_of": "S/O Rajesh Sharma",
"address": "<string>",
"verified": {
"pan": "ABCDE1234F",
"aadhaar": "XXXXXXXX1234",
"driving_licence": "KA01-20110012345"
}
},
"consent": {
"purpose": "KYC for loan account opening",
"consented_at": "2026-05-30T22:37:17+00:00"
},
"consented_documents": [
"pan",
"driving_licence"
],
"documents": [
{
"name": "PAN Verification Record",
"type": "file",
"doctype": "PANCR",
"issuer": "Income Tax Department",
"issuerid": "in.gov.pan",
"uri": "in.gov.pan-PANCR-xxxxxxxxxxxx",
"mime": [
"application/pdf",
"application/xml"
],
"date": "2024-09-19"
}
],
"fetched": {
"pan": {
"pan": "ABCPD1234E",
"name": "RAHUL SHARMA",
"father_name": null,
"dob": "22-03-1995",
"gender": "MALE",
"status": "A",
"verified_on": "31-05-2026 03:55:02",
"signature": {
"signature_present": true,
"certificate": {
"subject": "C=IN,O=DIGITAL INDIA CORPORATION,CN=DS DIGITAL INDIA CORPORATION",
"issuer": "<string>",
"valid_from": "2023-11-07T05:31:56Z",
"valid_until": "2023-11-07T05:31:56Z",
"serial_number": "<string>"
}
}
},
"aadhaar": {
"name": "Anjali Sharma",
"dob": "16-05-1990",
"gender": "F",
"care_of": "S/O Rajesh Sharma",
"address": "12, MG Road, Indiranagar, Bengaluru, Karnataka, 560038, India",
"photo_base64": "<string>",
"masked_aadhaar": "XXXXXXXX1234",
"session_id": "<string>"
},
"driving_licence": {
"dl_number": "KA0120190008989",
"name": "Rahul Sharma",
"father_name": "Suresh Sharma",
"dob": "1995-03-22",
"gender": "M",
"status": "A",
"issued_at": "RTO, Bengaluru",
"issue_date": "2023-12-25",
"valid_from": "2023-12-25",
"expiry_date": "2023-12-25",
"present_address": "<string>",
"permanent_address": "<string>",
"categories": [
{
"code": "<string>",
"abbreviation": "<string>",
"description": "<string>",
"issue_date": "2023-12-25"
}
],
"signature": {
"signature_present": true,
"certificate": {
"subject": "C=IN,O=DIGITAL INDIA CORPORATION,CN=DS DIGITAL INDIA CORPORATION",
"issuer": "<string>",
"valid_from": "2023-11-07T05:31:56Z",
"valid_until": "2023-11-07T05:31:56Z",
"serial_number": "<string>"
}
}
}
},
"errors": {}
}{
"status": "failed",
"msg": "Authentication failed: API key is missing. Please provide a valid API key in the x-api-key header."
}Authorizations
Your API key for authentication.
Use sandbox-with-json-responses as Sandbox key.
Path Parameters
The session_id returned by /v1/kyc/digilocker/session.
Body
Response
Aggregate result (sections present per availability)
"success"
The investor's verified identity. Only fields the investor shared are
populated. verified contains the authenticated document identifiers
(e.g. PAN, Aadhaar number).
Show child attributes
Show child attributes
Consent receipt captured at session start. Carried through the flow for audit (DPDP / RBI compliance).
Show child attributes
Show child attributes
Friendly names of documents the user consented to share.
["pan", "driving_licence"]
Show child attributes
Show child attributes
Parsed documents keyed by the fetch_documents value
(pan/aadhaar/driving_licence). Value is null if the document
was requested but unavailable. Each parsed object also
includes a signature block.
Show child attributes
Show child attributes
Per-section error codes (omitted when there are none).
Show child attributes
Show child attributes
Was this page helpful?

