Microsoft Azure AI Foundry DetectLiveness Sessions API

The DetectLiveness Sessions API from Microsoft Azure AI Foundry — 2 operation(s) for detectliveness sessions.

GitHub OpenAPI

Operations 3

POST /detectLiveness-sessions Create a new detect liveness session #
GET /detectLiveness-sessions/{sessionId} Liveness session operations get liveness session result #
DELETE /detectLiveness-sessions/{sessionId} Delete all session related information for matching the specified session id #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/azure-ai-foundry:azure-ai-foundry-detectliveness-sessions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

azure-ai-foundry-detectliveness-sessions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Azure AI Face DetectLiveness Sessions API
  version: v1.2
  x-typespec-generated:
  - emitter: '@azure-tools/typespec-autorest'
security:
- KeyAuth: []
- AADToken:
  - https://cognitiveservices.azure.com/.default
tags:
- name: DetectLiveness Sessions
paths:
  /detectLiveness-sessions:
    post:
      operationId: LivenessSessionOperations_CreateLivenessSession
      summary: Create a new detect liveness session
      description: 'A session is best for client device scenarios where developers want to authorize a client device to perform only a liveness detection without granting full access to their resource. Created sessions have a limited life span and only authorize clients to perform the desired action before access is expired.


        Permissions includes...

        >

        *

        * A token lifetime of 10 minutes.


        > [!NOTE]

        > Client access can be revoked by deleting the session using the Delete Liveness Session operation. To retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your resource, use the List Liveness Session Audit Entries.'
      responses:
        '200':
          description: A successful call create a session for a client device and provide an authorization token for use by the client application for a limited purpose and time.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LivenessSession'
        default:
          description: An unexpected error response.
          headers:
            x-ms-error-code:
              description: String error code indicating what went wrong.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FaceErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLivenessSessionContent'
        description: Body parameter.
        required: true
      tags:
      - DetectLiveness Sessions
  /detectLiveness-sessions/{sessionId}:
    get:
      operationId: LivenessSessionOperations_GetLivenessSessionResult
      description: Get session result of detectLiveness/singleModal call.
      parameters:
      - name: sessionId
        in: path
        description: The unique ID to reference this session.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LivenessSession'
        default:
          description: An unexpected error response.
          headers:
            x-ms-error-code:
              description: String error code indicating what went wrong.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FaceErrorResponse'
      tags:
      - DetectLiveness Sessions
      summary: Liveness session operations get liveness session result
      x-summary-source: derived
    delete:
      operationId: LivenessSessionOperations_DeleteLivenessSession
      summary: Delete all session related information for matching the specified session id
      description: '> [!NOTE]

        > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth Token. While this can be used to remove any access for that token, those requests will still count towards overall resource rate limits. It''s best to leverage TokenTTL to limit length of tokens in the case that it is misused.'
      parameters:
      - name: sessionId
        in: path
        description: The unique ID to reference this session.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Successfully deleted session and all correlated data.
        default:
          description: An unexpected error response.
          headers:
            x-ms-error-code:
              description: String error code indicating what went wrong.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FaceErrorResponse'
      tags:
      - DetectLiveness Sessions
components:
  schemas:
    LivenessSession:
      type: object
      description: Session result of detect liveness.
      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: '#/components/schemas/Azure.Core.Foundations.OperationState'
          description: The current status of the session.
        modelVersion:
          $ref: '#/components/schemas/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: '#/components/schemas/LivenessSessionResults'
          description: The results of the liveness session.
      required:
      - sessionId
      - authToken
      - status
      - results
    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.
    FaceError:
      type: object
      description: 'The error object. For comprehensive details on error codes and messages returned by the Face Service, please refer to the following link: https://aka.ms/face-error-codes-and-messages.'
      properties:
        code:
          type: string
          description: One of a server-defined set of error codes.
        message:
          type: string
          description: A human-readable representation of the error.
      required:
      - code
      - message
    CreateLivenessSessionContent:
      type: object
      description: Request model for creating liveness session.
      properties:
        livenessOperationMode:
          $ref: '#/components/schemas/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: '#/components/schemas/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
    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.
    LivenessSessionAttempt:
      type: object
      description: The liveness session attempt.
      properties:
        attemptId:
          type: integer
          format: int32
          description: The attempt ID, start from 1.
        attemptStatus:
          $ref: '#/components/schemas/Azure.Core.Foundations.OperationState'
          description: The status of the attempt.
        result:
          $ref: '#/components/schemas/LivenessResult'
          description: The result of the liveness call, will be null if there is error.
        error:
          $ref: '#/components/schemas/LivenessError'
          description: The error of the liveness call, will be null if there is result.
      required:
      - attemptId
      - attemptStatus
    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: '#/components/schemas/LivenessDecisionTargets'
          description: Targets used for liveness classification.
      required:
      - code
      - message
      - targets
    LivenessColorDecisionTarget:
      type: object
      description: The target from color image used for liveness classification.
      properties:
        faceRectangle:
          $ref: '#/components/schemas/FaceRectangle'
          description: The face region where the liveness classification was made on.
      required:
      - faceRectangle
    FaceErrorResponse:
      type: object
      description: A response containing error details.
      properties:
        error:
          $ref: '#/components/schemas/FaceError'
          description: The error object.
      required:
      - error
    LivenessSessionResults:
      type: object
      description: The results of the liveness session.
      properties:
        attempts:
          type: array
          description: The attempts data of underlying liveness call with the session.
          items:
            $ref: '#/components/schemas/LivenessSessionAttempt'
      required:
      - attempts
    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'
    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.
    LivenessDecisionTargets:
      type: object
      description: The targets used for liveness classification.
      properties:
        color:
          $ref: '#/components/schemas/LivenessColorDecisionTarget'
          description: The target from color image used for liveness classification.
      required:
      - color
    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
    LivenessResult:
      type: object
      description: The results of the liveness classification.
      properties:
        livenessDecision:
          $ref: '#/components/schemas/LivenessDecision'
          description: The liveness classification for the target face.
        targets:
          $ref: '#/components/schemas/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.
      required:
      - targets
      - digest
  securitySchemes:
    AADToken:
      type: oauth2
      flows:
        authorizationCode:
          scopes:
            https://cognitiveservices.azure.com/.default: ''
          authorizationUrl: https://api.example.com/oauth2/authorize
          tokenUrl: https://api.example.com/oauth2/token
      description: The Azure Active Directory OAuth2 Flow
    KeyAuth:
      type: apiKey
      description: The secret key for your Azure AI Face subscription.
      name: Ocp-Apim-Subscription-Key
      in: header
x-ms-parameterized-host:
  hostTemplate: '{endpoint}/face/{apiVersion}'
  useSchemePrefix: false
  parameters:
  - name: endpoint
    in: path
    description: 'Supported Cognitive Services endpoints (protocol and hostname, for example:

      https://{resource-name}.cognitiveservices.azure.com).'
    required: true
    type: string
    format: uri
    x-ms-skip-url-encoding: true


# --- truncated at 32 KB (72 KB total) ---
# Full source: https://artifacts.apis.io/azure-ai-foundry/openapi/azure-ai-foundry-detectliveness-sessions-api-openapi.yml