Anti-spoofing

Once you've set up your organisation account on the Yoti Hub, you’re ready to start integrating with the Anti-spoofing API.

Before you start
Please have a read of our image requirements.
Good to know
This services works best on mobiles.

There is one step to follow to integrate the Age estimation and anti-spoofing API:

1) Create a request

Face Capture

For optimal results, Yoti provides and recommends to use the Yoti Face Capture modules, which are designed to capture optimal images meeting the requirements of the API. This is available as a Native package, and Web implementation.

Strongly recommend
Get better results by using our Face capture module.

Create a request

After completing the Yoti onboarding, you will need to complete authentication for the API by using the Yoti SDK to simplify the process. The Yoti SDKs are available via popular dependency management systems.

Javascript
Java
PHP
Python
C#
Go
Ruby
Copy
EndpointDescription
https://api.yoti.com/ai/v1/antispoofingUse Yoti's anti-spoofing check as a standalone product.

Once you have added the Yoti SDK dependency to your project, you can use it to build and send your request. See the code snippets below for examples.

Javascript
Java
PHP
Python
C#
Go
Ruby
Copy

This endpoint will return an anti-spoofing result.

JSON
Copy
JSON
Copy
ResponseExplained
Prediction - realYoti has detected a real user.
Prediction - fakeYoti has detected a spoof attempt.
Prediction - undeterminedYoti is unable to determine if the user is real or not.

Help If integrating into a non-browser client, we recommend you contact us through our support form for additional support.

Terminal integrations

Good to know
This is not live yet but will be going live soon. Please contact us if this interests you.

Optionally, additional headers may be provided to the request to allow Yoti to track error responses coming from a particular machine. This would typically be used in a non-browser client scenario, such as an ePOS terminal where each individual machine must be registered by the business.

In order to do this, the following headers should be applied:

HeaderDescription
Terminal-IdUnique ID per machine. Mandatory for non-browser integrations.
Session-IdMay be provided to demonstrate multiple attempts are from a single user transaction.

Error codes

Error codeErrorDescription
404APP_NOT_FOUNDApplication app_id not found.
401INVALID_X_YOTI_AUTH_ID
  • X-Yoti-Auth-Id__header not provided.
  • auth id is not a valid uuid.
400INVALID_APP_IDApplication id cannot be empty.
400INVALID_PUBLIC_KEYApplication public key cannot be empty.
403DISABLED_APP_STATEApplication must be enabled.
400INVALID_ORG_IDOrganisation id cannot be empty.
400INVALID_BILLING_SOURCE_IDApplication billing source id cannot be empty.
404ORG_NOT_FOUNDOrganisation org_id not found.
401INVALID_YOTI_AUTH_DIGEST
  • X-Yoti-Auth-Digest header is missing.
  • X-Yoti-Auth-Digest is not base64 encoded.
401INVALID_NONCE
  • Nonce is missing. nonce parameter is mandatory
  • Provided nonce is not a valid uuid.
401INVALID_TIMESTAMP
  • Timestamp is missing. timestamp parameter is mandatory.
  • Provided timestamp is not a valid unix timestamp.
401INVALID_PUBLIC_KEY_ENCODINGFailed to load public key. key is not der encoded.
401UNSUPPORTED_ALGORITHMSerialised key is of a type that is not supported by the backend.
401INVALID_SIGNATUREFailed to verify signature.
403INVALID_ORG_STATUSOrganisation has an invalid status
404INVALID_METADATA_DEVICEInvalid device metadata provided.
400INVALID_BODY_ENCODINGThe request body should be a valid JSON.
404INVALID_ENDPOINTThe endpoint request is invalid.
413PAYLOAD_TOO_LARGEPayload too large, the maximum size is 2MB.
400IMAGE_NOT_PROVIDEDImage has not been provided.
400INVALID_B64_IMAGECannot read the base64 image.
400UNSUPPORTED_IMAGE_FORMATImage format not supported. Please use JPEGs (95 to 100 quality) and PNGs.
400IMAGE_SIZE_TOO_BIGImage size too big, the maximum size is 2MB.
400IMAGE_SIZE_TOO_SMALLImage size too small, the minimum size is 50KB.
400MIN_HEIGHTThe image height is incorrect. Image minimum height required is 300 pixels.
400MAX_HEIGHTThe image height is incorrect. Image maximum height required is 2000 pixels.
400MIN_WIDTHThe image width is incorrect. Image minimum width required is 300 pixels.
400MAX_WIDTHThe image width is incorrect. Image maximum width required is 2000 pixels.
400MIN_PIXELSTo process the image the minimum number of pixels required is 90,000 pixels.
400MAX_PIXELSTo process the image the maximum number of pixels required is 2,100,000 pixels.
400IMAGE_WRONG_CHANNELSMissing colour channel, the input image must be RGB or RGBA.
400IMAGE_GRAYSCALE_NOT_SUPPORTEDGrayscale images not supported.
503SERVICE_UNAVAILABLEThe service is temporarily unavailable.
400FACE_NOT_FOUNDNo faces in the image provided.
400MULTIPLE_FACESPlease only show one face.
400INSUFFICIENT_AREA_AROUND_THE_FACEInsufficient area around the face in the image provided.
400FACE_TOO_BRIGHTMove to an area with less brightness.
400FACE_TOO_DARKMove to a brighter area.
500UNSPECIFIED_ERRORAn internal server error occurred.
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard