Skip to main content

Error Codes

HTTP Status Codes

CodeMeaning
200Success
400Bad Request: missing required field or malformed JSON
401Unauthorized: invalid or missing API key / token
403Forbidden: valid key but insufficient permissions
404Not Found: customer, session, or resource not found
429Too Many Requests: rate limit exceeded
500Internal Server Error

Session Status Types

FaceGuard sessions have an internally-tagged status:

Status TypeFieldsDescription
in_progressstagesSession is active, user is in the verification flow
completedoutcome, stages, completed_atSession finished
bypassedexpires_at, completed_atCustomer has an admin-granted bypass

Completed Outcomes

OutcomeDescription
passedFace matched the base photo
failedFace did not match

PostMessage Close Reasons

Events emitted from FaceGuard to the host application:

ReasonPayloadDescription
approved{ confidence: number }Face verified successfully
rejected{ confidence: number }Face did not match
canceledUser tapped X to close
bypass_active{ bypass_expires_at: string }Customer has an active bypass
no_base_photoNo enrolled photo to compare against
error{ error: string }Camera issue, network error, expired token, etc. The error value is a typed code — see below.

Camera Error Codes

When the user's camera cannot be started, FaceGuard emits { action: 'close', reason: 'error', error: <code> } with one of the codes below. You can switch on the code to render product-specific recovery UI.

CodeUnderlying causeSuggested guidance
camera_permission_deniedUser (or browser/OS policy) denied camera access (NotAllowedError)Ask the user to enable camera access in browser site settings (web) or device Settings → your app (mobile WebView)
camera_unavailableNo camera device present (NotFoundError)Suggest using a device with a camera
camera_in_useAnother app or tab is holding the camera (NotReadableError, TrackStartError)Ask the user to close other apps or tabs using the camera
camera_constraintsRequested resolution / facing mode unsupported (OverconstrainedError)Rare — usually indicates a hardware limitation
camera_insecure_contextPage not served over HTTPS, or iframe missing allow="camera" (SecurityError)Verify the integration host serves HTTPS and the iframe has allow="camera"
camera_unknownCatch-all for unexpected getUserMedia failuresGeneric retry / contact support

SDK Result Statuses

When using FaceGuard.verify():

StatusConfidenceErrorDescription
approved0-100Face verified
rejected0-100Face did not match
canceled-User closed
errorstringSomething went wrong. error is one of the camera codes above, 'no_base_photo', or another error string.
Confidence Score

The confidence score (0-100) represents the similarity between the captured face and the enrolled base photo. Higher scores indicate a stronger match.