> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-pt-br/sdks/backend-sdk/ine/technical_documentation/api_reference/authentication/api-v1-facial-authentication.md). Agents can also search and read this documentation through its [MCP server](https://docs.facephi.com/~gitbook/mcp).

# /api/v1/facial/authentication

This endpoint is used to authenticate two photo images.

```json
{"openapi":"3.0.0","info":{"title":"INE-Service Rest API","version":"1.7.0"},"tags":[{"name":"Authentication","description":"Protected facial authentication operation."}],"servers":[{"url":"http://127.0.0.1:6982/"}],"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"AuthenticationBody":{"type":"object","description":"Authentication request body","properties":{"idTransaccion":{"$ref":"#/components/schemas/IdTransaction"},"fotoA":{"$ref":"#/components/schemas/Photo"},"fotoB":{"$ref":"#/components/schemas/Photo"}},"required":["idTransaccion","fotoA","fotoB"]},"IdTransaction":{"type":"string","description":"Unique identifier associated with the transaction being processed."},"Photo":{"type":"object","properties":{"tipo":{"$ref":"#/components/schemas/PhotoTypes"},"data":{"$ref":"#/components/schemas/PhotoBuffer"}}},"PhotoTypes":{"type":"number","description":"Supported photo image types.","enum":["INE               = 0","JPEG              = 1","TEMPLATE_RAW      = 2","BEST_IMAGE_TOKEN  = 3"]},"PhotoBuffer":{"type":"string","description":"Photo image encoded in base64 RFC4648."},"AuthenticationResponse":{"type":"object","description":"Result of the photo comparison","properties":{"codigo":{"$ref":"#/components/schemas/ErrorCodes"},"score":{"$ref":"#/components/schemas/Score"},"resultado":{"$ref":"#/components/schemas/Similarity"},"tiempoServicio":{"$ref":"#/components/schemas/ServiceTime"}}},"ErrorCodes":{"type":"number","description":"Operation error codes.","enum":["OK              = 0","MALFORMED_JSON  = 400","PHOTOA_EMPTY    = 401","PHOTOB_EMPTY    = 402","NO_PHOTOS       = 403","POSE_INVALID    = 404","PHOTOA_INVALID  = 405","PHOTOB_INVALID  = 406"]},"Score":{"type":"integer","minimum":0,"maximum":1,"description":"Score resulting from the comparison."},"Similarity":{"type":"number","minimum":0,"maximum":100,"description":"Similarity resulting from the comparison."},"ServiceTime":{"type":"integer","description":"Total time in milliseconds from when the request arrives until the response is sent."},"BadRequestResult":{"type":"object","description":"Result returned when the request contains incorrect parameters.","properties":{"status":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}},"TimeStamp":{"type":"string","description":"A date/time value in the format \"%Y-%m-%dT%H:%M:%SZ\"."},"UnauthorizedResult":{"type":"object","description":"Result returned when the request does not provide a valid JWT.","properties":{"status":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}},"ExceptionResult":{"type":"object","description":"An error occurred in the call to the SDK backend.","properties":{"status":{"type":"number"},"error":{"type":"string"},"exception":{"type":"string"},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}}}},"paths":{"/api/v1/facial/authentication":{"post":{"description":"This endpoint is used to authenticate two photo images.","tags":["Authentication"],"requestBody":{"description":"JSON with the input photo encoded in base64 RFC4648 format","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticationBody"}}}},"responses":{"200":{"description":"The authentication result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticationResponse"}}}},"400":{"description":"The request contains incorrect parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResult"}}}},"401":{"description":"The JWT authentication token is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedResult"}}}},"500":{"description":"An error occurred in the call to the SDK backend.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}}}}
```
