> ## Documentation Index
> Fetch the complete documentation index at: https://developers.argosidentity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ID Liveness API

> Verify the authenticity of ID documents by analyzing images for tampering or forgery

The ID Liveness API section allows users to verify the authenticity of an ID document by analyzing the provided image for signs of tampering or forgery. Users can leverage different pipelines to detect screen captures, printed copies, and portrait replacements, ensuring the integrity of the ID document. Upon completion, users will receive recognition results and transaction information, facilitating secure identity verification processes.

<Warning>
  **Notes**<br />
  To properly verify the authenticity of an image, whitespace around the ID is required.<br />
  If the ID fills the entire image without any whitespace, accurate results may not be produced.<br />
  Example image:

  <Frame>
    <img src="https://mintcdn.com/argosidentity/5SYhN-ygFsvuliHf/images/verify/id_livness_guidline.png?fit=max&auto=format&n=5SYhN-ygFsvuliHf&q=85&s=5210079f5e4b1562108a4a8b202fc0be" style={{ borderRadius: '0.5rem' }} width="2592" height="1469" data-path="images/verify/id_livness_guidline.png" />
  </Frame>
</Warning>

## Response Attributes

<ResponseField name="transactionId" type="string">
  Unique identifier for the transaction associated with the recognition request.
</ResponseField>

<ResponseField name="result" type="string">
  Returns detection scores for each pipelines.

  **Pipelines Values:**

  * `screenReplay` - liveness\_score
  * `paperPrinted` - liveness\_score
  * `replacePortraits` - liveness\_score
</ResponseField>

<ResponseField name="errorCode" type="string">
  Identifies the specific error for troubleshooting.

  **Error Code Values:**

  * `1001` - Workspace is unavailable
  * `1003` - Fail to process data
  * `1005` - idImage is required
  * `1007` - pipelines is required
  * `1008` - invalid pipelines format
  * `1009` - Fail to analyze document
  * `1010` - callbackUrl is required
</ResponseField>

<ResponseField name="message" type="string">
  Briefly describes the error. Please refer to the error code for details.
</ResponseField>


## OpenAPI

````yaml POST /document
openapi: 3.1.0
info:
  title: ID Liveness API
  description: >-
    Verify the liveness of ID documents by detecting whether the provided
    document is a live capture or a static image/photo of a document
  version: 1.0.0
servers:
  - url: https://idverify-api.argosidentity.com/modules
    description: Production server
security: []
paths:
  /document:
    post:
      tags:
        - ID Liveness
      summary: ID Liveness Detection
      description: >-
        Analyze an ID document image to determine if it's a live capture or a
        static photo, helping prevent spoofing attacks with printed or digital
        copies of documents.
      operationId: idLivenessDetection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - idImage
                - pipelines
              properties:
                idImage:
                  type: string
                  description: >-
                    Base64 encoded ID document image to analyze for liveness
                    detection. The image should contain a clear view of the ID
                    document.
                  format: base64
                pipelines:
                  type: object
                  required:
                    - sr
                    - pc
                    - ps
                  description: Forgery detection options object
                  properties:
                    sr:
                      type: boolean
                      description: >-
                        Pipeline - Screen Replay: Verify if the image is a
                        screen capture
                    pc:
                      type: boolean
                      description: >-
                        Pipeline - Paper Printed: Verify if the ID is a printed
                        or photocopied copy
                    ps:
                      type: boolean
                      description: >-
                        Pipeline - Replace Portraits: Verify if the face image
                        has been tampered with
                useUpcomingVersion:
                  type: boolean
                  description: Use the upcoming version of the liveness engine
                  default: 'False'
                callbackUrl:
                  type: string
                  description: >-
                    Optional callback URL where the liveness detection results
                    will be sent upon completion. If provided, the process works
                    asynchronously.
                  format: uri
                  example: https://your-domain.com/callback
            examples:
              synchronous:
                summary: Synchronous request
                value:
                  idImage: base64_encoded_id_document_image
                  pipelines:
                    sr: true
                    pc: true
                    ps: true
                  useUpcomingVersion: true
                  callbackUrl: https://your-domain.com/callback
      responses:
        '200':
          description: Successful liveness detection analysis
          content:
            application/json:
              schema:
                type: object
                properties:
                  apiType:
                    type: string
                    example: id_live_doc
                  transactionId:
                    type: string
                    description: Unique transaction identifier
                    example: txn_123456789
                  engineVersion:
                    type: string
                    description: Liveness Engine's version for each request
                    example: id_liveness@3.4.2
                  result:
                    type: object
                    properties:
                      screenReplay:
                        type: object
                        properties:
                          liveness_score:
                            type: number
                            description: Screen replay detection score
                            example: 99
                      paperPrinted:
                        type: object
                        properties:
                          liveness_score:
                            type: number
                            description: Paper printed detection score
                            example: 82
                      replacePortraits:
                        type: object
                        properties:
                          liveness_score:
                            type: number
                            description: Portrait replacement detection score
                            example: 100
        '201':
          description: Asynchronous request accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  transactionId:
                    type: string
                    description: Unique transaction identifier
                    example: txn_123456789
                  engineVersion:
                    type: string
                    description: Liveness Engine's version for each request
                    example: id_liveness@3.4.2
                  message:
                    type: string
                    description: Confirmation message for asynchronous processing
                    example: >-
                      request has been successfully received. The response will
                      be sent to your callback URL
        '400':
          description: Bad request - Invalid image data or missing required parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      statusCode:
                        type: number
                        example: 400
                      apiType:
                        type: string
                        example: id_live_doc
                      transactionId:
                        type: string
                        description: Unique transaction identifier
                        example: txn_123456789
                      engineVersion:
                        type: string
                        description: Liveness Engine's version for each request
                        example: id_liveness@3.4.2
                      errorCode:
                        type: string
                        example: '1003'
                      message:
                        type: string
                        example: Fail to process data
        '401':
          description: Workspace is unavailable
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      transactionId:
                        type: string
                        description: Unique transaction identifier
                        example: txn_123456789
                      errorCode:
                        type: string
                        example: '1001'
                      message:
                        type: string
                        example: Workspace is unavailable
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````