Skip to main content
POST
Initiate session

Run in Postman

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

Entity type of the request. Always in.co.sandbox.kyc.digilocker.session.request.

Available options:
in.co.sandbox.kyc.digilocker.session.request
flow
enum<string>
required

Which DigiLocker screen the user starts on. signin opens the sign-in screen, for users who already have a DigiLocker account. signup opens account creation.

Available options:
signin,
signup
redirect_url
string<uri>
required

HTTPS URL where the user will be redirected after granting or denying DigiLocker consent. Must be a valid, publicly accessible URL.

Pattern: ^https://
doc_types
enum<string>[]
required

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

Minimum array length: 1
Available options:
aadhaar,
pan,
driving_license
Minimum string length: 1
purpose
string
default:Know Your Customer

Purpose of the request, shown to the user on DigiLocker's consent screen. Letters, digits, spaces and underscores only, as DigiLocker requires; anything else returns 400. Defaults to Know Your Customer.

Pattern: ^[A-Za-z0-9_ ]+$
requestor_name
string

Name of the business requesting the documents, shown to the user on DigiLocker's consent screen. Letters, digits, spaces and underscores only, as DigiLocker requires; anything else returns 400. Defaults to your workspace's business name from the Sandbox console, with other characters replaced by spaces.

Pattern: ^[A-Za-z0-9_ ]+$
options
object

Controls DigiLocker's sign-in and sign-up screens. Every option is optional, and an option that does not apply to the chosen flow is ignored, not rejected.

When the consent expires, as Unix epoch milliseconds. Must be at least one hour from now, otherwise 400. Defaults to 61 minutes from now. DigiLocker rejects a link opened with less than an hour of consent left, so allow time for the user to open it.

Response

code
integer
required
timestamp
integer
required
data
object
required
transaction_id
string
required