Create an App Registration Document Validation
Endpointβ
POST https://api.verifik.co/v2/document-validations/app-registration
A Document Validation is an instance within Verifik's system that allows you to process and validate identity documents during the app registration process. This process ensures the authenticity of user documents and provides secure verification through various analysis methods.
warning
The JWT Token you should use when creating App Registration Document Validations is provided from the App Registration in creation. You must use the token returned when creating an App Registration to authenticate this request.
Headersβ
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Paramsβ
| Name | Type | Required | Description |
|---|---|---|---|
image | string | No | The base64 encoded image of the document that will be scanned and analyzed. Either image or backImage is required |
backImage | string | No | The base64 encoded image of the back side of the document that will be scanned and analyzed. Either image or backImage is required |
force | boolean | No | Use force to overwrite values from previous attempts. When set to true, this will allow creating a new document validation even if one already exists for the app registration. Defaults to false |
Requestβ
- Node.js
- PHP
- Python
- Go
const fetch = require("node-fetch");
async function run() {
const res = await fetch("https://api.verifik.co/v2/document-validations/app-registration", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`,
},
body: JSON.stringify({
image: "base64_encoded_document_image",
backImage: "base64_encoded_back_image",
force: true
}),
});
console.log(await res.json());
}
run();
<?php
$ch = curl_init("https://api.verifik.co/v2/document-validations/app-registration");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer " . getenv("VERIFIK_TOKEN")
]);
$body = json_encode([
"image" => "base64_encoded_document_image",
"backImage" => "base64_encoded_back_image",
"force" => true
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import os, requests
url = "https://api.verifik.co/v2/document-validations/app-registration"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_TOKEN')}"
}
payload = {
"image": "base64_encoded_document_image",
"backImage": "base64_encoded_back_image",
"force": True
}
r = requests.post(url, json=payload, headers=headers)
print(r.json())
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
payload := map[string]interface{}{
"image": "base64_encoded_document_image",
"backImage": "base64_encoded_back_image",
"force": true,
}
b, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://api.verifik.co/v2/document-validations/app-registration", bytes.NewBuffer(b))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+os.Getenv("VERIFIK_TOKEN"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var out map[string]interface{}
json.NewDecoder(resp.Body).Decode(&out)
fmt.Println(out)
}
Responseβ
- 200
- 422
- 422 (Missing Image or BackImage)
- 409
- 404 (App Registration Not Found)
- 404 (Document Settings Not Set)
{
"data": {
"documentValidation": {
"_id": "507f1f77bcf86cd799439011",
"appRegistration": "507f1f77bcf86cd799439012",
"client": "507f1f77bcf86cd799439013",
"project": "507f1f77bcf86cd799439014",
"projectFlow": "507f1f77bcf86cd799439015",
"documentType": "Passport",
"documentCategory": "ID",
"status": "ASSESSING",
"validationMethod": "OCR",
"inputMethod": "FILE_UPLOAD",
"imageValidated": false,
"namesMatch": false,
"fullNameMatchPercentage": 0,
"firstNameMatchPercentage": 0,
"lastNameMatchPercentage": 0,
"type": "validation",
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T00:00:00.000Z"
}
}
}
{
"code": "MissingParameter",
"message": "missing image"
}
{
"code": "MissingParameter",
"message": "Either image or backImage must be provided"
}
{
"code": "already_exists",
"message": "409:already_exists"
}
This error occurs when a document validation already exists for the app registration and the force parameter is not set to true.
{
"code": "appRegistration_not_found",
"message": "404:appRegistration_not_found"
}
{
"code": "document_settings_not_set",
"message": "404:document_settings_not_set"
}
Notesβ
- App Registration Required: This endpoint requires an active app registration session. You must use the token returned from creating an App Registration.
- At Least One Image Required: Either
imageorbackImage(or both) must be provided in the request. - Document Processing: Documents are processed using OCR (Optical Character Recognition) to extract and validate information.
- Status Values: The document validation status can be
ASSESSING,VALIDATED,FAILED, or other status values depending on the validation process. - Credit Charging: This endpoint automatically charges credits from your SmartEnroll plan.
- Force Flag: Use the
forceparameter to overwrite existing document validations if needed.