{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-ai-foundry/json-schema/azure-ai-foundry-create-liveness-session-content-schema.json",
  "title": "CreateLivenessSessionContent",
  "description": "Request model for creating liveness session.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/azure-ai-foundry-detectliveness-sessions-api-openapi.yml#/components/schemas/CreateLivenessSessionContent",
  "type": "object",
  "properties": {
    "livenessOperationMode": {
      "$ref": "#/$defs/LivenessOperationMode",
      "description": "Type of liveness mode the client should follow."
    },
    "deviceCorrelationIdSetInClient": {
      "type": "boolean",
      "description": "Whether or not to allow client to set their own 'deviceCorrelationId' via the Vision SDK. Default is false, and 'deviceCorrelationId' must be set in this request body."
    },
    "enableSessionImage": {
      "type": "boolean",
      "description": "Whether or not store the session image."
    },
    "livenessModelVersion": {
      "$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"
    },
    "deviceCorrelationId": {
      "type": "string",
      "description": "Unique Guid per each end-user device. This is to provide rate limiting and anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be null."
    },
    "authTokenTimeToLiveInSeconds": {
      "type": "integer",
      "format": "int32",
      "description": "Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600.",
      "default": 600,
      "minimum": 60,
      "maximum": 86400
    }
  },
  "required": [
    "livenessOperationMode"
  ],
  "$defs": {
    "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"
          }
        ]
      }
    },
    "LivenessOperationMode": {
      "type": "string",
      "description": "The liveness operation mode to drive the client's end-user experience.",
      "enum": [
        "Passive",
        "PassiveActive"
      ],
      "x-ms-enum": {
        "name": "LivenessOperationMode",
        "modelAsString": true,
        "values": [
          {
            "name": "Passive",
            "value": "Passive",
            "description": "Utilizes a passive liveness technique that requires no additional actions from the user. Requires normal indoor lighting and high screen brightness for optimal performance. And thus, this mode has a narrow operational envelope and will not be suitable for scenarios that requires the end-user's to be in bright lighting conditions. Note: this is the only supported mode for the Mobile (iOS and Android) solution."
          },
          {
            "name": "PassiveActive",
            "value": "PassiveActive",
            "description": "This mode utilizes a hybrid passive or active liveness technique that necessitates user cooperation. It is optimized to require active motion only under suboptimal lighting conditions. Unlike the passive mode, this mode has no lighting restrictions, and thus offering a broader operational envelope. This mode is preferable on Web based solutions due to the lack of automatic screen brightness control available on browsers which hinders the Passive mode's operational envelope on Web based solutions."
          }
        ]
      }
    }
  }
}