Inspecionar dados de exemplo
Inspecione um payload de verificação sampleData e receba um mapa estruturado de caminhos de campos, formatos de valores, escolhas recomendadas de sectionType, tipos de seção alternativos, colunas de tabela sugeridas e sugestões de vinculação.
Em autoria de relatórios headless e pipelines de agentes de IA, chame este endpoint logo após buscar um payload em Consultar uma resposta simulada ou capturar uma linha de SmartBatch. Em vez de adivinhar strings de dataPath ou escrever lógica frágil de travessia de JSON, sua interface ou agente pode usar os metadados inspecionados de nodes e batch para montar sections válidas diretamente ou enriquecer o contexto de prompt para Gerar layout do template. O inspetor percorre até a profundidade 5 e até 600 nós.
Endpoint
POST https://api.verifik.co/v2/smart-report-templates/introspect
O proxy do Smart-Agent (https://ai.verifik.co) expõe os mesmos caminhos /v2/... e exige o seu próprio cabeçalho Authorization: Bearer <VERIFIK_JWT>.
Cabeçalhos
| Nome | Valor |
|---|---|
| Content-Type | application/json |
| Accept | application/json |
| Authorization | Bearer <VERIFIK_JWT> |
Corpo
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
sampleData | object | Sim | Payload de verificação de exemplo com batchName (string), rowIndex (number), inputData (object) e results (object) opcionais. |
Requisição
- Node.js
- PHP
- Python
- Go
- cURL
const fetch = require("node-fetch");
async function run() {
const res = await fetch(
"https://api.verifik.co/v2/smart-report-templates/introspect",
{
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
body: JSON.stringify({
sampleData: {
batchName: "Driver Onboarding",
rowIndex: 0,
inputData: {
documentType: "CC",
documentNumber: "1020304050",
},
results: {
identity: {
fullName: "Mateo Rojas",
status: "active",
},
fines: [
{ code: "C02", amount: 580000, status: "pending" },
],
},
},
}),
}
);
console.log(await res.json());
}
run();
<?php
$payload = [
"sampleData" => [
"batchName" => "Driver Onboarding",
"rowIndex" => 0,
"inputData" => [
"documentType" => "CC",
"documentNumber" => "1020304050",
],
"results" => [
"identity" => [
"fullName" => "Mateo Rojas",
"status" => "active",
],
"fines" => [
["code" => "C02", "amount" => 580000, "status" => "pending"],
],
],
],
];
$ch = curl_init("https://api.verifik.co/v2/smart-report-templates/introspect");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Accept: application/json",
"Authorization: Bearer " . getenv("VERIFIK_JWT"),
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);
curl_close($ch);
import os
import requests
url = "https://api.verifik.co/v2/smart-report-templates/introspect"
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_JWT')}",
}
payload = {
"sampleData": {
"batchName": "Driver Onboarding",
"rowIndex": 0,
"inputData": {
"documentType": "CC",
"documentNumber": "1020304050",
},
"results": {
"identity": {
"fullName": "Mateo Rojas",
"status": "active",
},
"fines": [
{"code": "C02", "amount": 580000, "status": "pending"},
],
},
}
}
r = requests.post(url, json=payload, headers=headers)
print(r.json())
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
body, _ := json.Marshal(map[string]interface{}{
"sampleData": map[string]interface{}{
"batchName": "Driver Onboarding",
"rowIndex": 0,
"inputData": map[string]interface{}{
"documentType": "CC",
"documentNumber": "1020304050",
},
"results": map[string]interface{}{
"identity": map[string]interface{}{
"fullName": "Mateo Rojas",
"status": "active",
},
"fines": []map[string]interface{}{
{"code": "C02", "amount": 580000, "status": "pending"},
},
},
},
})
req, _ := http.NewRequest("POST", "https://api.verifik.co/v2/smart-report-templates/introspect", bytes.NewReader(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer "+os.Getenv("VERIFIK_JWT"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var out map[string]interface{}
json.NewDecoder(resp.Body).Decode(&out)
fmt.Println(out)
}
curl -X POST "https://api.verifik.co/v2/smart-report-templates/introspect" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT" \
-d '{
"sampleData": {
"batchName": "Driver Onboarding",
"rowIndex": 0,
"inputData": {
"documentType": "CC",
"documentNumber": "1020304050"
},
"results": {
"identity": {
"fullName": "Mateo Rojas",
"status": "active"
},
"fines": [
{ "code": "C02", "amount": 580000, "status": "pending" }
]
}
}
}'
Resposta
- 200
- 401
- 409
{
"data": {
"nodes": [
{
"path": "results.identity",
"shape": "object",
"sectionType": "keyValueGrid",
"alternatives": ["card", "table"],
"columns": [
{ "key": "fullName", "label": "Full Name" },
{ "key": "status", "label": "Status" }
],
"suggestion": {
"type": "keyValueGrid",
"dataPath": "results.identity"
}
},
{
"path": "results.fines",
"shape": "array",
"sectionType": "dataTable",
"alternatives": ["repeater", "table"],
"columns": [
{ "key": "code", "label": "Code" },
{ "key": "amount", "label": "Amount" },
{ "key": "status", "label": "Status" }
],
"suggestion": {
"type": "dataTable",
"dataPath": "results.fines"
}
}
],
"batch": [
{
"path": "inputData",
"shape": "object",
"sectionType": "keyValueGrid"
}
],
"count": 2,
"truncated": false
}
}
{
"message": "Unauthorized",
"code": "Unauthorized"
}
{
"message": "\"sampleData\" is required",
"code": "MissingParameter"
}
Notas
- A travessia para na profundidade
5e tem limite de600nós. Quando um payload muito grande atinge o limite,truncatedétrue. - Este endpoint é somente leitura e sem estado; ele não salva um template nem consome créditos de verificação.