---
agentTools:
  projectIndex: https://cypherfacemerchant.readme.io/llms.txt
---

# Liveness Detection

The client application initiates a liveness detection session by making a request to the backend. The system generates a unique session identifier (sessionId), which is essential for tracking the session. This step ensures that the user is physically present and interacting with the system in real time.

**Curl Request**

```
curl --location 'https://staging.cypherface.com/start-liveness-session/' \
--header 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjeXBoZXJGYWNlSWQiOiI2Nzg4YTU0Njk3ZmQxNjQzNjA5YWMwNGIiLCJ4QXBpS2V5IjoiMWI4YTIyYjgtNmI2NC00YWJhLTlhNWMtNWFiNGNhOWM5NDQ5IiwiaWF0IjoxNzQwMDYyMTIwLCJleHAiOjE3NDAyMzQ5MjB9.fTmqwMCElXGICO34WyNzNJGYnQoMsxWNkqAVDra7h4A' \
--header 'Content-Type: application/json' \
--header 'Cookie: connect.sid=s%3AyoqwqQtJPuetxSVZLt9_3cikxJ6eSZO-.RDMRaaGKPjP%2F7f6E1pJeiOCPXiu61fEP8J8PwHvgW%2BY' \
--data '{
    "userId":"67b72c82732237217a7e1824"
}'
```

<br />

[block:html]
{
  "html": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    \n    <style>\n        body {\n            font-family: Arial, sans-serif;\n            margin: 20px;\n            padding: 20px;\n            background-color: #f9f9f9;\n        }\n        .container {\n            max-width: 800px;\n            background: white;\n            padding: 20px;\n            border-radius: 8px;\n            box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);\n        }\n        h2 {\n            color: #333;\n        }\n        code {\n            background-color: #eee;\n            padding: 2px 5px;\n            border-radius: 4px;\n        }\n        pre {\n            background-color: #272822;\n            color: #f8f8f2;\n            padding: 10px;\n            border-radius: 5px;\n            overflow-x: auto;\n        }\n    </style>\n</head>\n<body>\n\n<div class=\"container\">\n    <h2>Liveness Detection Process</h2>\n    <p>To start the liveness detection process, the client application must send a <code>POST</code> request to the endpoint <code>/start-liveness-session/</code>. This request will initiate a new session and return a unique <code>sessionId</code>.</p>\n\n    <h3>Request</h3>\n    <p><strong>Endpoint:</strong> <code>POST /start-liveness-session/</code></p>\n\n    <h3>Response</h3>\n    <p>On success, the API will return a JSON response containing the session ID:</p>\n    \n    <pre>\n{\n    \"sessionId\": \"1234567890abcdef\"\n}\n    </pre>\n\n    <h3>Usage</h3>\n    <p>The generated <code>sessionId</code> must be stored and used for subsequent requests related to liveness detection, such as face capture and validation.</p>\n</div>\n\n</body>\n</html>\n"
}
[/block]

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Staging",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://staging.cypherface.com/"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/start-liveness-session/": {
      "post": {
        "summary": "Liveness Detection",
        "description": "The client application initiates a liveness detection session by making a request to the backend. The system generates a unique session identifier (sessionId), which is essential for tracking the session. This step ensures that the user is physically present and interacting with the system in real time.",
        "operationId": "liveness-detection",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjeXBoZXJGYWNlSWQiOiI2Nzg4YTU0Njk3ZmQxNjQzNjA5YWMwNGIiLCJ4QXBpS2V5IjoiMWI4YTIyYjgtNmI2NC00YWJhLTlhNWMtNWFiNGNhOWM5NDQ5IiwiaWF0IjoxNzM3NTU2Mzk3LCJleHAiOjE3Mzc3MjkxOTd9.ZSDsJ69_NkcHtIgKd2okXh23HjOQBagjEKpS5gM5dgw"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId"
                ],
                "properties": {
                  "userId": {
                    "type": "string",
                    "default": "6789fb11e94adea011383478"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6792107c09391300702305ff:67bd7a39ca667e0070647c4f"
}
```