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

# Liveliness Check

> Use this API to verify if the customer is genuine and not a bot. We analyse the facial features of your customer in the picture or a selfie for identification. View the [test data](https://www.cashfree.com/docs/api-reference/vrs/data-to-test-integration#liveliness-check) and use the information to trigger the validations. The test data are usable only in the test environment sandbox.



## OpenAPI

````yaml post /liveliness
openapi: 3.0.0
info:
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  contact:
    email: developers@cashfree.com
    name: API Support
    url: https://discord.com/invite/QdZkNSxXsB
  title: Cashfree Verification API's.
  version: '2023-12-18'
  description: >-
    Cashfree's Verification APIs provide different types of verification to our
    merchants.
servers:
  - description: Sandbox Server
    url: https://sandbox.cashfree.com/verification
  - description: Production Server
    url: https://api.cashfree.com/verification
security: []
tags:
  - name: Aadhaar
    description: Operations related to Aadhaar verification.
  - name: BAV V2
    description: Operations related to Bank account verification v2.
  - name: PAN
    description: Operations related to PAN verification.
  - name: Digilocker
    description: Operations related to Digilocker verification.
  - name: E-sign
    description: Operations related to E-sign verification.
  - name: Reverse Penny Drop
    description: Operations related to Reverse Penny Drop verification.
  - name: IP
    description: Operation related to IP verification.
  - name: UPI
    description: Operations related to UPI verification.
  - name: Passport
    description: Operation related to Passport verification.
  - name: CIN
    description: Operation related to CIN verification.
  - name: Name Match
    description: Operation related to Name Match verification.
  - name: PAN to GSTIN
    description: Operation related to PAN to GSTIN.
  - name: Face Match
    description: Operation related to Face Match verification.
  - name: Voter ID
    description: Operation related to Voter ID verification.
  - name: Reverse Geocoding
    description: Operation related to Reverse Geocoding.
  - name: Liveliness
    description: Operation related to Liveliness.
  - name: Vehicle RC
    description: Operation related to Vehicle RC verification.
  - name: Driving License
    description: Operation related to Driving License verification.
  - name: GSTIN
    description: Operation related to GSTIN verification.
  - name: Account Aggregator
    description: Operations related to Account aggregator.
  - name: OTPLess
    description: Operations related to OTPLess Verification.
  - name: 1-Click
    description: Operations related to 1-Click.
  - name: BharatOCR
    description: Operations related to BharatOCR.
paths:
  /liveliness:
    post:
      tags:
        - Liveliness
      summary: Liveliness Check
      description: >-
        Use this API to verify if the customer is genuine and not a bot. We
        analyse the facial features of your customer in the picture or a selfie
        for identification. View the [test
        data](https://www.cashfree.com/docs/api-reference/vrs/data-to-test-integration#liveliness-check)
        and use the information to trigger the validations. The test data are
        usable only in the test environment sandbox.
      operationId: VrsLivelinessCheck
      parameters:
        - $ref: '#/components/parameters/x_cf_signature'
      requestBody:
        description: >-
          Find the request parameters to verify if the customer is genuine and
          not a bot
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - verification_id
                - image
              example:
                verification_id: test_verification_id
                image: <image_file>
                strict_check: true
              properties:
                verification_id:
                  type: string
                  description: >-
                    It is the unique ID you create to identify the verification
                    request. The maximum character limit is 50. Only
                    alphanumeric, period (.), hyphen (-) and underscore ( _ )
                    are allowed.
                  example: test_verification_id
                  default: test_verification_id
                image:
                  type: string
                  format: binary
                  description: >-
                    Upload the image of the individual to verify the liveliness
                    of the image. `Supported types(jpeg/jpg/png)`
                  example: <image_file>
                strict_check:
                  type: boolean
                  description: >-
                    It is the boolean value to set the strictness check of the
                    image. `Default value for strict_check is false`.
                  example: true
      responses:
        '200':
          $ref: '#/components/responses/Liveliness200Response'
        '400':
          $ref: '#/components/responses/Response400Liveliness'
        '401':
          $ref: '#/components/responses/Response401'
        '403':
          $ref: '#/components/responses/Response403'
        '409':
          $ref: '#/components/responses/Response409DuplicateId'
        '422':
          $ref: '#/components/responses/Response422'
        '429':
          $ref: '#/components/responses/Response429'
        '500':
          $ref: '#/components/responses/Response500V2'
        '502':
          $ref: '#/components/responses/Response502V2'
      security:
        - XClientID: []
          XClientSecret: []
components:
  parameters:
    x_cf_signature:
      description: Send the signature if IP is not whitelisted.
      name: x-cf-signature
      in: header
      required: false
      schema:
        type: string
      example: ''
  responses:
    Liveliness200Response:
      description: Success response for checking the liveliness of your customer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Liveliness200ResponseSchema'
          examples:
            SUCCESS:
              value:
                reference_id: 1357
                verification_id: '123456'
                status: SUCCESS
                liveliness: true
                score: 0.95
            FACE_NOT_DETECTED:
              value:
                reference_id: 1357
                verification_id: '123456'
                status: FACE_NOT_DETECTED
                liveliness: false
                score: 0
            MULTIPLE_FACE_DETECTED:
              value:
                reference_id: 1357
                verification_id: '123456'
                status: MULTIPLE_FACE_DETECTED
                liveliness: false
                score: 0
    Response400Liveliness:
      description: Validation errors for Liveliness Check API
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Image missing in the request:
              $ref: '#/components/examples/ImageMissingInTheRequest'
            File size exceeded:
              $ref: '#/components/examples/FileSizeExceeded'
            Invalid Verification ID:
              $ref: '#/components/examples/InvalidVerificationId'
            Client ID/Client Secret Missing:
              $ref: '#/components/examples/XClientIdMissing'
            Using-Test-Credentials-in-Prod:
              $ref: '#/components/examples/UsingTestCredentialsInProd'
    Response401:
      description: Invalid client ID and client secret combination
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Invalid client ID and client secret combination:
              value:
                type: authentication_error
                code: authentication_failed
                message: Invalid clientId and clientSecret combination
    Response403:
      description: Authentication error (IP not whitelisted)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            IP not whitelisted:
              value:
                type: authentication_error
                code: ip_validation_failed
                message: >-
                  IP not whitelisted your current ip is 106.51.91.104.For IP
                  whitelisting assistance, visit our guide at
                  https://www.cashfree.com/docs/secure-id/get-started/integration/ip-whitelisting-verification
    Response409DuplicateId:
      description: Conflict error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Conflict Error:
              value:
                type: validation_error
                code: verification_id_already_exists
                message: verification ID already exists
    Response422:
      description: Validation error because of insufficient balance to process this request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Insufficient balance:
              value:
                type: validation_error
                code: insufficient_balance
                message: Insufficient balance to process this request
    Response429:
      description: Rate limit exceed error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Rate limit error per operation:
              value:
                type: rate_limit_error
                code: too_many_requests_per_operation
                message: Too many requests for this operation, rate limit reached
            Rate limit error per IP:
              value:
                type: rate_limit_error
                code: too_many_requests_per_ip
                message: Too many requests from the IP, rate limit reached
    Response500V2:
      description: Internal error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Internal Server Error:
              value:
                type: internal_error
                code: verification_failed
                message: something went wrong
    Response502V2:
      description: Gateway error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Bad Gateway:
              value:
                type: internal_error
                code: verification_failed
                message: verification attempt failed
  schemas:
    Liveliness200ResponseSchema:
      type: object
      properties:
        reference_id:
          type: integer
          description: >-
            It displays the unique ID created by Cashfree Payments for reference
            purposes.

            format: `int64`
          example: 1357
        verification_id:
          type: string
          description: It displays the unique ID you created to identify the API request.
          example: '123456789'
        status:
          type: string
          description: |-
            It displays the status of the API request.
            Possible values are:
            - `SUCCESS`: A face is detected.
            - `FACE_NOT_DETECTED`: A face is not detected.
            - `MULTIPLE_FACE_DETECTED`: Multiple faces are detected.
          example: SUCCESS
        liveliness:
          type: boolean
          description: It displays the result of the liveliness check.
          example: true
        score:
          type: number
          description: |-
            It displays the score of the liveliness check. 
            Range: `0 < x < 1`
          format: float
          example: 0.95
    ErrorResponseSchema:
      type: object
      properties:
        code:
          type: string
          example: x-client-id_missing
        error:
          type: object
          example:
            ref_id: 102
        message:
          type: string
          example: x-client-id is missing in the request.
          description: It displays the outcome of the error.
        type:
          type: string
          example: validation_error
          description: It displays the type of error.
  examples:
    ImageMissingInTheRequest:
      value:
        type: validation_error
        code: image_field_missing
        message: image is missing in the request.
    FileSizeExceeded:
      value:
        type: validation_error
        code: file_size_exceeded
        message: File size exceeded 10MB limit
    InvalidVerificationId:
      value:
        type: validation_error
        code: verification_id_value_invalid
        message: verification_id can include only alphanum, dot, hyphen and underscores
    XClientIdMissing:
      value:
        type: validation_error
        code: x-client-id_missing
        message: x-client-id is missing in the request.
    UsingTestCredentialsInProd:
      value:
        type: validation_error
        code: x-client-secret_value_invalid
        message: Client secret belongs to test environment
  securitySchemes:
    XClientID:
      type: apiKey
      in: header
      name: x-client-id
      description: >-
        Client ID. You can find your ID in the [Merchant
        Dashboard](https://telr.cashfree.com/verificationsuite/developers/api-keys).
    XClientSecret:
      type: apiKey
      in: header
      name: x-client-secret
      description: >-
        Client secret key. You can find your secret key in the [Merchant
        Dashboard](https://telr.cashfree.com/verificationsuite/developers/api-keys).

````