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

# Generate OTP

> Generate OTP on the individual's registered mobile number to verify their Aadhaar number.

<Warning>
  **Deprecation Notice:** This Aadhaar verification endpoint has been deprecated by UIDAI. While it remains operational, reliability and response times may be impacted. For a more reliable verification experience, we recommend migrating to the [DigiLocker-based](https://developer.sandbox.co.in/api-reference/kyc/digilocker/overview) verification flow.
</Warning>

<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/sz97ap6/aadhaar-offline-e-kyc-generate-otp" width="2030" height="2031" data-path="static/svg/Postman.svg" />


## OpenAPI

````yaml api-reference/kyc/openapi.json POST /kyc/aadhaar/okyc/otp
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/aadhaar/okyc/otp:
    post:
      tags:
        - kyc
        - aadhaar
      summary: Aadhaar Offline e-KYC Generate OTP
      operationId: generateOTP
      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.aadhaar.okyc.otp.request
                aadhaar_number:
                  type: string
                  description: >-
                    12-digit Aadhaar number of the individual for whom the OTP
                    will be generated. Must contain exactly 12 numeric digits
                    with no spaces or separators.
                  minLength: 12
                  maxLength: 12
                  pattern: ^[0-9]{12}$
                consent:
                  type: string
                  enum:
                    - 'Y'
                    - 'y'
                  description: >-
                    Explicit consent from the end user to use their Aadhaar
                    details for OTP-based verification. Must be passed as "Y" or
                    "y" to proceed.
                reason:
                  type: string
                  description: >-
                    Purpose for initiating Aadhaar OTP verification, such as
                    identity verification or KYC compliance. Used for audit,
                    compliance, and request traceability.
              required:
                - '@entity'
                - aadhaar_number
                - consent
                - reason
            examples:
              200 - OTP Generated:
                value:
                  '@entity': in.co.sandbox.kyc.aadhaar.okyc.otp.request
                  aadhaar_number: '123456789012'
                  consent: 'y'
                  reason: For KYC
                summary: 200 - OTP Generated
              200 - OTP Generated | Invalid OTP:
                value:
                  '@entity': in.co.sandbox.kyc.aadhaar.okyc.otp.request
                  aadhaar_number: '123456789015'
                  consent: 'y'
                  reason: For KYC
                summary: 200 - OTP Generated | Invalid OTP
              200 - OTP Generated | OTP Expired:
                value:
                  '@entity': in.co.sandbox.kyc.aadhaar.okyc.otp.request
                  aadhaar_number: '123456789016'
                  consent: 'y'
                  reason: For KYC
                summary: 200 - OTP Generated | OTP Expired
              200 - OTP Generated | Invalid Reference ID:
                value:
                  '@entity': in.co.sandbox.kyc.aadhaar.okyc.otp.request
                  aadhaar_number: '123456789017'
                  consent: 'y'
                  reason: For KYC
                summary: 200 - OTP Generated | Invalid Reference ID
              200 - OTP Generated | Request under process:
                value:
                  '@entity': in.co.sandbox.kyc.aadhaar.okyc.otp.request
                  aadhaar_number: '123456789018'
                  consent: 'y'
                  reason: For KYC
                summary: 200 - OTP Generated | Request under process
              200 - Invalid Aadhaar Card:
                value:
                  '@entity': in.co.sandbox.kyc.aadhaar.okyc.otp.request
                  aadhaar_number: '123456789013'
                  consent: 'y'
                  reason: For KYC
                summary: 200 - Invalid Aadhaar Card
              422 - Invalid Aadhaar number pattern:
                value:
                  '@entity': in.co.sandbox.kyc.aadhaar.okyc.otp.request
                  aadhaar_number: '1234567890123'
                  consent: 'y'
                  reason: For KYC
                summary: 422 - Invalid Aadhaar number pattern
              503 - Source Unavailable:
                value:
                  '@entity': in.co.sandbox.kyc.aadhaar.okyc.otp.request
                  aadhaar_number: '123456789020'
                  consent: 'y'
                  reason: For KYC
                summary: 503 - Source Unavailable
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  timestamp:
                    type: integer
                  transaction_id:
                    type: string
                    format: uuid
                  data:
                    type: object
                    properties:
                      '@entity':
                        type: string
                        const: in.co.sandbox.kyc.aadhaar.okyc.otp.response
                      reference_id:
                        type: integer
                      message:
                        type: string
                    required:
                      - '@entity'
                      - reference_id
                      - message
                required:
                  - data
                  - transaction_id
                  - timestamp
                  - code
              examples:
                200 - OTP Generated:
                  summary: 200 - OTP Generated
                  value:
                    code: 200
                    timestamp: 1000000000000
                    transaction_id: 7d75d9db-0870-4719-8884-a3eee7bd68d5
                    data:
                      '@entity': in.co.sandbox.kyc.aadhaar.okyc.otp.response
                      reference_id: 1234567
                      message: OTP sent successfully
                200 - OTP Generated | Invalid OTP:
                  summary: 200 - OTP Generated | Invalid OTP
                  value:
                    code: 200
                    timestamp: 1000000000000
                    transaction_id: 7774ca39-156c-44f4-bcb2-9ea4c918810e
                    data:
                      '@entity': in.co.sandbox.kyc.aadhaar.okyc.otp.response
                      reference_id: 1234568
                      message: OTP sent successfully
                200 - OTP Generated | OTP Expired:
                  summary: 200 - OTP Generated | OTP Expired
                  value:
                    code: 200
                    timestamp: 1000000000000
                    transaction_id: c5780d5a-6af4-4689-a853-bc6460bfc5fb
                    data:
                      '@entity': in.co.sandbox.kyc.aadhaar.okyc.otp.response
                      reference_id: 1234569
                      message: OTP sent successfully
                200 - OTP Generated | Invalid Reference ID:
                  summary: 200 - OTP Generated | Invalid Reference ID
                  value:
                    code: 200
                    timestamp: 1000000000000
                    transaction_id: 85ce458f-51c7-452c-8970-f0b76f82f6f1
                    data:
                      '@entity': in.co.sandbox.kyc.aadhaar.okyc.otp.response
                      reference_id: 1234566
                      message: OTP sent successfully
                200 - OTP Generated | Request under process:
                  summary: 200 - OTP Generated | Request under process
                  value:
                    code: 200
                    timestamp: 1000000000000
                    transaction_id: 2532e897-fd40-4b07-ae1f-d0274a2dc37d
                    data:
                      '@entity': in.co.sandbox.kyc.aadhaar.okyc.otp.response
                      reference_id: 1234570
                      message: OTP sent successfully
                200 - Invalid Aadhaar Card:
                  summary: 200 - Invalid Aadhaar Card
                  value:
                    code: 200
                    timestamp: 1000000000000
                    transaction_id: db1d7415-2ce9-4a5a-ad98-b5d5a9499915
                    data:
                      '@entity': in.co.sandbox.kyc.aadhaar.okyc.otp.response
                      reference_id: 78829
                      message: Invalid Aadhaar Card
          headers: {}
        '422':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  timestamp:
                    type: integer
                  transaction_id:
                    type: string
                    format: uuid
                  message:
                    type: string
                required:
                  - transaction_id
                  - timestamp
                  - code
                  - message
              examples:
                422 - Invalid Aadhaar number pattern:
                  summary: 422 - Invalid Aadhaar number pattern
                  value:
                    code: 422
                    timestamp: 1000000000000
                    transaction_id: bc23288b-308f-4cd3-b688-94334bcfbcb6
                    message: Invalid Aadhaar number pattern
          headers: {}
        '503':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  timestamp:
                    type: integer
                  transaction_id:
                    type: string
                    format: uuid
                  message:
                    type: string
                required:
                  - code
                  - timestamp
                  - transaction_id
                  - message
              examples:
                503 - Source Unavailable:
                  summary: 503 - Source Unavailable
                  value:
                    code: 503
                    timestamp: 1000000000000
                    transaction_id: d9d89bfd-64fd-4a28-91b5-d7c26f3931c6
                    message: Source Unavailable
          headers: {}
      deprecated: false
      security: []

````