{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-ai-foundry/json-schema/azure-ai-foundry-liveness-with-verify-session-schema.json",
  "title": "LivenessWithVerifySession",
  "description": "Session result of detect liveness with verify.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/azure-ai-foundry-detectlivenesswithverify-sessions-api-openapi.yml#/components/schemas/LivenessWithVerifySession",
  "type": "object",
  "properties": {
    "sessionId": {
      "type": "string",
      "description": "The unique ID to reference this session.",
      "readOnly": true
    },
    "authToken": {
      "type": "string",
      "description": "Bearer token to provide authentication for the Vision SDK running on a client application. This Bearer token has limited permissions to perform only the required action and expires after the TTL time. It is also auditable."
    },
    "status": {
      "$ref": "#/$defs/Azure.Core.Foundations.OperationState",
      "description": "The current status of the session."
    },
    "modelVersion": {
      "$ref": "#/$defs/LivenessModel",
      "description": "The model version used for liveness classification. This is an optional parameter, and if this is not specified, then the latest supported model version will be chosen"
    },
    "results": {
      "$ref": "#/$defs/LivenessWithVerifySessionResults",
      "description": "The results of the liveness with verify session."
    }
  },
  "required": [
    "sessionId",
    "authToken",
    "status",
    "results"
  ],
  "$defs": {
    "Azure.Core.Foundations.OperationState": {
      "type": "string",
      "description": "Enum describing allowed operation states.",
      "enum": [
        "NotStarted",
        "Running",
        "Succeeded",
        "Failed",
        "Canceled"
      ],
      "x-ms-enum": {
        "name": "OperationState",
        "modelAsString": true,
        "values": [
          {
            "name": "NotStarted",
            "value": "NotStarted",
            "description": "The operation has not started."
          },
          {
            "name": "Running",
            "value": "Running",
            "description": "The operation is in progress."
          },
          {
            "name": "Succeeded",
            "value": "Succeeded",
            "description": "The operation has completed successfully."
          },
          {
            "name": "Failed",
            "value": "Failed",
            "description": "The operation has failed."
          },
          {
            "name": "Canceled",
            "value": "Canceled",
            "description": "The operation has been canceled by the user."
          }
        ]
      }
    },
    "FaceRectangle": {
      "type": "object",
      "description": "A rectangle within which a face can be found.",
      "properties": {
        "top": {
          "type": "integer",
          "format": "int32",
          "description": "The distance from the top edge if the image to the top edge of the rectangle, in pixels."
        },
        "left": {
          "type": "integer",
          "format": "int32",
          "description": "The distance from the left edge if the image to the left edge of the rectangle, in pixels."
        },
        "width": {
          "type": "integer",
          "format": "int32",
          "description": "The width of the rectangle, in pixels."
        },
        "height": {
          "type": "integer",
          "format": "int32",
          "description": "The height of the rectangle, in pixels."
        }
      },
      "required": [
        "top",
        "left",
        "width",
        "height"
      ]
    },
    "ImageType": {
      "type": "string",
      "description": "The type of image.",
      "enum": [
        "Color",
        "Infrared",
        "Depth"
      ],
      "x-ms-enum": {
        "name": "ImageType",
        "modelAsString": true,
        "values": [
          {
            "name": "Color",
            "value": "Color",
            "description": "Color image."
          },
          {
            "name": "Infrared",
            "value": "Infrared",
            "description": "Infrared image."
          },
          {
            "name": "Depth",
            "value": "Depth",
            "description": "Depth image."
          }
        ]
      }
    },
    "LivenessColorDecisionTarget": {
      "type": "object",
      "description": "The target from color image used for liveness classification.",
      "properties": {
        "faceRectangle": {
          "$ref": "#/$defs/FaceRectangle",
          "description": "The face region where the liveness classification was made on."
        }
      },
      "required": [
        "faceRectangle"
      ]
    },
    "LivenessDecision": {
      "type": "string",
      "description": "The outcome of the liveness classification.",
      "enum": [
        "uncertain",
        "realface",
        "spoofface"
      ],
      "x-ms-enum": {
        "name": "LivenessDecision",
        "modelAsString": true,
        "values": [
          {
            "name": "uncertain",
            "value": "uncertain",
            "description": "The algorithm could not classify the target face as either real or spoof."
          },
          {
            "name": "realFace",
            "value": "realface",
            "description": "The algorithm has classified the target face as real."
          },
          {
            "name": "spoofFace",
            "value": "spoofface",
            "description": "The algorithm has classified the target face as a spoof."
          }
        ]
      }
    },
    "LivenessDecisionTargets": {
      "type": "object",
      "description": "The targets used for liveness classification.",
      "properties": {
        "color": {
          "$ref": "#/$defs/LivenessColorDecisionTarget",
          "description": "The target from color image used for liveness classification."
        }
      },
      "required": [
        "color"
      ]
    },
    "LivenessError": {
      "type": "object",
      "description": "The error of the liveness classification.",
      "properties": {
        "code": {
          "type": "string",
          "description": "The error code."
        },
        "message": {
          "type": "string",
          "description": "The error message."
        },
        "targets": {
          "$ref": "#/$defs/LivenessDecisionTargets",
          "description": "Targets used for liveness classification."
        }
      },
      "required": [
        "code",
        "message",
        "targets"
      ]
    },
    "LivenessModel": {
      "type": "string",
      "description": "The model version used for liveness classification.",
      "enum": [
        "2024-11-15"
      ],
      "x-ms-enum": {
        "name": "LivenessModel",
        "modelAsString": true,
        "values": [
          {
            "name": "v2024_11_15",
            "value": "2024-11-15"
          }
        ]
      }
    },
    "LivenessWithVerifyOutputs": {
      "type": "object",
      "description": "The face verification output.",
      "properties": {
        "matchConfidence": {
          "type": "number",
          "format": "float",
          "description": "The target face liveness face and comparison image face verification confidence.",
          "minimum": 0,
          "maximum": 1
        },
        "isIdentical": {
          "type": "boolean",
          "description": "Whether the target liveness face and comparison image face match."
        }
      },
      "required": [
        "matchConfidence",
        "isIdentical"
      ]
    },
    "LivenessWithVerifyReference": {
      "type": "object",
      "description": "The detail of face for verification.",
      "properties": {
        "referenceType": {
          "$ref": "#/$defs/ImageType",
          "description": "The image type which contains the face rectangle where the liveness classification was made on."
        },
        "faceRectangle": {
          "$ref": "#/$defs/FaceRectangle",
          "description": "The face region where the comparison image's classification was made."
        },
        "qualityForRecognition": {
          "$ref": "#/$defs/QualityForRecognition",
          "description": "Quality of face image for recognition."
        }
      },
      "required": [
        "referenceType",
        "faceRectangle",
        "qualityForRecognition"
      ]
    },
    "LivenessWithVerifyResult": {
      "type": "object",
      "description": "The results of the liveness with verify call.",
      "properties": {
        "livenessDecision": {
          "$ref": "#/$defs/LivenessDecision",
          "description": "The liveness classification for the target face."
        },
        "targets": {
          "$ref": "#/$defs/LivenessDecisionTargets",
          "description": "Targets used for liveness classification."
        },
        "digest": {
          "type": "string",
          "description": "The server calculated digest for this request. If the client reported digest differs from the server calculated digest, then the message integrity between the client and service has been compromised and the result should not be trusted. For more information, see how to guides on how to leverage this value to secure your end-to-end solution."
        },
        "sessionImageId": {
          "type": "string",
          "description": "The image ID of the session request."
        },
        "verifyResult": {
          "$ref": "#/$defs/LivenessWithVerifyOutputs",
          "description": "The face verification output. Only available when the request is liveness with verify."
        },
        "verifyImageHash": {
          "type": "string",
          "description": "The sha256 hash of the verify-image in the request."
        }
      },
      "required": [
        "targets",
        "digest"
      ]
    },
    "LivenessWithVerifySessionAttempt": {
      "type": "object",
      "description": "The liveness with verify session attempt.",
      "properties": {
        "attemptId": {
          "type": "integer",
          "format": "int32",
          "description": "The attempt ID, start from 1."
        },
        "attemptStatus": {
          "$ref": "#/$defs/Azure.Core.Foundations.OperationState",
          "description": "The status of the attempt."
        },
        "result": {
          "$ref": "#/$defs/LivenessWithVerifyResult",
          "description": "The result of the liveness with verify call, will be null if there is error."
        },
        "error": {
          "$ref": "#/$defs/LivenessError",
          "description": "The error of the liveness with verify call, will be null if there is result."
        }
      },
      "required": [
        "attemptId",
        "attemptStatus"
      ]
    },
    "LivenessWithVerifySessionResults": {
      "type": "object",
      "description": "The results of the liveness with verify session.",
      "properties": {
        "verifyReferences": {
          "type": "array",
          "description": "The references used for face verification.",
          "items": {
            "$ref": "#/$defs/LivenessWithVerifyReference"
          }
        },
        "attempts": {
          "type": "array",
          "description": "The attempts data of underlying liveness with verify call with the session.",
          "items": {
            "$ref": "#/$defs/LivenessWithVerifySessionAttempt"
          }
        }
      },
      "required": [
        "verifyReferences",
        "attempts"
      ]
    },
    "QualityForRecognition": {
      "type": "string",
      "description": "Indicates quality of image for recognition.",
      "enum": [
        "low",
        "medium",
        "high"
      ],
      "x-ms-enum": {
        "name": "QualityForRecognition",
        "modelAsString": true,
        "values": [
          {
            "name": "low",
            "value": "low",
            "description": "Low quality."
          },
          {
            "name": "medium",
            "value": "medium",
            "description": "Medium quality."
          },
          {
            "name": "high",
            "value": "high",
            "description": "High quality."
          }
        ]
      }
    }
  }
}