> 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-en/sdks/backend-sdk/selphid/technical_documentation/api_reference/authentication/api-v1-selphid-authenticate-facial-templates.md).

# /api/v1/selphid/authenticate-facial/templates

Authenticates two facial templates.

```json
{"openapi":"3.0.0","info":{"title":"SelphID-SDK Rest API","version":"6.21.0"},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Default API key header name. It can be overridden at startup with `auth_api_key_header_name`."}},"schemas":{"FacialAuthenticationTemplates":{"type":"object","description":"Two facial templates, used for authentication. It also supports _extraData_ and _personalDataInfo_, for registration in Api Tracking.","properties":{"faceTemplate1":{"$ref":"#/components/schemas/FacialTemplateRaw"},"faceTemplate2":{"$ref":"#/components/schemas/FacialTemplateRaw"},"extraData":{"$ref":"#/components/schemas/ExtraData"},"personalDataInfo":{"$ref":"#/components/schemas/PersonalDataInfo"},"options":{"$ref":"#/components/schemas/SdkOptions"}},"required":["faceTemplate1","faceTemplete2"]},"FacialTemplateRaw":{"type":"string","description":"Biometric template buffer, obtained through GetFacialTemplateRaw(), base64-encoded."},"ExtraData":{"type":"string","description":"Tokenized data used to call the Api Tracking service after the operation, base64-encoded."},"PersonalDataInfo":{"type":"object","description":"Key/value dictionary with the user's personal data, to be sent to the Api Tracking service. It is only taken into account if the _extraData_ field is not empty.","properties":{"name":{"type":"string"},"surname":{"type":"string"},"nationality":{"type":"string"},"documentNumber":{"type":"string"},"birthDate":{"type":"string"},"birthPlace":{"type":"string"},"address":{"type":"string"},"city":{"type":"string"},"issuer":{"type":"string"},"issueDate":{"type":"string"},"expiryDate":{"type":"string"},"fullName":{"type":"string"},"gender":{"type":"string"},"nfcKey":{"type":"string"},"numSupport":{"type":"string"},"mrz":{"type":"string"}}},"SdkOptions":{"type":"object","description":"Options to customize the use of the extraction and identification engines. Their use is optional and no option is mandatory. If omitted, the default values are used.","properties":{"longDetail":{"$ref":"#/components/schemas/LongDetail"},"elapsedAllowedSeconds":{"$ref":"#/components/schemas/ElapsedSeconds"},"futureAllowedSeconds":{"$ref":"#/components/schemas/FutureSeconds"},"facialDetection":{"$ref":"#/components/schemas/FacialDetectionType"},"minFaceAbsPx":{"$ref":"#/components/schemas/MinFaceSize"},"minFaceRel":{"$ref":"#/components/schemas/MinFaceRel"},"minIodPx":{"$ref":"#/components/schemas/MinIOD"},"maxPoseDegrees":{"$ref":"#/components/schemas/MaxPoseDegrees"},"minFacialQuality":{"$ref":"#/components/schemas/FacialQuality"},"analyticsDetection":{"$ref":"#/components/schemas/Analytics"},"templateRawExtraction":{"$ref":"#/components/schemas/TemplateRawExtraction"},"falseDetectRate":{"$ref":"#/components/schemas/FalseDetectRate"},"maxCantidates":{"$ref":"#/components/schemas/MaxCandidates"},"minSimilarity":{"$ref":"#/components/schemas/MinSimilarity"},"authThreshold":{"$ref":"#/components/schemas/AuthThreshold"},"livenessDepth":{"$ref":"#/components/schemas/LivenessDepth"}}},"LongDetail":{"type":"boolean","description":"If true, the endpoint result will include additional information. If omitted, the default value is false."},"ElapsedSeconds":{"type":"integer","description":"Maximum lifetime of a templateRaw (in seconds) to be considered valid in authentication or liveness operations. If 0 (default), there is no limit.","minimum":0},"FutureSeconds":{"type":"integer","description":"Maximum future lifetime of a templateRaw (in seconds) to be considered valid in authentication or liveness operations. The template may have been created on a device with a date in the future relative to the device that consumes it. If 0 (default), no templateRaw with a future date is accepted.","minimum":0},"FacialDetectionType":{"type":"string","description":"Facial detection types in the extraction engine.","enum":["Frontal","FrontalFast"]},"MinFaceSize":{"type":"integer","description":"Minimum size, in pixels, that a face must have to be detected."},"MinFaceRel":{"type":"number","description":"Minimum size, relative to the image size, that a face must have to be detected.","minimum":0,"maximum":1},"MinIOD":{"type":"integer","description":"Minimum interocular distance, in pixels, that a face must have to be detected."},"MaxPoseDegrees":{"type":"number","description":"Maximum angle difference (in degrees) between two poses to be considered valid in authentication processes.","minimum":0,"maximum":180},"FacialQuality":{"type":"string","description":"A metric indicating how accurately a template will perform in recognition.","enum":["None","Bad","Regular","Good"]},"Analytics":{"type":"boolean","description":"Gets additional analytics in the extraction engine."},"TemplateRawExtraction":{"type":"boolean","description":"The extraction engine will generate the raw template."},"FalseDetectRate":{"type":"number","description":"False rejection tolerance level in the extraction engine. Using this value is not recommended unless you are sure of its effects.","minimum":0,"maximum":1},"MaxCandidates":{"type":"integer","description":"Maximum number of candidates required in 1:N searches."},"MinSimilarity":{"type":"number","description":"Minimum tolerable similarity in 1:N searches.","minimum":0,"maximum":1},"AuthThreshold":{"type":"number","description":"Minimum value in an authentication for it to be considered positive.","minimum":0,"maximum":100},"LivenessDepth":{"type":"string","description":"Which liveness pipelines must be used.","enum":["None","Partial","Full"]},"FacialAuthenticationResult":{"type":"object","description":"The result of an authentication operation. **extractionQuery** and **extractionTarget** are only added if **options:longDetail=true**.","properties":{"authStatus":{"$ref":"#/components/schemas/FacialAuthenticationStatus"},"similarity":{"$ref":"#/components/schemas/Similarity"},"validTimeStamp":{"$ref":"#/components/schemas/ValidTimeStamp"},"tokenTimeStamp":{"$ref":"#/components/schemas/TokenTimeStamp"},"trackingStatus":{"$ref":"#/components/schemas/TrackingStatus"},"trackingMessage":{"$ref":"#/components/schemas/TrackingMessage"},"sdkDuration":{"$ref":"#/components/schemas/SdkDuration"},"extractionQuery":{"$ref":"#/components/schemas/FacialExtractionResult"},"extractionTarget":{"$ref":"#/components/schemas/FacialExtractionResult"}}},"FacialAuthenticationStatus":{"type":"string","description":"Possible results of an authentication operation.","enum":["None","Negative","Uncertain","Positive","NoneBecausePoseExceed","NoneBecauseInvalidExtractions"]},"Similarity":{"type":"number","description":"Similarity between two facial templates (0-None, 1-Identical)."},"ValidTimeStamp":{"type":"boolean","description":"In authentication, liveness and extraction operations that involve templateRaws, indicates whether the template's lifetime is valid. See \"options:elapsedAllowedSeconds\". In operations that do not involve raw templates, it is always true."},"TokenTimeStamp":{"type":"string","description":"The token's internal date and time value in \"%Y-%m-%dT%H:%M:%SZ\" format."},"TrackingStatus":{"type":"number","description":"Status returned by the Api Tracking service, or -1 if tracking is not required."},"TrackingMessage":{"type":"string","description":"Message returned by the Api Tracking service, or empty if tracking is not required."},"SdkDuration":{"type":"number","description":"Duration of the operation in milliseconds."},"FacialExtractionResult":{"type":"object","description":"The result of an extraction operation.","properties":{"facialTemplate":{"$ref":"#/components/schemas/FacialTemplate"},"facialTemplateRaw":{"$ref":"#/components/schemas/FacialTemplateRaw"},"updatedTemplateRaw":{"$ref":"#/components/schemas/UpdatedTemplateRaw"},"face":{"$ref":"#/components/schemas/Rectangle"},"leftEye":{"description":"Location of the center of the left eye.","type":"object","properties":{"x":{"$ref":"#/components/schemas/XCoord"},"y":{"$ref":"#/components/schemas/YCoord"}}},"rightEye":{"description":"Location of the center of the right eye.","type":"object","properties":{"x":{"$ref":"#/components/schemas/XCoord"},"y":{"$ref":"#/components/schemas/YCoord"}}},"chin":{"description":"Location of the chin.","type":"object","properties":{"x":{"$ref":"#/components/schemas/XCoord"},"y":{"$ref":"#/components/schemas/YCoord"}}},"nose":{"description":"Location of the nose.","type":"object","properties":{"x":{"$ref":"#/components/schemas/XCoord"},"y":{"$ref":"#/components/schemas/YCoord"}}},"leftMouth":{"description":"Location of the left point of the mouth.","type":"object","properties":{"x":{"$ref":"#/components/schemas/XCoord"},"y":{"$ref":"#/components/schemas/YCoord"}}},"rightMouth":{"description":"Location of the right point of the mouth.","type":"object","properties":{"x":{"$ref":"#/components/schemas/XCoord"},"y":{"$ref":"#/components/schemas/YCoord"}}},"iod":{"$ref":"#/components/schemas/IOD"},"yaw":{"description":"Facial yaw angle in degrees.","type":"number"},"pitch":{"description":"Facial pitch angle in degrees.","type":"number"},"roll":{"description":"Facial roll angle in degrees.","type":"number"},"glasses":{"$ref":"#/components/schemas/FacialGlasses"},"age":{"$ref":"#/components/schemas/Age"},"gender":{"$ref":"#/components/schemas/FacialGender"},"mask":{"$ref":"#/components/schemas/FacialMask"},"faceConfidence":{"$ref":"#/components/schemas/FaceConfidence"},"facialQuality":{"$ref":"#/components/schemas/FacialQuality"},"validTimeStamp":{"$ref":"#/components/schemas/ValidTimeStamp"},"tokenTimeStamp":{"$ref":"#/components/schemas/TokenTimeStamp"},"sdkDuration":{"$ref":"#/components/schemas/SdkDuration"}}},"FacialTemplate":{"type":"string","description":"Biometric template buffer, obtained through GetFacialTemplate(), base64-encoded."},"UpdatedTemplateRaw":{"type":"boolean","description":"The templateRaw has been updated in the extraction operation."},"Rectangle":{"type":"object","description":"A bounded area of an image.","properties":{"x":{"type":"number","description":"X coordinate of the top-left corner."},"y":{"type":"number","description":"Y coordinate of the top-left corner."},"width":{"type":"number","description":"Width of the area."},"height":{"type":"number","description":"Height of the area."}}},"XCoord":{"type":"number","description":"X coordinate."},"YCoord":{"type":"number","description":"Y coordinate."},"IOD":{"type":"number","description":"Interocular distance."},"FacialGlasses":{"type":"string","description":"Whether the person in the image wears glasses (and of which type).","enum":["None","Eye","Sun"]},"Age":{"type":"number","description":"Approximate age of the person."},"FacialGender":{"type":"string","description":"The facial gender of the person in the image.","enum":["None","Male","Female"]},"FacialMask":{"type":"number","description":"The probability of a face mask.","minimum":0,"maximum":1},"FaceConfidence":{"type":"number","description":"Predicted face confidence.","minimum":0,"maximum":1},"BadRequestResult":{"type":"object","description":"Result when incorrect parameters arrive in the request.","properties":{"status":{"type":"number"},"error":{"type":"string"},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}},"TimeStamp":{"type":"string","description":"A date and time value in \"%Y-%m-%dT%H:%M:%SZ\" format."},"ExceptionResult":{"type":"object","description":"An error occurred in the call to the SelphID-SDK backend.","properties":{"status":{"type":"number"},"error":{"type":"string"},"exception":{"type":"string"},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}}}},"paths":{"/api/v1/selphid/authenticate-facial/templates":{"post":{"description":"Authenticates two facial templates.","tags":["Authentication"],"requestBody":{"description":"JSON with the input templates in base64 format.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacialAuthenticationTemplates"}}}},"responses":{"200":{"description":"Result of the facial authentication.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacialAuthenticationResult"}}}},"400":{"description":"Incorrect parameters in the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResult"}}}},"500":{"description":"An error occurred in the call to the SelphID-SDK backend.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}}}}
```
