Skip to main content

Obtener progreso de Smart Batch

Obtén un resumen ligero de progreso para un SmartBatch sin transferir todo el arreglo rows. La respuesta incluye contadores de filas (totalRows, completedRows, failedRows, partialRows, pendingRows), marcas de tiempo de ejecución, creditsSpent y —cuando está respaldado por una ejecución de FeatureRunner— los detalles anidados de run y el libro mayor de gasto (spend).

Las ejecuciones de FeatureRunner del lado del servidor también emiten un evento webhook smart_batch_batch_completed (incluyendo runId y creditsSpent) al finalizar cuando está configurado batchConfiguration.notification.webhookUrl. Consultar este endpoint no consume créditos.

Endpoint​

GET https://api.verifik.co/v2/smart-batches/{id}/progress

Este endpoint también es accesible a través del proxy de Smart-Agent en https://ai.verifik.co/v2/smart-batches/{id}/progress usando tu propio encabezado Authorization: Bearer <VERIFIK_JWT> por cliente. La ejecución compartida x402 está bloqueada con 403 Forbidden.

Encabezados​

NombreValorDescripción
Content-Typeapplication/jsonFormato de carga útil de la solicitud.
AuthorizationBearer <VERIFIK_JWT>JWT delimitado al cliente (authUser.clientId).

Parámetros​

NombreTipoRequeridoDescripción
idstringSíObjectId de SmartBatch a consultar.

Solicitud​

import axios from "axios";

const run = async () => {
const batchId = "6801a2b3c4d5e6f7a8b9c0d3";

const { data } = await axios.get(`https://api.verifik.co/v2/smart-batches/${batchId}/progress`, {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
});

console.log(data);
};

run();

Respuesta​

{
"data": {
"batchId": "6801a2b3c4d5e6f7a8b9c0d3",
"status": "processing",
"serverSide": true,
"totalRows": 25,
"completedRows": 12,
"failedRows": 1,
"partialRows": 2,
"pendingRows": 10,
"startedAt": "2026-11-24T20:10:00.000Z",
"creditsSpent": 1.6,
"run": {
"id": "6801a2b3c4d5e6f7a8b9c0e1",
"status": "processing",
"mergeStrategy": "sequential",
"totalItems": 25,
"completedItems": 12,
"failedItems": 1,
"partialItems": 2,
"startedAt": "2026-11-24T20:10:00.500Z",
"completedAt": null
},
"spend": {
"credits": 1.6,
"calls": 28,
"billableCalls": 24
}
}
}

Notas​

  • run y spend se incluyen cuando el lote tiene una ejecución de FeatureRunner asociada (run es null si el registro de ejecución referenciado no se devuelve).
  • Las ejecuciones de FeatureRunner del lado del servidor emiten el evento webhook smart_batch_batch_completed (con runId y creditsSpent) al finalizar si está configurado batchConfiguration.notification.webhookUrl. Consulta Webhooks de Smart Reports.
  • Una vez que el lote alcance un estado terminal, usa Recuperar un Smart Batch para inspeccionar results y errors por fila.

Relacionado​