Rekognition / Client / create_face_liveness_session



This API operation initiates a Face Liveness session. It returns a SessionId, which you can use to start streaming Face Liveness video and get the results for a Face Liveness session. You can use the OutputConfig option in the Settings parameter to provide an Amazon S3 bucket location. The Amazon S3 bucket stores reference images and audit images. You can use AuditImagesLimit to limit of audit images returned. This number is between 0 and 4. By default, it is set to 0. The limit is best effort and based on the duration of the selfie-video.

See also: AWS API Documentation

Request Syntax

response = client.create_face_liveness_session(
        'OutputConfig': {
            'S3Bucket': 'string',
            'S3KeyPrefix': 'string'
        'AuditImagesLimit': 123
  • KmsKeyId (string) – The identifier for your AWS Key Management Service key (AWS KMS key). Used to encrypt audit images and reference images.

  • Settings (dict) –

    A session settings object. It contains settings for the operation to be performed. For Face Liveness, it accepts OutputConfig and AuditImagesLimit.

    • OutputConfig (dict) –

      Can specify the location of an Amazon S3 bucket, where reference and audit images will be stored. Note that the Amazon S3 bucket must be located in the caller’s AWS account and in the same region as the Face Liveness end-point. Additionally, the Amazon S3 object keys are auto-generated by the Face Liveness system.

      • S3Bucket (string) – [REQUIRED]

        The path to an AWS Amazon S3 bucket used to store Face Liveness session results.

      • S3KeyPrefix (string) –

        The prefix appended to the output files for the Face Liveness session results.

    • AuditImagesLimit (integer) –

      Number of audit images to be returned back. Takes an integer between 0-4. Any integer less than 0 will return 0, any integer above 4 will return 4 images in the response. By default, it is set to 0. The limit is best effort and is based on the actual duration of the selfie-video.

  • ClientRequestToken (string) – Idempotent token is used to recognize the Face Liveness request. If the same token is used with multiple CreateFaceLivenessSession requests, the same session is returned. This token is employed to avoid unintentionally creating the same session multiple times.

Return type:



Response Syntax

    'SessionId': 'string'

Response Structure

  • (dict) –

    • SessionId (string) –

      A unique 128-bit UUID identifying a Face Liveness session.


  • Rekognition.Client.exceptions.AccessDeniedException

  • Rekognition.Client.exceptions.InternalServerError

  • Rekognition.Client.exceptions.InvalidParameterException

  • Rekognition.Client.exceptions.ThrottlingException

  • Rekognition.Client.exceptions.ProvisionedThroughputExceededException