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

# Face Liveness Check

> Use this API to check whether a submitted image contains a real human face. The API analyses facial characteristics and liveness signals to prevent spoofing attempts and validate genuine user presence and returns comprehensive facial analysis.

View the [test data](https://www.cashfree.com/docs/api-reference/vrs/data-to-test-integration#face-liveness) and use the information to trigger the validations.



## OpenAPI

````yaml post /face-liveness
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: UPI Penny Drop
    description: Operations related to UPI Penny Drop verification.
  - name: Mobile Penny Drop
    description: Operations related to Mobile 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: 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: Smart OCR
    description: Operations related to Smart OCR.
  - name: Geocoding
    description: Operations related to Geocoding.
  - name: Udyam
    description: Operation related to Udyam verification.
  - name: PAN to Udyam
    description: Operation related to PAN to Udyam.
paths:
  /face-liveness:
    post:
      tags:
        - Face Liveness
      summary: Face Liveness Check
      description: >-
        Use this API to check whether a submitted image contains a real human
        face. The API analyses facial characteristics and liveness signals to
        prevent spoofing attempts and validate genuine user presence and returns
        comprehensive facial analysis.


        View the [test
        data](https://www.cashfree.com/docs/api-reference/vrs/data-to-test-integration#face-liveness)
        and use the information to trigger the validations.
      operationId: VrsFaceLivenessCheck
      parameters:
        - $ref: '#/components/parameters/x_cf_signature'
        - $ref: '#/components/parameters/global_x_api_version'
      requestBody:
        description: Find the request parameters of Face Liveness Check.
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - verification_id
                - image
              example:
                verification_id: test_verification_id
                image: <image_file>
              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 liveness of
                    the image. Supported types are jpeg, jpg and png.
                  example: <image_file>
      responses:
        '200':
          $ref: '#/components/responses/FaceLiveness200Response'
        '400':
          $ref: '#/components/responses/FaceLivenessResponse400'
        '401':
          $ref: '#/components/responses/Response401'
        '403':
          $ref: '#/components/responses/Response403'
        '409':
          $ref: '#/components/responses/Response409'
        '422':
          $ref: '#/components/responses/Response422'
        '429':
          $ref: '#/components/responses/Response429'
        '500':
          $ref: '#/components/responses/Response500'
      security:
        - XClientID: []
          XClientSecret: []
components:
  parameters:
    x_cf_signature:
      description: >-
        Send the signature if two-factor authentication is selected as Public
        Key.  [More
        details](https://www.cashfree.com/docs/api-reference/vrs/getting-started#2fa-api-signature-generation).
      name: x-cf-signature
      in: header
      required: false
      schema:
        type: string
      example: ''
    global_x_api_version:
      description: API version to be used. Format is in YYYY-MM-DD.
      name: x-api-version
      in: header
      required: true
      schema:
        type: string
        default: '2024-12-01'
        example: '2024-12-01'
      example: '2024-12-01'
  responses:
    FaceLiveness200Response:
      description: Success response for checking the face liveness.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FaceLiveness200ResponseSchema'
          examples:
            SUCCESS:
              value:
                reference_id: 1078756
                verification_id: asbfhjjree1247
                status: SUCCESS
                liveness: true
                liveness_score: 0.98
                gender:
                  value: FEMALE
                  confidence: 98.4
                age_range:
                  min: 29
                  max: 37
                eye_wear:
                  value: true
                  confidence: 96.4
                face_occluded:
                  value: false
                  confidence: 98.7
                quality:
                  blur: false
                  bright: true
                  exposure: NEUTRAL
                pose:
                  face_alignment: CENTRE
                  head_turned: false
                eyes_open:
                  value: true
                  confidence: 95.5
            FACE_NOT_DETECTED:
              value:
                reference_id: 1357
                verification_id: '333312345'
                status: FACE_NOT_DETECTED
                liveness: false
                liveness_score: 0
                gender: null
                age_range: null
                eye_wear: null
                face_occluded: null
                quality: null
                pose: null
                eyes_open: null
            MULTIPLE_FACES_DETECTED:
              value:
                reference_id: 1357
                verification_id: '222232412'
                status: MULTIPLE_FACES_DETECTED
                liveness: false
                liveness_score: 0
                gender: null
                age_range: null
                eye_wear: null
                face_occluded: null
                quality: null
                pose: null
                eyes_open: null
            REAL_FACE_NOT_DETECTED:
              value:
                reference_id: 1357
                verification_id: '4444123455'
                status: REAL_FACE_NOT_DETECTED
                liveness: false
                liveness_score: 0
                gender: null
                age_range: null
                eye_wear: null
                face_occluded: null
                quality: null
                pose: null
                eyes_open: null
    FaceLivenessResponse400:
      description: Validation errors for Face Liveness 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
            x-cf-signature header missing:
              value:
                type: validation_error
                code: authentication_failed
                message: x-cf-signature missing in the request header
    Response409:
      description: >-
        Conflict error for requesting another OTP for the same aadhaar within 30
        seconds.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Request for same aadhaar within 30s:
              value:
                type: validation_error
                code: verification_pending
                message: Otp generated for this aadhaar, please try after some time
    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
    Response500:
      description: Internal error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseSchema'
          examples:
            Internal Server Error:
              value:
                type: internal_error
                code: request_failed
                message: Unable to process your request. Try again after some time
  schemas:
    FaceLiveness200ResponseSchema:
      type: object
      properties:
        reference_id:
          type: integer
          description: Unique reference ID generated by Cashfree.
          example: 1078756
        verification_id:
          type: string
          description: It displays the unique ID you created to identify this API request.
          example: asbfhjjree1247
        status:
          type: string
          description: >
            The status of the face liveness verification request.

            Possible values:

            - SUCCESS: Face verification completed successfully

            - REAL_FACE_NOT_DETECTED: The submitted image does not contain a
            real face

            - MULTIPLE_FACES_DETECTED: More than one face detected in the image

            - FACE_NOT_DETECTED: No face detected in the submitted image
          example: SUCCESS
        liveness:
          type: boolean
          description: >-
            Indicates whether the detected face exhibits signs of being from a
            live person.
          example: true
        liveness_score:
          type: number
          format: float
          description: >-
            A confidence score between 0 and 1 indicating the probability that
            the face is from a live person.
          example: 0.98
        gender:
          type: object
          properties:
            value:
              type: string
              description: Detected gender of the person in the image.
              example: FEMALE
            confidence:
              type: number
              format: float
              description: Confidence score for gender detection (0-100).
              example: 98.4
        age_range:
          type: object
          properties:
            min:
              type: integer
              description: Lower bound of the estimated age range.
              example: 29
            max:
              type: integer
              description: Upper bound of the estimated age range.
              example: 37
        eye_wear:
          type: object
          properties:
            value:
              type: boolean
              description: >-
                Indicates whether the person is wearing glasses or other
                eyewear.
              example: true
            confidence:
              type: number
              format: float
              description: Confidence score for eyewear detection (0-100).
              example: 96.4
        face_occluded:
          type: object
          properties:
            value:
              type: boolean
              description: Indicates whether the face is partially covered or obscured.
              example: false
            confidence:
              type: number
              format: float
              description: Confidence score for face occlusion detection (0-100).
              example: 98.7
        quality:
          type: object
          properties:
            blur:
              type: boolean
              description: Indicates whether the image is blurry.
              example: false
            bright:
              type: boolean
              description: Indicates whether the image has adequate lighting.
              example: true
            exposure:
              type: string
              description: Assessment of image exposure level.
              enum:
                - UNDER_EXPOSED
                - NEUTRAL
                - OVER_EXPOSED
              example: NEUTRAL
        pose:
          type: object
          properties:
            face_alignment:
              type: string
              description: Direction of face alignment in the image.
              enum:
                - LEFT
                - RIGHT
                - CENTRE
            head_turned:
              type: boolean
              description: Indicates whether the head is turned from the frontal position.
              example: false
        eyes_open:
          type: object
          properties:
            value:
              type: boolean
              description: Indicates whether both eyes are open in the image.
              example: true
            confidence:
              type: number
              format: float
              description: Confidence score for eyes open detection (0-100).
              example: 95.5
    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: >-
        Your unique client identifier issued by Cashfree. You can find this in
        your [Merchant
        Dashboard](https://merchant.cashfree.com/verificationsuite/developers/api-keys).
    XClientSecret:
      type: apiKey
      in: header
      name: x-client-secret
      description: >-
        The secret key associated with your client ID. Use this to authenticate
        your API requests. You can find this in your [Merchant
        Dashboard](https://merchant.cashfree.com/verificationsuite/developers/api-keys).

````