Skip to main content
POST
/
kyc
/
entitylocker-sdk
/
sessions
/
create
Create Session
curl --request POST \
  --url https://test-api.sandbox.co.in/kyc/entitylocker-sdk/sessions/create \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "@entity": "in.co.sandbox.kyc.entitylocker.sdk.session.request",
  "flow": "signin",
  "doc_types": [
    "company_master_details",
    "gstn_details",
    "udhyam_certificate"
  ]
}
'
import requests

url = "https://test-api.sandbox.co.in/kyc/entitylocker-sdk/sessions/create"

payload = {
"@entity": "in.co.sandbox.kyc.entitylocker.sdk.session.request",
"flow": "signin",
"doc_types": ["company_master_details", "gstn_details", "udhyam_certificate"]
}
headers = {
"Authorization": "<authorization>",
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'x-api-key': '<x-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'@entity': 'in.co.sandbox.kyc.entitylocker.sdk.session.request',
flow: 'signin',
doc_types: ['company_master_details', 'gstn_details', 'udhyam_certificate']
})
};

fetch('https://test-api.sandbox.co.in/kyc/entitylocker-sdk/sessions/create', 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://test-api.sandbox.co.in/kyc/entitylocker-sdk/sessions/create",
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([
'@entity' => 'in.co.sandbox.kyc.entitylocker.sdk.session.request',
'flow' => 'signin',
'doc_types' => [
'company_master_details',
'gstn_details',
'udhyam_certificate'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"x-api-key: <x-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://test-api.sandbox.co.in/kyc/entitylocker-sdk/sessions/create"

payload := strings.NewReader("{\n \"@entity\": \"in.co.sandbox.kyc.entitylocker.sdk.session.request\",\n \"flow\": \"signin\",\n \"doc_types\": [\n \"company_master_details\",\n \"gstn_details\",\n \"udhyam_certificate\"\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<authorization>")
req.Header.Add("x-api-key", "<x-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://test-api.sandbox.co.in/kyc/entitylocker-sdk/sessions/create")
.header("Authorization", "<authorization>")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"@entity\": \"in.co.sandbox.kyc.entitylocker.sdk.session.request\",\n \"flow\": \"signin\",\n \"doc_types\": [\n \"company_master_details\",\n \"gstn_details\",\n \"udhyam_certificate\"\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://test-api.sandbox.co.in/kyc/entitylocker-sdk/sessions/create")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"@entity\": \"in.co.sandbox.kyc.entitylocker.sdk.session.request\",\n \"flow\": \"signin\",\n \"doc_types\": [\n \"company_master_details\",\n \"gstn_details\",\n \"udhyam_certificate\"\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "timestamp": 1750331120324,
  "transaction_id": "5ccad959-0bf4-4472-a3dd-d57e2b61b5a9",
  "data": {
    "@entity": "in.co.sandbox.kyc.entitylocker.sdk.session",
    "id": "0454f149-26d0-41ef-9f14-c54f4b5f7b70",
    "status": "created",
    "created_at": 1750331120324
  },
  "code": 200
}

Headers

Authorization
string
required

JWT access token. For token-generation steps, refer to the Quickstart Guide.

x-api-key
string
required

API key used to identify and authenticate the client.

x-api-version
string

Specifies the API version for the request.

Content-Type
enum<string>

Media type of the request body.

Available options:
application/json

Body

application/json
@entity
enum<string>
required
Available options:
in.co.sandbox.kyc.entitylocker.sdk.session.request
flow
enum<string>
required

EntityLocker authentication flow to initiate for the user. Use signin for existing EntityLocker users or signup to create a new account.

Available options:
signin,
signup
doc_types
enum<string>[]
required

List of EntityLocker document types for which user consent is being requested.

Minimum array length: 1
Available options:
company_master_details,
gstn_details,
udhyam_certificate

Response

200 - application/json
timestamp
integer
required
transaction_id
string
required
data
object
required
code
integer
required