> ## 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.

# Aadhaar v2

> Upload an Aadhaar document URL and extract personal details using OCR technology. Returns structured information including name, address, DOB, and Aadhaar number.

## Description

Extract structured data from Aadhaar cards using advanced OCR technology powered by IDfy. Simply provide the document URL and receive comprehensive details including Aadhaar number, personal information, complete address breakdown, and demographic data. The API intelligently extracts information from both the document image and QR code (if present) to ensure maximum accuracy.

## Use Cases

This API is valuable for:

* **Digital KYC Onboarding** - Automate customer verification by extracting Aadhaar details during account opening or registration processes
* **Loan Applications** - Quickly capture applicant identity and address information for credit assessment and verification
* **Address Verification** - Extract detailed address components (house number, street, district, state, pincode) for delivery or compliance purposes
* **Identity Authentication** - Verify individual identity by extracting name, date of birth, gender, and Aadhaar number from document uploads
* **Document Validation** - Detect whether the Aadhaar card is scanned or photographed to assess document quality
* **Compliance Requirements** - Extract and store Aadhaar details to meet regulatory KYC/AML obligations
* **Customer Onboarding** - Eliminate manual data entry by automatically capturing all required fields from uploaded Aadhaar documents


## OpenAPI

````yaml POST /v2/ocr/aadhaar
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:
  /v2/ocr/aadhaar:
    post:
      tags:
        - OCR
      summary: Extract Aadhaar data using OCR
      description: >-
        Upload an Aadhaar document URL and extract personal details using OCR
        technology. Returns structured information including name, address, DOB,
        and Aadhaar number.
      operationId: extractAadhaarOCR
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AadhaarOCRRequest'
            examples:
              Example:
                summary: Aadhaar OCR extraction
                value:
                  document_url: https://example.com/documents/aadhaar-sample.jpg
      responses:
        '200':
          description: Aadhaar OCR processed successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/APIBaseResponse'
                  - type: object
                    required:
                      - data
                    properties:
                      data:
                        $ref: '#/components/schemas/AadhaarOCRData'
                  - $ref: '#/components/schemas/Credits'
              examples:
                Success:
                  summary: Successful Aadhaar OCR extraction
                  value:
                    status: success
                    code: 200
                    message: Operation completed successfully
                    data:
                      extraction_output:
                        id_number: '836696393224'
                        name_on_card: Parvez Alam
                        date_of_birth: '1986-06-20'
                        year_of_birth: '1986'
                        gender: Male
                        address: >-
                          S/O  Shameem Ansari, 486, Badi Bashi Kalan, Rajpura,
                          Rajpur, Mirzapur, Uttar Pradesh, 231001
                        street_address: >-
                          S/O: Shameem Ansari, 486, Badi Bashi Kalan , Rajpura ,
                          Rajpur
                        house_number: '486'
                        district: Mirzapur
                        state: Uttar Pradesh
                        pincode: '231001'
                        fathers_name: Shameem Ansari
                        is_scanned: false
                      qr_output:
                        id_number: null
                        name_on_card: null
                        date_of_birth: null
                        year_of_birth: null
                        gender: null
                        address: null
                        street_address: null
                        house_number: null
                        district: null
                        state: null
                        pincode: null
                    credits_used: 10
                    credits_remaining: 984076.5
        '400':
          $ref: '#/components/responses/400'
          description: Bad request due to invalid input data.
          content:
            application/json:
              examples:
                Document URL Missing:
                  summary: Document URL missing
                  value:
                    status: error
                    code: 400
                    message: '`document_url` is required.'
                    data: null
                Invalid Document URL:
                  summary: Invalid Document URL
                  value:
                    status: error
                    code: 400
                    message: Enter a valid `document_url`
                    data: null
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          description: Unprocessable Entity - Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Invalid URL:
                  summary: Invalid document URL provided
                  value:
                    status: error
                    code: 422
                    message: Invalid URL
                    data: null
        '500':
          $ref: '#/components/responses/500'
components:
  schemas:
    AadhaarOCRRequest:
      type: object
      required:
        - document_url
      properties:
        document_url:
          type: string
          format: uri
          description: Public URL of the Aadhaar document image (JPG, PNG, or PDF)
          example: https://example.com/documents/aadhaar-sample.jpg
    APIBaseResponse:
      type: object
      required:
        - status
        - code
        - message
      properties:
        status:
          $ref: '#/components/schemas/APIStatus'
        code:
          $ref: '#/components/schemas/HTTPCode'
        message:
          $ref: '#/components/schemas/APIMessage'
    AadhaarOCRData:
      type: object
      required:
        - extraction_output
        - qr_output
      properties:
        extraction_output:
          $ref: '#/components/schemas/AadhaarExtractionOutput'
        qr_output:
          $ref: '#/components/schemas/AadhaarQROutput'
    Credits:
      type: object
      properties:
        credits_used:
          $ref: '#/components/schemas/CreditsUsed'
        credits_left:
          $ref: '#/components/schemas/CreditsLeft'
      required:
        - credits_used
        - credits_left
    Error:
      allOf:
        - $ref: '#/components/schemas/APIBaseResponse'
    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
    AadhaarExtractionOutput:
      type: object
      properties:
        id_number:
          type: string
          description: 12-digit Aadhaar number extracted from the document
          example: '836696393224'
        name_on_card:
          type: string
          description: Full name as printed on Aadhaar card
          example: Parvez Alam
        date_of_birth:
          type: string
          format: date
          description: Date of birth in YYYY-MM-DD format
          example: '1986-06-20'
        year_of_birth:
          type: string
          description: Year of birth
          example: '1986'
        gender:
          type: string
          enum:
            - Male
            - Female
            - Transgender
          description: Gender as per Aadhaar
          example: Male
        address:
          type: string
          description: Complete address from Aadhaar card
          example: >-
            S/O  Shameem Ansari, 486, Badi Bashi Kalan, Rajpura, Rajpur,
            Mirzapur, Uttar Pradesh, 231001
        street_address:
          type: string
          description: Street address including house details
          example: 'S/O: Shameem Ansari, 486, Badi Bashi Kalan , Rajpura , Rajpur'
        house_number:
          type: string
          nullable: true
          description: House/flat number
          example: '486'
        district:
          type: string
          description: District name
          example: Mirzapur
        state:
          type: string
          description: State name
          example: Uttar Pradesh
        pincode:
          type: string
          pattern: ^[0-9]{6}$
          description: 6-digit PIN code
          example: '231001'
        fathers_name:
          type: string
          description: Father's name extracted from address
          example: Shameem Ansari
        is_scanned:
          type: boolean
          description: Whether the document is a scanned copy
          example: false
    AadhaarQROutput:
      type: object
      description: Data extracted from QR code (if present on Aadhaar card)
      properties:
        id_number:
          type: string
          nullable: true
          description: Aadhaar number from QR code
        name_on_card:
          type: string
          nullable: true
          description: Name from QR code
        date_of_birth:
          type: string
          nullable: true
          description: DOB from QR code
        year_of_birth:
          type: string
          nullable: true
          description: Year of birth from QR code
        gender:
          type: string
          nullable: true
          description: Gender from QR code
        address:
          type: string
          nullable: true
          description: Address from QR code
        street_address:
          type: string
          nullable: true
          description: Street address from QR code
        house_number:
          type: string
          nullable: true
          description: House number from QR code
        district:
          type: string
          nullable: true
          description: District from QR code
        state:
          type: string
          nullable: true
          description: State from QR code
        pincode:
          type: string
          nullable: true
          description: PIN code from QR code
    CreditsUsed:
      type: integer
      description: Represents the total number of credits used in this request.
      example: 3
    CreditsLeft:
      type: integer
      description: 'Represents the remaining credits available for use. '
      example: 4040
    APIErrorData:
      type: object
      properties:
        data:
          type: object
          nullable: true
          example: null
  responses:
    '400':
      description: Bad Request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
    '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
    '403':
      description: Forbidden
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
          examples:
            Token Revoked:
              summary: Token access has been Revoked, Contact Support.
              value:
                status: error
                code: 403
                message: Token access has been Revoked, Contact Support.
                data: null
            Token Inactive:
              summary: Token is Inactive, Contact Support.
              value:
                status: error
                code: 403
                message: Token is Inactive, Contact Support.
                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>`.

````