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

# Face Compare with Liveness Check

> This is a service that conducts a face comparison between two images in base 64 format provided by the client.



## OpenAPI

````yaml products/didx-verify/api-reference/v1/openapi.json post /Citizen/FaceCompareWithLiveness
openapi: 3.0.1
info:
  title: SecureCitizen.Citizen.Api
  description: >-
    This is the API documentation for Secure Citizen products. Should you
    require further information please contact us on the email provided.
  contact:
    name: Api Contant Name
    email: support@securecitizen.co.za
  license:
    name: Proprietary
    url: https://www.securecitizen.co.za
  version: v1
  x-logo:
    url: >-
      https://securecitizen.co.za/wp-content/uploads/2022/11/Untitled-design-14.svg
    altText: Secure Citizen
servers:
  - url: https://citizen.uat.securecitizen.cloud
security: []
tags:
  - name: Citizen
    description: This details information we can replace to describe this endpoint
  - name: CitizenV
    description: This details information we can replace to describe this endpoint
  - name: CustomClient
    description: This details information we can replace to describe this endpoint
  - name: Partner
    description: This details information we can replace to describe this endpoint
paths:
  /Citizen/FaceCompareWithLiveness:
    post:
      tags:
        - Citizen
      summary: Face Compare with Liveness Check
      description: >-
        This is a service that conducts a face comparison between two images in
        base 64 format provided by the client.
      operationId: FaceCompareWithLiveness
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FaceCompareWithLivenessRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FaceCompareWithLivenessResponse'
        '401':
          description: Unauthenticated
        '403':
          description: Unauthorized access to this resource
        '500':
          description: Cat-as-trophy
      security:
        - oauth2:
            - sc-citizen
components:
  schemas:
    FaceCompareWithLivenessRequest:
      required:
        - ConsentReceived
        - Face1
        - Face2
      type: object
      properties:
        CRef:
          title: Client Reference
          type: string
          description: "Example: \"REF00001\"\r\n\r\nThis is the unique transaction reference number that can be supplied by the controller. This will be provided in response messages related to the transaction and will be required for identifying transactions for support purposes."
          format: string
          nullable: true
        ConsentReceived:
          title: Consent Received
          type: boolean
          description: "Example: true\r\n\r\nThis is an indicator to audit the fact that the controller has obtained consent from the subject to process their personal information and data as per the regulatory requirements pertaining to local and global privacy and data protection legislation."
          format: bool
        Face1:
          title: First Image to Compare
          minLength: 1
          type: string
          description: >-
            The client would provide the base 64 string of the first image to be
            used for the comparison.
        Face2:
          title: Second Image to Compare
          minLength: 1
          type: string
          description: >-
            The client would provide the base 64 string of the second image to
            be used for the comparison.
        face1Meta:
          $ref: '#/components/schemas/IdrndMetaEnums'
        face2Meta:
          $ref: '#/components/schemas/IdrndMetaEnums'
      additionalProperties: false
    FaceCompareWithLivenessResponse:
      type: object
      properties:
        CRef:
          title: Client Reference
          type: string
          description: >-
            This field will return the reference provided by the client to track
            the transaction.
          format: string
          nullable: true
        Status:
          $ref: '#/components/schemas/ExternalStatusEnums'
        Message:
          title: Message
          type: string
          description: >-
            This will return a status of the transaction s well as external
            tracking information.
          format: string
          nullable: true
        RequestedBy:
          title: Requested By
          type: string
          description: This will indicate who requested the data that is being provided.
          nullable: true
        AuthorizedBy:
          title: Authorized By
          type: string
          description: >-
            This will indicate who authorized the provision of the requested
            data
          nullable: true
        VerifyResult:
          $ref: '#/components/schemas/VerifyResult'
        trackingNumber:
          type: string
          nullable: true
        face1LivenessResult:
          $ref: '#/components/schemas/IDRNDParialResponse'
        face2LivenessResult:
          $ref: '#/components/schemas/IDRNDParialResponse'
      additionalProperties: false
    IdrndMetaEnums:
      title: IDRND Meta Types
      enum:
        - Desktop
        - Ios
        - Android
        - Unknown
      type: string
      description: These include Desktop, Android, iOS and Unknown
      format: string
    ExternalStatusEnums:
      title: Status
      enum:
        - Success
        - Failure
        - Unknown
        - AuthFailure
        - DataDeserializationError
        - EmptyResults
        - ErrorContactSupport
        - FaceDetectionFailure
        - FaceComparisonFailure
        - NoStatusDefined
        - FaceDetectionQualityTooLow
        - FaceDetectionTooManyFaces
        - FaceDetectionNoFacesFound
        - FaceComparisonError
        - FaceComparisonNotSame
        - GoldenSourceImageNull
        - ProvidedImageNull
        - GoldenSourceNoFacesFound
        - ProvidedImageNoFacesFound
        - GoldenSourceHasTooManyFaces
        - ProvidedImageHasTooManyFaces
        - GoldenSourceQualityTooLow
        - ProvidedImageQualityTooLow
        - GoldenSourceGUIDIncorrect
        - ProvidedImageGUIDIncorrect
        - FaceAPIGeneralError
        - FaceAPIPublicUrlInputError
        - FaceBadInput
        - GoldenSourceIncorrectStringFormat
        - ProvidedImageIncorrectStringFormat
        - SAFPSNPROk
        - SAFPSHANISOk
        - SAFPSNIISOk
        - SAFPSNPRSlow
        - SAFPSHANISSlow
        - SAFPSNIISSlow
        - SAFPSFailure
        - SAFPSPossibleFailure
        - SAFPSNPRFailure
        - SAFPSHANISFailure
        - SAFPSNIISFailure
        - FaceTooClose
        - EyesClosed
        - FaceCloseToBorder
        - FaceCropped
        - FaceIsOccluded
        - FaceNotFound
        - TooManyFaces
        - FaceTooSmall
        - AbsoluteFaceTooSmall
        - RelativeFaceTooSmall
        - FaceAngleTooLarge
        - FailedToPredictLandmarks
        - Active
        - CSuccess
        - AsyncCSuccess
        - IdentificationNumberInvalid
        - IdentificationNumberAgeBelow18
        - UnableToVerifyIdentificationNumberOnDocument
        - UnableToVerifyIdentificationNumberAtGoldenSource
        - GoldenSourceUnavailable
        - MandatoryInformationMissing
        - NPRSuccess
        - HANISNotAvailable
        - InvalidIDNCheckDigitTestNotPassed
        - NPRNotAvailableOnlyPhotoIsReturned
        - IDNRIsNotCurrentlyAValidNPRIDNR
        - IDNRIsMarkedForDeletion
      type: string
      description: >-
        Status values (static strings) to be used for external connection
        management
      format: string
    VerifyResult:
      type: object
      properties:
        isIdentical:
          type: boolean
        confidence:
          type: number
          format: double
      additionalProperties: false
    IDRNDParialResponse:
      type: object
      properties:
        LivenessResultScore:
          title: Liveness Result Score
          type: number
          description: >-
            This is the raw liveness score generated by the system. It's an
            unbounded linear value where higher scores indicate a greater
            likelihood that the input (e.g., a face) is from a live person. This
            score is primarily used for calibration and tuning purposes, such as
            adjusting the system's sensitivity to false positives or negatives.
          format: double
        LivenessResultProbability:
          title: Liveness Result Probability
          type: number
          description: >-
            This represents the system's calculated probability that the input
            is from a live person, expressed as a value between 0 and 1. A value
            greater than 0.5 typically indicates a live input, while a value
            below 0.5 suggests a spoof or fake. This probability is the main
            metric used to make liveness decisions.
          format: double
        LivenessResultQuality:
          title: Liveness Result Quality
          type: number
          description: >-
            This field assesses the quality of the input image in the context of
            liveness detection. The quality score ranges from 0 (poor quality)
            to 1 (high quality). A score below 0.5 generally indicates that the
            image is unsuitable for reliable liveness analysis. Note that in
            some contexts, this field may be deprecated in favor of more
            detailed image quality warnings.
          format: double
        LivenessResultClass:
          title: Liveness Result Class
          type: boolean
          description: >-
            This field classifies the input based on its suitability for
            liveness detection. For example, a value of 1 might indicate a
            good-quality image suitable for analysis, while 0 could denote a
            poor-quality image. However, this field is considered obsolete in
            some versions of the model, with a recommendation to use the quality
            score instead.
        LivenessPassResult:
          title: Liveness Pass Result
          type: boolean
          description: >-
            This boolean field indicates whether the liveness check was passed.
            A value of true means the input was determined to be live, while
            false indicates a failure in the liveness check. This is a
            straightforward pass/fail result based on the system's analysis.
          readOnly: true
        LivenessMessage:
          title: Liveness Message
          type: string
          description: >-
            This field likely provides a textual message or status related to
            the liveness check, such as "Live," "Spoof," or "Invalid." It offers
            a human-readable interpretation of the liveness result, which can be
            useful for logging or user feedback.
          nullable: true
          readOnly: true
      additionalProperties: false
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://sts.uat.securecitizen.cloud/connect/authorize
          tokenUrl: https://sts.uat.securecitizen.cloud/connect/token
          scopes:
            sc-citizen: SecureCitizen.Citizen.Api

````