Schedule a demo with an expertSchedule demo
Back to documentation
Guide20 min

Evidence management

Stores and retrieves digital files with complete traceability to pass audits and compliance with regulations.

What's automatically stored

Each check generates a complete digital file:

Images and video

  • • Photo of document (front and back)
  • • User's Selfie
  • • Liveness detection Video
  • • Captures of the process

Data extracted

  • • Data OCR document
  • • Biometric scors
  • • Validation results
  • • Consultation with official sources

Methates

  • • Certificated Timforms
  • • Geolocalisation
  • • IP address
  • • User agent / device

Audit

  • • Full event log
  • • Chain of custody
  • • Hashes of integrity
  • • Access to the file

1. Consult file

Reforms the complete file of a check:

NET / v1 / evidence /{verificationId}
const evidence = await jaak.evidence.get('ver_abc123');

console.log(evidence);
// {
//   "verificationId": "ver_abc123",
//   "createdAt": "2025-01-09T10:30:00Z",
//   "status": "approved",
//
//   "subject": {
//     "name": "Juan Pérez García",
//     "documentNumber": "XXXX1234567890",
//     "curp": "PEGJ900515HDFRRL09"
//   },
//
//   "documents": {
//     "front": {
//       "url": "https://evidence.jaak.ai/ver_abc123/doc_front.jpg",
//       "hash": "sha256:abc123...",
//       "capturedAt": "2025-01-09T10:28:15Z"
//     },
//     "back": {
//       "url": "https://evidence.jaak.ai/ver_abc123/doc_back.jpg",
//       "hash": "sha256:def456..."
//     }
//   },
//
//   "biometrics": {
//     "selfie": {
//       "url": "https://evidence.jaak.ai/ver_abc123/selfie.jpg",
//       "hash": "sha256:ghi789..."
//     },
//     "livenessVideo": {
//       "url": "https://evidence.jaak.ai/ver_abc123/liveness.mp4",
//       "duration": 3.2
//     },
//     "scores": {
//       "liveness": 0.98,
//       "faceMatch": 0.95
//     }
//   },
//
//   "validations": {...},
//   "metadata": {...},
//   "auditLog": [...]
// }

2. Download Files

// Descargar imagen individual
const imageBuffer = await jaak.evidence.downloadFile(
  'ver_abc123',
  'documents.front'
);
fs.writeFileSync('./documento_frente.jpg', imageBuffer);

// Descargar todo el expediente como ZIP
const zipBuffer = await jaak.evidence.downloadAll('ver_abc123');
fs.writeFileSync('./expediente_completo.zip', zipBuffer);

// Generar PDF de expediente para auditoría
const pdfBuffer = await jaak.evidence.generateReport('ver_abc123', {
  format: 'audit_report',
  language: 'es',
  includeImages: true,
  includeAuditLog: true
});
fs.writeFileSync('./reporte_auditoria.pdf', pdfBuffer);

3. Search for files

He looks for files by different criteria:

// Buscar por nombre o documento
const results = await jaak.evidence.search({
  query: 'Juan Pérez',
  fields: ['name', 'documentNumber', 'curp'],
  dateRange: {
    from: '2024-01-01',
    to: '2025-01-09'
  },
  status: ['approved', 'rejected'],
  limit: 50,
  offset: 0
});

// Buscar por metadatos personalizados
const results2 = await jaak.evidence.search({
  metadata: {
    'userId': 'usr_123',
    'applicationId': 'app_456'
  }
});

// Listar todos los expedientes de un período
const allRecords = await jaak.evidence.list({
  dateRange: {
    from: '2024-12-01',
    to: '2024-12-31'
  },
  orderBy: 'createdAt',
  order: 'desc'
});

4. Audit log

Check the registration of all events and accesses:

const auditLog = await jaak.evidence.getAuditLog('ver_abc123');

// [
//   {
//     "timestamp": "2025-01-09T10:28:00Z",
//     "event": "verification_started",
//     "actor": "end_user",
//     "ip": "189.xxx.xxx.xxx",
//     "userAgent": "Mozilla/5.0..."
//   },
//   {
//     "timestamp": "2025-01-09T10:28:15Z",
//     "event": "document_captured",
//     "details": { "side": "front", "quality": 0.95 }
//   },
//   {
//     "timestamp": "2025-01-09T10:30:00Z",
//     "event": "verification_completed",
//     "result": "approved"
//   },
//   {
//     "timestamp": "2025-01-10T14:00:00Z",
//     "event": "evidence_accessed",
//     "actor": "api_user",
//     "apiKeyId": "key_abc",
//     "action": "download"
//   }
// ]

5. Retention and disposal

// Configurar política de retención por tipo
await jaak.evidence.setRetentionPolicy({
  default: '5y', // 5 años por defecto (LFPIORPI)
  policies: [
    {
      type: 'kyc_financial',
      retention: '10y' // 10 años para sector financiero
    },
    {
      type: 'signature',
      retention: '10y'
    }
  ]
});

// Solicitar eliminación (para cumplir con LFPDPPP)
// Solo si no hay obligación legal de conservación
await jaak.evidence.requestDeletion('ver_abc123', {
  reason: 'user_request_arco',
  requestedBy: 'privacy@tuempresa.com'
});

// La eliminación se ejecuta después de validar
// que no hay obligaciones legales pendientes

Note: The LFPIORPI requires keeping files for at least 5 years. JAAK Valid automatically before disposal.

Audit report

Generates reports ready to report to regulators:

// Generar reporte de cumplimiento
const complianceReport = await jaak.evidence.generateComplianceReport({
  dateRange: {
    from: '2024-01-01',
    to: '2024-12-31'
  },
  format: 'cnbv', // 'cnbv', 'uif', 'custom'
  includeStatistics: true,
  includeFailedVerifications: true
});

// El reporte incluye:
// - Total de verificaciones
// - Tasa de aprobación/rechazo
// - Desglose por tipo de documento
// - Alertas de AML generadas
// - Accesos a expedientes
// - Integridad de la cadena de custodia