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
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
documentType | string | No | Filter templates by document type (e.g., "CC", "DNI") |
Request
- JavaScript
- Python
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);
}
import requests
url = "https://api.verifik.co/v2/ocr/scan-prompt/templates"
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer <your_token>'
}
params = {
'documentType': 'CC' # Optional filter
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
Response
- 200
- 401
{
"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
}
]
}
{
"error": "Unauthorized",
"message": "UNAUTHORIZED"
}
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