> ## Documentation Index
> Fetch the complete documentation index at: https://docs.konnectnxt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Initiate DigiLocker

> Initiates DigiLocker-based profile creation by requesting documents such as Aadhaar and PAN



## OpenAPI

````yaml POST /client/profile-creation-with-digilocker
openapi: 3.0.0
info:
  title: KonnectNXT API Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://bgv.konnectnxt.com/api
    description: Production
  - url: https://testbgv.konnectnxt.com/api
    description: QA
security:
  - bearerAuth: []
paths:
  /client/profile-creation-with-digilocker:
    post:
      tags:
        - DigiLocker
      summary: Initiate DigiLocker
      description: >-
        Initiates DigiLocker-based profile creation by requesting documents such
        as Aadhaar and PAN and validating them via IDfy.
      operationId: profileCreationWithDigilocker
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DigilockerProfileCreationRequest'
      responses:
        '200':
          description: DigiLocker request successfully initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DigilockerInitiateSuccess'
              examples:
                Success:
                  summary: DigiLocker session created
                  value:
                    status: success
                    code: 200
                    message: DigiLocker session initiated successfully
                    data:
                      consent_url: >-
                        https://testbgv.konnectnxt.com/api/digilocker/consent-form?case=36af8453-51e9-43e1-aace-3e8371ef2118
                      case_id: 36af8453-51e9-43e1-aace-3e8371ef2118
                    credits_used: 50
                    credits_remaining: 10000
        '400':
          description: Validation error in request payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DigilockerErrorResponse'
              examples:
                BlankName:
                  summary: Name is blank or whitespace
                  value:
                    status: error
                    code: 400
                    message: Name cannot be empty or whitespace
                    data: null
                InvalidNameFormat:
                  summary: Name contains invalid characters
                  value:
                    status: error
                    code: 400
                    message: Name must contain only alphabets and spaces
                    data: null
                InvalidMobile:
                  summary: Invalid Indian mobile number
                  value:
                    status: error
                    code: 400
                    message: Enter a valid 10-digit Indian mobile number
                    data: null
                InvalidEmail:
                  summary: Invalid email format
                  value:
                    status: error
                    code: 400
                    message: Invalid email format
                    data: null
                MissingPANNumber:
                  summary: PAN number missing when PANCR is requested
                  value:
                    status: error
                    code: 400
                    message: >-
                      extra_fields.panno: panno is required when PANCR is
                      requested
                    data: null
                MissingPANName:
                  summary: PAN full name missing when PANCR is requested
                  value:
                    status: error
                    code: 400
                    message: >-
                      extra_fields.PANFullName: PANFullName is required when
                      PANCR is requested
                    data: null
                InvalidPANFormat:
                  summary: Invalid PAN number format
                  value:
                    status: error
                    code: 400
                    message: 'extra_fields.panno: Invalid PAN number format'
                    data: null
        '401':
          $ref: '#/components/responses/401'
        '402':
          $ref: '#/components/responses/402'
        '500':
          $ref: '#/components/responses/500'
components:
  schemas:
    DigilockerProfileCreationRequest:
      type: object
      required:
        - name
        - email
        - mobile
        - documents_requested
      properties:
        name:
          type: string
          example: SAM
        email:
          type: string
          format: email
          example: sam@gmail.com
        mobile:
          type: string
          example: '9090909012'
        documents_requested:
          type: array
          minItems: 1
          items:
            type: string
            enum:
              - ADHAR
              - PANCR
          example:
            - ADHAR
            - PANCR
        callback_url:
          type: string
          format: uri
          description: Webhook URL to receive DigiLocker updates (optional)
          example: https://webhook.site/9c4c8d1a-8c2b-4f9e-9b2f-2c12fbd1f9f3
        extra_fields:
          type: object
          description: Optional document-specific metadata
          properties:
            panno:
              type: string
              example: AABCI6363G
            PANFullName:
              type: string
              example: SAM
    DigilockerInitiateSuccess:
      type: object
      required:
        - status
        - code
        - message
        - data
        - credits_used
        - credits_remaining
      properties:
        status:
          type: string
          example: success
        code:
          type: integer
          example: 200
        message:
          type: string
          example: DigiLocker session initiated successfully
        data:
          type: object
          required:
            - consent_url
            - case_id
          properties:
            consent_url:
              type: string
              format: uri
            case_id:
              type: string
        credits_used:
          type: integer
          example: 50
        credits_remaining:
          type: number
          example: 10000
    DigilockerErrorResponse:
      type: object
      required:
        - status
        - code
        - message
        - data
        - credits_used
        - credits_remaining
      properties:
        status:
          type: string
          example: error
        code:
          type: integer
          example: 400
        message:
          type: string
          example: Validation failed
        data:
          nullable: true
          example: null
        credits_used:
          type: integer
          example: 0
        credits_remaining:
          type: number
          example: 9900
    Error:
      allOf:
        - $ref: '#/components/schemas/APIBaseResponse'
    APIErrorData:
      type: object
      properties:
        data:
          type: object
          nullable: true
          example: null
    APIBaseResponse:
      type: object
      required:
        - status
        - code
        - message
      properties:
        status:
          $ref: '#/components/schemas/APIStatus'
        code:
          $ref: '#/components/schemas/HTTPCode'
        message:
          $ref: '#/components/schemas/APIMessage'
    APIStatus:
      type: string
      enum:
        - success
        - error
      description: Overall status of the API
    HTTPCode:
      type: integer
      description: HTTP status code
      example: 400
    APIMessage:
      type: string
      description: Description of the response or error
      example: Invalid request parameters
  responses:
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
          examples:
            Missing Token:
              summary: Bearer token is missing or invalid.
              value:
                status: error
                code: 401
                message: Bearer token is missing or invalid.
                data: null
            Incorrect Token Format:
              summary: Token format is incorrect
              value:
                status: error
                code: 401
                message: Token format is incorrect
                data: null
            No Admin Found:
              summary: No admin found for this request
              value:
                status: error
                code: 401
                message: No admin user found for this organization
                data: null
            Invalid API Key:
              summary: Invalid API Key
              value:
                status: error
                code: 401
                message: Invalid API key (organization ID)
                data: null
            User not Found:
              summary: User not found
              value:
                status: error
                code: 401
                message: User not found.
                data: null
    '402':
      description: Payment Required
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
          examples:
            Credit Limit Exceed:
              summary: Credit Limit Exceeded.
              value:
                status: error
                code: 402
                message: Credit Limit Exceeded.
                data: null
            Insufficient Credits:
              summary: Insufficient credits
              value:
                status: error
                code: 402
                message: 'Insufficient credits: 2 required, 1 remaining.'
                data: null
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
          examples:
            Internal Server Error:
              summary: Internal Server Error.
              value:
                status: error
                code: 500
                message: Internal Server Error.
                data: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key issued by KonnectNXT. Pass as `Authorization: Bearer
        <your_api_key>`.

````