Scan Agent
Scan Agent extracts structured fields from a document image. Call POST https://api.verifik.co/v2/ocr/scan-gpt. image is required. documentType, backImage, and template are optional. There is no country field on this body. The stored extraction sets validationMethod to SCAN_AGENT.
What the call returns
- Extracted
documentType,documentNumber, and name validationMethod—SCAN_AGENT
Use cases
- Read an identity document from one image.
- Add the back image when the card has a second side.
- Pin a template when the layout is known.
API Reference
Endpoint
POST https://api.verifik.co/v2/ocr/scan-gpt
A hit includes the extracted document fields and validationMethod SCAN_AGENT. The URL stays /v2/ocr/scan-gpt.
Headers
| Name | Value | Description |
|---|---|---|
| Content-Type | application/json | Request payload format |
| Accept | application/json | Response format |
| Authorization | Bearer <your_token> | Client JWT |
Parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
image | string | Yes | data:image/jpeg;base64,AAAA | Front image as base64 or a data URI. Required. |
documentType | string | No | CC | Optional document family, such as CC or DNI. |
backImage | string | No | data:image/jpeg;base64,BBBB | Optional back image. |
template | string | No | template_id | Optional template id. |
Request
- Node.js / JavaScript
- Python
- cURL
import axios from "axios";
const options = {
method: "POST",
url: "https://api.verifik.co/v2/ocr/scan-gpt",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: "Bearer <your_token>",
},
data: {
"image": "data:image/jpeg;base64,AAAA",
"documentType": "CC"
},
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error.response ? error.response.data : error.message);
}
import requests
url = "https://api.verifik.co/v2/ocr/scan-gpt"
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer <your_token>",
}
payload = {
"image": "data:image/jpeg;base64,AAAA",
"documentType": "CC",
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
curl -X POST "https://api.verifik.co/v2/ocr/scan-gpt" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer <your_token>" \
-d '{"image":"data:image/jpeg;base64,AAAA","documentType":"CC"}'
Response
- 200 (Record found)
- 409 (Missing parameter)
- 404 (Not found)
- 401 (Unauthorized)
- 500 (Source unavailable)
{
"data": {
"documentType": "CC",
"documentNumber": "1234567890",
"fullName": "MARIA LOPEZ",
"validationMethod": "SCAN_AGENT"
},
"signature": {
"dateTime": "November 27, 2026 12:00 PM",
"message": "Certified by Verifik.co"
}
}
{
"code": "MissingParameter",
"message": "\"image\" is required"
}
{
"code": "NotFound",
"message": "Record not found."
}
{
"code": "UNAUTHORIZED",
"message": "Authentication required"
}
{
"code": "InternalServerError",
"message": "The official source is temporarily unavailable. Please retry shortly."
}
Notes
imageis required.documentType,backImage, andtemplateare optional.- Do not send a country field. This body does not accept one.
- The recorded method is
SCAN_AGENTand the URL remains/v2/ocr/scan-gpt. - Send a Bearer JWT in the
Authorizationheader. - The JSON sample illustrates the fields. A live call returns the record for the values you send.
- Do not send a cache-bypass flag. This page documents only the client parameters.
Sandbox
| Scenario | Parameters | Result |
|---|---|---|
| Record on file | image plus documentType: "CC" | 200 with extracted fields and validationMethod SCAN_AGENT. |
| Missing required value | Omit image | 409 MissingParameter. |
| Unknown value | image and backImage | 200 when a back image is also sent. |
401 when the bearer token is missing or rejected.