REST API Reference

Create a verification session

Creates a session with an executable flow. Supply language IDs returned by GET /langs, such as en, rather than display names such as English. The deprecated modules field is rejected. See the flow examples and validation behavior in the guides before opening the session.

POST
/sessions

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication. Use format "Bearer sk_prod_..." or "Bearer sk_test_..."

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.facesign.ai/sessions" \  -H "Content-Type: application/json" \  -d '{    "clientReferenceId": "user-123",    "langs": [      "en"    ],    "defaultLang": "en",    "metadata": {      "source": "web-app"    },    "flow": [      {        "id": "start",        "type": "start",        "outcome": "greeting"      },      {        "id": "greeting",        "type": "conversation",        "prompt": "Say: Hello! What\'s your name?",        "outcomes": [          {            "id": "t1",            "condition": "user provided name",            "targetNodeId": "end"          }        ]      },      {        "id": "end",        "type": "end"      }    ]  }'
{
  "session": {
    "id": "string",
    "createdAt": 0,
    "startedAt": 0,
    "finishedAt": 0,
    "status": "created",
    "settings": {
      "clientReferenceId": "user-123",
      "metadata": {
        "source": "web-app",
        "department": "sales"
      },
      "initialPhrase": "string",
      "finalPhrase": "string",
      "providedData": {
        "property1": "string",
        "property2": "string"
      },
      "avatarId": "string",
      "langs": [
        "en",
        "es",
        "fr"
      ],
      "defaultLang": "en",
      "zone": "es",
      "modules": [
        {
          "type": "emailVerification",
          "name": "string",
          "email": "string",
          "publicRecognitionEnabled": true
        }
      ],
      "flow": [
        {
          "id": "string",
          "type": "start",
          "outcome": "string"
        },
        {
          "id": "string",
          "type": "start",
          "outcome": "string"
        }
      ]
    },
    "version": "string",
    "report": {
      "transcript": [
        {
          "id": "string",
          "createdAt": 0,
          "text": "string",
          "isAvatar": true
        }
      ],
      "aiAnalysis": {
        "ageMin": 0,
        "ageMax": 0,
        "sex": "male",
        "realPersonOrVirtual": "real",
        "overallSummary": "string",
        "analysis": [
          {
            "title": "string",
            "shortDescription": "string",
            "longDescription": "string"
          }
        ]
      },
      "location": {},
      "device": {},
      "livenessDetected": true,
      "lang": "string",
      "extractedData": {
        "property1": "string",
        "property2": "string"
      },
      "screenshots": [
        "string"
      ],
      "videos": {
        "avatarVideoUrl": "string",
        "userVideoUrl": "string"
      },
      "isVerified": true
    }
  },
  "clientSecret": {
    "secret": "string",
    "createdAt": 0,
    "expireAt": 0,
    "url": "string"
  },
  "warnings": [
    "string"
  ]
}
{
  "error": "Invalid session settings",
  "code": "invalid_session_settings",
  "details": [
    {
      "field": "defaultLang",
      "code": "unsupported_language",
      "message": "Use an enabled language ID from GET /langs, for example \"en\"."
    }
  ]
}
{
  "error": {
    "type": "authentication_error",
    "message": "Invalid API key provided"
  }
}
Empty
{
  "error": "string",
  "code": "session_creation_failed"
}
{
  "error": "string",
  "code": "language_catalog_unavailable"
}