curl --request POST \
--url https://production.deepvue.tech/v1/kyc/digilocker/initiate-session \
--header 'Content-Type: application/json' \
--header 'client-id: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"consent": "<string>",
"purpose": "<string>",
"redirect_url": "<string>",
"doc_types": []
}
'import requests
url = "https://production.deepvue.tech/v1/kyc/digilocker/initiate-session"
payload = {
"consent": "<string>",
"purpose": "<string>",
"redirect_url": "<string>",
"doc_types": []
}
headers = {
"x-api-key": "<api-key>",
"client-id": "<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>',
'client-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
consent: '<string>',
purpose: '<string>',
redirect_url: '<string>',
doc_types: []
})
};
fetch('https://production.deepvue.tech/v1/kyc/digilocker/initiate-session', 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://production.deepvue.tech/v1/kyc/digilocker/initiate-session",
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([
'consent' => '<string>',
'purpose' => '<string>',
'redirect_url' => '<string>',
'doc_types' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"client-id: <api-key>",
"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://production.deepvue.tech/v1/kyc/digilocker/initiate-session"
payload := strings.NewReader("{\n \"consent\": \"<string>\",\n \"purpose\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"doc_types\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("client-id", "<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://production.deepvue.tech/v1/kyc/digilocker/initiate-session")
.header("x-api-key", "<api-key>")
.header("client-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"consent\": \"<string>\",\n \"purpose\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"doc_types\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.deepvue.tech/v1/kyc/digilocker/initiate-session")
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["client-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"consent\": \"<string>\",\n \"purpose\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"doc_types\": []\n}"
response = http.request(request)
puts response.read_body{
"code": 201,
"timestamp": 1738305237960,
"transaction_id": "0c8c7833678e412f9fec77dbe0494562",
"data": {
"authorization_url": "https://production.deepvue.tech/v1/kyc/digilocker/digilocker-redirect?state=0c8c7833678e412f9fec77dbe0494562"
}
}{
"detail": "Inactive client_id"
}{
"detail": "Not authenticated"
}{
"detail": "Not a valid token"
}{
"detail": [
{
"loc": [
"body",
"consent"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}{
"detail": "Internal Server Error"
}Initiate Session
This API is used to initiate a session with Digilocker. This API generates a code on UI which will be used in the next DigiLocker flow APIs.
curl --request POST \
--url https://production.deepvue.tech/v1/kyc/digilocker/initiate-session \
--header 'Content-Type: application/json' \
--header 'client-id: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"consent": "<string>",
"purpose": "<string>",
"redirect_url": "<string>",
"doc_types": []
}
'import requests
url = "https://production.deepvue.tech/v1/kyc/digilocker/initiate-session"
payload = {
"consent": "<string>",
"purpose": "<string>",
"redirect_url": "<string>",
"doc_types": []
}
headers = {
"x-api-key": "<api-key>",
"client-id": "<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>',
'client-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
consent: '<string>',
purpose: '<string>',
redirect_url: '<string>',
doc_types: []
})
};
fetch('https://production.deepvue.tech/v1/kyc/digilocker/initiate-session', 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://production.deepvue.tech/v1/kyc/digilocker/initiate-session",
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([
'consent' => '<string>',
'purpose' => '<string>',
'redirect_url' => '<string>',
'doc_types' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"client-id: <api-key>",
"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://production.deepvue.tech/v1/kyc/digilocker/initiate-session"
payload := strings.NewReader("{\n \"consent\": \"<string>\",\n \"purpose\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"doc_types\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("client-id", "<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://production.deepvue.tech/v1/kyc/digilocker/initiate-session")
.header("x-api-key", "<api-key>")
.header("client-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"consent\": \"<string>\",\n \"purpose\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"doc_types\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.deepvue.tech/v1/kyc/digilocker/initiate-session")
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["client-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"consent\": \"<string>\",\n \"purpose\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"doc_types\": []\n}"
response = http.request(request)
puts response.read_body{
"code": 201,
"timestamp": 1738305237960,
"transaction_id": "0c8c7833678e412f9fec77dbe0494562",
"data": {
"authorization_url": "https://production.deepvue.tech/v1/kyc/digilocker/digilocker-redirect?state=0c8c7833678e412f9fec77dbe0494562"
}
}{
"detail": "Inactive client_id"
}{
"detail": "Not authenticated"
}{
"detail": "Not a valid token"
}{
"detail": [
{
"loc": [
"body",
"consent"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}{
"detail": "Internal Server Error"
}Authorizations
The CLIENT_SECRET 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.
Body
The consent parameter indicates whether the user has given consent for the session initiation in the Digilocker service.
The purpose parameter specifies the reason for initiating the session in the Digilocker service.
URL where the user needs to be redirected once the consent is approved.
List of ID Documents. Allowed values are 'aadhaar', 'pan', 'dl'. Only the specified document types will be displayed on the consent screen page for the user. Default value: ['aadhaar','pan','dl']
aadhaar, pan, dl