Skip to main content

List of Scan Prompt Templates

Retrieve a list of available scan prompt templates. Super admins can see both system and client templates, while clients can only see their own templates and system templates.

Endpoint

GET https://api.verifik.co/v2/ocr/scan-prompt/templates

Headers

NameValue
Content-Typeapplication/json
AuthorizationBearer <token>

Query Parameters

NameTypeRequiredDescription
documentTypestringNoFilter templates by document type (e.g., "CC", "DNI")

Request

import axios from 'axios';

const options = {
method: 'GET',
url: 'https://api.verifik.co/v2/ocr/scan-prompt/templates',
params: {
documentType: 'CC' // Optional filter
},
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <your_token>'
}
};

try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}

Response

{
"data": [
{
"_id": "template_id_123",
"name": "CC - Escaneo de cédulas de Colombia",
"description": "Template for scanning Colombian ID cards",
"documentTypes": ["CC"],
"fields": ["firstName", "lastName", "documentNumber", "dateOfBirth"],
"prompt": "From the provided image of the legal document, extract the fields {{fields}} in {{format}} format.",
"format": "json",
"requiresBackSide": true,
"system": true,
"active": true,
"version": 1
},
{
"_id": "template_id_456",
"name": "Custom CC Template",
"description": "Custom template for CC documents",
"documentTypes": ["CC"],
"fields": ["firstName", "lastName", "documentNumber"],
"prompt": "Extract these fields from the document: {{fields}} in {{format}} format.",
"format": "json",
"requiresBackSide": false,
"system": false,
"client": "client_id_789",
"active": true,
"version": 1
}
]
}

Features

  • Template Management: Retrieve all available templates
  • Filtering: Filter templates by document type
  • Access Control: Super admins see all templates, clients see their own and system templates
  • System Templates: Access to pre-configured system templates
  • Client Templates: Access to custom client-created templates