Skip to main content

Face Search, Enrol or Block API

Description

Objective

The Face Search, Enrol or Block API enrols a user in the database, provides a reason for the enrolment rejection or adds it to a block-list.

InputOutput
The selfie of the customer and the unique transaction ID.A response that reflects the success or failure of the customer enrolment process, or the addition to your block-list. The reason for rejecting the enrolment application is also returned if the enrolment fails.

Next Step

To enrol a face without running a search first, use the India Enrol Face flow or the same API with enrol and omitSearch set appropriately.

API URL

https://ind-orion.hyperverge.co/v2/search/face

API Endpoint

search/face

Overview

The Face Search, Enrol or Block API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Authentication

You need a unique pair of application ID (appId) and application key (appKey) from HyperVerge to verify your identity for accessing the Face Search, Enrol or Block API.

API Request Details

Method

POST

Headers

The following table provides the complete information on the request headers for the Face Search, Enrol or Block API.

HeaderMandatory / OptionalDescriptionInput Format
Content-TypeMandatoryThis parameter defines the media type for the request payload.multipart/form-data
acceptMandatoryThis parameter defines the media type for the response.application/json
appIdMandatoryApplication ID shared by HyperVerge.N/A. This is a unique value.
appKeyMandatoryApplication Key shared by HyperVerge.N/A. This is a unique value.
transactionIdMandatoryUnique ID for the customer journey.Any defined unique value mapped to a transaction in your business ecosystem.

Input

The following table provides the complete information on the input parameters used in the request body for the Face Search, Enrol or Block API.

ParameterMandatory or OptionalValid ValuesTypeDescription
transactionIdMandatoryN/A. This is a unique value.stringThe unique identifier for the customer's application.
selfieMandatoryN/AfileThe selfie image of the user.
Note
The maximum image size supported is 6 MB.
blockOptionalyes or nostringTo add this application to blocklist if enrol is set to yes.
enrolOptionalyes or nostringIf this flag is set to yes, this customer application will be enrolled in your database.
omitSearchOptionalyes or nostringIf this flag is set to yes, the Face Search, Enrol or Block API skips searching the database for a matching record.
Note
When both enrol and omitSearch are set to yes, the Face Search, Enrol or Block API only performs the enrollment for the application without searching for a matching record in the database.

Request

The following code snippet demonstrates a standard curl request for the Face Search, Enrol or Block API:

curl --location --request POST 'https://ind-orion.hyperverge.co/v2/search/face' \
--header 'accept: application/json' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_appId-Shared-by-HyperVerge>' \
--header 'appKey: <Enter_the_appKey-shared-by-HyperVerge>' \
--form 'transactionId=<Enter_the_Transaction_ID>' \
--form 'selfie=<Attach_The_Image>' \
--form 'enrol=<Yes_or_No>' \
--form 'omitSearch=<Yes_or_No>'

Success Response

The following are success responses (HTTP 200) when result.summary.action is Pass or Manual Review: no duplicates, verified match, blocklist match (manual review), or successful enrolment. Use result.summary.action and result.summary.value to determine the outcome.

No face duplicates found. summary.action is Pass, isEnrolled.value is no.

{
"statusCode": 200,
"metaData": { "requestId": "<Request_ID>", "transactionId": "<Transaction_ID>" },
"result": {
"data": {
"transactionId": "<Transaction_ID>",
"isEnrolled": { "value": "no", "reason": "NA" },
"matches": { "internalCount": 0, "externalCount": 0, "count": 0, "internal": [], "external": [] },
"blocklist": { "internalCount": 0, "externalCount": 0, "count": 0, "internal": [], "external": [] },
"dashboardUrl": "..."
},
"summary": { "value": "No record found", "action": "Pass" }
}
}

Success Response Details

The following table provides the details of the parameters in a successful response.

ObjectFieldDescription
metaDatarequestIdA unique identifier to track the customer's application.
metaDatatransactionIdThe same transactionId used in the API request.
isEnrolledvalueIf the value is yes, the application was successfully enrolled in your database. If the value is no, the reason field explains the corresponding reason of non-enrollment.
result.datamatchesCount and list of matching records (same face). Contains internalCount, externalCount, count, internal, and external arrays.
result.datablocklistCount and list of blocklist matches. Same structure as matches.
result.datadashboardUrlURL to view results in the dashboard.
summaryvalueOutcome label: No record found, Verified, Match with blocklist, Quality Insufficient, Enrol successful, or Enrol failed with message: '...'. Use with summary.action to determine the recommended next step.
summaryaction

It displays the recommended decision for the customer. It can take any of the values from the following table.

ActionRecommendation
PassYou can proceed with the application. Returned when value is No record found (no duplicates), Verified (face match, not blocklisted), or Enrol successful.
Manual ReviewRequires manual review for further approval or rejection. Returned when value is Match with blocklist.
FailThe enrolment failed either because of an image quality issue (Quality Insufficient), a matching transactionId pre-existing in the database, or enrol-only failure (Enrol failed with message: '...'). See error and errorCode when present.

Failure Response

The following are failure responses (HTTP 200 with result.summary.action = Fail): selfie quality insufficient (blur or liveness failed), or enrolment requested but failed. Use result.summary.value, and when present error and errorCode, to determine the reason.

Selfie blur or liveness failed. summary.action is Fail, summary.value is Quality Insufficient, isEnrolled.value is no.

{
"statusCode": 200,
"metaData": { "requestId": "<Request_ID>", "transactionId": "<Transaction_ID>" },
"result": {
"data": {
"transactionId": "<Transaction_ID>",
"isEnrolled": { "value": "no", "reason": "Quality Insufficient" },
"matches": { "internalCount": 0, "externalCount": 0, "count": 0, "internal": [], "external": [] },
"blocklist": { "internalCount": 0, "externalCount": 0, "count": 0, "internal": [], "external": [] },
"dashboardUrl": "..."
},
"summary": { "value": "Quality Insufficient", "action": "Fail" }
}
}

Error Responses

The following are the error responses for the Face Search, Enrol or Block API.

The following is a response for a request missing the transactionId.

{
"status": "failure",
"metaData": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
},
"statusCode": 400,
"error": "\"transactionId\" is required"
}

Failure and Error Response Details

A failure or error response contains a failure status with a relevant status code and error message.
The following table lists all error responses:


Status CodeError MessageError DescriptionError Resolution
200Quality InsufficientSelfie blur or liveness check failed. result.summary.action is Fail, result.summary.value is Quality Insufficient.Ask the user to retake the selfie with better lighting and clarity; ensure the face is clearly visible and live.
200ApplicationId already existsenrol=yes was sent but enrolment failed. result.summary.action is Fail. The error and errorCode fields (e.g. "ApplicationId already exists", E_006) contain the reason.Check error and errorCode in the response; resolve the underlying issue (e.g. use a different transactionId if ApplicationId already exists) and retry.
400"transactionId" is requiredThe request does not contain the transaction identification number.Include a valid transactionId in the request body or headers.
400Face not detected in Selfie imageNo face was detected in the selfie imageEnsure the selfie contains a single, clearly visible face and retry.
401Missing/Invalid credentialsThe request either does not contain the mandatory credentials or contains invalid credentials.Provide valid appId and appKey headers.
429Requests rate limit exceededThe number of transactions per minute has crossed the limit set for your credentials.Throttle requests or contact HyperVerge to increase the rate limit.
500Internal Server ErrorThere is an error with HyperVerge's server. Kindly contact the HyperVerge team for resolution.Contact the HyperVerge team for resolution.
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: