> ## Documentation Index
> Fetch the complete documentation index at: https://developer.sandbox.co.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Initiate Session

> The Initiate Session API returns a DigiLocker link that the user is redirected to, where they can provide consent for the requested documents.

<Card title="Run in Postman" icon="https://mintcdn.com/sandboxfinancialtechnologiesprivatelimited/gviqebbpT5NUt_6i/static/svg/Postman.svg?fit=max&auto=format&n=gviqebbpT5NUt_6i&q=85&s=da47f2b7e10d87befec951aed9468de3" horizontal arrow="true" href="https://www.postman.com/in-co-sandbox/sandbox-api/request/uvvxtcp/initiate-session" width="2030" height="2031" data-path="static/svg/Postman.svg" />


## OpenAPI

````yaml api-reference/kyc/openapi.json POST /kyc/digilocker/sessions/init
openapi: 3.1.0
info:
  title: in-co-sandbox-kyc
  description: ''
  version: 1.0.0
servers:
  - url: https://test-api.sandbox.co.in
    description: test
  - url: https://api.sandbox.co.in
    description: prod
security: []
tags:
  - name: kyc
  - name: digilocker-sdk
  - name: digilocker
  - name: aadhaar
  - name: bank
  - name: pan
  - name: mca
  - name: entitylocker
  - name: entitylocker-sdk
paths:
  /kyc/digilocker/sessions/init:
    post:
      tags:
        - kyc
        - digilocker
      summary: Initiate session
      operationId: initiateSession
      parameters:
        - name: Authorization
          in: header
          description: >-
            JWT access token. For token-generation steps, refer to the
            [Quickstart
            Guide](https://developer.sandbox.co.in/guides/get-started/quickstart).
          required: true
          example: '{{access_token}}'
          schema:
            type: string
        - name: x-api-key
          in: header
          description: API key used to identify and authenticate the client.
          required: true
          example: '{{api_key}}'
          schema:
            type: string
        - name: x-api-version
          in: header
          description: Specifies the API version for the request.
          required: false
          example: 1.0.0
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Media type of the request body.
          required: false
          example: application/json
          schema:
            type: string
            enum:
              - application/json
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                '@entity':
                  type: string
                  enum:
                    - in.co.sandbox.kyc.digilocker.session.request
                flow:
                  type: string
                  enum:
                    - signin
                    - signup
                  description: >-
                    Authentication flow to initiate on DigiLocker. Use `signin`
                    for existing users or `signup` to create a new DigiLocker
                    account.
                redirect_url:
                  type: string
                  format: uri
                  pattern: ^https://
                  description: >-
                    HTTPS URL where the user will be redirected after granting
                    or denying DigiLocker consent. Must be a valid, publicly
                    accessible URL.
                doc_types:
                  type: array
                  minItems: 1
                  items:
                    type: string
                    minLength: 1
                    enum:
                      - aadhaar
                      - pan
                      - driving_license
                  description: >-
                    List of DigiLocker document types for which user consent is
                    being requested.
                options:
                  type: object
                  properties:
                    verification_method:
                      type: array
                      items:
                        type: string
                        enum:
                          - aadhaar
                          - pan
                          - driving_license
                          - email
                          - username
                          - mobile
                          - other
                      minItems: 1
                      description: Verification methods allowed during DigiLocker sign-up.
                    pinless:
                      type: boolean
                      description: >-
                        Allow users to sign in using OTP without entering a
                        DigiLocker PIN. Applicable only for the `signin` flow.
                    usernameless:
                      type: boolean
                      description: >-
                        Allow users to skip username creation during DigiLocker
                        sign-up. Applicable only for the `signup` flow.
                    verified_mobile:
                      type: string
                      pattern: ^[6-9][0-9]{9}$
                      description: >-
                        Mobile number already verified by your system to skip
                        DigiLocker mobile OTP during sign-up.
                  description: >-
                    Configuration object controlling the DigiLocker
                    authentication and sign-up user experience.
                consent_expiry:
                  type: integer
                  description: >-
                    Unix epoch timestamp (milliseconds) after which the consent
                    request expires. Must be at least 1 hour in the future.
              required:
                - '@entity'
                - flow
                - redirect_url
                - doc_types
            examples:
              200 - OK:
                value:
                  '@entity': in.co.sandbox.kyc.digilocker.session.request
                  flow: signin
                  redirect_url: https://developer.sandbox.co.in/
                  doc_types:
                    - aadhaar
                  options:
                    verification_method:
                      - aadhaar
                    pinless: true
                    usernameless: true
                    verified_mobile: '9687205427'
                summary: 200 - OK
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  timestamp:
                    type: integer
                  data:
                    type: object
                    properties:
                      '@entity':
                        type: string
                      authorization_url:
                        type: string
                      session_id:
                        type: string
                    required:
                      - '@entity'
                      - authorization_url
                      - session_id
                  transaction_id:
                    type: string
                required:
                  - code
                  - timestamp
                  - data
                  - transaction_id
              examples:
                200 - OK:
                  summary: 200 - OK
                  value:
                    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
          headers: {}
      deprecated: false
      security: []

````