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

# Check KYC PAN Status

> Query KYC registration status for a PAN number across all five SEBI-registered KRAs
(CVL, NDML, CAMS, Karvy, KFin) via the CVL KRA portal.

Raw portal status strings are normalized into clean enums (see `kyc_status`).

**`kyc_compliant`** is `true` only when `kyc_status` is `validated` or `registered`.
Use this for quick onboarding gate decisions.

**`remarks`** on a KRA object is only actionable when `status` is `on_hold` —
it contains the reason (e.g. `"APPLICANT PHOTO MISMATCH"`). For `validated` KRAs,
remarks like `"FATCA NOT APPLICABLE"` can be safely ignored.

**Note:** This endpoint may take up to 60 seconds. Set your client timeout accordingly.

**Credits:** 0.5 per successful lookup. Failed lookups are not billed.




## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/kyc/pan/status
openapi: 3.1.0
info:
  title: CAS Parser - Track Portfolios from CDSL, NSDL, CAMS, KFintech
  description: >-
    API for parsing and analyzing CAS (Consolidated Account Statement) PDF files
    from NSDL, CDSL, and CAMS/KFintech, with a unified response format
  version: 4.0.0
  contact:
    name: Sameer Kumar
    email: sameer@casparser.in
servers:
  - url: https://api.casparser.in
    description: Production server
  - url: https://portfolio-parser.api.casparser.in
    description: Legacy production server (still supported)
  - url: http://localhost:5000
    description: Local development server
security: []
tags:
  - name: CAS Parser
    description: Endpoints for parsing CAS PDF files from different sources.
  - name: CAS Generator
    description: Endpoints for generating new CAS documents via email mailback (KFintech).
  - name: CAS Fetch
    description: |
      Endpoints for fetching CAS documents with instant download.
      Currently supports CDSL via OTP authentication.
  - name: Email Import
    description: >
      Endpoints for importing CAS files directly from user email inboxes.


      **Supported Providers:** Gmail (more coming soon)


      **How it works:**

      1. Call `POST /v4/inbox/connect` to get an OAuth URL

      2. Redirect user to the OAuth URL for consent

      3. User is redirected back to your `redirect_uri` with an encrypted
      `inbox_token`

      4. Use the token to list/fetch CAS files from their inbox
      (`/v4/inbox/cas`)

      5. Files are uploaded to temporary cloud storage (URLs expire in 24 hours)


      **Security:**

      - Read-only access (we cannot send emails)

      - Tokens are encrypted with server-side secret

      - User can revoke access anytime via `/v4/inbox/disconnect`
  - name: Inbound Email
    description: >
      Create dedicated inbound email addresses for investors to forward their
      CAS statements.


      **Use Case:** Your app wants to collect CAS statements from users without
      requiring OAuth or file upload.


      **How it works:**

      1. Call `POST /v4/inbound-email` to create a unique inbound email address

      2. Display this email to your user: "Forward your CAS statement to
      ie_xxx@import.casparser.in"

      3. When user forwards a CAS email, we verify sender authenticity
      (SPF/DKIM) and call your webhook

      4. Your webhook receives email metadata + attachment download URLs


      **Sender Validation:**

      - Only emails from verified CAS authorities are processed:
        - CDSL: `eCAS@cdslstatement.com`
        - NSDL: `NSDL-CAS@nsdl.co.in`
        - CAMS: `donotreply@camsonline.com`
        - KFintech: `samfS@kfintech.com`
      - Emails failing SPF/DKIM/DMARC are rejected

      - Forwarded emails must contain the original sender in headers


      **Billing:** 0.2 credits per successfully processed valid email
  - name: Contract Note Parser
    description: >-
      Endpoints for parsing Contract Note PDF files from various SEBI brokers
      like Zerodha, Groww, Upstox, ICICI etc.
  - name: Authorization
    description: |
      Endpoints for checking API quota and credits usage.
      These endpoints help you monitor your API usage and remaining quota.
  - name: Portfolio Connect
    description: >
      Endpoints for managing access tokens for the Portfolio Connect SDK.

      Use these to generate short-lived `at_` prefixed tokens that can be safely
      passed to frontend applications.

      Access tokens can be used in place of API keys on all v4 endpoints.
  - name: Agent Auth
    description: >
      Endpoints for coding agents to obtain API keys via a browser-based
      approval flow.


      **How it works:**

      1. Agent generates a random token locally (e.g. `openssl rand -hex 32`).
      No API call needed.

      2. Agent asks the user to open
      `https://app.casparser.in/agent-auth?token=<token>&client_name=<name>`

      3. User signs in via the browser and clicks Approve.

      4. Agent polls `GET /v1/agent-auth/token/{token}` every 5 seconds until
      the key is delivered.


      **Security:**

      - Token must be 16-128 characters (recommended: 64 hex chars / 256 bits)

      - Approved keys are delivered once (one-shot) and then deleted

      - Tokens expire after 10 minutes if not approved
  - name: KYC
    description: >
      Endpoints for verifying KYC (Know Your Customer) status of Indian
      investors.


      **Data source:** CVL KRA public inquiry portal (cvlkra.com), which
      aggregates

      records from all five SEBI-registered KRAs: CVL, NDML, CAMS, Karvy, and
      KFin.


      **Status normalization:** Raw CVL portal strings are normalized into clean
      enums.

      See the `kyc_status` property on `KycPanStatusResponse` for the full list.


      **Credits:** 0.5 per successful lookup. Failed lookups are not billed.
paths:
  /v1/kyc/pan/status:
    post:
      tags:
        - KYC
      summary: Check KYC PAN Status
      description: >
        Query KYC registration status for a PAN number across all five
        SEBI-registered KRAs

        (CVL, NDML, CAMS, Karvy, KFin) via the CVL KRA portal.


        Raw portal status strings are normalized into clean enums (see
        `kyc_status`).


        **`kyc_compliant`** is `true` only when `kyc_status` is `validated` or
        `registered`.

        Use this for quick onboarding gate decisions.


        **`remarks`** on a KRA object is only actionable when `status` is
        `on_hold` —

        it contains the reason (e.g. `"APPLICANT PHOTO MISMATCH"`). For
        `validated` KRAs,

        remarks like `"FATCA NOT APPLICABLE"` can be safely ignored.


        **Note:** This endpoint may take up to 60 seconds. Set your client
        timeout accordingly.


        **Credits:** 0.5 per successful lookup. Failed lookups are not billed.
      operationId: checkKycPanStatus
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - pan_no
              properties:
                pan_no:
                  type: string
                  description: PAN number to look up (10 characters, uppercase)
                  example: ABCDE1234F
                  pattern: ^[A-Z]{5}[0-9]{4}[A-Z]{1}$
      responses:
        '200':
          description: KYC status retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KycPanStatusResponse'
              examples:
                validated:
                  summary: Fully validated KYC (CVL, DigiLocker)
                  value:
                    status: success
                    pan: ABCDE1234F
                    kyc_compliant: true
                    kyc_status: validated
                    kyc_mode: digilocker
                    active_kra: cvl
                    registered_on: '2011-03-18'
                    last_updated_on: '2024-09-19'
                    kras:
                      cvl:
                        status: validated
                        registered_on: '2011-03-18'
                        last_updated_on: '2024-09-19'
                        kyc_mode: digilocker
                        remarks: null
                        raw_status: null
                      ndml:
                        status: not_available
                        registered_on: null
                        last_updated_on: null
                        kyc_mode: null
                        remarks: null
                        raw_status: null
                      cams:
                        status: not_checked
                        registered_on: null
                        last_updated_on: null
                        kyc_mode: null
                        remarks: null
                        raw_status: null
                      karvy:
                        status: not_checked
                        registered_on: null
                        last_updated_on: null
                        kyc_mode: null
                        remarks: null
                        raw_status: null
                      kfin:
                        status: not_checked
                        registered_on: null
                        last_updated_on: null
                        kyc_mode: null
                        remarks: null
                        raw_status: null
                on_hold:
                  summary: KYC on hold — action required
                  value:
                    status: success
                    pan: XYZPQ9876R
                    kyc_compliant: false
                    kyc_status: on_hold
                    kyc_mode: normal
                    active_kra: cvl
                    registered_on: '2026-04-24'
                    last_updated_on: '2026-04-25'
                    kras:
                      cvl:
                        status: on_hold
                        registered_on: '2026-04-24'
                        last_updated_on: '2026-04-25'
                        kyc_mode: normal
                        remarks: >-
                          APPLICANT PHOTO MISMATCH IN THE APPLICATION,FATCA NOT
                          APPLICABLE
                        raw_status: ON HOLD - New KYC
                      ndml:
                        status: not_available
                        registered_on: null
                        last_updated_on: null
                        kyc_mode: null
                        remarks: null
                        raw_status: null
                      cams:
                        status: not_checked
                        registered_on: null
                        last_updated_on: null
                        kyc_mode: null
                        remarks: null
                        raw_status: null
                      karvy:
                        status: not_checked
                        registered_on: null
                        last_updated_on: null
                        kyc_mode: null
                        remarks: null
                        raw_status: null
                      kfin:
                        status: not_checked
                        registered_on: null
                        last_updated_on: null
                        kyc_mode: null
                        remarks: null
                        raw_status: null
        '400':
          description: Missing or invalid pan_no
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: failed
                msg: pan_no is required
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          description: KYC service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: failed
                msg: KYC service unavailable. Please try again later.
        '504':
          description: KYC service timed out (CVL portal slow/unresponsive)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: failed
                msg: KYC service timed out. Please try again.
      security:
        - ApiKeyAuth: []
        - AccessTokenAuth: []
components:
  schemas:
    KycPanStatusResponse:
      type: object
      description: Normalized KYC status response for a PAN number
      properties:
        status:
          type: string
          enum:
            - success
          example: success
        pan:
          type: string
          description: The PAN number that was queried (uppercase)
          example: ABCDE1234F
        kyc_compliant:
          type: boolean
          description: |
            `true` if the investor has a `validated` or `registered` KYC record.
            Use this as the primary onboarding gate signal.
          example: true
        kyc_status:
          type: string
          description: >
            Normalized KYC status from the active KRA. Possible values:

            - `validated` — KYC complete, investor can onboard and transact
            freely

            - `registered` — KYC registered; some restrictions may apply
            depending on your platform's onboarding policy

            - `under_process` — Recently submitted KYC, still being processed by
            KRA

            - `on_hold` — KYC on hold due to discrepancy; check `remarks` on the
            KRA object

            - `rejected` — KYC rejected; investor must submit fresh KYC

            - `legacy` — Old/incomplete record; re-KYC recommended

            - `not_available` — No KYC record found at any KRA

            - `unknown` — Portal returned an unrecognized string; `raw_status`
            preserved
          enum:
            - validated
            - registered
            - under_process
            - on_hold
            - rejected
            - legacy
            - not_available
            - unknown
          example: validated
        kyc_mode:
          type:
            - string
            - 'null'
          description: |
            How the KYC was completed. Possible values:
            - `normal` — Physical/paper KYC
            - `digilocker` — DigiLocker-backed digital KYC
            - `ekyc` — Aadhaar eKYC (OTP-based)
            - `paper` — Offline paper submission
            - `unknown` — Mode string not recognized
          enum:
            - normal
            - digilocker
            - ekyc
            - paper
            - unknown
          example: digilocker
        active_kra:
          type:
            - string
            - 'null'
          description: Short key of the KRA where the active KYC record was found
          enum:
            - cvl
            - ndml
            - cams
            - karvy
            - kfin
          example: cvl
        registered_on:
          type:
            - string
            - 'null'
          format: date
          description: Date the KYC was first registered at the active KRA (ISO 8601)
          example: '2020-07-02'
        last_updated_on:
          type:
            - string
            - 'null'
          format: date
          description: Date the KYC record was last updated at the active KRA (ISO 8601)
          example: '2024-09-19'
        kras:
          type: object
          description: Per-KRA status breakdown. All five KRA keys are always present.
          required:
            - cvl
            - ndml
            - cams
            - karvy
            - kfin
          properties:
            cvl:
              $ref: '#/components/schemas/KycKraStatus'
            ndml:
              $ref: '#/components/schemas/KycKraStatus'
            cams:
              $ref: '#/components/schemas/KycKraStatus'
            karvy:
              $ref: '#/components/schemas/KycKraStatus'
            kfin:
              $ref: '#/components/schemas/KycKraStatus'
    ErrorResponse:
      type: object
      required:
        - status
        - msg
      properties:
        status:
          type: string
          description: The status of the error.
          enum:
            - failed
          example: failed
        msg:
          type: string
          description: A descriptive message explaining the error.
          example: Invalid PDF file or password.
    KycKraStatus:
      type: object
      description: >
        KYC status at a single KRA. All six keys are always present (never
        omitted).

        For `not_checked` and `not_available` KRAs, date/mode/remarks fields are
        `null`.
      required:
        - status
        - registered_on
        - last_updated_on
        - kyc_mode
        - remarks
        - raw_status
      properties:
        status:
          type: string
          description: Normalized status for this KRA
          enum:
            - validated
            - registered
            - under_process
            - on_hold
            - rejected
            - legacy
            - not_available
            - not_checked
            - unknown
          example: validated
        registered_on:
          type:
            - string
            - 'null'
          format: date
          description: Date KYC was first registered at this KRA
          example: '2020-07-02'
        last_updated_on:
          type:
            - string
            - 'null'
          format: date
          description: Date KYC was last updated at this KRA
          example: '2024-09-19'
        kyc_mode:
          type:
            - string
            - 'null'
          description: KYC completion mode at this KRA
          enum:
            - normal
            - digilocker
            - ekyc
            - paper
            - unknown
          example: digilocker
        remarks:
          type:
            - string
            - 'null'
          description: |
            Remarks from the KRA. Only actionable when `status` is `on_hold`
            (e.g. `"APPLICANT PHOTO MISMATCH"`). For `validated` KRAs,
            remarks like `"FATCA NOT APPLICABLE"` can be safely ignored.
            Multiple remarks are comma-separated.
          example: APPLICANT PHOTO MISMATCH IN THE APPLICATION,FATCA NOT APPLICABLE
        raw_status:
          type:
            - string
            - 'null'
          description: >
            The original status string from the CVL portal. `null` for
            exact-matched

            statuses. Non-null when a fuzzy match or unknown string was
            encountered —

            preserve this for debugging and to help us expand coverage.
          example: ON HOLD - New KYC
    AuthErrorResponse:
      type: object
      required:
        - status
        - msg
      properties:
        status:
          type: string
          description: The status of the error.
          example: error
        msg:
          type: string
          description: A descriptive message explaining the error.
          example: 'Authentication failed: API key is missing.'
  responses:
    Unauthorized:
      description: Unauthorized. This can happen if the `x-api-key` header is missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthErrorResponse'
          example:
            status: error
            msg: >-
              Authentication failed: API key is missing. Please provide a valid
              API key in the x-api-key header.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: |
        Your API key for authentication.
        Use `sandbox-with-json-responses` as Sandbox key.

````