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

# /recognition/

This endpoint is used for comparing a live face image (or a document image) with a database of image

This endpoint is used to fetch users that you've added to the database via PUT guest method. It can be used for logging into a certain service you provide exclusively via face recognition.

## Request format

Accepts a JSON encoded specification in the request body, example is given:

```Text JSON
{
    "AcceptTermsAndConditions":true,
    "DataFields": {
        "ImageType": "base64",
        "Image": "..."
    },
    "Settings":{
    
    }
}
```

The request body must contain AcceptTermsAndConditions as previously explained.\
DataFields is a subdictionary that must contain two fields: ImageType and Image.\
ImageType is a string field that contains Image encoding. Currently, the only supported\
ImageType is base64 which corresponds to BASE64 image encoding. Image field needs\
to contain an image encoded by the ImageType algorithm.\
Settings, as in the POST /guest/ request is currently an optional field which doesn’t\
need to be provided.

## Response format

In the case the service recognized the input, it will return 200 OK response as presented by 200 Successful recognition response, otherwise it will return 200 Unsuccessful recognition response containing recognition: false field.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Guest Identification API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.scandoc.ai/cis/"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/recognition/": {
      "post": {
        "summary": "/recognition/",
        "description": "This endpoint is used for comparing a live face image (or a document image) with a database of image",
        "operationId": "recognition-2",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Access token fetched from the key service",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "AcceptTermsAndConditions",
                  "DataFields"
                ],
                "properties": {
                  "AcceptTermsAndConditions": {
                    "type": "boolean",
                    "description": "Terms and conditions must be accepted or the request will be rejected",
                    "default": true
                  },
                  "DataFields": {
                    "type": "object",
                    "description": "Image payload",
                    "required": [
                      "ImageType",
                      "Image"
                    ],
                    "properties": {
                      "ImageType": {
                        "type": "string",
                        "description": "Image encoding format (currently only supports base64)",
                        "default": "base64"
                      },
                      "Image": {
                        "type": "string",
                        "description": "Base64 encoded face image"
                      }
                    }
                  },
                  "Settings": {
                    "type": "object",
                    "description": "Currently empty",
                    "properties": {}
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Successful recognition": {
                    "value": "{\n    \"TransactionID\": \"<UUID>\",\n    \"UploadedAt\": \"<UTC-TIME>\",\n    \"ProductName\": \"Customer Identification <version-tag>\",\n    \"Data\": {\n        \"Recognized\": true,\n        \"GuestUUID\": \"...\",\n        \"GuestImage\": \"...\",\n        \"GuestName\": \"...\",\n        \"GuestSurname\": \"...\"\n    }\n    \"Errors\": [],\n    \"Warnings\": [],\n    \"Status\": 200,\n    \"Method\": \"Recognition\",\n    \"UserId\": \"...\",\n    \"SubClientId\": \"...\"\n}"
                  },
                  "Unsuccessful recognition": {
                    "value": "{\n    \"TransactionID\": \"<UUID>\",\n    \"UploadedAt\": \"<UTC-TIME>\",\n    \"ProductName\": \"Customer Identification <version-tag>\",\n    \"Data\": {\n        \"Recognized\": false,\n    }\n    \"Errors\": [],\n    \"Warnings\": [],\n    \"Status\": 200,\n    \"Method\": \"Recognition\",\n    \"UserId\": \"...\",\n    \"SubClientId\": \"...\"\n}"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6511de94eb250f00120ab66a:6511df58c1b3310018b85d4b"
}
```